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


PHP JRoute类代码示例

本文整理汇总了PHP中JRoute的典型用法代码示例。如果您正苦于以下问题:PHP JRoute类的具体用法?PHP JRoute怎么用?PHP JRoute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: display

 /**
  * Method to display a view.
  *
  * @param	boolean			If true, the view output will be cached
  * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController		This object to support chaining.
  * @since	1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     require_once JPATH_COMPONENT . '/helpers/users.php';
     // Load the submenu.
     UsersHelper::addSubmenu(JRequest::getCmd('view', 'users'));
     $view = JRequest::getCmd('view', 'users');
     $layout = JRequest::getCmd('layout', 'default');
     $id = JRequest::getInt('id');
     if (!$this->canView($view)) {
         JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
         return;
     }
     // Check for edit form.
     if ($view == 'user' && $layout == 'edit' && !$this->checkEditId('com_users.edit.user', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=users', false));
         return false;
     } elseif ($view == 'group' && $layout == 'edit' && !$this->checkEditId('com_users.edit.group', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=groups', false));
         return false;
     } elseif ($view == 'level' && $layout == 'edit' && !$this->checkEditId('com_users.edit.level', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=levels', false));
         return false;
     }
     return parent::display();
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:43,代码来源:controller.php

示例2: onAfterRoute

	public function onAfterRoute()
	{
		$app = JFactory::getApplication();

		if($app->isAdmin()){
			return;
		}

		$menus = $app->getMenu('site');
		$menu = $menus->getActive();
		if(!$menu || $menu->home != 1) return;

		$doc = JFactory::getDocument();
		if($doc->getType() != 'html') return;

		$params = JComponentHelper::getParams('com_xmlrpc');

		if($params->get('show_rsd', 1)){
			class_exists('XMLRPCHelperRoute') or require(JPATH_SITE.'/components/com_xmlrpc/helpers/route.php');
			$link = JRoute::_(XMLRPCHelperRoute::getRsdRoute());
			$doc->addHeadLink($link, 'EditURI', 'rel', array('type' => 'application/rsd+xml', 'title'=>'RSD'));
		}

		if($params->get('show_manifest', 1)){
			class_exists('XMLRPCHelperRoute') or require(JPATH_SITE.'/components/com_xmlrpc/helpers/route.php');
			$link = JRoute::_(XMLRPCHelperRoute::getManifestRoute());
			$doc->addHeadLink($link, 'wlwmanifest', 'rel', array('type'=>'application/wlwmanifest+xml'));
		}
	}
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:29,代码来源:rsd.php

示例3: _render

 protected function _render($params = array())
 {
     $target = $this->_data->get('target', '') ? 'target="_blank"' : '';
     $rel = $this->_data->get('rel', '');
     $rel = !empty($rel) ? 'rel="' . $rel . '"' : '';
     return '<a href="' . JRoute::_($this->_data->get('value', '')) . '" title="' . $this->getTitle() . '" ' . $target . ' ' . $rel . '>' . $this->getText() . '</a>';
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:7,代码来源:link.php

示例4: delete

 public function delete()
 {
     // Check for request forgeries
     JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
     // Get items to remove from the request.
     $cid = JFactory::getApplication()->input->get('cid', array(), 'array');
     if (!is_array($cid) || count($cid) < 1) {
         JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');
     } else {
         // Get the model.
         $model = $this->getModel();
         // Make sure the item ids are integers
         jimport('joomla.utilities.arrayhelper');
         JArrayHelper::toInteger($cid);
         // Remove the items.
         if ($model->delete($cid)) {
             $this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
         } else {
             $this->setMessage($model->getError());
         }
     }
     $version = new JVersion();
     if ($version->isCompatible('3.0')) {
         // Invoke the postDelete method to allow for the child class to access the model.
         $this->postDeleteHook($model, $cid);
     }
     $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
 }
开发者ID:AndreKoepke,项目名称:Einsatzkomponente,代码行数:28,代码来源:alarmierungsarten.php

示例5: getInput

 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     // Initialise variables.
     $html = array();
     $recordId = (int) $this->form->getValue('id');
     $size = ($v = $this->element['size']) ? ' size="' . $v . '"' : '';
     $class = ($v = $this->element['class']) ? ' class="' . $v . '"' : 'class="text_area"';
     // Get a reverse lookup of the base link URL to Title
     $model = JModel::getInstance('menutypes', 'menusModel');
     $rlu = $model->getReverseLookup();
     switch ($this->value) {
         case 'url':
             $value = JText::_('COM_MENUS_TYPE_EXTERNAL_URL');
             break;
         case 'alias':
             $value = JText::_('COM_MENUS_TYPE_ALIAS');
             break;
         case 'separator':
             $value = JText::_('COM_MENUS_TYPE_SEPARATOR');
             break;
         default:
             $link = $this->form->getValue('link');
             // Clean the link back to the option, view and layout
             $value = JText::_(JArrayHelper::getValue($rlu, MenusHelper::getLinkKey($link)));
             break;
     }
     // Load the javascript and css
     JHtml::_('behavior.framework');
     JHtml::_('behavior.modal');
     $html[] = '<input type="text" readonly="readonly" disabled="disabled" value="' . $value . '"' . $size . $class . ' />';
     $html[] = '<input type="button" value="' . JText::_('JSELECT') . '" onclick="SqueezeBox.fromElement(this, {handler:\'iframe\', size: {x: 600, y: 450}, url:\'' . JRoute::_('index.php?option=com_menus&view=menutypes&tmpl=component&recordId=' . $recordId) . '\'})" />';
     $html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" />';
     return implode("\n", $html);
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:40,代码来源:menutype.php

示例6: array

 public static function &getButtons()
 {
     if (empty(self::$buttons)) {
         self::$buttons = array(array('link' => JRoute::_('index.php?option=com_imageshow'), 'image' => 'components/com_imageshow/assets/images/icons-48/icon-off.png', 'text' => JText::_('LAUNCH_PAD'), 'extra_text' => ''), array('link' => JRoute::_('index.php?option=com_imageshow&controller=showlist'), 'image' => 'components/com_imageshow/assets/images/icons-48/icon-file.png', 'text' => JText::_('SHOWLISTS_MANAGER'), 'extra_text' => ''), array('link' => JRoute::_('index.php?option=com_imageshow&controller=showlist&task=add'), 'image' => 'components/com_imageshow/assets/images/icons-48/icon-add-file.png', 'text' => JText::_('ADD_NEW_SHOWLISTS'), 'extra_text' => ''), array('link' => JRoute::_('index.php?option=com_imageshow&controller=showcase'), 'image' => 'components/com_imageshow/assets/images/icons-48/icon-monitor.png', 'text' => JText::_('SHOWCASES_MANAGER'), 'extra_text' => ''), array('link' => JRoute::_('index.php?option=com_imageshow&controller=showcase&task=add'), 'image' => 'components/com_imageshow/assets/images/icons-48/icon-add-monitor.png', 'text' => JText::_('ADD_NEW_SHOWCASES'), 'extra_text' => ''), array('link' => JRoute::_('index.php?option=com_imageshow&controller=about'), 'image' => 'components/com_imageshow/assets/images/icons-48/icon-star.png', 'text' => JText::_('ABOUT'), 'extra_text' => ''));
     }
     return self::$buttons;
 }
开发者ID:jdrzaic,项目名称:joomla-dummy,代码行数:7,代码来源:helper.php

示例7: display

 /**
  * sauto view display method.
  *
  * @param string $tpl The name of the template file to parse;
  *
  * @return void
  */
 public function display($tpl = null)
 {
     $app =& JFactory::getApplication();
     $link_redirect = JRoute::_('index.php?option=com_sauto');
     $user =& JFactory::getUser();
     $uid = $user->id;
     if ($uid == 0) {
         //vizitator
         $app->redirect($link_redirect, JText::_('SAUTO_PAGE_NOT_EXIST'));
     } else {
         $db = JFactory::getDbo();
         $query = "SELECT `tip_cont` FROM #__sa_profiles WHERE `uid` = '" . $uid . "'";
         $db->setQuery($query);
         $type = $db->loadResult();
         if ($type == 0) {
             //cont customer
             $tpl = '0';
         } elseif ($type == 1) {
             //cont dealer
             $tpl = '1';
         } else {
             $app->redirect($link_redirect, JText::_('SAUTO_PAGE_NOT_EXIST'));
         }
         parent::display($tpl);
     }
 }
