当前位置: 首页>>代码示例>>PHP>>正文


PHP JFilterOutput::ampReplace方法代码示例

本文整理汇总了PHP中JFilterOutput::ampReplace方法的典型用法代码示例。如果您正苦于以下问题:PHP JFilterOutput::ampReplace方法的具体用法?PHP JFilterOutput::ampReplace怎么用?PHP JFilterOutput::ampReplace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JFilterOutput的用法示例。


在下文中一共展示了JFilterOutput::ampReplace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onContentPrepare

 function onContentPrepare($context, &$article, &$params, $limitstart = 1)
 {
     preg_match_all($this->regex, $article->text, $results, PREG_PATTERN_ORDER);
     //var_dump($results);
     if (count($results[0]) > 0) {
         for ($i = 0; $i < count($results[0]); $i++) {
             $subArray = array();
             $subArray = explode("|", $results[1][$i]);
             //var_dump($subArray);
             $contactId = $subArray[0] == '' || $subArray[0] == NULL ? 0 : $subArray[0];
             if (isset($subArray[1])) {
                 $itemId = $subArray[1] == '' || $subArray[1] == NULL ? 0 : $subArray[1];
                 //echo $itemId;
             }
             $itemId = isset($itemId) ? '&Itemid=' . $itemId : NULL;
             // Get Contact Details from Contact Component
             $query = 'SELECT * FROM #__contact_details' . ' WHERE id = ' . $contactId . ' AND published = 1';
             $contactInfo = $this->_getObject($query);
             // Set contact form link
             if (isset($contactInfo->email_to)) {
                 $contactFormLink = 'index.php?option=com_contact&view=contact&id=' . $contactId . $itemId . '&tmpl=component';
                 $contactFormLink = JFilterOutput::ampReplace($contactFormLink);
                 $contactFormOutput = '<iframe id="contact-form" onload="setIframeHeight(this.id)" src="' . $contactFormLink . '" scrolling="no" style="border:none;width:100%;"></iframe>';
                 $script = 'function setIframeHeight( iframeId ){var ifDoc, ifRef = document.getElementById( iframeId );try{ifDoc = ifRef.contentWindow.document.documentElement;}catch( e ){try{ifDoc = ifRef.contentDocument.documentElement;}catch(ee){}}if( ifDoc ){ifRef.height = 1;ifRef.height = ifDoc.scrollHeight;}}';
                 $doc =& JFactory::getDocument();
                 $doc->addScriptDeclaration($script);
                 $article->text = preg_replace($this->regex, $contactFormOutput, $article->text, 1);
             }
         }
     }
     return true;
 }
开发者ID:freaqzilla,项目名称:joomla-site,代码行数:32,代码来源:masters_articles_contact_form.php

