Get($field);
$NewValue = $c->Get($field);
$class = ($OrgValue != $NewValue) ? 'error' : 'text';
return ''.$OrgValue.'';
}
}
// --------------------------------------------------------------------
$objEditItems = new clsLinkList();
$objRelList = new clsRelationshipList();
$objReviewList = new clsItemReviewList();
$objImages = new clsImageList();
$application->SetVar('l_mode', 't');
$objCustomFields = new clsCustomFieldList(4);
$objCustomDataList = new clsCustomDataList();
//Multiedit init
if ($_GET["new"] == 1)
{
$objEditItems->SourceTable = $objSession->GetEditTable("Link");
$objEditItems->EnablePaging = FALSE;
$c = new clsLink(NULL);
$c->Set("CreatedOn", adodb_mktime());
$c->Set("EndOn", adodb_mktime());
$c->Set("CategoryId",$objCatList->CurrentCategoryID());
$c->Set("HotItem",2);
$c->Set("NewItem",2);
$c->Set("PopItem",2);
$c->Set("Status",2);
$c->Set('AutomaticFilename', 1);
if($objSession->Get("PortalUserId")>0)
{
$u = $objUsers->GetUser($objSession->Get("PortalUserId"));
$CreatedByName = $u->Get("Login");
}
else
{
$CreatedByName = "root";
}
$en = 0;
$action = "l_link_add";
$objLinkList->CreateEmptyEditTable("LinkId");
$objRelList->CreateEmptyEditTable("RelationshipId");
$objReviewList->CreateEmptyEditTable("ReviewId");
$objCustomDataList->CreateEmptyEditTable('l');
$objLinkList->CreateEmptyCatListTable("ItemResourceId");
$objImages->CreateEmptyEditTable("ResourceId");
$TitleVerb = prompt_language("la_Text_Adding");
}
else
{
/*$direct_id = GetVar('direct_id');
if($direct_id) $_POST['linklist'] = Array($direct_id);*/
$env_id = $l_var_list['id'];
if($env_id) $_POST['linklist'] = Array($env_id);
$en = (int)$_GET["en"];
if($_GET["item"])
{
if($_GET["newsession"]==1)
{
$objSession->CopyToNewSession();
}
/*shortcut to edit link */
$objLinkList->CopyToEditTable("ResourceId",$_GET["item"]);
}
else
{
if (GetVar('multiple_ids') == 1) {
// from K4 template LinkId's are passed here
SetVar('linklist', array_keys($application->GetVar('l')) );
}
if (isset($_POST["linklist"]))
{
$objLinkList->CopyToEditTable("LinkId",$_POST["linklist"]);
}
}
$objEditItems->SourceTable = $objSession->GetEditTable("Link");
$objEditItems->EnablePaging = FALSE;
$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
if(isset($_POST["linklist"]) || $_GET["item"])
{
$ids = $objEditItems->GetResourceIDList();
$objRelList->CopyToEditTable("SourceId",$ids);
$objReviewList->CopyToEditTable("ItemId",$ids);
$objCustomDataList->CopyToEditTable('l', $ids);
$objLinkList->CopyCatListToEditTable("ItemResourceId", $ids);
$objImages->CopyToEditTable("ResourceId",$ids);
}
$itemcount=$objEditItems->NumItems();
$c = $objEditItems->GetItemByIndex($en);
if($c->Get("CreatedById")>0)
{
$u = $objUsers->GetUser($c->Get("CreatedById"));
$CreatedByName = $u->Get("Login");
}
else
$CreatedByName = "root";
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 = "l_edit_link";
$TitleVerb = prompt_language("la_Text_Editing");
/* check to see if this is a pending link */
//echo "checking
";
//echo "OID_:".$c->Get("OrgId")."
";
if( (int)$c->Get("OrgId") > 0 && $c->Get("Status") == -2 )
$Org = new clsLink($c->Get("OrgId"));
else
$Org = NULL;
//echo "GC: ".get_class($Org).'
';
}
$envar = "env=" . BuildEnv() . "&en=$en";
$section = 'in-link:editlink_general';
$saveURL = $admin."/".$objSession->GetVariable('ReturnScript');
//Display header
$sec = $objSections->GetSection($section);
$objCatToolBar = new clsToolBar();
$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('link','LinkEditStatus','$saveURL',1);","tool_select.gif");
$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('link','LinkEditStatus','$saveURL',2);","tool_cancel.gif");
if ( isset($en_prev) || isset($en_next) )
{
$url = $RootUrl."/in-link/admin/addlink.php";
$StatusField = "LinkEditStatus";
$form = "link";
MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"));
}
if (strlen($c->Get("Name")))
$editing_title = "'".$c->Get("Name")."' ";
else
$editing_title = "";
$title = $TitleVerb." ".prompt_language("la_Text_Link")." $editing_title- ".prompt_language("la_tab_General");
int_header($objCatToolBar,NULL,$title);
$c->Data=inp_htmlize($c->Data);
if ($objSession->GetVariable("HasChanges") == 1) {
?>