开发者ID:grchis,项目名称:Site-Auto,代码行数:33,代码来源:view.html.php

示例8: onCCK_FieldPrepareContent

 public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array())
 {
     if (self::$type != $field->type) {
         return;
     }
     parent::g_onCCK_FieldPrepareContent($field, $config);
     // Prepare
     $link = '';
     $html = '';
     $text = '';
     if ($value) {
         $app = JFactory::getApplication();
         $menu = $app->getMenu()->getItem($value);
         if (is_object($menu)) {
             $link = JRoute::_('index.php?Itemid=' . $value);
             $text = $menu->title;
             $html = '<a href="' . $link . '">' . $text . '</a>';
         } else {
             $value = '';
         }
     }
     // Set
     $field->html = $html;
     $field->link = $link;
     $field->linked = true;
     $field->text = $text;
     $field->typo_target = 'text';
     $field->value = $value;
 }
开发者ID:olafzieger,项目名称:joomla3.x-seblod-test,代码行数:29,代码来源:jform_menuitem.php

示例9: save

 /**
  * Saves a new meta object
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function save()
 {
     // Check for request forgeries
     EB::checkToken();
     // @task: Check for acl rules.
     $this->checkAccess('meta');
     // Default return url
     $return = JRoute::_('index.php?option=com_easyblog&view=metas', false);
     $post = $this->input->getArray('post');
     if (!isset($post['id']) || empty($post['id'])) {
         $this->info->set('COM_EASYBLOG_INVALID_META_TAG_ID', 'error');
         return $this->app->redirect($return);
     }
     $meta = EB::table('Meta');
     $meta->load((int) $post['id']);
     $meta->bind($post);
     // Save the meta object
     $meta->store();
     $task = $this->getTask();
     if ($task == 'apply') {
         $return = 'index.php?option=com_easyblog&view=metas&layout=form&id=' . $meta->id;
     }
     $this->info->set('COM_EASYBLOG_META_SAVED', 'success');
     return $this->app->redirect($return);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:33,代码来源:meta.php

示例10: toggleInList

 public function toggleInList()
 {
     // Check for request forgeries
     JRequest::checkToken() or die(JText::_('JINVALID_TOKEN'));
     // Get items to publish from the request.
     $cid = JRequest::getVar('cid', array(), '', 'array');
     $data = array('showInListView' => 1, 'hideFromListView' => 0);
     $task = $this->getTask();
     $value = JArrayHelper::getValue($data, $task, 0, 'int');
     if (empty($cid)) {
         JError::raiseWarning(500, JText::_($this->text_prefix . '_NO_ITEM_SELECTED'));
     } else {
         // Get the model.
         $model = $this->getModel();
         // Make sure the item ids are integers
         JArrayHelper::toInteger($cid);
         // Publish the items.
         if (!$model->addToListView($cid, $value)) {
             JError::raiseWarning(500, $model->getError());
         } else {
             if ($value == 1) {
                 $ntext = $this->text_prefix . '_N_ITEMS_ADDED_TO_LIST_VIEW';
             } else {
                 $ntext = $this->text_prefix . '_N_ITEMS_REMOVED_FROM_LIST_VIEW';
             }
             $this->setMessage(JText::plural($ntext, count($cid)));
         }
     }
     $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:30,代码来源:elements.php

示例11: prepareSidebar

 protected function prepareSidebar()
 {
     if (!JCck::on()) {
         return;
     }
     $buttons = array();
     if (JCck::getUIX() == 'compact') {
         $core = array(array('val' => '2', 'pre' => '', 'key' => 'COM_CCK_'));
     } else {
         $core = array(array('val' => '0', 'pre' => '', 'key' => 'COM_CCK_', 'img' => 'cck-application'), array('val' => '2', 'pre' => '-&nbsp;', 'key' => 'COM_CCK_', 'img' => 'cck-form'), array('val' => '3', 'pre' => '-&nbsp;', 'key' => '', 'img' => 'cck-plugin'), array('val' => '4', 'pre' => '-&nbsp;', 'key' => 'COM_CCK_', 'img' => 'cck-search'), array('val' => '1', 'pre' => '-&nbsp;', 'key' => '', 'img' => 'cck-template'), array('val' => '5', 'pre' => '', 'key' => '', 'img' => 'cck-multisite'));
     }
     $components = JCckDatabase::loadObjectList('SELECT a.title, a.link, b.element' . ' FROM #__menu AS a LEFT JOIN #__extensions AS b ON b.extension_id = a.component_id' . ' WHERE a.link LIKE "index.php?option=com_cck\\_%"' . ' AND a.link NOT IN ("index.php?option=com_cck_toolbox&view=processing","index.php?option=com_cck_webservices&view=api")' . ' ORDER BY a.title ASC');
     $groupedButtons = array();
     $more = array('ADDON' => 16, 'PLUGIN_FIELD' => 19, 'PLUGIN_LINK' => 20, 'PLUGIN_LIVE' => 21, 'PLUGIN_RESTRICTION' => 112, 'PLUGIN_TYPOGRAPHY' => 24, 'PLUGIN_VALIDATION' => 25, 'TEMPLATE' => 27);
     foreach ($core as $k => $v) {
         $buttons[] = array('access' => array('core.manage', 'com_cck'), 'group' => 'COM_CCK_CORE', 'image' => $v['img'], 'link' => JRoute::_(constant('_C' . $v['val'] . '_LINK')), 'target' => '_self', 'text' => $v['pre'] . JText::_($v['key'] . constant('_C' . $v['val'] . '_TEXT') . 'S'));
     }
     foreach ($components as $k => $v) {
         $buttons[] = array('access' => array('core.manage', $v->element), 'group' => 'COM_CCK_SEBLOD_MORE', 'image' => 'cck-addon', 'link' => JRoute::_($v->link), 'target' => '_self', 'text' => $v->title);
     }
     foreach ($more as $k => $v) {
         $buttons[] = array('access' => array('core.manage', 'com_cck'), 'group' => 'COM_CCK_SEBLOD_COM', 'image' => 'download', 'link' => JRoute::_('http://www.seblod.com/products?seb_item_category=' . $v), 'target' => '_blank', 'text' => JText::_('COM_CCK_PANE_MORE_' . $k));
     }
     foreach ($buttons as $button) {
         $groupedButtons[$button['group']][] = $button;
     }
     $this->sidebar = '<div class="sidebar-nav quick-icons">' . JHtml::_('links.linksgroups', $groupedButtons) . '</div>';
 }
开发者ID:kolydart,项目名称:SEBLOD,代码行数:28,代码来源:view.html.php

示例12: makeList

 private static function makeList(&$html, &$root, $path, $expand, $cid, $level = 0, $show_count = false)
 {
     $children = $root->getChildren();
     foreach ($children as $child) {
         $current = $child->id == $cid ? true : false;
         $parent = count($child->getChildren()) ? true : false;
         $active = $current || in_array($child->id, $path) ? true : false;
         $deeper = $parent && $expand ? true : false;
         $class = 'djc_catid-' . $child->id . ' level' . $level;
         $class .= $current ? ' current' : '';
         $class .= $active ? ' active' : '';
         $class .= $parent ? ' parent' : '';
         $class .= $deeper ? ' deeper' : '';
         $display_name = $child->name;
         if ($show_count) {
             if (($count = $child->getProductCount()) !== false) {
                 $display_name = $child->name . ' <small class="djc_category_counter">[' . $count . ']</small>';
             }
         }
         $html .= '<li class="' . $class . '"><a href="' . JRoute::_(DJCatalogHelperRoute::getCategoryRoute($child->id . ':' . $child->alias), true) . '">' . $display_name . '</a>';
         if (($active || $expand) && count($child->getChildren())) {
             $html .= '<ul>';
             $level++;
             self::makeList($html, $child, $path, $expand, $cid, $level, $show_count);
             $level--;
             $html .= '</ul>';
         }
         $html .= '</li>';
     }
 }
开发者ID:ForAEdesWeb,项目名称:AEW3,代码行数:30,代码来源:helper.php

示例13: onContentPrepare

 /**
  * Plugin that retrieves contact information for contact
  *
  * @param   string   $context  The context of the content being passed to the plugin.
  * @param   mixed    &$row     An object with a "text" property
  * @param   mixed    $params   Additional parameters. See {@see PlgContentContent()}.
  * @param   integer  $page     Optional page number. Unused. Defaults to zero.
  *
  * @return  boolean	True on success.
  */
 public function onContentPrepare($context, &$row, $params, $page = 0)
 {
     $allowed_contexts = array('com_content.category', 'com_content.article', 'com_content.featured');
     if (!in_array($context, $allowed_contexts)) {
         return true;
     }
     // Return if we don't have valid params or don't link the author
     if (!$params instanceof Registry || !$params->get('link_author')) {
         return true;
     }
     // Return if we don't have a valid article id
     if (!isset($row->id) || !(int) $row->id) {
         return true;
     }
     $row->contactid = $this->getContactId($row->created_by);
     if ($row->contactid) {
         $needle = 'index.php?option=com_contact&view=contact&id=' . $row->contactid;
         $menu = JFactory::getApplication()->getMenu();
         $item = $menu->getItems('link', $needle, true);
         $link = $item ? $needle . '&Itemid=' . $item->id : $needle;
         $row->contact_link = JRoute::_($link);
     } else {
         $row->contact_link = '';
     }
     return true;
 }
