Esempio n. 1
0
 case "addvideos":
     if (!icms::$security->check()) {
         redirect_header(icms_getPreviousPage('index.php'), 3, _MD_PROFILE_SECURITY_CHECK_FAILED . implode('<br />', icms::$security->getErrors()));
     }
     $controller = new icms_ipf_Controller($profile_videos_handler);
     $controller->storeFromDefaultForm(_MD_PROFILE_VIDEOS_CREATED, _MD_PROFILE_VIDEOS_MODIFIED, PROFILE_URL . basename(__FILE__));
     break;
 case "del":
     if (!$videosObj->userCanEditAndDelete()) {
         redirect_header($videosObj->getItemLink(true), 3, _NOPERM);
     }
     if (isset($_POST['confirm']) && !icms::$security->check()) {
         redirect_header(icms_getPreviousPage('index.php'), 3, _MD_PROFILE_SECURITY_CHECK_FAILED . implode('<br />', icms::$security->getErrors()));
     }
     $controller = new icms_ipf_Controller($profile_videos_handler);
     $controller->handleObjectDeletionFromUserSide();
     break;
 default:
     $clean_start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
     if ($real_uid && $real_uid == $uid) {
         editvideos($videosObj, true);
     }
     if ($clean_uid > 0 || $real_uid > 0) {
         $uid = $clean_uid > 0 ? $clean_uid : $real_uid;
         $videosArray = $profile_videos_handler->getVideos($clean_start, icms::$module->config['videosperpage'], $clean_uid);
         if (count($videosArray) == 0) {
             $icmsTpl->assign('lang_nocontent', _MD_PROFILE_VIDEOS_NOCONTENT);
         } else {
             $total_videos_count = $profile_videos_handler->getCount(new icms_db_criteria_Compo(new icms_db_criteria_Item('uid_owner', $uid)));
             $pagenav = new icms_view_PageNav($total_videos_count, icms::$module->config['videosperpage'], $clean_start, 'start', 'uid=' . $uid);
             $icmsTpl->assign('profile_videos_pagenav', $pagenav->renderNav());