Exemplo n.º 1
0
 function render($xmlpath, $data)
 {
     $css = NextendCss::getInstance();
     $js = NextendJavascript::getInstance();
     $css->addCssLibraryFile('common.css');
     $css->addCssLibraryFile('window.css');
     $css->addCssLibraryFile('configurator.css');
     $js->loadLibrary('dojo');
     nextendimport('nextend.form.form');
     $form = new NextendForm();
     $form->loadArray($data);
     $form->loadXMLFile($xmlpath);
     echo $form->render('settings');
     $js->addLibraryJsAssetsFile('dojo', 'form.js');
     $js->addLibraryJs('dojo', '
         new NextendForm({
           container: "smartslider-form",
           data: ' . json_encode($form->_data) . ',
           xml: "' . NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($xmlpath)) . '",
           control_name: "settings",
           url: "' . NextendUri::ajaxUri('nextend', 'smartslider') . '",
           loadedJSS: ' . json_encode($js->generateArrayJs()) . ',
           loadedCSS: ' . json_encode($css->generateArrayCSS()) . '
         });
     ', true);
 }
Exemplo n.º 2
0
 function render()
 {
     if ($this->_form) {
         return;
     }
     $html = '';
     $css = NextendCss::getInstance();
     $css->addCssLibraryFile('fontmanager.css');
     $js = NextendJavascript::getInstance();
     nextendimport('nextend.form.form');
     $form = new NextendForm();
     $form->loadXMLFile(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'fontmanager' . DIRECTORY_SEPARATOR . 'form.xml');
     $this->_form =& $form;
     $js->addLibraryJsLibraryFile('dojo', 'dojo/window.js');
     $js->addLibraryJsAssetsFile('dojo', 'window.js');
     $js->addLibraryJsAssetsFile('dojo', 'element.js');
     $js->addLibraryJsAssetsFile('dojo', 'fontmanager.js');
     $id = 'nextend-fontmanager-lightbox-' . md5(time());
     $html .= '<div id="' . $id . '" class="gk_hack nextend-window ' . $this->_currentform->get('class', isset($_REQUEST['view']) && $_REQUEST['view'] == 'sliders_settings' ? 'smartslider' : '') . '">';
     $html .= '<div class="gk_hack nextend-window-container">';
     $html .= '<div class="gk_hack nextend-topbar"><div class="gk_hack nextend-topbar-logo"></div>';
     $manual = $this->_currentform->get('manual');
     if ($manual != "") {
         $html .= '<a href="' . $manual . '" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-manual">' . NextendText::_('Manual') . '</a>';
     }
     $support = $this->_currentform->get('support');
     if ($support != "") {
         $html .= '<a href="' . $support . '" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-support">' . NextendText::_('Support') . '</a>';
     }
     $html .= '<div id="nextend-fontmanager-save" class="nextend-window-save"><div class="NextendWindowSave">' . NextendText::_('APPLY') . '</div></div>';
     $html .= '</div>';
     $html .= '<div class="gk_hack nextend-window-container-inner">';
     $html .= '<fieldset id="nextend-fontmanager-panels" class="gk_hack panelform">';
     $html .= '<div id="nextend-fontmanager-tabs" class="gk_hack"></div>';
     $html .= '<div id="nextend-fontmanager-panel" class="gk_hack pane-sliders">';
     $html .= '<h3>' . NextendText::_('FONTMANAGER_Font_manager') . '</h3>';
     ob_start();
     //echo '<form method="post" name="nextend-fontmanager" id="nextend-fontmanager" action="" onsubmit="return false;">';
     $form->render('fontmanager');
     //echo '</form>';
     $html .= ob_get_clean();
     $html .= '</div>';
     $html .= '<p id="nextend-fontmanager-preview" style="background-color: #d0d0d0;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>';
     $html .= '<div class="fontcolorpickerinput"><div><input id="nextend-fontmanager-backgroundcolor" value="#d0d0d0" name="nextend-fontmanager-backgroundcolor" /></div></div>';
     $html .= '<div id="nextend-fontmanager-cleartab" style="float:right;">' . NextendText::_('FONTMANAGER_Clear_this_tab') . '</div>';
     $html .= '</fieldset>';
     $html .= '</div>';
     $html .= '</div>';
     $html .= '</div>';
     $js->addLibraryJs('dojo', '
         new NextendFontmanager({
           node: "' . $id . '"
         });
     ');
     return $html;
 }
Exemplo n.º 3
0
 function renderForm($data = array())
 {
     $css = NextendCss::getInstance();
     $js = NextendJavascript::getInstance();
     $css->addCssLibraryFile('common.css');
     $css->addCssLibraryFile('window.css');
     $css->addCssLibraryFile('configurator.css');
     $configurationXmlFile = dirname(__FILE__) . '/forms/layer.xml';
     $js->loadLibrary('dojo');
     nextendimport('nextend.form.form');
     $form = new NextendForm();
     $form->loadArray($data);
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render('layer');
 }
Exemplo n.º 4
0
 function editForm($data = array())
 {
     $css = NextendCss::getInstance();
     $js = NextendJavascript::getInstance();
     $css->addCssLibraryFile('common.css');
     $css->addCssLibraryFile('window.css');
     $css->addCssLibraryFile('configurator.css');
     $configurationXmlFile = dirname(__FILE__) . '/forms/slide.xml';
     $js->loadLibrary('dojo');
     nextendimport('nextend.form.form');
     $form = new NextendForm();
     $data['publishdates'] = isset($data['publishdates']) ? $data['publishdates'] : (isset($data['publish_up']) ? $data['publish_up'] : '') . '|*|' . (isset($data['publish_down']) ? $data['publish_down'] : '');
     $form->loadArray($data);
     $form->loadXMLFile($configurationXmlFile);
     $form->devicespecificimages = NextendSmartSliderSettings::get('devicespecificimages', 0);
     echo $form->render('slide');
 }
Exemplo n.º 5
0
 function renderForm($type, $item, $data = array())
 {
     $css = NextendCss::getInstance();
     $js = NextendJavascript::getInstance();
     $js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin/js/itemparser.js');
     $js->addLibraryJsFile('jquery', $item[4] . 'parser.js');
     $css->addCssLibraryFile('common.css');
     $css->addCssLibraryFile('window.css');
     $css->addCssLibraryFile('configurator.css');
     $configurationXmlFile = $item[4] . 'configuration.xml';
     $js->loadLibrary('dojo');
     nextendimport('nextend.form.form');
     $form = new NextendForm();
     $form->loadArray($data);
     $form->loadXMLFile($configurationXmlFile);
     $form->devicespecificimages = NextendSmartSliderSettings::get('devicespecificimages', 0);
     echo $form->render('item_' . $type);
 }
Exemplo n.º 6
0
 function subform()
 {
     $response = array();
     if (!isset($_POST['data'])) {
         echo json_encode(array('error' => 'Post not OK!'));
         exit;
     }
     if (get_magic_quotes_gpc() || nextendIsWordPress()) {
         $_POST['data'] = stripslashes($_POST['data']);
     }
     $data = json_decode($_POST['data'], true);
     $configurationXmlFile = rtrim(NextendFilesystem::getBasePath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $data['xml'];
     if (NextendFilesystem::fileexists($configurationXmlFile)) {
         nextendimport('nextend.css.css');
         nextendimport('nextend.javascript.javascript');
         $css = NextendCSS::getInstance();
         $js = NextendJavascript::getInstance();
         $js->loadLibrary('dojo');
         nextendimport('nextend.form.form');
         $form = new NextendForm();
         $form->loadArray($data['orig']);
         $form->loadArray(array($data['name'] => $data['value']));
         $form->loadXMLFile($configurationXmlFile);
         ob_start();
         $subform = $form->getSubform($data['tab'], $data['name']);
         $subform->initAjax($data['control_name']);
         echo $subform->renderForm();
         echo "<style>";
         echo $css->generateAjaxCSS($data['loadedCSS']);
         echo "</style>";
         $scripts = $js->generateAjaxJs($data['loadedJSS']);
         $html = ob_get_clean();
         $response = array('html' => $html, 'scripts' => $scripts);
     } else {
         $response = array('error' => 'Configuration file not found');
     }
     echo json_encode($response);
     exit;
 }
Exemplo n.º 7
0
 function fetchElement()
 {
     $css = NextendCss::getInstance();
     $css->addCssLibraryFile('element/pluginmatrix.css');
     $html = "<div id='nextend-pluginmatrix-" . $this->_id . "'>";
     $widgetTypes = $this->getOptions();
     $html .= "<div class='nextend-pluginmatrix-views nextend-button-grey nextend-clearfix'>";
     $value = $this->_form->get($this->_name, 'arrow');
     $test = false;
     foreach ($widgetTypes as $type => $v) {
         if ($value == $type) {
             $test = true;
             break;
         }
     }
     if (!$test) {
         $value = 'arrow';
     }
     foreach ($widgetTypes as $type => $v) {
         if ($value == $type) {
             $active = 'active ';
         } else {
             $active = '';
         }
         $html .= "<div onclick=\"njQuery('#" . $this->_id . "').val('" . $type . "')\" class='" . $active . "nextend-button-grey nextend-button-blue-active nextend-pluginmatrix-view nextend-pluginmatrix-view-" . $type . "'>\r\n                <div class='nextend-border'>";
         $html .= $v[0];
         $html .= "</div></div>";
     }
     $html .= "</div>";
     $html .= "<div class='nextend-pluginmatrix-panes nextend-clearfix'>";
     foreach ($widgetTypes as $type => $v) {
         if ($value == $type) {
             $active = 'active ';
         } else {
             $active = '';
         }
         $html .= "<div class='" . $active . "nextend-pluginmatrix-pane nextend-pluginmatrix-pane-" . $type . "'>";
         $GLOBALS['nextendbuffer'] = '';
         $form = new NextendForm();
         $form->_data =& $this->_form->_data;
         $form->loadXMLFile($v[1] . 'config.xml');
         ob_start();
         $form->render($this->control_name);
         $html .= ob_get_clean();
         $html .= $GLOBALS['nextendbuffer'];
         $html .= "</div>";
     }
     $html .= "</div>";
     $html .= "</div>";
     $js = NextendJavascript::getInstance();
     $js->addLibraryJs('jquery', '
         (function(){
             var parent = $("#nextend-pluginmatrix-' . $this->_id . '"),
                 views = parent.find("> .nextend-pluginmatrix-views > .nextend-pluginmatrix-view"),
                 panes = parent.find("> .nextend-pluginmatrix-panes > .nextend-pluginmatrix-pane");
             views.on("click", function(){
                 views.not(this).removeClass("active");
                 panes.removeClass("active");
                 var i = views.index(this);
                 views.eq(i).addClass("active");
                 panes.eq(i).addClass("active");
                 njQuery(window).trigger("resize");
             });
         })();
     ');
     return $html . parent::fetchElement();
 }
Exemplo n.º 8
0
 function renderForm()
 {
     $file = NextendXmlGetAttribute($this->_xml, 'file');
     $form = new NextendForm();
     $form->_data =& $this->_form->_data;
     $this->_value = $this->_form->get($this->_name, $this->_default);
     $form->loadXMLFile($this->getSubFormfolder($this->_value) . $file);
     ob_start();
     $this->onRender();
     $form->render($this->control_name);
     return ob_get_clean();
 }
Exemplo n.º 9
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $html = '';
     jimport('nextend.library');
     nextendimport('nextend.css.css');
     nextendimport('nextend.javascript.javascript');
     $css = NextendCss::getInstance();
     $js = NextendJavascript::getInstance();
     $css->addCssLibraryFile('common.css');
     $css->addCssLibraryFile('window.css');
     $css->addCssLibraryFile('configurator.css');
     $configurationXmlFile = JPATH_SITE . $node->attributes('xml');
     if (NextendFilesystem::fileexists($configurationXmlFile)) {
         $js->loadLibrary('dojo');
         $js->addLibraryJsLibraryFile('dojo', 'dojo/window.js');
         $js->addLibraryJsAssetsFile('dojo', 'window.js');
         $js->addLibraryJs('dojo', '
             new NextendWindow({
               button: dojo.byId("nextend-configurator-button"),
               node: dojo.byId("nextend-configurator-lightbox"),
               save: dojo.byId("nextend-configurator-save"),
               message: dojo.byId("nextend-configurator-message"),
               onHide: function(){
                 this.message.innerHTML = "Now you should save the module settings to apply changes!";
               }
             });
         ');
         $html .= '<div id="nextend-configurator-lightbox" class="gk_hack nextend-window ' . $node->attributes('identifier') . '">';
         $html .= '<div class="gk_hack nextend-window-container">';
         $html .= '<div class="gk_hack nextend-topbar"><div class="gk_hack nextend-topbar-logo"></div>';
         $manual = $node->attributes('manual');
         if ($manual != "") {
             $html .= '<a href="' . $manual . '" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-manual">Manual</a>';
         }
         $support = $node->attributes('support');
         if ($support != "") {
             $html .= '<a href="' . $support . '" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-support">Support</a>';
         }
         $html .= '<div id="nextend-configurator-save" class="nextend-window-save"><div class="NextendWindowSave">APPLY</div></div>';
         $html .= '</div>';
         $html .= '<div class="gk_hack nextend-window-container-inner">';
         $html .= '<fieldset id="nextend-configurator-panels" class="gk_hack panelform">';
         $html .= '<div id="menu-pane" class="gk_hack pane-sliders">';
         nextendimport('nextend.form.form');
         $form = new NextendForm();
         $form->loadArray($this->_parent->toArray());
         $form->set('manual', $manual);
         $form->set('support', $support);
         $form->loadXMLFile($configurationXmlFile);
         ob_start();
         $form->render($control_name);
         $html .= ob_get_clean();
         $html .= '</div>';
         $html .= '</fieldset>';
         $html .= '</div>';
         $html .= '</div>';
         $html .= '</div>';
         $html .= '<a id="nextend-configurator-button" class="nextend-configurator-button" href="#">Configure<span></span></a>
                   <span id="nextend-configurator-message">&nbsp;</span>';
         $js->addLibraryJsAssetsFile('dojo', 'form.js');
         $js->addLibraryJs('dojo', '
             new NextendForm({
               container: "nextend-configurator-lightbox",
               data: ' . json_encode($form->_data) . ',
               xml: "' . NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($configurationXmlFile)) . '",
               control_name: "' . $control_name . '",
               url: "' . JUri::current() . '",
               loadedJSS: ' . json_encode($js->generateArrayJs()) . ',
               loadedCSS: ' . json_encode($css->generateArrayCSS()) . '
             });
         ', true);
         return $html;
     } else {
         return NextendText::_("Not found xml configuration: ") . $configurationXmlFile;
     }
     return "asd";
     return '<input type="hidden" name="' . $control_name . '[' . $name . ']" id="' . $control_name . $name . '" value="' . $value . '" ' . $class . ' />';
 }
Exemplo n.º 10
0
 function editDynamicForm($data = array(), $control = 'dynamic', $onlyFilter = false)
 {
     $group = array();
     $list = array();
     NextendPlugin::callPlugin('nextendslidergenerator', 'onNextendSliderGeneratorList', array(&$group, &$list));
     $cgroup = NextendRequest::getVar('group');
     $ctype = NextendRequest::getVar('type');
     if (isset($list[$cgroup]) && isset($list[$cgroup][$ctype])) {
         $css = NextendCss::getInstance();
         $js = NextendJavascript::getInstance();
         $css->addCssLibraryFile('common.css');
         $css->addCssLibraryFile('window.css');
         $css->addCssLibraryFile('configurator.css');
         $configurationXmlFile = dirname(__FILE__) . '/forms/dynamic.xml';
         $js->loadLibrary('dojo');
         nextendimport('nextend.form.form');
         if (!$onlyFilter) {
             $form = new NextendForm();
             $form->loadArray($data);
             $form->loadXMLFile($configurationXmlFile);
             echo $form->render($control);
         }
         $form = new NextendForm();
         $form->loadArray($data);
         $form->loadXMLFile($list[$cgroup][$ctype][1] . 'config.xml');
         echo $form->render($control);
         return $list[$cgroup][$ctype][1] . 'config.xml';
     }
     return false;
 }
Exemplo n.º 11
0
 function renderTranslateUrlForm()
 {
     $js = NextendJavascript::getInstance();
     $js->loadLibrary('dojo');
     nextendimport('nextend.form.form');
     $form = new NextendForm();
     $configurationXmlFile = dirname(__FILE__) . '/forms/translateurl.xml';
     $form->loadArray(NextendRequest::getVar('translateurl'));
     $form->loadXMLFile($configurationXmlFile);
     echo $form->render('translateurl');
 }
Exemplo n.º 12
0
function nextend_configuration_box($object, $box)
{
    $configurationXmlFile = $box['args']['xml'];
    if (NextendFilesystem::fileexists($configurationXmlFile)) {
        nextendimport('nextend.css.css');
        nextendimport('nextend.javascript.javascript');
        $css = NextendCss::getInstance();
        $js = NextendJavascript::getInstance();
        $css->addCssLibraryFile('wordpress/removeslug.css');
        $css->addCssLibraryFile('common.css');
        $css->addCssLibraryFile('window.css');
        $css->addCssLibraryFile('configurator.css');
        $js->loadLibrary('dojo');
        $js->addLibraryJsLibraryFile('dojo', 'dojo/window.js');
        $js->addLibraryJsAssetsFile('dojo', 'window.js');
        nextendimport('nextend.form.form');
        $control_name = 'nextend';
        $form = new NextendForm();
        $data = get_post_meta($object->ID, 'nextend_configuration', true);
        $form->loadArray($data);
        $form->loadXMLFile($configurationXmlFile);
        require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . 'loadplugin.php';
        ?>
        <div id="nextend-configurator-wp" class="accordionmenu">
            <div class="gk_hack nextend-topbar"><div class="gk_hack nextend-topbar-logo"></div>
                <?php 
        $manual = 'http://www.nextendweb.com/wiki/accordion-menu-documentation/';
        if ($manual != "") {
            ?>
                    <a href="<?php 
            echo $manual;
            ?>
" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-manual">Manual</a>
                    <?php 
        }
        $support = 'http://www.nextendweb.com/accordion-menu/#support';
        if ($support != "") {
            ?>
                    <a href="<?php 
            echo $support;
            ?>
" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-support">Support</a>
                    <?php 
        }
        ?>
                
                <?php 
        if (defined('NEXTENDACCORDIONMENULITE')) {
            ?>
                    <a href="http://www.nextendweb.com/accordion-menu/" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-getpro">Get PRO</a>
                <?php 
        }
        ?>
                
                <div id="nextend-configurator-save" onclick="jQuery('#publish').trigger('click');" class="nextend-window-save"><div class="NextendWindowSave">SAVE</div></div>
		<div id="nextend-configurator-cancel" onclick="document.location.href='<?php 
        echo admin_url('edit.php?post_type=accordion_menu');
        ?>
';"
		class="nextend-window-cancel"><div class="NextendWindowCancel">CANCEL</div></div>
            </div>
            <?php 
        $form->set('manual', $manual);
        $form->set('support', $support);
        $form->render($control_name);
        $js->addLibraryJsAssetsFile('dojo', 'form.js');
        $js->addLibraryJs('dojo', '
                new NextendForm({
                  container: "nextend-configurator-wp",
                  data: ' . json_encode($form->_data) . ',
                  xml: "' . NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($configurationXmlFile)) . '",
                  control_name: "' . $control_name . '",
                  url: "' . site_url('/wp-admin/admin-ajax.php?action=nextend') . '",
                  loadedJSS: ' . json_encode($js->generateArrayJs()) . ',
                  loadedCSS: ' . json_encode($css->generateArrayCSS()) . '
                });
            ', true);
        ?>
        </div>
        <?php 
    }
}
Exemplo n.º 13
0
 protected function getInput()
 {
     $html = '';
     jimport('nextend.library');
     NextendText::l('common');
     nextendimport('nextend.css.css');
     nextendimport('nextend.javascript.javascript');
     $css = NextendCss::getInstance();
     $js = NextendJavascript::getInstance();
     $css->addCssLibraryFile('common.css');
     $css->addCssLibraryFile('window.css');
     $css->addCssLibraryFile('configurator.css');
     $attribs = $this->element->attributes();
     $configurationXmlFile = JPATH_SITE . (string) $attribs->xml;
     if (NextendFilesystem::fileexists($configurationXmlFile)) {
         $js->loadLibrary('dojo');
         $js->addLibraryJsLibraryFile('dojo', 'dojo/window.js');
         $js->addLibraryJsAssetsFile('dojo', 'window.js');
         $js->addLibraryJs('dojo', '
             new NextendWindow({
               button: dojo.byId("nextend-configurator-button"),
               node: dojo.byId("nextend-configurator-lightbox"),
               save: dojo.byId("nextend-configurator-save"),
               message: dojo.byId("nextend-configurator-message"),
               onHide: function(){
                 this.message.innerHTML = "' . NextendText::_('Now_you_should_save_the_module_settings_to_apply_changes') . '";
               }
             });
         ');
         $html .= '<div id="nextend-configurator-lightbox" class="gk_hack nextend-window ' . (string) $attribs->identifier . '">';
         $html .= '<div class="gk_hack nextend-window-container">';
         $html .= '<div class="gk_hack nextend-topbar"><div class="gk_hack nextend-topbar-logo"></div>';
         $manual = (string) $attribs->manual;
         if ($manual != "") {
             $html .= '<a href="' . $manual . '" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-manual">' . NextendText::_('Manual') . '</a>';
         }
         $support = (string) $attribs->support;
         if ($support != "") {
             $html .= '<a href="' . $support . '" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-support">' . NextendText::_('Support') . '</a>';
         }
         $html .= '<div id="nextend-configurator-save" class="nextend-window-save"><div class="NextendWindowSave">' . NextendText::_('APPLY') . '</div></div>';
         $html .= '</div>';
         $html .= '<div class="gk_hack nextend-window-container-inner">';
         $html .= '<fieldset id="nextend-configurator-panels" class="gk_hack panelform">';
         $html .= '<div id="menu-pane" class="gk_hack pane-sliders">';
         nextendimport('nextend.form.form');
         $form = new NextendForm();
         $form->loadArray($this->value);
         $form->set('manual', $manual);
         $form->set('support', $support);
         $form->loadXMLFile($configurationXmlFile);
         ob_start();
         $form->render($this->name);
         $html .= ob_get_clean();
         $html .= '</div>';
         $html .= '</fieldset>';
         $html .= '</div>';
         $html .= '</div>';
         $html .= '</div>';
         $html .= '<a id="nextend-configurator-button" class="nextend-configurator-button" href="#">' . NextendText::_('Configure') . '<span></span></a>
                   <span id="nextend-configurator-message">&nbsp;</span>';
         $js->addLibraryJsAssetsFile('dojo', 'form.js');
         $js->addLibraryJs('dojo', '
             new NextendForm({
               container: "nextend-configurator-lightbox",
               data: ' . json_encode($form->_data) . ',
               xml: "' . NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($configurationXmlFile)) . '",
               control_name: "' . $this->name . '",
               url: "' . JUri::current() . '",
               loadedJSS: ' . json_encode($js->generateArrayJs()) . ',
               loadedCSS: ' . json_encode($css->generateArrayCSS()) . '
             });
         ', true);
         $doc = JFactory::getDocument();
         $doc->_script = str_replace("jQuery('select').chosen({", "jQuery('select:not(.nextend-select)').chosen({", $doc->_script);
         return $html;
     } else {
         return NextendText::_("Not_found_xml_configuration") . $configurationXmlFile;
     }
 }
Exemplo n.º 14
0
function nextend_settings_page()
{
    ?>
<div>
<h2>Nextend Global Settings</h2>
<?php 
    if (isset($_POST['nextend'])) {
        update_option('nextend_config', $_POST['nextend']);
    }
    ?>
<div id="nextend_configuration" class="postbox" style="margin: 0 20px 0 0;">
<form method="post" id="nextend-settings" action="<?php 
    echo admin_url("options-general.php?page=nextend_settings_page");
    ?>
">
<?php 
    $configurationXmlFile = NEXTENDLIBRARY . 'wordpress/configuration.xml';
    if (NextendFilesystem::fileexists($configurationXmlFile)) {
        nextendimport('nextend.css.css');
        nextendimport('nextend.javascript.javascript');
        $css = NextendCss::getInstance();
        $js = NextendJavascript::getInstance();
        $css->addCssLibraryFile('wordpress/removeslug.css');
        $css->addCssLibraryFile('common.css');
        $css->addCssLibraryFile('window.css');
        $css->addCssLibraryFile('configurator.css');
        $js->loadLibrary('dojo');
        $js->addLibraryJsLibraryFile('dojo', 'dojo/window.js');
        $js->addLibraryJsAssetsFile('dojo', 'window.js');
        nextendimport('nextend.form.form');
        $control_name = 'nextend';
        $form = new NextendForm();
        $data = get_option('nextend_config');
        global $nextend;
        foreach ($nextend as $k => $v) {
            if (!isset($data[$k])) {
                $data[$k] = $v;
            }
        }
        $form->loadArray($data);
        $form->loadXMLFile($configurationXmlFile);
        ?>
        <div id="nextend-configurator-wp">
            <div class="gk_hack nextend-topbar"><div class="gk_hack nextend-topbar-logo"></div>
                <?php 
        $manual = 'http://www.nextendweb.com/wiki/';
        if ($manual != "") {
            ?>
                    <a href="<?php 
            echo $manual;
            ?>
" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-manual">Manual</a>
                    <?php 
        }
        $support = 'http://www.nextendweb.com/accordion-menu/#support';
        if ($support != "") {
            ?>
                    <a href="<?php 
            echo $support;
            ?>
" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-support">Support</a>
                    <?php 
        }
        ?>
                
                <?php 
        if (defined('NEXTENDACCORDIONMENULITE')) {
            ?>
                    <a href="http://www.nextendweb.com/accordion-menu/" target="_blank" class="gk_hack nextend-topbar-button nextend-topbar-getpro">Get PRO</a>
                <?php 
        }
        ?>
                
                <div id="nextend-configurator-save" onclick="njQuery('#nextend-settings').submit();" class="nextend-window-save"><div class="NextendWindowSave">SAVE</div></div>
            </div>
            <?php 
        $form->render($control_name);
        $js->addLibraryJsAssetsFile('dojo', 'form.js');
        $js->addLibraryJs('dojo', '
                new NextendForm({
                  container: "nextend-configurator-wp",
                  data: ' . json_encode($form->_data) . ',
                  xml: "' . NextendFilesystem::toLinux(NextendFilesystem::pathToRelativePath($configurationXmlFile)) . '",
                  control_name: "' . $control_name . '",
                  url: "' . site_url('/wp-admin/admin-ajax.php?action=nextend') . '",
                  loadedJSS: ' . json_encode($js->generateArrayJs()) . ',
                  loadedCSS: ' . json_encode($css->generateArrayCSS()) . '
                });
            ', true);
        ?>
        </div>
        <?php 
    }
    ?>
</div>
</form>
</div>
<?php 
}