开发者ID:adjaika,项目名称:J3Base,代码行数:36,代码来源:contact.php

示例14: array

 /**
  * Helper method to return button list.
  *
  * This method returns the array by reference so it can be
  * used to add custom buttons or remove default ones.
  *
  * @param	JRegistry	The module parameters.
  *
  * @return	array	An array of buttons
  * @since	1.6
  */
 public static function &getButtons($params)
 {
     $key = (string) $params;
     if (!isset(self::$buttons[$key])) {
         $context = $params->get('context', 'mod_pj_quickicon');
         if ($context == 'mod_pj_quickicon') {
             // Load mod_quickicon language file in case this method is called before rendering the module
             JFactory::getLanguage()->load('mod_pj_quickicon');
             self::$buttons[$key] = array(array('link' => JRoute::_('index.php?option=com_playjoom&view=audiotracks'), 'params' => null, 'id' => null, 'imagePath' => null, 'image' => ' fa fa-list-alt', 'text' => JText::_('MOD_PJ_QUICKICON_TRACKSMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_TRACKS'), array('link' => JRoute::_('index.php?option=com_playjoom&view=media'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-music', 'text' => JText::_('MOD_PJ_QUICKICON_ADD_TRACKS'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_TRACKS'), array('link' => JRoute::_('index.php?option=com_playjoom&view=artists'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-users', 'text' => JText::_('MOD_PJ_QUICKICON_ARTISTSMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_TRACKS'), array('link' => JRoute::_('index.php?option=com_playjoom&view=albums'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-picture-o', 'text' => JText::_('MOD_PJ_QUICKICON_ALBUMSMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_TRACKS'), array('link' => JRoute::_('index.php?option=com_playjoom&view=covers'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-file-image-o', 'text' => JText::_('MOD_PJ_QUICKICON_COVERSMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_TRACKS'), array('link' => JRoute::_('index.php?option=com_categories&view=categories&extension=com_playjoom'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-folder-o', 'text' => JText::_('MOD_PJ_QUICKICON_GENRESMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_CATEGORIES'), array('link' => JRoute::_('index.php?option=com_categories&view=categories&extension=com_playjoom.playlist'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-play', 'text' => JText::_('MOD_PJ_QUICKICON_PLAYLISTSMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_CATEGORIES'), array('link' => JRoute::_('index.php?option=com_categories&view=categories&extension=com_playjoom.trackfilter'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-filter', 'text' => JText::_('MOD_PJ_QUICKICON_TRACKFILTERMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_CATEGORIES'));
             //Get user objects
             $user = JFactory::getUser();
             if ($user->authorise('core.admin', 'com_playjoom')) {
                 $PJbuttons = array(array('link' => JRoute::_('index.php?option=com_users'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-user', 'text' => JText::_('MOD_QUICKICON_USER_MANAGER'), 'access' => array('core.manage', 'com_users'), 'group' => 'MOD_PJ_QUICKICON_USERS'), array('link' => JRoute::_('index.php?option=com_config'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-cogs', 'text' => JText::_('MOD_QUICKICON_GLOBAL_CONFIGURATION'), 'access' => array('core.manage', 'com_config', 'core.admin', 'com_config'), 'group' => 'MOD_PJ_QUICKICON_CONFIGURATIONS'), array('link' => JRoute::_('index.php?option=com_config&view=component&component=com_playjoom'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-cog', 'text' => JText::_('MOD_PJ_QUICKICON_PLAYJOOM_OPTIONS'), 'access' => array('core.manage', 'com_config', 'core.admin', 'com_config'), 'group' => 'MOD_PJ_QUICKICON_CONFIGURATIONS'));
                 //Marge standard icons with PlayJoom admin icons
                 self::$buttons[$key] = array_merge(self::$buttons[$key], $PJbuttons);
                 // Include buttons defined by published quickicon plugins
                 JPluginHelper::importPlugin('quickicon');
                 $app = JFactory::getApplication();
                 $arrays = (array) $app->triggerEvent('onGetIcons', array($context));
                 foreach ($arrays as $response) {
                     foreach ($response as $icon) {
                         $default = array('link' => null, 'image' => 'cog', 'text' => null, 'access' => true, 'group' => 'MOD_QUICKICON_EXTENSIONS');
                         $icon = array_merge($default, $icon);
                         if (!is_null($icon['link']) && !is_null($icon['text'])) {
                             self::$buttons[$key][] = $icon;
                         }
                     }
                 }
             }
         } else {
             self::$buttons[$key] = array();
         }
     }
     return self::$buttons[$key];
 }
开发者ID:TFToto,项目名称:playjoom-builds,代码行数:46,代码来源:helper.php

示例15: plugin

 function plugin(&$link, $attr = null)
 {
     global $Itemid, $mtconf;
     //, $mt_show_review;
     # Load Parameters
     $params =& new JParameter($link->attribs);
     $params->def('show_review', $mtconf->get('show_review'));
     if ($params->get('show_review') == 1) {
         $html = '';
         // $html = '<img src="images/M_images/indent1.png" width="9" height="9" />';
         $html .= '<a href="';
         $html .= JRoute::_('index.php?option=com_mtree&task=writereview&link_id=' . $link->link_id);
         $html .= '"';
         # Insert attributes
         if (is_array($attr)) {
             // from array
             foreach ($attr as $key => $val) {
                 $key = htmlspecialchars($key);
                 $val = htmlspecialchars($val);
                 $html .= " {$key}=\"{$val}\"";
             }
         } elseif (!is_null($attr)) {
             // from scalar
             $html .= " {$attr}";
         }
         $html .= '>' . JText::_('Write review') . "</a>";
         # Return the review link
         return $html;
     }
 }
开发者ID:rsemedo,项目名称:Apply-Within,代码行数:30,代码来源:Savant2_Plugin_ahrefreview.php


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