コード例 #1
0
    function fetchElement($name, $value, &$node, $control_name)
    {
        if ($node['secret'] && !JRequest::getBool($node['secret'])) {
            return null;
        }
        $order = $node['order'] == 'after' ? 'after' : 'before';
        $label = $node['label'] ? $node['label'] : 'Layout Parameters';
        $doc =& JFactory::getDocument();
        $style = "\n\t\t#{$control_name}{$name}-tabs {\n\t\t\tborder-top-width: 0px;\n\t\t\tborder-right-width: 0px;\n\t\t\tborder-bottom-width: 0px;\n\t\t\tborder-left-width: 0px;\n\t\t}";
        $doc->addStyleDeclaration($style);
        $id = JRequest::getInt('id');
        if (!$id) {
            $id = reset(JRequest::getVar('cid', array()));
        }
        $db =& JFactory::getDBO();
        $query = 'SELECT params' . ' FROM #__modules' . ' WHERE id =' . $id;
        $db->setQuery($query);
        $values = $db->loadResult();
        //Get the module name, in a slightly hacky way.
        $module = JRequest::getWord('module');
        $mod =& JTable::getInstance('Module', 'JTable');
        if ($id) {
            $mod->load($id);
            $modname = $mod->module;
        } elseif ($module) {
            $modname = $module;
        }
        nimport('napi.html.parameter');
        $load = new NParameter($values, JPATH_ROOT . DS . 'modules' . DS . $modname . DS . $modname . '.xml');
        if (!$node->children()) {
            $content = $load->renderFieldset('params', $value, $node['suffix']);
            $container = $node['panel'] ? "\n\t\t\t<div id='{$control_name}{$name}' class='panel ui-widget ui-widget-content'>\n\t\t\t\t<h3 class='title jpane-toggler' id='{$name}-page'>\n\t\t\t\t\t<span>" . JFilterOutput::ampReplace($label) . "</span>\n\t\t\t\t</h3>\n\t\t\t\t<div class='jpane-slider ui-widget-content content' style='background:transparent;'>{$content}</div>\n\t\t\t</div>" : " <div id='{$control_name}{$name}'>{$content}</div>";
            $script = "\n\t\t\t\tjQuery.noConflict();\n\t \n\t\t\t\tjQuery(document).ready(function(\$){\n\t\t\t\t\t\$('#{$control_name}{$name}').closest('.pane-sliders > .panel').{$order}(\$('#{$control_name}{$name}'));\n\t\t\t\t});\n\t\t\t\t";
            $doc->addScriptDeclaration($script);
        } else {
            $content = null;
            $panel = null;
            $title = null;
            $container = $node['panel'] ? " <div id='{$control_name}{$name}' class='panel ui-widget ui-widget-content'>" : " <div id='{$control_name}{$name}'>";
            $opt['useCookie'] = $node['cookie'] ? '\'' . $node['cookie'] . '\'' : null;
            JHTML::script('tabs.js');
            $panel .= JPaneTabs::startPane($control_name . $name . 'tabs');
            foreach ($node->children() as $group) {
                $content = $load->renderFieldset('params', $group['value'], $node['suffix']);
                $title .= $node['panel'] ? ' <span>' . JFilterOutput::ampReplace($group->data()) . '</span>' : JFilterOutput::ampReplace($group->data());
                $panel .= $node['panel'] ? JPaneTabs::startPanel(JFilterOutput::ampReplace($group->data()), $group['value']) . $content . JPaneTabs::endPanel() : $content;
            }
            $panel .= JPaneTabs::endPane();
            $container .= $node['panel'] ? '<h3 class="title jpane-toggler" id="' . $value . '-page"><span>' . JFilterOutput::ampReplace($label) . '</span></h3>
					<div class="jpane-slider jpane-current ui-widget-content content" style="background:transparent;">' . $panel . '</div>
				</div>' : $panel . '</div>';
            JHTML::script('accordion.fix.js', 'media/napi/js/');
            JHTML::script('tabs.fix.js', 'media/napi/js/');
            $script = "\n\t\tjQuery.noConflict();\n \n\t\tjQuery(document).ready(function(\$){\n\t\t\t\$('#{$control_name}{$name}').closest('.pane-sliders > .panel').{$order}(\$('#{$control_name}{$name}'));\n\t\t});";
            $doc->addScriptDeclaration($script);
            $doc->addStyleDeclaration('.jpane-current div.current { padding: 0px 0px; border-width:0px; border-top-width:1px;}');
        }
        return $container;
    }