示例2: render

 function render($selected, $prefix = false)
 {
     $t = JFilterOutput::ampReplace($this->label);
     // ensure ampersands are encoded
     $k = $prefix !== false ? $prefix . '/' . $this->value : $this->value;
     if (count($this->items) > 0) {
         // an option group
         $html = '';
         if ($k !== false) {
             // not the root group
             $html .= '<optgroup label="' . JText::_($t) . '">';
         }
         foreach ($this->items as $option) {
             $html .= $option->render($selected, $k);
         }
         if ($k !== false) {
             // not the root group
             $html .= '</optgroup>';
         }
         return $html;
     } else {
         // a single option
         if ($k !== false) {
             $s = $selected === $k ? ' selected="selected"' : '';
             return '<option value="' . $k . '"' . $s . '>' . JText::_($t) . '</option>';
         } else {
             // no options in root group
             return '';
         }
     }
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:31,代码来源:sectionedlist.php

示例3: renderIcon

    /**
     * Render iconset for cpanel
     *
     * @param $link string
     * @param $image string
     * @access private
     * @return void
     */
    private function renderIcon($link, $dataSourceName, $dataSourceUserViewName, $extensionName)
    {
        $lang = JFactory::getLanguage();
        ?>
		<div style="float:<?php 
        echo $lang->isRTL() ? 'right' : 'left';
        ?>
;">
			<div class="icon hasPopover" data-content="<?php 
        echo sprintf(JText::_('COM_JMAP_CREATE_DATASOURCE'), $dataSourceUserViewName);
        ?>
">
				<a data-role="start_create_process" data-extension="<?php 
        echo $extensionName;
        ?>
" href="<?php 
        echo JFilterOutput::ampReplace($link);
        ?>
">
					<img src="components/com_jmap/images/wizard/<?php 
        echo $dataSourceName;
        ?>
/icon.png" alt="<?php 
        echo $dataSourceUserViewName;
        ?>
"/>
					<span><?php 
        echo $dataSourceUserViewName;
        ?>
</span>
				</a>
			</div>
		</div>
		<?php 
    }
开发者ID:neoandrew1000,项目名称:crao_journal,代码行数:43,代码来源:view.html.php

示例4: display

 /**
  *
  * @return unknown_type
  */
 public static function display($articleid)
 {
     $html = '';
     if (empty($articleid)) {
         return;
     }
     $item = self::getArticle($articleid);
     $mainframe = JFactory::getApplication();
     // Return html if the load fails
     if (!$item->id) {
         return $html;
     }
     $item->title = JFilterOutput::ampReplace($item->title);
     $item->text = '';
     $item->text = $item->introtext . chr(13) . chr(13) . $item->fulltext;
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     $params = $mainframe->getParams('com_content');
     // Use param for displaying article title
     $j2store_params = JComponentHelper::getParams('com_j2store');
     $show_title = $j2store_params->get('show_title', $params->get('show_title'));
     if ($show_title) {
         $html .= "<h3>{$item->title}</h3>";
     }
     $html .= $item->introtext;
     return $html;
 }
开发者ID:ForAEdesWeb,项目名称:AEW4,代码行数:30,代码来源:j2item.php

示例5: display

 /**
  *
  * @return unknown_type
  */
 public function display($articleid)
 {
     $html = '';
     if (empty($articleid)) {
         return;
     }
     //try loading language associations
     if (version_compare(JVERSION, '3.3', 'gt')) {
         $id = $this->getAssociatedArticle($articleid);
         if ($id && is_int($id)) {
             $articleid = $id;
         }
     }
     $item = $this->getArticle($articleid);
     $mainframe = JFactory::getApplication();
     // Return html if the load fails
     if (!$item->id) {
         return $html;
     }
     $item->title = JFilterOutput::ampReplace($item->title);
     $item->text = '';
     $item->text = $item->introtext . chr(13) . chr(13) . $item->fulltext;
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     $params = $mainframe->getParams('com_content');
     $html .= $item->text;
     return $html;
 }
开发者ID:jputz12,项目名称:OneNow-Vshop,代码行数:31,代码来源:article.php

示例6: fetchElement

    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;
    }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:59,代码来源:loadgroup.php

示例7: testAmpReplace

	/**
	 * Tests replacing single ampersands with the entity, but leaving double ampersands
	 * and ampsersand-octothorpe combinations intact.
	 *
	 * @return void
	 */
	public function testAmpReplace()
	{
		$this->assertEquals(
			'&&george&amp;mary&#3son',
			$this->object->ampReplace('&&george&mary&#3son'),
			'Should replace single ampersands with HTML entity'
		);
	}
开发者ID:robschley,项目名称:joomla-platform,代码行数:14,代码来源:JFilterOutputTest.php

示例8: fetchElement

    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;
    }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:57,代码来源:loadgroup_backup.php

