Ejemplo n.º 1
0
         if (isset($_REQUEST['from'])) {
             $page->smarty->assign('from', $_REQUEST['from']);
         }
         $page->content = $page->smarty->fetch('myshows-add.tpl');
         $page->render();
     }
     break;
 case 'edit':
 case 'doedit':
     $show = $us->getShow($users->currentUserId(), $rid);
     if (!$show) {
         $page->show404();
     }
     if ($action == 'doedit') {
         $category = isset($_REQUEST['category']) && is_array($_REQUEST['category']) && !empty($_REQUEST['category']) ? $_REQUEST['category'] : array();
         $us->updateShow($users->currentUserId(), $rid, $category);
         if (isset($_REQUEST['from'])) {
             header("Location:" . WWW_TOP . $_REQUEST['from']);
         } else {
             header("Location:" . WWW_TOP . "/myshows");
         }
     } else {
         $cat = new Category();
         $tmpcats = $cat->getChildren(Category::CAT_PARENT_TV, true, $page->userdata["categoryexclusions"]);
         $categories = array();
         foreach ($tmpcats as $c) {
             $categories[$c['ID']] = $c['title'];
         }
         $page->smarty->assign('type', 'edit');
         $page->smarty->assign('cat_ids', array_keys($categories));
         $page->smarty->assign('cat_names', $categories);
         if (isset($_REQUEST['from'])) {
             $page->smarty->assign('from', $_REQUEST['from']);
         }
         $page->content = $page->smarty->fetch('myshows-add.tpl');
         $page->render();
     }
     break;
 case 'edit':
 case 'doedit':
     $show = $us->getShow($users->currentUserId(), $tvinfoID);
     if (!$show) {
         $page->show404();
     }
     if ($action == 'doedit') {
         $category = isset($_REQUEST['category']) && is_array($_REQUEST['category']) && !empty($_REQUEST['category']) ? $_REQUEST['category'] : array();
         $us->updateShow($users->currentUserId(), $tvinfoID, $category);
         if (isset($_REQUEST['from'])) {
             header("Location:" . WWW_TOP . $_REQUEST['from']);
         } else {
             header("Location:" . WWW_TOP . "/myshows");
         }
     } else {
         $cat = new Category();
         $tmpcats = $cat->getChildren(Category::CAT_PARENT_TV, true, $page->userdata["categoryexclusions"]);
         $categories = array();
         foreach ($tmpcats as $c) {
             $categories[$c['ID']] = $c['title'];
         }
         $page->smarty->assign('type', 'edit');
         $page->smarty->assign('cat_ids', array_keys($categories));
         $page->smarty->assign('cat_names', $categories);