isError()!=true){ //no error is found, so display the page $template=new HTML_Template_ITX("./Template"); $template->loadTemplateFile("pa_list_admin.tpl.php"); $template->setVariable("ADMIN_NUMBER_OF_IMAGE", ADMIN_NUMBER_OF_IMAGE); $course_name=get_course_title($admin->getVariable('course_id')); switch ($admin->getVariable('mode')){ case POSTED_NEW: $template->setVariable("TITLE", _AT('pa_tag_new_pic')." (".$course_name.")"); break; case APPROVED: $template->setVariable("TITLE", _AT('pa_tag_approved_pic')." (".$course_name.")"); break; case DISAPPROVED: $template->setVariable("TITLE", _AT('pa_tag_disapproved_pic')." (".$course_name.")"); break; } $template->setCurrentBlock("SELECT_PART"); $template->setVariable("SELECT_FORM_NAME", "select_form"); $template->setVariable("SELECT_ACTION", $_SERVER['PHP_SELF']); $template->setVariable("SELECT_NAME", "mode"); $template->setCurrentBlock("OPTION_PART"); $template->setVariable("OPTION_VALUE", POSTED_NEW); $template->setVariable("OPTION_STRING", _AT('pa_tag_new_pic')); $template->parseCurrentBlock("OPTION_PART"); $template->setCurrentBlock("OPTION_PART"); $template->setVariable("OPTION_VALUE", APPROVED); $template->setVariable("OPTION_STRING", _AT('pa_tag_approved_pic')); $template->parseCurrentBlock("OPTION_PART"); $template->setCurrentBlock("OPTION_PART"); $template->setVariable("OPTION_VALUE", DISAPPROVED); $template->setVariable("OPTION_STRING", _AT('pa_tag_disapproved_pic')); $template->parseCurrentBlock("OPTION_PART"); $template->setVariable("SELECT_SUBMIT", "select_submit"); $template->setVariable("SELECT_SUBMIT_VALUE", _AT('pa_tag_go')); $template->parseCurrentBlock("SELECT_PART"); $template->setCurrentBlock("IMAGE_TABLE_PART"); $template->setVariable("IMAGE_TABLE_FORM_NAME", "table_form"); $action_string=$_SERVER['PHP_SELF']."?mode=".$admin->getVariable('mode')."&current_page=".$admin->getVariable('current_page'); $template->setVariable("IMAGE_TABLE_ACTION", $action_string); /* start display images */ $image_array=$admin->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('login').": ".$login_name); $template->setVariable("IMAGE_TABLE_DATA4", _AT('pa_tag_alt').": ".$image_array[$i]['alt']); $template->setVariable("IMAGE_TABLE_DATA5", _AT('date').": ".$image_array[$i]['date']); $template->setVariable("IMAGE_TABLE_DATA6", ""._AT('pa_tag_view_image_link').""); $template->parseCurrentBlock("IMAGE_TABLE_DATA"); } $template->setVariable("CHECK_MESSAGE", _AT('pa_tag_check_all_image')); $template->setCurrentBlock("IMAGE_BUTTON"); $template->setVariable("IMAGE_BUTTON_NAME", "button_disapprove"); $template->setVariable("IMAGE_BUTTON_VALUE", _AT('pa_button_set_disapproved')); $template->parseCurrentBlock("IMAGE_BUTTON"); $template->setCurrentBlock("IMAGE_BUTTON"); $template->setVariable("IMAGE_BUTTON_NAME", "button_approve"); $template->setVariable("IMAGE_BUTTON_VALUE", _AT('pa_button_set_approved')); $template->parseCurrentBlock("IMAGE_BUTTON"); $template->setCurrentBlock("IMAGE_BUTTON"); $template->setVariable("IMAGE_BUTTON_NAME", "button_post_new"); $template->setVariable("IMAGE_BUTTON_VALUE", _AT('pa_button_set_new')); $template->parseCurrentBlock("IMAGE_BUTTON"); $template->parseCurrentBlock("IMAGE_TABLE_PART"); // Display page table $page_array=$admin->getVariable('page_array'); $current=$admin->getVariable('current_page'); $template->setCurrentBlock("PAGE_TABLE_PART"); if ($admin->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 ($admin->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(); $_SESSION['pa']['course_id']=$admin->getVariable('course_id'); } else { redirect('../index.php'); } ?>