예제 #1
0
파일: route.php 프로젝트: naka211/jydsk
 public static function getCategoryRoute($catid)
 {
     if ($catid instanceof CategoryNode) {
         $id = $catid->id;
         $category = $catid;
     } else {
         $id = (int) $catid;
         $category = Categories::getInstance('JFoobars')->get($id);
     }
     if ($id < 1) {
         $link = '';
     } else {
         $needles = array('category' => array($id));
         if ($item = self::_findItem($needles)) {
             $link = 'index.php?Itemid=' . $item;
         } else {
             //Create the link
             $link = 'index.php?option=com_jfoobars&view=category&id=' . $id;
             if ($category) {
                 $catids = array_reverse($category->getPath());
                 $needles = array('category' => $catids, 'categories' => $catids);
                 if ($item = self::_findItem($needles)) {
                     $link .= '&Itemid=' . $item;
                 } elseif ($item = self::_findItem()) {
                     $link .= '&Itemid=' . $item;
                 }
             }
         }
     }
     return $link;
 }
예제 #2
0
 function actionSavecopy()
 {
     $cid = Request::getVar("id", 0);
     $model = Categories::getInstance();
     $cid = $model->copyitem($cid);
     $this->redirect(Router::buildLink("categories", array("layout" => "edit", 'cid' => $cid)));
 }