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


PHP JHelperTags::convertPathsToNames方法代码示例

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


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

示例1: getOptions

 /**
  * Method to get a list of tags
  *
  * @return  array  The field option objects.
  *
  * @since   3.1
  */
 protected function getOptions()
 {
     $options = array();
     $published = $this->element['published'] ? $this->element['published'] : array(0, 1);
     $name = (string) $this->element['name'];
     $db = F0FPlatform::getInstance()->getDbo();
     $query = $db->getQuery(true)->select('a.id AS value, a.path, a.title AS text, a.level, a.published')->from('#__tags AS a')->join('LEFT', $db->quoteName('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
     $item = $this->form->getModel()->getItem();
     if ($item instanceof F0FTable) {
         // Fake value for selected tags
         $keyfield = $item->getKeyName();
         $content_id = $item->{$keyfield};
         $type = $item->getContentType();
         $selected_query = $db->getQuery(true);
         $selected_query->select('tag_id')->from('#__contentitem_tag_map')->where('content_item_id = ' . (int) $content_id)->where('type_alias = ' . $db->quote($type));
         $db->setQuery($selected_query);
         $this->value = $db->loadColumn();
     }
     // Ajax tag only loads assigned values
     if (!$this->isNested()) {
         // Only item assigned values
         $values = (array) $this->value;
         F0FUtilsArray::toInteger($values);
         $query->where('a.id IN (' . implode(',', $values) . ')');
     }
     // Filter language
     if (!empty($this->element['language'])) {
         $query->where('a.language = ' . $db->quote($this->element['language']));
     }
     $query->where($db->quoteName('a.alias') . ' <> ' . $db->quote('root'));
     // Filter to only load active items
     // Filter on the published state
     if (is_numeric($published)) {
         $query->where('a.published = ' . (int) $published);
     } elseif (is_array($published)) {
         F0FUtilsArray::toInteger($published);
         $query->where('a.published IN (' . implode(',', $published) . ')');
     }
     $query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.published, a.path')->order('a.lft ASC');
     // Get the options.
     $db->setQuery($query);
     try {
         $options = $db->loadObjectList();
     } catch (RuntimeException $e) {
         return false;
     }
     // Prepare nested data
     if ($this->isNested()) {
         $this->prepareOptionsNested($options);
     } else {
         $options = JHelperTags::convertPathsToNames($options);
     }
     return $options;
 }
开发者ID:01J,项目名称:topm,代码行数:61,代码来源:tag.php

示例2: getOptions

 /**
  * Method to get a list of tags
  *
  * @return  array  The field option objects.
  *
  * @since   3.1
  */
 protected function getOptions()
 {
     $published = $this->element['published'] ? $this->element['published'] : array(0, 1);
     $db = JFactory::getDbo();
     $query = $db->getQuery(true)->select('a.id AS value, a.path, a.title AS text, a.level, a.published')->from('#__tags AS a')->join('LEFT', $db->quoteName('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
     // Ajax tag only loads assigned values
     if (!$this->isNested()) {
         // Only item assigned values
         $values = (array) $this->value;
         JArrayHelper::toInteger($values);
         $query->where('a.id IN (' . implode(',', $values) . ')');
     }
     // Filter language
     if (!empty($this->element['language'])) {
         $query->where('a.language = ' . $db->quote($this->element['language']));
     }
     $query->where($db->quoteName('a.alias') . ' <> ' . $db->quote('root'));
     // Filter on the published state
     if (is_numeric($published)) {
         $query->where('a.published = ' . (int) $published);
     } elseif (is_array($published)) {
         JArrayHelper::toInteger($published);
         $query->where('a.published IN (' . implode(',', $published) . ')');
     }
     $query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.published, a.path')->order('a.lft ASC');
     // Get the options.
     $db->setQuery($query);
     try {
         $options = $db->loadObjectList();
     } catch (RuntimeException $e) {
         return false;
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     // Prepare nested data
     if ($this->isNested()) {
         $this->prepareOptionsNested($options);
     } else {
         $options = JHelperTags::convertPathsToNames($options);
     }
     return $options;
 }
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:49,代码来源:tag.php

示例3: getOptions

 /**
  * Method to get a list of tags
  *
  * @return  array  The field option objects.
  *
  * @since   3.1
  */
 protected function getOptions()
 {
     $published = $this->element['published'] ? $this->element['published'] : array(0, 1);
     $db = JFactory::getDbo();
     $query = $db->getQuery(true)->select('DISTINCT a.id AS value, a.path, a.title AS text, a.level, a.published, a.lft')->from('#__tags AS a')->join('LEFT', $db->qn('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
     // Filter language
     if (!empty($this->element['language'])) {
         $query->where('a.language = ' . $db->q($this->element['language']));
     }
     $query->where($db->qn('a.lft') . ' > 0');
     // Filter on the published state
     if (is_numeric($published)) {
         $query->where('a.published = ' . (int) $published);
     } elseif (is_array($published)) {
         JArrayHelper::toInteger($published);
         $query->where('a.published IN (' . implode(',', $published) . ')');
     }
     $query->order('a.lft ASC');
     // Get the options.
     $db->setQuery($query);
     try {
         $options = $db->loadObjectList();
     } catch (RuntimeException $e) {
         return array();
     }
     // Block the possibility to set a tag as it own parent
     if ($this->form->getName() == 'com_tags.tag') {
         $id = (int) $this->form->getValue('id', 0);
         foreach ($options as $option) {
             if ($option->value == $id) {
                 $option->disable = true;
             }
         }
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     // Prepare nested data
     if ($this->isNested()) {
         $this->prepareOptionsNested($options);
     } else {
         $options = JHelperTags::convertPathsToNames($options);
     }
     return $options;
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:51,代码来源:tag.php

示例4: getOptions

 /**
  * Method to get a list of tags
  *
  * @return  array  The field option objects.
  *
  * @since   3.1
  */
 protected function getOptions()
 {
     $input = JFactory::getApplication()->input;
     $componentParams = AgendaDirigentesHelper::getParams();
     $published = $this->element['published'] ? $this->element['published'] : array(0, 1);
     $db = JFactory::getDbo();
     $attr_name = $this->getAttribute('name', '');
     //inicializando variavel para receber opcoes do combo
     $options = array();
     //bloqueio para restringir lista de usuarios ao dono do evento selecionado.
     if ($attr_name != 'owner' && $attr_name != 'autoridade') {
         $compromisso_id = $input->getInt('id', 0);
         if ($compromisso_id == 0 && $componentParams->get('permitir_participantes_locais', 1) == 1) {
             $options[0] = new StdClass();
             $options[0]->value = "";
             $options[0]->path = "";
             $options[0]->level = 1;
             $options[0]->published = 0;
             $options[0]->text = JText::_('COM_AGENDADIRIGENTES_FIELD_DIRTAGS_CHOOSE_OWNER');
             $options = JHelperTags::convertPathsToNames($options);
             return $options;
         } else {
             if ($componentParams->get('permitir_participantes_locais', 1) == 1) {
                 $ownerData = $this->getOwnerDataFromCompromissoId($compromisso_id);
                 $valid_catid_list = $this->getCategoriesScope($ownerData);
             } else {
                 $valid_catid_list = array();
             }
         }
         if ((count($valid_catid_list) == 1 && @$valid_catid_list[0] == 0 || is_null($valid_catid_list)) && $componentParams->get('permitir_participantes_externos', 1) == 0) {
             $options[0] = new StdClass();
             $options[0]->value = "";
             $options[0]->path = "";
             $options[0]->level = 1;
             $options[0]->published = 0;
             $options[0]->text = JText::_('COM_AGENDADIRIGENTES_FIELD_DIRTAGS_NO_ENOUGH_PERMISSIONS');
             $options = JHelperTags::convertPathsToNames($options);
             return $options;
         }
     }
     //se componente configurado para inclusao de participantes cadastrados no sistema e por isso locais (do mesmo orgao)
     //ou se nome do campo equivale a owner (responsavel pelo compromisso ou dono)
     // entao busque por dirigentes para povoar as opcoes do combo...
     if ($componentParams->get('permitir_participantes_locais', 1) == 1 || $attr_name == 'owner' || $attr_name == 'autoridade') {
         $query = $db->getQuery(true);
         if ($this->getAttribute('show_category', 1) == 1) {
             $query->select('a.id AS value, CONCAT(c.title, " - ", b.name, " - " ,a.name) AS text, \'\' AS path, 1 AS level, a.state AS published, b.catid');
             $query->order('c.title, b.name, a.name');
         } else {
             $query->select('a.id AS value, CONCAT(b.name, " - " ,a.name) AS text, \'\' AS path, 1 AS level, a.state AS published, b.catid');
             $query->order('b.name, a.name');
         }
         $query->from($db->quoteName('#__agendadirigentes_dirigentes', 'a'))->join('INNER', $db->quoteName('#__agendadirigentes_cargos', 'b') . ' ON (' . $db->quoteName('a.cargo_id') . ' = ' . $db->quoteName('b.id') . ')')->join('INNER', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('b.catid') . ' = ' . $db->quoteName('c.id') . ')');
         // Filter on the published state
         if (is_numeric($published)) {
             $query->where('a.state = ' . (int) $published);
         } elseif (is_array($published)) {
             JArrayHelper::toInteger($published);
             $query->where('a.state IN (' . implode(',', $published) . ')');
         }
         //se esta permitida a inclusao de participantes locais e o campo
         //nao se refere ao campo de escolha do dono do compromisso, entao flag permitir_sobreposicao = 1
         if ($attr_name != 'owner' && $attr_name != 'autoridade') {
             $query->where('b.permitir_sobreposicao = 1');
             if ($valid_catid_list != '*') {
                 if (is_null($valid_catid_list)) {
                     $valid_catid_list = array(0);
                     JFactory::getApplication()->enqueueMessage(JText::_('COM_AGENDADIRIGENTES_FIELD_DIRTAGS_INVALID_CATEGORY_LIST'), 'Warning');
                 }
                 $query->where('b.catid IN (' . implode(', ', $valid_catid_list) . ')');
             }
         }
         // Get the options.
         $db->setQuery((string) $query);
         $categories = $db->loadObjectList();
     } else {
         $categories = array();
     }
     //se campo == owner, incluir primeira opcao vazia
     if ($attr_name == 'owner' || $attr_name == 'autoridade') {
         $options[0] = new StdClass();
         $options[0]->value = "";
         $options[0]->path = "";
         $options[0]->level = 1;
         $options[0]->published = 1;
         $options[0]->text = " - Selecione - ";
         //restringir de acordo com as permissoes de usuario, para que a escolha do owner respeite o que foi cadastrado como permissao
         //so ocorre se componente configurado para restringir ou usuario nao for superuser
         if ($componentParams->get('restricted_list_compromissos', 0) == 1 && !AgendaDirigentesHelper::isSuperUser() && $attr_name == 'owner') {
             $allowedCategories = array();
             $id = $input->getInt('id', 0);
             if (empty($id)) {
                 for ($i = 0, $limit = count($categories); $i < $limit; $i++) {
//.........这里部分代码省略.........
开发者ID:VierlingMt,项目名称:joomla-3.x,代码行数:101,代码来源:dirigentestags.php

示例5: edit


//.........这里部分代码省略.........
        ?>
);">[<?php 
        echo $ff_config->arealarge;
        ?>
]</a>
					<br/>
					<textarea wrap="off" name="description" style="width:100%;" rows="<?php 
        echo $ff_config->areasmall;
        ?>
" class="inputbox"><?php 
        echo htmlspecialchars($row->description, ENT_QUOTES);
        ?>
</textarea>
				</td>
				<td></td>
			</tr>

			</table>
                    </fieldset>
<?php 
        $tabs->endTab();
        jimport('joomla.version');
        $version = new JVersion();
        if (version_compare($version->getShortVersion(), '3.1', '>=')) {
            $tabs->startTab(BFText::_('COM_BREEZINGFORMS_TAGS_AND_CONTENT'), 'tab_tags');
            JHtml::_('tag.ajaxfield', '#tags_form', true);
            JHtml::_('tag.ajaxfield', '#tags_content', true);
            $tags = JHtml::_('tag.options');
            // incredible....
            foreach ($tags as $tag) {
                JFactory::getDbo()->setQuery("Select path From #__tags Where id = " . intval($tag->value));
                $tag->path = JFactory::getDbo()->loadResult();
            }
            $tags = JHelperTags::convertPathsToNames($tags);
            ?>
              <fieldset><legend><?php 
            echo BFText::_('COM_BREEZINGFORMS_TAGS_AND_CONTENT');
            ?>
</legend>
                <?php 
            echo bf_alert('Joomla! tagging is supported in the full version only', 'http://crosstec.de/en/extensions/joomla-forms-download.html');
            ?>
               
                </fieldset>
<?php 
            $tabs->endTab();
        }
        $tabs->startTab(BFText::_('COM_BREEZINGFORMS_ADMIN_EMAILS'), 'tab_admin_emails');
        ?>
                <fieldset><legend><?php 
        echo BFText::_('COM_BREEZINGFORMS_ADMIN_EMAILS');
        ?>
</legend>
                <table width="80%" cellpadding="4" cellspacing="1" border="0">
                <tr>
				
				<td style="width: 200px;" valign="top"><?php 
        echo BFText::_('COM_BREEZINGFORMS_FORMS_EMAILNOTIFY');
        ?>
</td>
				<td valign="top">
					<select style="width: 335px;" name="emailntf" size="1" onchange="dispemail(this.value);" class="inputbox">
						<option value="0"<?php 
        if ($row->emailntf == 0) {
            echo ' selected="selected"';
        }
开发者ID:greyhat777,项目名称:vuslinterliga,代码行数:67,代码来源:form.html.php


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