isError()!=true){ //no error is occured $course_id=$_SESSION['pa']['course_id']; //store course_id temporarily unset($_SESSION['pa']); //clear pa session variables $_SESSION['pa']['course_id']=$course_id; $_SESSION['pa']['my_pic_mode']=true; $template=new HTML_Template_ITX("./Template"); $template->loadTemplateFile("my_photo.tpl.php"); $template->setVariable("COURSE_PHOTO_URL", BASE_PATH.'index.php'); $template->setVariable("COURSE_PHOTO_IMAGE", COURSE_ALBUM_IMAGE); $template->setVariable("MY_PHOTO_URL", BASE_PATH.'my_photo.php'); $template->setVariable("MY_PHOTO_IMAGE", MY_ALBUM_IMAGE); switch ($my->getVariable('mode')){ case POSTED_NEW: $template->setVariable("TITLE", _AT('pa_title_my_photo_new')); break; case APPROVED: $template->setVariable("TITLE", _AT('pa_title_my_photo_approved')); break; case DISAPPROVED: $template->setVariable("TITLE", _AT('pa_title_my_photo_disapproved')); break; } $template->setCurrentBlock("SELECT_PART"); $template->setVariable("DESTINATION", BASE_PATH.'my_photo.php?mode='.POSTED_NEW.'&current_page='.$my->getVariable('current_page')); $template->setVariable("LINK_TEXT", _AT('pa_tag_new_pic').' | '); $template->parseCurrentBlock("SELECT_PART"); $template->setCurrentBlock("SELECT_PART"); $template->setVariable("DESTINATION", BASE_PATH.'my_photo.php?mode='.APPROVED.'&current_page='.$my->getVariable('current_page')); $template->setVariable("LINK_TEXT", _AT('pa_tag_approved_pic').' | '); $template->parseCurrentBlock("SELECT_PART"); $template->setCurrentBlock("SELECT_PART"); $template->setVariable("DESTINATION", BASE_PATH.'my_photo.php?mode='.DISAPPROVED.'&current_page='.$my->getVariable('current_page')); $template->setVariable("LINK_TEXT", _AT('pa_tag_disapproved_pic')); $template->parseCurrentBlock("SELECT_PART"); /* start display images */ $image_array=$my->image_array; for ($i=0; $isetCurrentBlock("IMAGE_TABLE_DATA"); $template->setVariable("CHECK_NAME", "imageId".$i); $template->setVariable("CHECK_VALUE", $image_array[$i]['image_id']); $template->setVariable("IMAGE_TABLE_DATA1", "\"".$image_array[$i]['alt']."\"/"); $template->setVariable("IMAGE_TABLE_DATA2", _AT('title').": ".$image_array[$i]['title']); $login_name=get_login_name($image_array[$i]['member_id']); $template->setVariable("IMAGE_TABLE_DATA3", _AT('date').": ".$image_array[$i]['date']); $template->setVariable("FORM_NAME", "edit_button"); $template->setVariable("ACTION", UPLOAD_ACTION); $template->setVariable("CHOOSE_VALUE", IMAGE); $template->setVariable("IMAGE_ID", $image_array[$i]['image_id']); $template->setVariable("EDIT_VALUE", _AT('pa_button_edit_image')); $template->parseCurrentBlock("IMAGE_TABLE_DATA"); } // Display page table $page_array=$my->getVariable('page_array'); $current=$my->getVariable('current_page'); $template->setCurrentBlock("PAGE_TABLE_PART"); if ($my->getVariable('show_page_left_buttons')==true){ $template->setCurrentBlock("PAGE_TABLE_DATA"); $template->setVariable("T_DATA", 'getVariable('mode').'\'>\'first_page_button\''); $template->parseCurrentBlock("PAGE_TABLE_DATA"); $template->setCurrentBlock("PAGE_TABLE_DATA"); $template->setVariable("T_DATA", 'getVariable('mode').'\'>\'previous_page_button\''); $template->parseCurrentBlock("PAGE_TABLE_DATA"); } for ($i=$page_array['start']; $i<=$page_array['end']; $i++){ if ($i==$current){ $template->setCurrentBlock("PAGE_TABLE_DATA"); $template->setVariable("T_DATA", $i); $template->parseCurrentBlock("PAGE_TABLE_DATA"); } else { $template->setCurrentBlock("PAGE_TABLE_DATA"); $template->setVariable("T_DATA", 'getVariable('mode').'\'>'.$i.''); $template->parseCurrentBlock("PAGE_TABLE_DATA"); } } if ($my->getVariable('show_page_right_buttons')==true){ $template->setCurrentBlock("PAGE_TABLE_DATA"); $template->setVariable("T_DATA", 'getVariable('mode').'\'>\'next_page_button\''); $template->parseCurrentBlock("PAGE_TABLE_DATA"); $template->setCurrentBlock("PAGE_TABLE_DATA"); $template->setVariable("T_DATA", 'getVariable('mode').'\'>\'last_page_button\''); $template->parseCurrentBlock("PAGE_TABLE_DATA"); } $template->parseCurrentBlock("PAGE_TABLE_PART"); $template->parseCurrentBlock(); $template->show(); } ?>