<h1>Project "FreeSWITCH user-contributed scripts, etc" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
via: 0cb41713987185aec7f42c9cff174b6d2757e460 (commit)
from: c2e63f1d8fc269cf17bd85d534c9099af8a454b6 (commit)
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Mathieu Parent
comments:
MediaBrotha: add ability to pass params by using hidden fields
<span style="color: #000080; font-weight: bold">diff --git a/sathieu/cisco-xml/lib/MediaBrotha/Form.php b/sathieu/cisco-xml/lib/MediaBrotha/Form.php</span>
<span style="color: #000080; font-weight: bold">index 08dd4c6..509341a 100644</span>
<span style="color: #A00000">--- a/sathieu/cisco-xml/lib/MediaBrotha/Form.php</span>
<span style="color: #00A000">+++ b/sathieu/cisco-xml/lib/MediaBrotha/Form.php</span>
<span style="color: #800080; font-weight: bold">@@ -40,6 +40,7 @@ class MediaBrotha_Field {</span>
class MediaBrotha_Form extends ArrayIterator {
        private $_title;
<span style="color: #00A000">+</span>
        public function getTitle() {
                return $this->_title;
        }
<span style="color: #000080; font-weight: bold">diff --git a/sathieu/cisco-xml/lib/MediaBrotha/Frontend/CiscoXML.php b/sathieu/cisco-xml/lib/MediaBrotha/Frontend/CiscoXML.php</span>
<span style="color: #000080; font-weight: bold">index d859829..0f31ee1 100644</span>
<span style="color: #A00000">--- a/sathieu/cisco-xml/lib/MediaBrotha/Frontend/CiscoXML.php</span>
<span style="color: #00A000">+++ b/sathieu/cisco-xml/lib/MediaBrotha/Frontend/CiscoXML.php</span>
<span style="color: #800080; font-weight: bold">@@ -72,11 +72,20 @@ class MediaBrotha_Frontend_CiscoXML extends MediaBrotha_Frontend_HTTP {</span>
        }
        public function renderForm(MediaBrotha_Form $form) {
<span style="color: #00A000">+                foreach($form as $field) {</span>
<span style="color: #00A000">+                        if ($field->get('visibility') === 'hidden') {</span>
<span style="color: #00A000">+                                $params[$field->get('name')] = $field->get('value');</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+                }</span>
                $xml = new CiscoIPPhoneInput();
                $xml->setCiscoElement('Title', $form->getTitle());
                //$xml->setCiscoElement('Prompt', ...);
<span style="color: #A00000">-                $xml->setCiscoElement('URL', $this->rootURL());</span>
<span style="color: #00A000">+                $xml->setCiscoElement('URL', $this->rootURL().'?'.MediaBrotha_Core::value2hash(http_build_query($params)));</span>
<span style="color: #00A000">+                $params = Array();</span>
                foreach($form as $field) {
<span style="color: #00A000">+                        if ($field->get('visibility') === 'hidden') {</span>
<span style="color: #00A000">+                                continue;</span>
<span style="color: #00A000">+                        }</span>
                        $flags = 'A';
                        $xml->setCiscoElement('InputItem',
                                Array(
<span style="color: #800080; font-weight: bold">@@ -88,6 +97,19 @@ class MediaBrotha_Frontend_CiscoXML extends MediaBrotha_Frontend_HTTP {</span>
                        );
                        
                }
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                $xml->setCiscoElement('SoftKeyItem',</span>
<span style="color: #00A000">+                        Array('Name' => 'Search',</span>
<span style="color: #00A000">+                        'URL' => 'SoftKey:Submit',</span>
<span style="color: #00A000">+                        'Position' => 1));</span>
<span style="color: #00A000">+                $xml->setCiscoElement('SoftKeyItem',</span>
<span style="color: #00A000">+                        Array('Name' => '<<',</span>
<span style="color: #00A000">+                        'URL' => 'SoftKey:<<',</span>
<span style="color: #00A000">+                        'Position' => 2));</span>
<span style="color: #00A000">+                $xml->setCiscoElement('SoftKeyItem',</span>
<span style="color: #00A000">+                        Array('Name' => 'Exit',</span>
<span style="color: #00A000">+                        'URL' => 'SoftKey:Exit',</span>
<span style="color: #00A000">+                        'Position' => 3));</span>
                CiscoXMLObject::HttpHeader();
                print $xml;
        }
<span style="color: #000080; font-weight: bold">diff --git a/sathieu/cisco-xml/lib/MediaBrotha/Frontend/HTML.php b/sathieu/cisco-xml/lib/MediaBrotha/Frontend/HTML.php</span>
<span style="color: #000080; font-weight: bold">index c1ea4df..1c0454a 100644</span>
<span style="color: #A00000">--- a/sathieu/cisco-xml/lib/MediaBrotha/Frontend/HTML.php</span>
<span style="color: #00A000">+++ b/sathieu/cisco-xml/lib/MediaBrotha/Frontend/HTML.php</span>
<span style="color: #800080; font-weight: bold">@@ -56,6 +56,7 @@ class MediaBrotha_Frontend_HTML extends MediaBrotha_Frontend_HTTP {</span>
        private function _createHTMLDocument($title) {
                $this->_xml = new DOMDocument('1.0');
<span style="color: #00A000">+                $this->_xml->formatOutput = true;</span>
                $root = $this->_xml->createElement('html');
                $root = $this->_xml->appendChild($root);
<span style="color: #800080; font-weight: bold">@@ -135,6 +136,9 @@ class MediaBrotha_Frontend_HTML extends MediaBrotha_Frontend_HTTP {</span>
                $tableElement = $formElement->appendChild($tableElement);
                foreach($form as $field) {
<span style="color: #00A000">+                        if ($field->get('visibility') === 'hidden') {</span>
<span style="color: #00A000">+                                continue;</span>
<span style="color: #00A000">+                        }</span>
                        $trElement = $this->_xml->createElement('tr');
                        $trElement = $tableElement->appendChild($trElement);
</pre></div>
========================================================================<pre>
Summary of changes:
sathieu/cisco-xml/lib/MediaBrotha/Form.php | 1 +
.../lib/MediaBrotha/Frontend/CiscoXML.php | 24 +++++++++++++++++++-
.../cisco-xml/lib/MediaBrotha/Frontend/HTML.php | 4 +++
3 files changed, 28 insertions(+), 1 deletions(-)
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH user-contributed scripts, etc</p>