コード例 #2
0
    function fetchElement($name, $value, &$node, $control_name)
    {
        if ($node['secret'] && !JRequest::getBool($node['secret'])) {
            return null;
        }
        $order = $node['order'] == 'after' ? 'after' : 'before';
        $label = $node['label'] ? $node['label'] : 'Layout Parameters';
        $doc =& JFactory::getDocument();
        $style = "\n\t\t#{$control_name}{$name}-tabs {\n\t\t\tborder-top-width: 0px;\n\t\t\tborder-right-width: 0px;\n\t\t\tborder-bottom-width: 0px;\n\t\t\tborder-left-width: 0px;\n\t\t}";
        $doc->addStyleDeclaration($style);
        $id = JRequest::getInt('id');
        if (!$id) {
            $id = reset(JRequest::getVar('cid', array()));
        }
        $db =& JFactory::getDBO();
        $query = 'SELECT params' . ' FROM #__modules' . ' WHERE id =' . $id;
        $db->setQuery($query);
        $values = $db->loadResult();
        //Get the module name, in a slightly hacky way.
        $module = JRequest::getWord('module');
        $mod =& JTable::getInstance('Module', 'JTable');
        if ($id) {
            $mod->load($id);
            $modname = $mod->module;
        } elseif ($module) {
            $modname = $module;
        }
        nimport('napi.html.parameter');
        $load = new NParameter($values, JPATH_ROOT . DS . 'modules' . DS . $modname . DS . $modname . '.xml');
        if (!$node->children()) {
            $content = $load->renderFieldset('params', $value, $node['suffix']);
            $container = $node['panel'] ? "\n\t\t\t<div id='{$control_name}{$name}' class='panel ui-widget ui-widget-content'>\n\t\t\t\t<h3 class='title jpane-toggler' id='{$name}-page'>\n\t\t\t\t\t<span>" . JFilterOutput::ampReplace($label) . "</span>\n\t\t\t\t</h3>\n\t\t\t\t<div class='jpane-slider ui-widget-content content' style='background:transparent;'>{$content}</div>\n\t\t\t</div>" : " <div id='{$control_name}{$name}'>{$content}</div>";
            $script = "\n\t\t\t\tjQuery.noConflict();\n\t \n\t\t\t\tjQuery(document).ready(function(\$){\n\t\t\t\t\t\$('#{$control_name}{$name}').closest('.pane-sliders > .panel').{$order}(\$('#{$control_name}{$name}'));\n\t\t\t\t});\n\t\t\t\t";
            $doc->addScriptDeclaration($script);
        } else {
            $content = null;
            $panel = null;
            $title = null;
            $container = $node['panel'] ? " <div id='{$control_name}{$name}' class='panel ui-widget ui-widget-content'>" : " <div id='{$control_name}{$name}'>";
            $opt['useCookie'] = $node['cookie'] ? '\'' . $node['cookie'] . '\'' : null;
            JHTML::script('tabs.js');
            $panel .= JPaneTabs::startPane($control_name . $name . 'tabs');
            foreach ($node->children() as $group) {
                $content = $load->renderFieldset('params', $group['value'], $node['suffix']);
                $title .= $node['panel'] ? ' <span>' . JFilterOutput::ampReplace($group->data()) . '</span>' : JFilterOutput::ampReplace($group->data());
                $panel .= $node['panel'] ? JPaneTabs::startPanel(JFilterOutput::ampReplace($group->data()), $group['value']) . $content . JPaneTabs::endPanel() : $content;
            }
            $panel .= JPaneTabs::endPane();
            $container .= $node['panel'] ? '<h3 class="title jpane-toggler" id="' . $value . '-page"><span>' . JFilterOutput::ampReplace($label) . '</span></h3>
					<div class="jpane-slider jpane-current ui-widget-content content" style="background:transparent;">' . $panel . '</div>
				</div>' : $panel . '</div>';
            $script = "\n\t\tjQuery.noConflict();\n \n\t\tjQuery(document).ready(function(\$){\n\t\t\t\$('#{$control_name}{$name}').closest('.pane-sliders > .panel').{$order}(\$('#{$control_name}{$name}'));\n\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\twindow.addEvent('domready', function(){ \n\t\t\t\n\t\t\tvar dur = 600;\n\t\t\tvar trans = Fx.Transitions.Quad.easeInOut;\n\t\t\tvar el = \$\$('#{$control_name}{$name} div.jpane-slider').getFirst();\n\t\t\tvar fx = new Fx.Styles(el, {duration: dur, transition: trans});\n\t\t\t\n\t\t\t\$\$('dl.tabs').each(function(tabs){ new JTabs(tabs, {\n\t\t\tonActive: function(title, description){\n                description.effects({duration: dur, transition: trans}).start({'opacity': 1, 'height': description.getSize().scrollSize.y});\n                title.addClass('open').removeClass('closed');\n\t            el.effects({duration: dur, transition: trans}).start({'height': description.getSize().scrollSize.y + title.getParent().getSize().scrollSize.y + title.getParent().getStyle('margin-top').toInt()});\n            },\n            onBackground: function(title, description){\n            \tdescription.effects({duration: dur, transition: trans}).start({'opacity': 0});\n            \tdescription.effects({duration: dur, transition: trans}).start({'height': 0});\n                title.addClass('closed').removeClass('open');\n            },\n            cookie: 'showcase'}); }); \n        });";
            $doc->addScriptDeclaration($script);
            $doc->addStyleDeclaration('.jpane-current div.current { padding: 0px 0px; border-width:0px; border-top-width:1px;}');
        }
        return $container;
    }
コード例 #3
0
 function endPane()
 {
     echo parent::endPane();
 }