本文整理汇总了PHP中JText类的典型用法代码示例。如果您正苦于以下问题:PHP JText类的具体用法?PHP JText怎么用?PHP JText使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JText类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: getJsonParams
/**
* Recupera de una cadena JSON un arreglo de parámetros.
*
* @param String $json_params Cadena JSON que contiene el parametro a extraer
* @param String $type Mensaje de error a retornar si falla el parseo
* @return StdObject El parametro recuperado
*/
function getJsonParams($json_params, $type)
{
$params = json_decode($json_params);
$jtext = new JText();
if (is_null($params)) {
echo $this->getEqJsonResponse(comEqZonalesHelper::FAILURE, $jtext->sprintf('ZONALES_JSON_READ_FAILURE', $type));
return false;
}
return $params;
}
开发者ID:BGCX261,项目名称:zonales-svn-to-git,代码行数:17,代码来源:helper.php
示例4: 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
示例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: 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
示例7: 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
示例8: 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
示例9: 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
示例10: 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
示例11: _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
示例12: 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
示例13: delete
/**
* Removes an item.
*
* @return void
*
* @since 1.6
*/
public function delete()
{
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$user = JFactory::getUser();
$ids = $this->input->get('cid', array(), 'array');
// Access checks.
foreach ($ids as $i => $id) {
if (!$user->authorise('core.delete', 'com_content.article.' . (int) $id)) {
// Prune items that you can't delete.
unset($ids[$i]);
JError::raiseNotice(403, JText::_('JERROR_CORE_DELETE_NOT_PERMITTED'));
}
}
if (empty($ids)) {
JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
} else {
// Get the model.
$model = $this->getModel();
// Remove the items.
if (!$model->featured($ids, 0)) {
JError::raiseWarning(500, $model->getError());
}
}
$this->setRedirect('index.php?option=com_content&view=featured');
}
开发者ID:olegverstka,项目名称:monax.dev,代码行数:33,代码来源:featured.php
示例14: getList
static function getList(&$params)
{
//get database
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('MONTH(created) AS created_month, created, id, title, YEAR(created) AS created_year');
$query->from('#__content');
$query->where('state = 2 AND checked_out = 0');
$query->group('created_year DESC, created_month DESC');
// Filter by language
if (JFactory::getApplication()->getLanguageFilter()) {
$query->where('language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')');
}
$db->setQuery($query, 0, intval($params->get('count')));
$rows = (array) $db->loadObjectList();
$app = JFactory::getApplication();
$menu = $app->getMenu();
$item = $menu->getItems('link', 'index.php?option=com_content&view=archive', true);
$itemid = isset($item) && !empty($item->id) ? '&Itemid=' . $item->id : '';
$i = 0;
$lists = array();
foreach ($rows as $row) {
$date = JFactory::getDate($row->created);
$created_month = $date->format('n');
$created_year = $date->format('Y');
$created_year_cal = JHTML::_('date', $row->created, 'Y');
$month_name_cal = JHTML::_('date', $row->created, 'F');
$lists[$i] = new stdClass();
$lists[$i]->link = JRoute::_('index.php?option=com_content&view=archive&year=' . $created_year . '&month=' . $created_month . $itemid);
$lists[$i]->text = JText::sprintf('MOD_ARTICLES_ARCHIVE_DATE', $month_name_cal, $created_year_cal);
$i++;
}
return $lists;
}
开发者ID:NavaINT1876,项目名称:ccustoms,代码行数:34,代码来源:helper.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
示例16: onContentPrepare
/**
* Prepare content method
*
* Method is called by the view
*
* @param string $context The context of the content being passed to the plugin.
* @param object &$row The article object. Note $article->text is also available
* @param object &$params The article params
* @param int $page The 'page' number
*
* @return void
*/
public function onContentPrepare($context, &$row, &$params, $page = 0)
{
jimport('joomla.html.parameter');
jimport('joomla.filesystem.file');
// Load fabrik language
$lang = JFactory::getLanguage();
$lang->load('com_fabrik', JPATH_BASE . '/components/com_fabrik');
if (!defined('COM_FABRIK_FRONTEND')) {
JError::raiseError(400, JText::_('COM_FABRIK_SYSTEM_PLUGIN_NOT_ACTIVE'));
}
// Get plugin info
$plugin = JPluginHelper::getPlugin('content', 'fabrik');
// $$$ hugh had to rename this, it was stomping on com_content and friends $params
// $$$ which is passed by reference to us!
$fparams = new JRegistry($plugin->params);
// Simple performance check to determine whether bot should process further
$botRegex = $fparams->get('Botregex') != '' ? $fparams->get('Botregex') : 'fabrik';
if (JString::strpos($row->text, $botRegex) === false) {
return true;
}
require_once COM_FABRIK_FRONTEND . '/helpers/parent.php';
/* $$$ hugh - hacky fix for nasty issue with IE, which (for gory reasons) doesn't like having our JS content
* wrapped in P tags. But the default WYSIWYG editor in J! will automagically wrap P tags around everything.
* So let's just look for obvious cases of <p>{fabrik ...}</p>, and replace the P's with DIV's.
* Yes, it's hacky, but it'll save us a buttload of support work.
*/
$pregex = "/<p>\\s*{" . $botRegex . "\\s*.*?}\\s*<\\/p>/i";
$row->text = preg_replace_callback($pregex, array($this, 'preplace'), $row->text);
// $$$ hugh - having to change this to use {[]}
$regex = "/{" . $botRegex . "\\s*.*?}/i";
$row->text = preg_replace_callback($regex, array($this, 'replace'), $row->text);
}
开发者ID:rogeriocc,项目名称:fabrik,代码行数:44,代码来源:fabrik.php
示例17: getOptions
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 11.1
*/
protected function getOptions()
{
$options = array();
$options[] = JHtml::_('select.option', 'id', JText::_('COM_VISFORMS_ID'), 'value', 'text', false);
$options[] = JHtml::_('select.option', 'created', JText::_('COM_VISFORMS_SUBMISSIONDATE'), 'value', 'text', false);
$options[] = JHtml::_('select.option', 'ismfd', JText::_('COM_VISFORMS_MODIFIED'), 'value', 'text', false);
$id = 0;
//extract form id
$form = $this->form;
$link = $form->getValue('link');
if (isset($link) && $link != "") {
$parts = array();
parse_str($link, $parts);
if (isset($parts['id']) && is_numeric($parts['id'])) {
$id = $parts['id'];
}
}
// Create options according to visfield settings
$db = JFactory::getDbo();
$query = ' SELECT c.id , c.label from #__visfields as c where c.fid=' . $id . ' AND c.published = 1 AND (c.frontdisplay is null or c.frontdisplay = 1 or c.frontdisplay = 2) ' . "and !(c.typefield = 'reset') and !(c.typefield = 'submit') and !(c.typefield = 'image') and !(c.typefield = 'fieldsep') and !(c.typefield = 'hidden')";
$db->setQuery($query);
$fields = $db->loadObjectList();
if ($fields) {
foreach ($fields as $field) {
$tmp = JHtml::_('select.option', $field->id, $field->label, 'value', 'text', false);
// Add the option object to the result set.
$options[] = $tmp;
}
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
开发者ID:shamusdougan,项目名称:GDMCWebsite,代码行数:40,代码来源:visdatasortorder.php
示例18: setMessage
static function setMessage($file, $name)
{
jimport('joomla.filesystem.file');
$file = str_replace('\\', '/', $file);
if (strpos($file, '/administrator') === 0) {
$file = str_replace('/administrator', JPATH_ADMINISTRATOR, $file);
} else {
$file = JPATH_SITE . '/' . $file;
}
$file = str_replace('//', '/', $file);
$file_alt = preg_replace('#(com|mod)_([a-z-_]+\\.)#', '\\2', $file);
if (!JFile::exists($file) && !JFile::exists($file_alt)) {
$msg = JText::sprintf('NN_THIS_EXTENSION_NEEDS_THE_MAIN_EXTENSION_TO_FUNCTION', JText::_($name));
$message_set = 0;
$messageQueue = JFactory::getApplication()->getMessageQueue();
foreach ($messageQueue as $queue_message) {
if ($queue_message['type'] == 'error' && $queue_message['message'] == $msg) {
$message_set = 1;
break;
}
}
if (!$message_set) {
JFactory::getApplication()->enqueueMessage($msg, 'error');
}
}
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:26,代码来源:dependency.php
示例19: addSubmenu
public static function addSubmenu($vName)
{
JSubMenuHelper::addEntry(JText::_('COM_BFSTOP_SUBMENU_BLOCKLIST'), 'index.php?option=com_bfstop&view=blocklist', $vName == 'blocklist');
JSubMenuHelper::addEntry(JText::_('COM_BFSTOP_SUBMENU_WHITELIST'), 'index.php?option=com_bfstop&view=whitelist', $vName == 'whitelist');
JSubMenuHelper::addEntry(JText::_('COM_BFSTOP_SUBMENU_FAILEDLOGINLIST'), 'index.php?option=com_bfstop&view=failedloginlist', $vName == 'failedloginlist');
JSubMenuHelper::addEntry(JText::_('COM_BFSTOP_SUBMENU_SETTINGS'), 'index.php?option=com_bfstop&view=settings', $vName == 'settings');
}
开发者ID:sumithMadhushan,项目名称:joomla-project,代码行数:7,代码来源:bfstop.php
示例20: __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
注:本文中的JText类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论