示例9: getVMComponent

    public static function getVMComponent($authCheck = true)
    {
        $lang = JFactory::getLanguage();
        $user = JFactory::getUser();
        $db = JFactory::getDBO();
        $q = 'SELECT m.id, m.title, m.alias, m.link, m.parent_id, m.img, e.element FROM `#__menu` as m
				LEFT JOIN #__extensions AS e ON m.component_id = e.extension_id
		         WHERE m.client_id = 1 AND e.enabled = 1 AND m.id > 1 AND e.element = \'com_virtuemart\'
		         AND (m.parent_id=1 OR m.parent_id =
			                        (SELECT m.id FROM `#__menu` as m
									LEFT JOIN #__extensions AS e ON m.component_id = e.extension_id
			                        WHERE m.parent_id=1 AND m.client_id = 1 AND e.enabled = 1 AND m.id > 1 AND e.element = \'com_virtuemart\'))
		         ORDER BY m.lft';
        $db->setQuery($q);
        $vmComponentItems = $db->loadObjectList();
        $result = new stdClass();
        if ($vmComponentItems) {
            if (!class_exists('VmConfig')) {
                require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
            }
            VmConfig::loadJLang('com_virtuemart.sys');
            // Parse the list of extensions.
            foreach ($vmComponentItems as &$vmComponentItem) {
                $vmComponentItem->link = trim($vmComponentItem->link);
                $vmComponentItem->link = JFilterOutput::ampReplace($vmComponentItem->link);
                if ($vmComponentItem->parent_id == 1) {
                    if ($authCheck == false || $authCheck && $user->authorise('core.manage', $vmComponentItem->element)) {
                        $result = $vmComponentItem;
                        if (!isset($result->submenu)) {
                            $result->submenu = array();
                        }
                        if (empty($vmComponentItem->link)) {
                            $vmComponentItem->link = 'index.php?option=' . $vmComponentItem->element;
                        }
                        $vmComponentItem->text = $lang->hasKey($vmComponentItem->title) ? JText::_($vmComponentItem->title) : $vmComponentItem->alias;
                    }
                } else {
                    // Sub-menu level.
                    if (isset($result)) {
                        // Add the submenu link if it is defined.
                        if (isset($result->submenu) && !empty($vmComponentItem->link)) {
                            $vmComponentItem->text = $lang->hasKey($vmComponentItem->title) ? JText::_($vmComponentItem->title) : $vmComponentItem->alias;
                            $class = preg_replace('#\\.[^.]*$#', '', basename($vmComponentItem->img));
                            $class = preg_replace('#\\.\\.[^A-Za-z0-9\\.\\_\\- ]#', '', $class);
                            $vmComponentItem->class = "icon-16-" . $class;
                            $result->submenu[] =& $vmComponentItem;
                        }
                    }
                }
            }
            return $result;
        } else {
            return NULL;
        }
    }
开发者ID:juanmcortez,项目名称:Lectorum,代码行数:55,代码来源:helper.php

示例10: display

 function display($tpl = null)
 {
     global $mainframe;
     $this->_layout = 'default';
     /*
      * Set toolbar items for the page
      */
     $menutype = $mainframe->getUserStateFromRequest('com_menus.menutype', 'menutype', 'mainmenu', 'menutype');
     JToolBarHelper::title(JText::_('MENU ITEM MANAGER'), 'menu.png');
     JToolBarHelper::addNewX('newItem');
     JToolBarHelper::spacer();
     JToolBarHelper::trash();
     JToolBarHelper::spacer();
     JToolBarHelper::customX('move', 'move.png', 'move_f2.png', 'Move', true);
     JToolBarHelper::customX('copy', 'copy.png', 'copy_f2.png', 'Copy', true);
     JToolBarHelper::spacer();
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     JToolBarHelper::spacer();
     JToolBarHelper::makeDefault('setdefault');
     JSubMenuHelper::addEntry(JText::_('Items'), 'index.php?option=com_menus&task=view', true);
     JSubMenuHelper::addEntry(JText::_('Menus'), 'index.php?option=com_menus');
     if (JFactory::getUser()->authorize('com_trash', 'manage')) {
         JSubMenuHelper::addEntry(JText::_('Trash'), 'index.php?option=com_trash&task=viewMenu');
     }
     $document =& JFactory::getDocument();
     $document->setTitle(JText::_('View Menu Items'));
     $limitstart = JRequest::getVar('limitstart', '0', '', 'int');
     $items =& $this->get('Items');
     $pagination =& $this->get('Pagination');
     $lists =& $this->_getViewLists();
     $user =& JFactory::getUser();
     require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'helper.php';
     $menus = MenusHelper::getMenuTypelist();
     // Ensure ampersands and double quotes are encoded in item titles
     foreach ($items as $i => $item) {
         $treename = $item->treename;
         $treename = JFilterOutput::ampReplace($treename);
         $treename = str_replace('"', '&quot;', $treename);
         $items[$i]->treename = $treename;
     }
     //Ordering allowed ?
     $ordering = $lists['order'] == 'm.ordering';
     JHTML::_('behavior.tooltip');
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('lists', $lists);
     $this->assignRef('user', $user);
     $this->assignRef('menutype', $menutype);
     $this->assignRef('ordering', $ordering);
     $this->assignRef('limitstart', $limitstart);
     $this->assignRef('menus', $menus);
     parent::display($tpl);
 }
开发者ID:JSWebdesign,项目名称:intranet-platform,代码行数:54,代码来源:view.php

示例11: showContent

    function showContent($option, $rows)
    {
        ?>
		
		<form action="index.php" method="post" name="adminForm">
		  <table class="adminlist">
		    <thead>
		      <tr>
			<th width="20">&nbsp;</th>
			<th class="title">Title</th>
		      </tr>
		    </thead>
		<?php 
        jimport('joomla.filter.output');
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $checked = JHTML::_("grid.id", $i, $row->id);
            $link = JFilterOutput::ampReplace('index.php?option=' . $option . '&task=edit&cid[]=' . $row->id);
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
			  <td><?php 
            echo $checked;
            ?>
</td>
			  <td><a href="<?php 
            echo $link;
            ?>
"><?php 
            echo $row->title;
            ?>
</a></td>
			</tr>
			<?php 
        }
        ?>
		</table>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
"/>
		<input type="hidden" name="task" value=""/>
		<input type="hidden" name="boxchecked" value="0"/>
		</form>
		<?php 
    }
开发者ID:bizanto,项目名称:Hooked,代码行数:49,代码来源:admin.saasy.html.php

示例12: get

 function get()
 {
     global $mainframe;
     // Lets get some variables we are going to need
     $menu = JToolBar::getInstance('submenu');
     $list = $menu->_bar;
     if (!is_array($list) || !count($list)) {
         $option = JRequest::getCmd('option');
         if ($option == 'com_categories') {
             $section = JRequest::getCmd('section');
             if ($section) {
                 if ($section != 'content') {
                     // special handling for specific core components
                     $map['com_contact_details'] = 'com_contact';
                     $map['com_banner'] = 'com_banners';
                     $option = isset($map[$section]) ? $map[$section] : $section;
                 }
             }
         }
         $list = JAdminSubMenu::_loadDBList($option);
     }
     if (!is_array($list) || !count($list)) {
         return null;
     }
     $hide = JRequest::getInt('hidemainmenu');
     $txt = "<ul id=\"submenu\">\n";
     /*
      * Iterate through the link items for building the menu items
      */
     foreach ($list as $item) {
         $txt .= "<li>\n";
         if ($hide) {
             if (isset($item[2]) && $item[2] == 1) {
                 $txt .= "<span class=\"nolink active\">" . $item[0] . "</span>\n";
             } else {
                 $txt .= "<span class=\"nolink\">" . $item[0] . "</span>\n";
             }
         } else {
             if (isset($item[2]) && $item[2] == 1) {
                 $txt .= "<a class=\"active\" href=\"" . JFilterOutput::ampReplace($item[1]) . "\">" . $item[0] . "</a>\n";
             } else {
                 $txt .= "<a href=\"" . JFilterOutput::ampReplace($item[1]) . "\">" . $item[0] . "</a>\n";
             }
         }
         $txt .= "</li>\n";
     }
     $txt .= "</ul>\n";
     return $txt;
 }
开发者ID:jicheng17,项目名称:comanova,代码行数:49,代码来源:mod_submenu.php

示例13: menuLink

 /**
 * Link the content to the menu
 * @param id The id of the content to insert
 * @param title: The  title of the menu element
 * @param menuselect: The menu where to create the link
 * @param contentType:  to know the kind of content (static content or not)
 */
 function menuLink($id, $title, $menuselect, $contentType, $parent)
 {
     global $mainframe;
     $database =& JFactory::getDBO();
     $menu = strval($menuselect);
     $link = strval($title);
     $link = stripslashes(JFilterOutput::ampReplace($link));
     //find what kind of link needs to be created in $row->link
     switch ($contentType) {
         case "content_section":
             $taskLink = "section";
             break;
         case "content_blog_section":
             $taskLink = "section&layout=blog";
             break;
         case "content_category":
             $taskLink = "category";
             break;
         case "content_blog_category":
             $taskLink = "category&layout=blog";
             break;
         default:
             $taskLink = "article";
     }
     $row =& JTable::getInstance('menu');
     $row->menutype = $menu;
     $row->name = $link;
     $row->alias = JFilterOutput::stringURLSafe($link);
     $row->parent = $parent == -1 ? 0 : $parent;
     $row->type = 'component';
     $row->link = 'index.php?option=com_content&view=' . $taskLink . '&id=' . $id;
     $row->published = 1;
     //$row->componentid	= $id;
     $row->componentid = 20;
     $row->ordering = 9999;
     $row->params = "display_num=10\nshow_headings=1\nshow_date=0\ndate_format=\nfilter=1\nfilter_type=title\norderby_sec=\nshow_pagination=1\nshow_pagination_limit=1\nshow_feed_link=1\nshow_noauth=\nshow_title=\nlink_titles=\nshow_intro=\nshow_section=\nlink_section=\nshow_category=\nlink_category=\nshow_author=\nshow_create_date=\nshow_modify_date=\nshow_item_navigation=\nshow_readmore=\nshow_vote=\nshow_icons=\nshow_pdf_icon=\nshow_print_icon=\nshow_email_icon=\nshow_hits=\nfeed_summary=\npage_title=\nshow_page_title=1\npageclass_sfx=\nmenu_image=-1\nsecure=0\n\n";
     if (!$row->check()) {
         echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
         exit;
     }
     if (!$row->store()) {
         echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
         exit;
     }
     $row->reorder("menutype = " . $database->Quote($row->menutype) . " AND parent = " . (int) $row->parent);
     // clean any existing cache files
     //mosCache::cleanCache( 'com_content' );
 }
开发者ID:Ratmir15,项目名称:Joomla---formula-of-success,代码行数:55,代码来源:categories.php

示例14: display

    function display($tpl=null) {


        $app = JFactory::getApplication();
        $uri = JFactory::getURI();
        $params = $app->getParams();

        $model = $this->getModel('users');

        $items = $model->get('users');
        if ($items)
            for ($key = 0; $key < count($items); $key++) {
                $user = $items[$key];
                $user->rownr = $key;
                $user->link = JRoute::_("index.php?option=com_bids&task=userdetails&id={$user->id}");
                $items[$key] = $user;
            }

        //add alternate feed link
        if ($params->get('show_feed_link', 1) == 1) {
            $document = JFactory::getDocument();
            $link = '&format=feed&limitstart=';
            $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
            $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
            $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
            $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
        }

        $filters = $model->getFilters();
        $pagination = $model->getPagination();

        $this->assign("action", JRoute::_(JFilterOutput::ampReplace($uri->toString())));
        $this->assign("users", $items);
        $this->assign("sfilters", $filters);

        $this->assign("pagination", $pagination);

        if ($params->get('show_page_title', 1)) {
            $page_title = $this->escape($params->get('page_title', "Show users"));
            $this->assign("page_title", $page_title);
        }
        $this->assign("pageclass_sfx", $params->get('pageclass_sfx'));

        JHTML::_("behavior.modal");
        JHTML::script( JURI::root().'components/com_bids/js/startup.js' );

        parent::display($tpl);
    }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:48,代码来源:view.html.php

示例15: display

 /**
  *
  * @return unknown_type
  */
 public static function display($articleid)
 {
     $html = '';
     $item = K2StoreItem::_getK2Item($articleid);
     // Return html if the load fails
     if (!$item->id) {
         return $html;
     }
     $item->title = JFilterOutput::ampReplace($item->title);
     //import plugins
     $item->text = '';
     $item->text = $item->introtext . chr(13) . chr(13) . $item->fulltext;
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     $params = JComponentHelper::getParams('com_k2');
     $dispatcher = JDispatcher::getInstance();
     // process k2 plugins
     //Init K2 plugin events
     $item->event = new JObject();
     $item->event->K2BeforeDisplay = '';
     $item->event->K2AfterDisplay = '';
     $item->event->K2AfterDisplayTitle = '';
     $item->event->K2BeforeDisplayContent = '';
     $item->event->K2AfterDisplayContent = '';
     $item->event->K2CommentsCounter = '';
     JPluginHelper::importPlugin('k2');
     $results = $dispatcher->trigger('onK2BeforeDisplay', array(&$item, &$params, $limitstart));
     $item->event->K2BeforeDisplay = trim(implode("\n", $results));
     $results = $dispatcher->trigger('onK2AfterDisplay', array(&$item, &$params, $limitstart));
     $item->event->K2AfterDisplay = trim(implode("\n", $results));
     $results = $dispatcher->trigger('onK2AfterDisplayTitle', array(&$item, &$params, $limitstart));
     $item->event->K2AfterDisplayTitle = trim(implode("\n", $results));
     $results = $dispatcher->trigger('onK2BeforeDisplayContent', array(&$item, &$params, $limitstart));
     $item->event->K2BeforeDisplayContent = trim(implode("\n", $results));
     $results = $dispatcher->trigger('onK2AfterDisplayContent', array(&$item, &$params, $limitstart));
     $item->event->K2AfterDisplayContent = trim(implode("\n", $results));
     $dispatcher->trigger('onK2PrepareContent', array(&$item, &$params, $limitstart));
     $item->introtext = $item->text;
     // Use param for displaying article title
     $k2store_params = JComponentHelper::getParams('com_k2store');
     $show_title = $k2store_params->get('show_title', $params->get('show_title'));
     if ($show_title) {
         $html .= "<h3>{$item->title}</h3>";
     }
     $html .= $item->introtext;
     return $html;
 }
开发者ID:A-Bush,项目名称:pprod,代码行数:50,代码来源:k2item.php


注:本文中的JFilterOutput::ampReplace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。