SourceTable = $objSession->GetEditTable("Link");
$objEditItems->EnablePaging = FALSE;
$en = (int)$_GET["en"];
if (isset($_POST["linklist"]))
{
$objLinkList->CopyToEditTable("LinkId",$_POST["linklist"]);
}
$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
$itemcount=$objEditItems->NumItems();
if( $GLOBALS['debuglevel'] )
echo $itemcount . " items loaded..
\n";
$c = $objEditItems->GetItemByIndex($en);
$objImageList = new clsImageList();
$objImageList->SourceTable = $objSession->GetEditTable("Images");
//$objImageList->Query_Images("ResourceId=".$c->Get("ResourceId"),"");
if($itemcount>1)
{
if ($en+1 == $itemcount)
$en_next = -1;
else
$en_next = $en+1;
if ($en == 0)
$en_prev = -1;
else
$en_prev = $en-1;
}
$action = "m_item_image";
$envar = "env=" . BuildEnv() . "&en=$en";
$saveURL = $admin."/".$objSession->GetVariable('ReturnScript');
$section = 'in-link:editlink_images';
$objListToolBar = new clsToolBar();
$objListToolBar->Add("img_save", "la_Save","","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','".$saveURL."',1);","tool_select.gif");
$objListToolBar->Add("img_cancel", "la_Cancel","","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','".$saveURL."',2);","tool_cancel.gif");
if($itemcount == 1) $objListToolBar->Add("divider");
$objListToolBar->Set("section",$section);
$objListToolBar->Set("load_menu_func","");
$objListToolBar->Set("CheckClass","PermChecks");
$objListToolBar->Set("CheckForm","imagelistform");
//Display header
$sec = $objSections->GetSection($section);
if ( isset($en_prev) || isset($en_next) )
{
$url = $RootUrl."/in-link/admin/addlink_images.php";
$StatusField = "LinkEditStatus";
$form = "link";
MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"));
$objListToolBar->Add("divider");
}
$listImages = array();
//$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
$objListToolBar->Add("new_img", "la_ToolTip_New_Image",$rootURL."in-link/admin/addimage.php?".$envar,"swap('new_img','toolbar/tool_new_image_f2.gif');",
"swap('new_img', 'toolbar/tool_new_image.gif');",
"","tool_new_image.gif");
$objListToolBar->Add("img_edit","la_ToolTip_Edit","#", "if (PermChecks.itemChecked()) swap('img_edit','toolbar/tool_edit_f2.gif');",
"if (PermChecks.itemChecked()) swap('img_edit', 'toolbar/tool_edit.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addimage', '');",
"tool_edit.gif",TRUE,TRUE);
$listImages[] = "PermChecks.addImage('img_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); ";
$objListToolBar->Add("img_del","la_ToolTip_Delete","#", "if (PermChecks.itemChecked()) swap('img_del','toolbar/tool_delete_f2.gif');",
"if (PermChecks.itemChecked()) swap('img_del', 'toolbar/tool_delete.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addlink_images', 'm_img_delete');",
"tool_delete.gif",FALSE,TRUE);
$listImages[] = "PermChecks.addImage('img_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); ";
$objListToolBar->Add("divider");
$objListToolBar->Add("img_move_up","la_ToolTip_Move_Up","#", "if (PermChecks.itemChecked()) swap('img_move_up','toolbar/tool_move_up_f2.gif');",
"if (PermChecks.itemChecked()) swap('img_move_up', 'toolbar/tool_move_up.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addlink_images', 'm_img_move_up');",
"tool_move_up.gif",FALSE,TRUE);
$listImages[] = "PermChecks.addImage('img_move_up','$imagesURL/toolbar/tool_move_up.gif','$imagesURL/toolbar/tool_move_up_f3.gif',1); ";
$objListToolBar->Add("img_move_down","la_ToolTip_Move_Down","#", "if (PermChecks.itemChecked()) swap('img_move_down','toolbar/tool_move_down_f2.gif');",
"if (PermChecks.itemChecked()) swap('img_move_down', 'toolbar/tool_move_down.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addlink_images', 'm_img_move_down');",
"tool_move_down.gif",FALSE,TRUE);
$listImages[] = "PermChecks.addImage('img_move_down','$imagesURL/toolbar/tool_move_down.gif','$imagesURL/toolbar/tool_move_down_f3.gif',1); ";
$objListToolBar->Add("divider");
$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ",
"swap('viewmenubutton', 'toolbar/tool_view.gif');",
"ShowViewMenu();","tool_view.gif");
$objListToolBar->AddToInitScript($listImages);
/* ----------------------------------------- Set the View Filter ---------------------------------------- */
$Img_AllValue = 3;
$Bit_Enabled=1;
$Bit_Disabled=2;
$FilterLabels = array();
$FilterLabels[0] = admin_language("la_Text_Enabled");
$FilterLabels[1] = admin_language("la_Text_Disabled");
$ImgView = $objConfig->Get("LinkImg_View");
if(!is_numeric($ImgView))
{
$ImgView = $Img_AllValue;
}
else
{
if($ImgView & $Bit_Enabled)
$Filters[] = "img.Enabled=1";
if($ImgView & $Bit_Disabled)
$Filters[] = "img.Enabled=0";
if(count($Filters))
{
$imgFilter = implode(" OR ",$Filters);
}
else
$imgFilter = "ImageId = -1";
}
$objListToolBar->AddToInitScript("fwLoadMenus(); \n");
$filter = false; // always initialize variables before use
if ($ImgView != $Img_AllValue) {
$filter = true;
}
$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Link")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Images");
int_header($objListToolBar,NULL, $title);
if ($objSession->GetVariable("HasChanges") == 1) {
?>