• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JRoute类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: association

 /**
  * Get the associated language flags
  *
  * @param   int  $newsfeedid  The item id to search associations
  *
  * @return  string  The language HTML
  */
 public static function association($newsfeedid)
 {
     // Defaults
     $html = '';
     // Get the associations
     if ($associations = JLanguageAssociations::getAssociations('com_newsfeeds', '#__newsfeeds', 'com_newsfeeds.item', $newsfeedid)) {
         foreach ($associations as $tag => $associated) {
             $associations[$tag] = (int) $associated->id;
         }
         // Get the associated newsfeed items
         $db = JFactory::getDbo();
         $query = $db->getQuery(true)->select('c.id, c.name as title')->select('l.sef as lang_sef')->from('#__newsfeeds as c')->select('cat.title as category_title')->join('LEFT', '#__categories as cat ON cat.id=c.catid')->where('c.id IN (' . implode(',', array_values($associations)) . ')')->join('LEFT', '#__languages as l ON c.language=l.lang_code')->select('l.image')->select('l.title as language_title');
         $db->setQuery($query);
         try {
             $items = $db->loadObjectList('id');
         } catch (RuntimeException $e) {
             throw new Exception($e->getMessage(), 500);
         }
         if ($items) {
             foreach ($items as &$item) {
                 $text = strtoupper($item->lang_sef);
                 $url = JRoute::_('index.php?option=com_newsfeeds&task=newsfeed.edit&id=' . (int) $item->id);
                 $tooltipParts = array(JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => $item->language_title), true), $item->title, '(' . $item->category_title . ')');
                 $item->link = JHtml::_('tooltip', implode(' ', $tooltipParts), null, null, $text, $url, null, 'hasTooltip label label-association label-' . $item->lang_sef);
             }
         }
         $html = JLayoutHelper::render('joomla.content.associations', $items);
     }
     return $html;
 }
开发者ID:WineWorld,项目名称:joomlatrialcmbg,代码行数:37,代码来源:newsfeed.php


示例17: getObjectInfo

 function getObjectInfo($id, $language = null)
 {
     $info = new JCommentsObjectInfo();
     $routerHelper = JPATH_ROOT . '/components/com_djcatalog2/helpers/route.php';
     if (is_file($routerHelper)) {
         require_once $routerHelper;
         $db = JFactory::getDBO();
         $query = $db->getQuery(true);
         $query->select('a.id, a.alias, a.name, a.created_by');
         $query->from('#__djc2_items AS a');
         $query->select('c.id AS category_id, c.alias AS category_alias');
         $query->join('LEFT', '#__djc2_categories AS c ON c.id = a.cat_id');
         $query->where('a.id = ' . (int) $id);
         $db->setQuery($query);
         $row = $db->loadObject();
         if (!empty($row)) {
             $slug = $row->alias ? $row->id . ':' . $row->alias : $row->id;
             $catslug = $row->category_alias ? $row->category_id . ':' . $row->category_alias : $row->category_id;
             $info->title = $row->name;
             $info->category_id = $article->category_id;
             $info->userid = $row->created_by;
             $info->link = JRoute::_(DJCatalogHelperRoute::getItemRoute($slug, $catslug));
         }
     }
     return $info;
 }
开发者ID:ForAEdesWeb,项目名称:AEW2,代码行数:26,代码来源:com_djcatalog2.plugin.php


示例18: display

 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  *
  * @see     JViewLegacy::loadTemplate()
  * @since   12.2
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     /** @var $app JApplicationSite */
     $this->layout = $this->getLayout();
     switch ($this->layout) {
         case "contact":
             $this->prepareContact();
             break;
         case "social":
             $this->prepareSocialProfiles();
             break;
         default:
             // Basic data for the profile.
             $this->prepareBasic();
             break;
     }
     $userId = JFactory::getUser()->id;
     if (!$userId) {
         $app->enqueueMessage(JText::_("COM_SOCIALCOMMUNITY_ERROR_NOT_LOG_IN"), "notice");
         $app->redirect(JRoute::_('index.php?option=com_users&view=login', false));
         return;
     }
     // Prepare layout data.
     $this->layoutData = new JData();
     $this->layoutData->layout = $this->layout;
     $this->prepareDocument();
     parent::display($tpl);
 }
开发者ID:pashakiz,项目名称:crowdf,代码行数:39,代码来源:view.html.php


示例19: _prepareItem

 /**
  * Prepare item properties
  */
 protected function _prepareItem($item)
 {
     $item->link = JRoute::_(K2HelperRoute::getItemRoute($item->id, $item->catid));
     $item->introtext = JHtml::_('string.truncate', $item->introtext, $this->_params->get('intro_length', 200));
     $item->cat_link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($item->catid . ':' . urlencode($item->catslug))));
     return $item;
 }
开发者ID:jooservices,项目名称:zt-news,代码行数:10,代码来源:k2.php


示例20: remind

 /**
  * Method to request a username reminder.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 public function remind()
 {
     // Check the request token.
     JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN'));
     $model = $this->getModel('Remind', 'UsersModel');
     $data = $this->input->post->get('jform', array(), 'array');
     // Submit the password reset request.
     $return = $model->processRemindRequest($data);
     // Check for a hard error.
     if ($return == false) {
         // The request failed.
         // Get the route to the next page.
         $itemid = UsersHelperRoute::getRemindRoute();
         $itemid = $itemid !== null ? '&Itemid=' . $itemid : '';
         $route = 'index.php?option=com_users&view=remind' . $itemid;
         // Go back to the request form.
         $message = JText::sprintf('Request failed: Your account is not activated yet or is under review. Please contact the admin more for details.', $model->getError());
         $this->setRedirect(JRoute::_($route, false), $message, 'notice');
         return false;
     } else {
         // The request succeeded.
         // Get the route to the next page.
         $itemid = UsersHelperRoute::getRemindRoute();
         $itemid = $itemid !== null ? '&Itemid=' . $itemid : '';
         $route = 'index.php?option=com_users&view=login' . $itemid;
         // Proceed to step two.
         $message = JText::_('COM_USERS_REMIND_REQUEST_SUCCESS');
         $this->setRedirect(JRoute::_($route, false), $message);
         return true;
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:38,代码来源:remind.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JRouter类代码示例发布时间:2022-05-23
下一篇:
PHP JResponse类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap