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


PHP JText::_方法代码示例

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


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

示例1: save

 function save()
 {
     $mainframe =& JFactory::getApplication();
     $row =& JTable::getInstance('K2UserGroup', 'Table');
     if (!$row->bind(JRequest::get('post'))) {
         $mainframe->redirect('index.php?option=com_k2&view=userGroups', $row->getError(), 'error');
     }
     if (!$row->check()) {
         $mainframe->redirect('index.php?option=com_k2&view=userGroup&cid=' . $row->id, $row->getError(), 'error');
     }
     if (!$row->store()) {
         $mainframe->redirect('index.php?option=com_k2&view=userGroups', $row->getError(), 'error');
     }
     $cache =& JFactory::getCache('com_k2');
     $cache->clean();
     switch (JRequest::getCmd('task')) {
         case 'apply':
             $msg = JText::_('Changes to User Group saved');
             $link = 'index.php?option=com_k2&view=userGroup&cid=' . $row->id;
             break;
         case 'save':
         default:
             $msg = JText::_('User Group Saved');
             $link = 'index.php?option=com_k2&view=userGroups';
             break;
     }
     $mainframe->redirect($link, $msg);
 }
开发者ID:navinpai,项目名称:GEC-Tandav,代码行数:28,代码来源:usergroup.php

示例2: addToolbar

 /**
  * Add the page title and toolbar.
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     if (isset($this->item->checked_out)) {
         $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
     } else {
         $checkedOut = false;
     }
     $canDo = SomosmaestrosHelper::getActions();
     JToolBarHelper::title(JText::_('COM_SOMOSMAESTROS_TITLE_FORMACION'), 'formacion.png');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
         JToolBarHelper::apply('formacion.apply', 'JTOOLBAR_APPLY');
         JToolBarHelper::save('formacion.save', 'JTOOLBAR_SAVE');
     }
     if (!$checkedOut && $canDo->get('core.create')) {
         JToolBarHelper::custom('formacion.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::custom('formacion.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('formacion.cancel', 'JTOOLBAR_CANCEL');
     } else {
         JToolBarHelper::cancel('formacion.cancel', 'JTOOLBAR_CLOSE');
     }
 }
开发者ID:emeraldstudio,项目名称:somosmaestros,代码行数:33,代码来源:view.html.php

示例3: 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

示例4: _validate

	protected function _validate($context)
	{
		$config = $this->_config;
		$row = $context->caller;

		if (is_uploaded_file($row->file) && $config->restrict && !in_array($row->extension, $config->ignored_extensions->toArray())) 
		{
			if ($row->isImage()) 
			{
				if (getimagesize($row->file) === false) {
					$context->setError(JText::_('WARNINVALIDIMG'));
					return false;
				}
			}
			else 
			{
				$mime = KFactory::get('com://admin/files.database.row.file')->setData(array('path' => $row->file))->mimetype;

				if ($config->check_mime && $mime) 
				{
					if (in_array($mime, $config->illegal_mimetypes->toArray()) || !in_array($mime, $config->allowed_mimetypes->toArray())) {
						$context->setError(JText::_('WARNINVALIDMIME'));
						return false;
					}
				}
				elseif (!$config->authorized) {
					$context->setError(JText::_('WARNNOTADMIN'));
					return false;
				}
			}
		}
	}
开发者ID:raeldc,项目名称:com_learn,代码行数:32,代码来源:mimetype.php

示例5: hikashopSubscriptionType

 function hikashopSubscriptionType()
 {
     if (!HIKASHOP_PHP5) {
         $acl =& JFactory::getACL();
     } else {
         $acl = JFactory::getACL();
     }
     if (!HIKASHOP_J16) {
         $this->groups = $acl->get_group_children_tree(null, 'USERS', false);
     } else {
         $db = JFactory::getDBO();
         $db->setQuery('SELECT a.*, a.title as text, a.id as value  FROM #__usergroups AS a ORDER BY a.lft ASC');
         $this->groups = $db->loadObjectList('id');
         foreach ($this->groups as $id => $group) {
             if (isset($this->groups[$group->parent_id])) {
                 $this->groups[$id]->level = intval(@$this->groups[$group->parent_id]->level) + 1;
                 $this->groups[$id]->text = str_repeat('- - ', $this->groups[$id]->level) . $this->groups[$id]->text;
             }
         }
     }
     $this->choice = array();
     $this->choice[] = JHTML::_('select.option', 'none', JText::_('HIKA_NONE'));
     $this->choice[] = JHTML::_('select.option', 'special', JText::_('HIKA_CUSTOM'));
     $js = "function updateSubscription(map){\r\n\t\t\tchoice = document.adminForm['choice_'+map];\r\n\t\t\tchoiceValue = 'special';\r\n\t\t\tfor (var i=0; i < choice.length; i++){\r\n\t\t\t\tif (choice[i].checked){\r\n\t\t\t\t\tchoiceValue = choice[i].value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\thiddenVar = document.getElementById('hidden_'+map);\r\n\t\t\tif(choiceValue != 'special'){\r\n\t\t\t\thiddenVar.value = choiceValue;\r\n\t\t\t\tif(hiddenVar.value == 'none') hiddenVar.value = '';\r\n\t\t\t\tdocument.getElementById('div_'+map).style.display = 'none';\r\n\t\t\t}else{\r\n\t\t\t\tdocument.getElementById('div_'+map).style.display = '';\r\n\t\t\t\tspecialVar = eval('document.adminForm.special_'+map);\r\n\t\t\t\tfinalValue = '';\r\n\t\t\t\tfor (var i=0; i < specialVar.length; i++){\r\n\t\t\t\t\tif (specialVar[i].checked){\r\n\t\t\t\t\t\tfinalValue += specialVar[i].value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\thiddenVar.value = finalValue;\r\n\t\t\t}\r\n\t\t}";
     if (!HIKASHOP_PHP5) {
         $doc =& JFactory::getDocument();
     } else {
         $doc = JFactory::getDocument();
     }
     $doc->addScriptDeclaration($js);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:31,代码来源:subscription.php

示例6: akeebaACLCheck

 /**
  * Do our custom ACL checks for the back-end views
  *
  * @return boolean
  */
 private function akeebaACLCheck()
 {
     // Get the view
     $view = $this->input->getCmd('view', '');
     // Fetch the privilege to check, or use the default (akeeba.configure)
     // privilege.
     if (array_key_exists($view, self::$viewACLMap)) {
         $privilege = self::$viewACLMap[$view];
     } else {
         $privilege = 'akeeba.configure';
     }
     // If an empty privileve is defined do not do any ACL check
     if (empty($privilege)) {
         return true;
     }
     // Throw an error if we are not allowed access to the view
     if (!JFactory::getUser()->authorise($privilege, 'com_akeeba')) {
         $this->setRedirect('index.php?option=com_akeeba&view=cpanel');
         JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
         $this->redirect();
         return false;
     } else {
         return true;
     }
 }
开发者ID:jvhost,项目名称:A-Website,代码行数:30,代码来源:default.php

示例7: addToolbar

 /**
  * Add the page title and toolbar.
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
     $canDo = SibdietHelper::getActions();
     JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_ERRAND'), 'database errands');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
         JToolBarHelper::apply('errand.apply');
         JToolBarHelper::save('errand.save');
     }
     if (!$checkedOut && $canDo->get('core.create')) {
         JToolbarHelper::save2new('errand.save2new');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolbarHelper::save2copy('errand.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('errand.cancel');
     } else {
         JToolBarHelper::cancel('errand.cancel', 'JTOOLBAR_CLOSE');
     }
 }
开发者ID:smhnaji,项目名称:sdnet,代码行数:29,代码来源:view.html.php

示例8: addToolbar

 /**
  * Method to configure the toolbar for this view.
  *
  * @return  void
  *
  * @since   2.5
  */
 protected function addToolbar()
 {
     $canDo = JHelperContent::getActions('com_finder');
     JToolbarHelper::title(JText::_('COM_FINDER_MAPS_TOOLBAR_TITLE'), 'zoom-in finder');
     $toolbar = JToolbar::getInstance('toolbar');
     if ($canDo->get('core.edit.state')) {
         JToolbarHelper::publishList('maps.publish');
         JToolbarHelper::unpublishList('maps.unpublish');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.admin') || $canDo->get('core.options')) {
         JToolbarHelper::preferences('com_finder');
     }
     JToolbarHelper::divider();
     $toolbar->appendButton('Popup', 'bars', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350);
     JToolbarHelper::divider();
     JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_CONTENT_MAPS');
     if ($canDo->get('core.delete')) {
         JToolbarHelper::deleteList('', 'maps.delete');
         JToolbarHelper::divider();
     }
     JHtmlSidebar::setAction('index.php?option=com_finder&view=maps');
     JHtmlSidebar::addFilter('', 'filter_branch', JHtml::_('select.options', JHtml::_('finder.mapslist'), 'value', 'text', $this->state->get('filter.branch')), true);
     JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state')));
 }
开发者ID:educakanchay,项目名称:educared,代码行数:32,代码来源:view.html.php

示例9: getHeader

 /**
  * Get the header
  *
  * @return  string  The header HTML
  */
 protected function getHeader()
 {
     $sortable = $this->element['sortable'] != 'false';
     $view = $this->form->getView();
     $model = $this->form->getModel();
     $hasAjaxOrderingSupport = $view->hasAjaxOrderingSupport();
     if (!$sortable) {
         // Non sortable?! I'm not sure why you'd want that, but if you insist...
         return JText::_('JGRID_HEADING_ORDERING');
     }
     if (!$hasAjaxOrderingSupport) {
         // Ye olde Joomla! 2.5 method
         $html = JHTML::_('grid.sort', 'JFIELD_ORDERING_LABEL', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, 'browse');
         $html .= JHTML::_('grid.order', $model->getList());
         return $html;
     } else {
         // The new, drag'n'drop ordering support WITH a save order button
         $html = JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $view->getLists()->order_Dir, $view->getLists()->order, null, 'asc', 'JGRID_HEADING_ORDERING');
         $ordering = $view->getLists()->order == 'ordering';
         if ($ordering) {
             $html .= '<a href="javascript:saveorder(' . (count($model->getList()) - 1) . ', \'saveorder\')" ' . 'rel="tooltip" class="save-order btn btn-micro pull-right" title="' . JText::_('JLIB_HTML_SAVE_ORDER') . '">' . '<span class="icon-ok"></span></a>';
         }
         return $html;
     }
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:30,代码来源:ordering.php

示例10: display

 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_REDSOCIALSTREAM_CONFIGURE'), 'configure.png');
     JToolBarHelper::apply();
     JToolBarHelper::cancel('cancel', 'COM_REDSOCIALSTREAM_CLOSE');
     //DEVNOTE: set document title
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSOCIALSTREAM_REDSOCIALSTREAMS'));
     $mainframe = JFactory::getApplication();
     $context = "config";
     $model = $this->getModel('configure');
     $db = JFactory::getDbo();
     $q = "SELECT * FROM #__redsocialstream_settings";
     $db->setQuery($q);
     $this->settingsrows = $db->loadObjectList();
     $typelist = $this->get('type_list_sorted');
     $pagination = $this->get('Pagination');
     //DEVNOTE:give me ordering from request
     $filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'ordering');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '');
     $this->assignRef('lists', $lists);
     $this->assignRef("typelist", $typelist);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
开发者ID:prox91,项目名称:joomla-dev,代码行数:25,代码来源:view.html.php

示例11: chosen

 /**
  * Method to load the Chosen JavaScript framework and supporting CSS into the document head
  *
  * If debugging mode is on an uncompressed version of Chosen is included for easier debugging.
  *
  * @param   string  $selector  Class for Chosen elements.
  * @param   mixed   $debug     Is debugging mode on? [optional]
  * @param   array   $options   the possible Chosen options as name => value [optional]
  *
  * @return  void
  *
  * @since   3.0
  */
 public static function chosen($selector = '.advancedSelect', $debug = null, $options = array())
 {
     if (isset(static::$loaded[__METHOD__][$selector])) {
         return;
     }
     // If no debugging value is set, use the configuration setting
     if ($debug === null) {
         $config = JFactory::getConfig();
         $debug = (bool) $config->get('debug');
     }
     // Default settings
     if (!isset($options['disable_search_threshold'])) {
         $options['disable_search_threshold'] = 10;
     }
     // Allow searching contains space in query
     if (!isset($options['search_contains'])) {
         $options['search_contains'] = true;
     }
     if (!isset($options['allow_single_deselect'])) {
         $options['allow_single_deselect'] = true;
     }
     if (!isset($options['placeholder_text_multiple'])) {
         $options['placeholder_text_multiple'] = JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS');
     }
     if (!isset($options['placeholder_text_single'])) {
         $options['placeholder_text_single'] = JText::_('JGLOBAL_SELECT_AN_OPTION');
     }
     if (!isset($options['no_results_text'])) {
         $options['no_results_text'] = JText::_('JGLOBAL_SELECT_NO_RESULTS_MATCH');
     }
     $displayData = array('debug' => $debug, 'options' => $options, 'selector' => $selector);
     JLayoutHelper::render('joomla.html.formbehavior.chosen', $displayData);
     static::$loaded[__METHOD__][$selector] = true;
     return;
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:48,代码来源:formbehavior.php

示例12: __construct

 /**
  * Constructor
  *
  * @param   array  $options  Optional parameters.
  *
  * @since   11.1
  */
 public function __construct($options = array())
 {
     if (!$this->test()) {
         return JError::raiseError(404, JText::_('JLIB_SESSION_EACCELERATOR_EXTENSION_NOT_AVAILABLE'));
     }
     parent::__construct($options);
 }
开发者ID:joomline,项目名称:Joomla2.5.999,代码行数:14,代码来源:eaccelerator.php

示例13: getInput

 protected function getInput()
 {
     $class = !empty($this->class) ? $this->class : '';
     $required = $this->required ? ' required aria-required="true"' : '';
     // Prepare birthday
     if (!empty($this->value)) {
         $date = new Prism\Validator\Date($this->value);
         if (!$date->isValid()) {
             $birthdayDay = "";
             $birthdayMonth = "";
             $birthdayYear = "";
         } else {
             $date = new JDate($this->value);
             $birthdayDay = $date->format("d");
             $birthdayMonth = $date->format("m");
             $birthdayYear = $date->format("Y");
         }
     }
     $html = array();
     $html[] = '<div class="' . $class . '">';
     $html[] = '    <input name="' . $this->name . '[day]"   value="' . $birthdayDay . '" id="birthday_day"   class="span3" type="text" placeholder="' . JText::_("COM_SOCIALCOMMUNITY_DAY") . '" ' . $required . '>';
     $html[] = '    <input name="' . $this->name . '[month]" value="' . $birthdayMonth . '" id="birthday_month" class="span3" type="text" placeholder="' . JText::_("COM_SOCIALCOMMUNITY_MONTH") . '" ' . $required . '>';
     $html[] = '    <input name="' . $this->name . '[year]"  value="' . $birthdayYear . '" id="birthday_year"  class="span4" type="text" placeholder="' . JText::_("COM_SOCIALCOMMUNITY_YEAR") . '" ' . $required . '>';
     $html[] = '</div>';
     return implode($html);
 }
开发者ID:pashakiz,项目名称:crowdf,代码行数:26,代码来源:scbirthdayb3.php

示例14: load

 function load()
 {
     $this->values = array();
     if (JRequest::getCmd('from_display', false) == false) {
         $this->values[] = JHTML::_('select.option', '', JText::_('HIKA_INHERIT'));
     }
     $this->values[] = JHTML::_('select.optgroup', '-- ' . JText::_('FROM_HIKASHOP') . ' --');
     foreach ($this->default as $d) {
         $this->values[] = JHTML::_('select.option', $d, JText::_(strtoupper($d)));
     }
     if (version_compare(JVERSION, '1.6.0', '>=')) {
         $this->values[] = JHTML::_('select.optgroup', '-- ' . JText::_('FROM_HIKASHOP') . ' --');
     }
     $closeOpt = '';
     $values = $this->getLayout();
     foreach ($values as $value) {
         if (substr($value, 0, 1) == '#') {
             if (version_compare(JVERSION, '1.6.0', '>=') && !empty($closeOpt)) {
                 $this->values[] = JHTML::_('select.optgroup', $closeOpt);
             }
             $value = substr($value, 1);
             $closeOpt = '-- ' . JText::sprintf('FROM_TEMPLATE', basename($value)) . ' --';
             $this->values[] = JHTML::_('select.optgroup', $closeOpt);
         } else {
             $this->values[] = JHTML::_('select.option', $value, $value);
         }
     }
     if (version_compare(JVERSION, '1.6.0', '>=') && !empty($closeOpt)) {
         $this->values[] = JHTML::_('select.optgroup', $closeOpt);
     }
 }
开发者ID:q0821,项目名称:esportshop,代码行数:31,代码来源:quantitydisplay.php

示例15: _prepareDocument

 /**
  * Prepares the document
  *
  * @return void
  *
  * @throws Exception
  */
 protected function _prepareDocument()
 {
     $app = JFactory::getApplication();
     $menus = $app->getMenu();
     $title = null;
     // Because the application sets a default page title,
     // we need to get it from the menu item itself
     $menu = $menus->getActive();
     if ($menu) {
         $this->params->def('page_heading', $this->params->get('page_title', $menu->title));
     } else {
         $this->params->def('page_heading', JText::_('COM_AKRECIPES_DEFAULT_PAGE_TITLE'));
     }
     $title = $this->params->get('page_title', '');
     if (empty($title)) {
         $title = $app->get('sitename');
     } elseif ($app->get('sitename_pagetitles', 0) == 1) {
         $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
     } elseif ($app->get('sitename_pagetitles', 0) == 2) {
         $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
     }
     $this->document->setTitle($title);
     if ($this->params->get('menu-meta_description')) {
         $this->document->setDescription($this->params->get('menu-meta_description'));
     }
     if ($this->params->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
     }
     if ($this->params->get('robots')) {
         $this->document->setMetadata('robots', $this->params->get('robots'));
     }
 }
开发者ID:rutvikd,项目名称:ak-recipes,代码行数:39,代码来源:view.html.php


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