SourceTable = $objSession->GetEditTable("News"); $objEditItems->EnablePaging = FALSE; $objRelList = new clsRelationshipList(); $objReviewList = new clsItemReviewList(); $objCustomFields = new clsCustomFieldList(2); $objCustomDataList = new clsCustomDataList(); $objImages = new clsImageList(); //Multiedit init if ($_GET["new"] == 1) { $c = new clsNews(NULL); $c->Set("CreatedOn", adodb_mktime()); // echo "val: ".$objConfig->Get("News_Archive")."
\n"; if($objConfig->Get("News_Archive")>0) { $e = ((int)$objConfig->Get("News_Archive")*86400) + (int)adodb_date("U"); $c->Set("EndOn", $e); } else $c->Set("EndOn",0); $c->Set("StartDate",0); $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); $c->Set("TextFormat",1); //html enabled if($objSession->Get("PortalUserId")>0) { $u = $objUsers->GetUser($objSession->Get("PortalUserId")); $c->Set("Author",$u->Get("Login")); } else { $c->Set("Author","root"); } $en = 0; $action = "n_add_article"; $objArticleList->CreateEmptyEditTable("NewsId"); $objRelList->CreateEmptyEditTable("SourceId"); $objCustomDataList->CreateEmptyEditTable("CustomDataId"); $objArticleList->CreateEmptyCatListTable("ItemResourceId"); $objReviewList->CreateEmptyEditTable("ReviewId"); $objImages->CreateEmptyEditTable("ResourceId"); $TitleVerb = prompt_language("la_Text_Adding"); $Org = NULL; } else { $env_id=$n_var_list['id']; if($env_id) $_POST['newslist']=Array($env_id); $en = (int)$_GET["en"]; if($_GET["item"]) { if($_GET["newsession"]==1) { $objSession->CopyToNewSession(); $objEditItems->SourceTable = $objSession->GetEditTable("News"); } /*shortcut to edit link */ $objArticleList->CopyToEditTable("ResourceId",$_GET["item"]); } else { if (isset($_POST["newslist"])) { $objArticleList->CopyToEditTable("NewsId",$_POST["newslist"]); } } $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); /* make a copy of the relationship records */ if(isset($_POST["newslist"]) || $_GET["item"]) { $ids = $objEditItems->GetResourceIDList(); $objRelList->CopyToEditTable("SourceId",$ids); $objCustomDataList->CopyToEditTable("ResourceId",$ids); $objArticleList->CopyCatListToEditTable("ItemResourceId", $ids); $objReviewList->CopyToEditTable("ItemId",$ids); $objImages->CopyToEditTable("ResourceId",$ids); } $itemcount=$objEditItems->NumItems(); $c = $objEditItems->GetItemByIndex($en); 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 = "n_edit_article"; $TitleVerb = prompt_language("la_Text_Editing"); /* check to see if this is a pending item */ if((int)$c->Get("OrgId")>0 && $c->Get("Status")==-2) { $Org = new clsNews($c->Get("OrgId")); } else $Org = NULL; } $envar = "env=" . BuildEnv() . "&en=$en"; //$formaction = "addarticle.php?".$envar; //Set Section //if (isset($itemlist)) $section = 'in-news:editarticle_general'; //else // $section = 'in-news:addarticle_general'; //Set Environment Variable $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('article','NewsEditStatus','$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('article','NewsEditStatus','$saveURL',2);","tool_cancel.gif"); if ( isset($en_prev) || isset($en_next) ) { $url = $RootUrl."in-news/admin/addarticle.php"; $StatusField = "NewsEditStatus"; $form = "article"; MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick")); //$objCatToolBar->Add("divider"); } $article_t = inp_textarea_unescape($c->parsetag("article_title")); if (strlen($article_t)) $editing_title = "'".$article_t."' "; else $editing_title = ""; $title = $TitleVerb." ".prompt_language("la_Text_Article")." $editing_title- ".prompt_language("la_tab_General"); int_header($objCatToolBar,NULL,$title); if ($objSession->GetVariable("HasChanges") == 1) { ?>
> > > > > > > > > > > > > > > > > > > > > > GetFieldUIList(TRUE); if($CustomFieldUI->NumItems()>0) { $objCustomDataList->SourceTable = $objSession->GetEditTable("CustomMetaData"); if((int)$c->Get("ResourceId")>0) { $objCustomDataList->LoadResource($c->Get("ResourceId")); } $headings = $CustomFieldUI->GetHeadingList(); //echo "
";print_r($objCustomFields); echo "
"; $tab_index = 21; for($i=0;$i<=count($headings);$i++) { $h = $headings[$i]; if(strlen($h)) { int_subsection_title(prompt_language($h)); $Items = $CustomFieldUI->GetHeadingItems($h); foreach($Items as $f) { $n = substr($f->name,1); $cfield = $objCustomFields->GetItemByField("FieldName",$n,FALSE); if(is_object($cfield)) { $cv = $objCustomDataList->GetDataItem($cfield->Get("CustomFieldId")); if(is_object($cv)) { $f->default_value = $cv->Get("Value"); } } print "\n"; print " \n"; print " "; if(is_object($f->NextItem)) { $n = $f->NextItem; print " "; } else print " \n"; print "\n"; } } } } ?> ">
Get("TextFormat")==1) $checked=" checked"; ?> >
Get("NewsId"); ?>
"> Get("Title"); $NewValue = $c->Get("Title"); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "".inp_textarea_unescape($OrgValue).""; } ?>
"> Get("Author"); $NewValue = $c->Get("Author"); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "".inp_textarea_unescape($OrgValue).""; } ?>

Get("Body"); $NewValue = $c->Get("Body"); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "".substr(strip_tags($OrgValue),0,100); if(strlen($OrgValue)>100) echo " .."; echo ""; } ?>

