Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1067970
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jul 16, 4:12 AM
Size
9 KB
Mime Type
text/x-diff
Expires
Fri, Jul 18, 4:12 AM (6 h, 3 m)
Engine
blob
Format
Raw Data
Handle
691052
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/kernel/admin/include/parser.php
===================================================================
--- trunk/kernel/admin/include/parser.php (revision 3229)
+++ trunk/kernel/admin/include/parser.php (revision 3230)
@@ -1,285 +1,290 @@
<?php
function adListSubCats($ParentId, $template, $KeywordsVar = 'SearchWord')
{
global $var_list, $m_cat_filter, $m_category_sort, $m_category_sortby,
$objCatList, $objSession,$pathtoroot, $objConfig,$admin;
if($objCatList->NumCategories()==0)
return "<br>No Categories<br><br>";
$o="<table border=0 cellspacing=2 width=\"100%\"><tbody><tr>";
$i=1;
$list = $objSession->GetVariable($KeywordsVar);
if(strlen($list))
$Keywords = explode(",",$list);
$template = $pathtoroot.$admin."/templates/".$template;
$topleft = 0;
$topright = 0;
$rightcount = 0;
$totalcats = 0;
$totalcats = $objCatList->NumItems();
$topleft = ceil($totalcats/2);
$topright = $totalcats-$topleft;
for ($x=0;$x<$topleft;$x++)
{
//printingleft
$cat = $objCatList->Items[$x];
if($cat->Get("CategoryId")!=$ParentId)
{
if ($i > 2)
{
$o.="</tr>\n<tr>";
$i = 1;
}
//$cat->LoadPermissions($objSession->Get("GroupId"));
if(strlen($list))
{
$h = $cat->AdminParseTemplate($template);
$h = HighlightKeywords($Keywords, $h);
$o .= $h;
$h = "";
}
else
$o.=$cat->AdminParseTemplate($template);
$i++;
}
//printingright
if ($rightcount < $topright && (($x+$topleft) <$totalcats))
{
$cat = $objCatList->Items[$x+$topleft];
if($cat->Get("CategoryId")!=$ParentId)
{
if ($i > 2)
{
$o.="</tr>\n<tr>";
$i = 1;
}
//$cat->LoadPermissions($objSession->Get("GroupId"));
if(strlen($list))
{
$h = $cat->AdminParseTemplate($template);
$h = HighlightKeywords($Keywords, $h);
$o .= $h;
$h = "";
}
else
$o.=$cat->AdminParseTemplate($template);
$i++;
}
$rightcount++;
}
}
$o .="\n</tr></tbody></table>\n";
return $o;
}
function list_custom($c,$Type)
{
global $objSession, $objCustomFieldList, $objCustomDataList,
$imagesURL;
$field_list = $objCustomFieldList->Query_CustomField("Type=$Type");
if (count($field_list) == 0)
return "No Custom Fields<br><br>";
$o="";
$i = 1;
$objCustomDataList->SourceTable = $objSession->GetEditTable("CustomMetaData");
$objCustomDataList->LoadResource($c->Get("ResourceId"));
foreach($field_list as $field)
{
$fieldname = $field->Get("FieldName");
$fieldlabel = $field->Get("FieldLabel");
$fieldid = $field->Get("CustomFieldId");
$f = $objCustomDataList->GetDataItem($fieldid);
if(is_object($f))
{
$fieldvalue = $f->Get("Value");
}
else
$fieldvalue="";
$o .="<tr " . int_table_color_ret() .">";
$o .="<td valign=\"top\"><img src=\"$imagesURL/itemicons/icon16_custom.gif\" height=\"16\" width=\"16\" align=\"absmiddle\"><span class=\"text\"> $fieldname</span></td>
<td valign=\"top\"><span class=\"text\">$fieldlabel</span></td>
<td>
<input type=\"text\" name=\"customdata[$fieldid]\" class=\"text\" size=\"30\" value=\"$fieldvalue\">
</td></tr>\n";
$i++;
}
return $o;
}
function adListRelatedCategories($Item)
{
global $objCatList;
if(is_object($Item))
{
$catlist = $Item->GetRelatedCategories(0);
$o = "";
foreach($catlist as $catrel)
{
$o .= "<input type=checkbox NAME=\"dellist[]\" VALUE=\"".$catrel->Get("RelationshipId")."\">";
$cat = $objCatList->GetByResource($catrel->Get("TargetId"));
$path = $cat->ParentNames();
if(strlen($path))
{
$o .= implode(">",$path);
}
$o .="<br>\n";
}
}
return $o;
}
function adListRelatedItems($Item)
{
global $objCatList;
if(is_object($Item))
{
$item_list=$Item->GetRelatedItems(0);
$o = "";
foreach($item_list as $i)
{
$data = $i->GetTargetItemData();
$o .= "<tr ".int_table_color_ret().">";
$o .= "<TD>";
$o .= "<input type=checkbox NAME=\"dellist[]\" VALUE=\"".$i->Get("RelationshipId")."\">";
$o .= $data[$data["TitleField"]];
$o .= "</TD>";
$o .= "<TD>".$data["SourceTable"]."</TD>";
$cat =& $objCatList->GetCategory($data["CategoryId"]);
$o .= "<TD>";
$path = $cat->ParentNames();
if(strlen($path))
{
$o .= implode(">",$path);
}
$o .= "</TD></TR>";
}
}
return $o;
}
function adListItemReviews($Item)
{
global $pathtoroot,$admin;
$Reviews = $Item->GetItemReviews();
$o = "";
if($Reviews->ItemCount()>0)
{
foreach($Reviews->ItemList as $r)
{
$o .= "<TR ".int_table_color_ret().">";
$o .= "<TD width=\"5%\">";
if($r->Get("Pending")==0)
{
$o .= "<INPUT TYPE=checkbox NAME=\"deletelist[]\" VALUE=\"".$r->Get("ReviewId")."\"> Delete";
}
$o .= "</TD><TD width=\"5%\">";
if($r->Get("Pending")!=0)
{
$o .= "<INPUT TYPE=checkbox NAME=\"approvelist[]\" VALUE=\"".$r->Get("ReviewId")."\"> Approve";
}
$o .= "</TD>";
$o .= $r->parse_template(admintemplate($pathtoroot.$admin."/templates/review_element.tpl"));
$o .= "</TR>";
}
}
return $o;
}
function adImageUploadFormTags($img)
{
static $file_count=0;
$o = "";
if($file_count==0)
{
$o .= "<INPUT TYPE=HIDDEN NAME=\"img\" VALUE=1>";
}
$o .= "<TD><INPUT TYPE=TEXT NAME=\"img_Name_$file_count\" VALUE=\"".$img->Get("Name")."\"></TD>";
$o .= "<TD><INPUT TYPE=TEXT NAME=\"img_Alt_$file_count\" VALUE=\"".$img->Get("AltName")."\"></TD>";
$o .= "<TD>";
$o .= "<INPUT TYPE=TEXT size=40 NAME=\"img_Url_$file_count\" VALUE=\"".$img->Get("Url")."\">";
$o .= "</TD><TD>";
$o .= "<INPUT TYPE=FILE class=\"button\" VALUE=\"".$img->Get("Url")."\" NAME=\"$file_count\">";
$o .= "<INPUT TYPE=HIDDEN NAME=\"img_Res_$file_count\" VALUE=\"".$img->Get("ResourceId")."\">";
$o .= "<INPUT TYPE=HIDDEN NAME=\"img_Rel_$file_count\" VALUE=\"".$img->Get("RelatedTo")."\">";
$o .= "<INPUT TYPE=HIDDEN NAME=\"img_Thumb_$file_count\" VALUE=\"".$img->Get("IsThumbnail")."\">";
$parts = pathinfo($img->Get("LocalPath"));
$destdir = $parts["dirname"];
$o .= "<INPUT TYPE=HIDDEN NAME=\"img_DestDir_$file_count\" VALUE=\"$destdir\">";
if($img->Get("RelatedTo")>0)
$o .= "<input type=\"submit\" name=\"img_Del_$file_count\" value=\"Delete\" class=\"button2\">";
$o .= "</TD>";
$file_count++;
return $o;
}
function m_GetModuleInfo($info_type)
{
// get information for building sql in
switch($info_type)
{
case 'rel_list': // Edit Category -> Relations List
return Array( 'MainTable' => 'Category', 'ItemNameField' => 'CachedNavbar',
'ItemNamePhrase' => 'la_Text_Category', 'TargetType' => 1);
break;
case 'summary_pending':
global $imagesURL;
$ret = Array();
$UserURL = $GLOBALS['adminURL'].'/users/user_list.php?env='.BuildEnv();
// pending users
$ret[] = Array( 'link' => "config_val('User_View', '4' ,'$UserURL')",
'icon_image' => $imagesURL.'/itemicons/icon16_user_pending.gif',
'phrase' => 'la_Text_Users', 'list_var_name' => 'objUsers' );
// pending categories
$ret[] = Array( 'link' => "PendingLink('category','Category_View',41)",
'icon_image' => $imagesURL.'/itemicons/icon16_cat_pending.gif',
'phrase' => 'la_tab_Categories', 'list_var_name' => 'objCatList');
return $ret;
break;
case 'all_bitmask': // return bitmask value equals to "all" for module filter
return Array('VarName' => 'Category_View', 'Bits' => 127);
break;
case 'dupe_resourceids':
$ret=Array();
$ret[]=Array('Table'=>'Category','IDField'=>'CategoryId');
$ret[]=Array('Table'=>'PortalGroup','IDField'=>'GroupId');
$ret[]=Array('Table'=>'PortalUser','IDField'=>'PortalUserId');
return $ret;
+ break;
+
+ case 'filenames':
+ return Array('prefix' => 'm', 'table' => 'Category', 'id_field' => 'CategoryId', 'title_field' => 'Name');
+ break;
}
return false;
}
?>
Property changes on: trunk/kernel/admin/include/parser.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Event Timeline
Log In to Comment