예제 #1
0
 protected static function _findItem($needles = null)
 {
     $app = JFactory::getApplication();
     $menus = $app->getMenu('site');
     // Prepare the reverse lookup array.
     if (self::$lookup === null) {
         self::$lookup = array();
         $component = JComponentHelper::getComponent('com_asom');
         $items = $menus->getItems('component_id', $component->id);
         foreach ($items as $item) {
             if (isset($item->query) && isset($item->query['task'])) {
                 $task = $item->query['task'];
                 if (!isset(self::$lookup[$task])) {
                     self::$lookup[$task] = $item->id;
                 }
             }
         }
     }
     if ($needles) {
         foreach ($needles as $task) {
             if (isset(self::$lookup[$task])) {
                 return self::$lookup[$task];
             }
         }
     } else {
         $active = $menus->getActive();
         if ($active && $active->component == 'com_asom') {
             return $active->id;
         }
     }
     return null;
 }
예제 #2
0
 public function select()
 {
     $order = JRequest::getVar('cid', '', '', 'int');
     if ($order != 0) {
         $config = JFactory::getConfig();
         $app = JFactory::getApplication();
         $code = sha1($order . $config->getValue('config.secret'));
         $link = JRoute::_(AsomHelperRoute::getRoute('orders.detail&order=' . $order), false);
         $app->setUserState('asom.code', $code);
         $app->redirect($link);
     } else {
         JFactory::getApplication()->redirect('index.php', JText::_('AOM_YOU_DONT_HAVE_PERMISSIONS'), 'error');
     }
 }
예제 #3
0
        </tr>
       
      </thead>
      <tfoot>
        <td colspan="7"><?php 
    echo $this->pagination->getListFooter();
    ?>
</td>
      </tfoot>
      <tbody>
      <?php 
    $k = 0;
    $page = $this->pagination;
    for ($i = 0, $n = count($this->data); $i < $n; $i++) {
        $row =& $this->data[$i];
        $edit = JRoute::_(AsomHelperRoute::getRoute('orders.select&cid=' . $row->id), false);
        ?>
         <tr class="<?php 
        echo "row{$k}";
        ?>
">
	       <td align="right" width="20%"><?php 
        echo $row->id;
        ?>
</td>
           <td align="center" width="20%"><a href='<?php 
        echo $edit;
        ?>
'><?php 
        echo $row->recloc;
        ?>