Example #1
0
 /**
  * Add the page title and toolbar
  *
  */
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     $canDo = TagMetaHelper::getActions();
     JToolBarHelper::title($isNew ? JText::_('COM_TAGMETA_RULE_NEW') : JText::_('COM_TAGMETA_RULE_EDIT'), 'tagmeta.png');
     // If not checked out, can save the item
     if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_tagmeta', 'core.create')) > 0)) {
         JToolBarHelper::apply('rule.apply');
         JToolBarHelper::save('rule.save');
         if ($canDo->get('core.create')) {
             //JToolBarHelper::save2new('rule.save2new');
             JToolBarHelper::custom('rule.save2new', 'save-new', '', 'JTOOLBAR_SAVE_AND_NEW', false);
         }
     }
     // If an existing item, can save to a copy
     if (!$isNew && $canDo->get('core.create')) {
         //JToolBarHelper::save2copy('rule.save2copy');
         JToolBarHelper::custom('rule.save2copy', 'save-copy', '', 'JTOOLBAR_SAVE_AS_COPY', false);
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('rule.cancel');
     } else {
         JToolBarHelper::cancel('rule.cancel', 'JTOOLBAR_CLOSE');
     }
 }
Example #2
0
 /**
  * Add the page title and toolbar
  *
  */
 protected function addToolbar()
 {
     JToolBarHelper::title(JText::_('COM_TAGMETA_MANAGER'), 'tagmeta.png');
     require_once JPATH_COMPONENT . '/helpers/tagmeta.php';
     $canDo = TagMetaHelper::getActions();
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_tagmeta');
     }
     JHtmlSidebar::setAction('index.php?option=com_tagmeta&view=about');
 }
Example #3
0
 /**
  * Add the page title and toolbar
  *
  */
 protected function addToolbar()
 {
     JToolBarHelper::title(JText::_('COM_TAGMETA_MANAGER'), 'tagmeta.png');
     $canDo = TagMetaHelper::getActions();
     if ($canDo->get('core.create')) {
         JToolBarHelper::custom('rules.copy', 'copy.png', 'copy_f2.png', JText::_('COM_TAGMETA_TOOLBAR_COPY'));
         JToolBarHelper::addNew('rule.add');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('rule.edit');
     }
     JToolBarHelper::divider();
     if ($canDo->get('core.edit.state')) {
         if ($this->state->get('filter.state') != 2) {
             JToolBarHelper::publish('rules.publish', 'JTOOLBAR_PUBLISH', true);
             JToolBarHelper::unpublish('rules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
         }
         JToolBarHelper::divider();
         if ($this->state->get('filter.state') != -1) {
             if ($this->state->get('filter.state') != 2) {
                 JToolBarHelper::archiveList('rules.archive');
             } else {
                 if ($this->state->get('filter.state') == 2) {
                     JToolBarHelper::unarchiveList('rules.publish');
                 }
             }
         }
         //JToolBarHelper::checkin('rules.checkin');
         JToolBarHelper::custom('rules.checkin', 'checkin', '', 'JTOOLBAR_CHECKIN', true);
         JToolBarHelper::trash('rules.trash');
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'rules.delete', 'JTOOLBAR_EMPTY_TRASH');
     }
     JToolBarHelper::divider();
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_tagmeta');
     }
     JHtmlSidebar::setAction('index.php?option=com_tagmeta&view=rules');
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true));
 }
Example #4
0
       <?php 
 }
 ?>
     </span>
   </td>
   <td class="center">
     <?php 
 echo $item->weight;
 ?>
   </td>
   <td class="small">
     <span style="display:block; width:200px; word-wrap:break-word;">
     <?php 
 $max_chars = 60;
 echo "<span class=\"editlinktip hasTip\" title=\"" . addslashes(htmlspecialchars(JText::_('COM_TAGMETA_HEADING_SYNONYMS_COMMENT') . '::' . $item->comment)) . "\">";
 echo TagMetaHelper::trimText($item->comment, $max_chars);
 echo "</span>";
 ?>
     </span>
   </td>
   <td class="center">
     <?php 
 echo $item->hits;
 ?>
   </td>
   <td class="center">
     <?php 
 echo $item->last_visit;
 ?>
   </td>
   <td class="center hidden-phone">
Example #5
0
            <div style="float: right; border: 1px dashed silver; padding: 5px; margin-bottom: 10px; height: 45px; width: 200px; word-wrap:break-word;" class="editlinktip hasTip" title="<?php 
        echo JText::_('COM_TAGMETA_FIELD_RULES_XREFERENCE_LABEL') . "::" . htmlspecialchars($item->xreference, ENT_QUOTES);
        ?>
">
              <?php 
        $max_chars = 100;
        echo TagMetaHelper::trimText(htmlspecialchars($item->xreference, ENT_QUOTES), $max_chars);
        ?>
            </div>
            <div style="float: left; border: 1px dashed silver; padding: 5px; margin-bottom: 10px; height: 45px; width: 200px; word-wrap:break-word;" class="editlinktip hasTip" title="<?php 
        echo JText::_('COM_TAGMETA_FIELD_RULES_CANONICAL_LABEL') . "::" . htmlspecialchars($item->canonical, ENT_QUOTES);
        ?>
">
              <?php 
        $max_chars = 100;
        echo TagMetaHelper::trimText(htmlspecialchars($item->canonical, ENT_QUOTES), $max_chars);
        ?>
            </div>
          </td>
          <td class="center">
            <?php 
        $robots = '';
        if ($item->rindex != 2) {
            $robots .= $item->rindex ? 'index,' : 'noindex,';
        }
        if ($item->rfollow != 2) {
            $robots .= $item->rfollow ? 'follow,' : 'nofollow,';
        }
        if ($item->rsnippet != 2) {
            $robots .= $item->rsnippet ? 'snippet,' : 'nosnippet,';
        }