Get("Excerpt"); $NewValue = $c->Get("Excerpt"); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "".inp_textarea_unescape($OrgValue).""; } ?>
Get('AutomaticFilename') == 1) echo ' checked'; ?> onchange="reflect_filename();">  
 
Get("Status") == 1) echo "checked"; ?>> Get("Status") == $PendingVal) echo "checked"; ?>> Get("Status") == 0) echo "checked"; ?>>
Get("NewItem") == 2) echo "checked"; ?>> Get("NewItem") == 1) echo "checked"; ?>> Get("NewItem") == 0) echo "checked"; ?>> Get("NewItem")) { case 2: echo prompt_language("la_val_Auto"); break; case 1: echo prompt_language("la_val_Always"); break; case 0: echo prompt_language("la_val_Never"); break; } } ?>
Get("HotItem") == 2) echo "checked"; ?>> Get("HotItem") == 1) echo "checked"; ?>> Get("HotItem") == 0) echo "checked"; ?>> Get("HotItem")) { case 2: echo prompt_language("la_val_Auto"); break; case 1: echo prompt_language("la_val_Always"); break; case 0: echo prompt_language("la_val_Never"); break; } } ?>
Get("PopItem") == 2) echo "checked"; ?>> Get("PopItem") == 1) echo "checked"; ?>> Get("PopItem") == 0) echo "checked"; ?>> Get("PopItem")) { case 2: echo prompt_language("la_val_Auto"); break; case 1: echo prompt_language("la_val_Always"); break; case 0: echo prompt_language("la_val_Never"); break; } } ?>
Get("EditorsPick") == 1) echo "checked"; ?>> Get("EditorsPick")) { echo prompt_language("lu_yes"); } else echo prompt_language("lu_no"); } ?>
Get("LeadStory") == 1) echo "checked"; ?>> Get("LeadStory")) { echo prompt_language("lu_yes"); } else echo prompt_language("lu_no"); } ?>
Get("LeadCatStory") == 1) echo "checked"; ?>> Get("LeadCatStory")) { echo prompt_language("lu_yes"); } else echo prompt_language("lu_no"); } ?>
"> Get("Priority"); $NewValue = (int)$c->Get("Priority"); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "$OrgValue"; } ?>
parsetag('article_date'); $NewValue = $c->parsetag('article_date'); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "$OrgValue"; } ?>
parsetag('article_startdate'); $NewValue = $c->parsetag('article_startdate'); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "$OrgValue"; } ?>
parsetag('article_enddate'); $NewValue = $c->parsetag('article_enddate'); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "$OrgValue"; } ?>
"> Get("CachedRating"); $NewValue = (int)$c->Get("CachedRating"); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "$OrgValue"; } ?>
"> Get("CachedVotesQty"); $NewValue = (int)$c->Get("CachedVotesQty"); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "$OrgValue"; } ?>
"> "> Get("Views"); $NewValue = (int)$c->Get("Views"); if($OrgValue != $NewValue) { $class = "error"; } else $class = "text"; echo "$OrgValue"; } ?>
".$f->GetPrompt()."".$f->ItemFormElement($tab_index++)."".$n->ItemFormElement($tab_index++)."