Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1032668
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
Thu, Jun 19, 4:01 AM
Size
41 KB
Mime Type
text/x-diff
Expires
Sat, Jun 21, 4:01 AM (1 h, 1 m)
Engine
blob
Format
Raw Data
Handle
667211
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/unlabeled/unlabeled-1.21.2/kernel/include/image.php
===================================================================
--- branches/unlabeled/unlabeled-1.21.2/kernel/include/image.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.21.2/kernel/include/image.php (revision 7644)
@@ -0,0 +1,1257 @@
+<?php
+
+class clsImage extends clsParsedItem
+{
+ var $Pending;
+
+ function clsImage($id=NULL)
+ {
+ global $objSession;
+
+ $this->clsParsedItem();
+ $this->tablename = GetTablePrefix()."Images";
+ $this->Pending = FALSE;
+ $this->id_field = "ImageId";
+ $this->type=-30;
+ $this->TagPrefix = "image";
+ $this->NoResourceId=1;
+ if($id)
+ $this->LoadFromDatabase($id);
+ //$this->SetDebugLevel(0);
+ }
+
+ function DetectChanges($name, $value)
+ {
+ global $objSession;
+ //print_pre($_POST);
+ if (!isset($this->Data[$name]) ) return false;
+
+ if ($this->Data[$name] != $value) {
+ //echo "$name Modified tt ".$this->Data[$name]." tt $value<br>";
+ if (!stristr($name, 'Resource') && !stristr($name, 'ImageId')) {
+ if ($objSession->GetVariable("HasChanges") != 1) {
+ $objSession->SetVariable("HasChanges", 2);
+ }
+ }
+ }
+ }
+
+ function GetFileName($thumb = 0)
+ {
+ global $pathtoroot;
+
+ if($thumb)
+ {
+ $p = $this->Get("ThumbPath");
+ }
+ else
+ {
+ $p = $this->Get("LocalPath");
+ if(!strlen($p) && $this->Get("SameImages"))
+ {
+ $p = $this->Get("ThumbPath");
+ }
+ }
+
+ if(strlen($p))
+ {
+ $parts = pathinfo($pathtoroot.$p);
+ $filename = $parts["basename"];
+ }
+ else
+ $filename = "";
+
+ return $filename;
+ }
+
+ function GetImageDir()
+ {
+ global $pathtoroot;
+
+ $p = $this->Get("ThumbPath");
+ $localp = $this->Get("LocalPath");
+ if(strlen($p))
+ {
+ $parts = pathinfo($pathtoroot.$p);
+ $d = $parts["dirname"]."/";
+ }
+ elseif (strlen($localp))
+ {
+ $parts = pathinfo($pathtoroot.$localp);
+ $d = $parts["dirname"]."/";
+ }
+
+ if($this->Pending)
+ $d .= "pending/";
+
+ return $d;
+ }
+
+
+ function Delete()
+ {
+ $this->DeleteLocalImage();
+ parent::Delete();
+ }
+
+ function Update($UpdatedBy=NULL,$modificationDate = null)
+ {
+ global $Errors, $objSession;
+
+ if(count($this->m_dirtyFieldsMap) == 0)
+ return true;
+
+ $this->SetModified($UpdatedBy,$modificationDate);
+ $sql = "UPDATE ".$this->tablename ." SET ";
+ $first = 1;
+
+ foreach ($this->m_dirtyFieldsMap as $key => $value)
+ {
+ if(!is_numeric($key) && $key != $this->IdField())
+ {
+ if($first)
+ {
+ if(isset($GLOBALS['_CopyFromEditTable']))
+ $sql = sprintf("%s %s=%s",$sql,$key,$this->adodbConnection->qstr(($value)));
+ else
+ $sql = sprintf("%s %s=%s",$sql,$key,$this->adodbConnection->qstr(stripslashes($value)));
+ $first = 0;
+ }
+ else
+ {
+ if(isset($GLOBALS['_CopyFromEditTable']))
+ $sql = sprintf("%s, %s=%s",$sql,$key,$this->adodbConnection->qstr(($value)));
+ else
+ $sql = sprintf("%s, %s=%s",$sql,$key,$this->adodbConnection->qstr(stripslashes($value)));
+ }
+ }
+ }
+
+ $sql = sprintf("%s WHERE %s = '%s'",$sql, $this->IdField(), $this->UniqueId());
+
+ if($this->debuglevel>0)
+ echo $sql."<br>";
+ if ($this->adodbConnection->Execute($sql) === false)
+ {
+ $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Update");
+ return false;
+ }
+
+ if ($objSession->GetVariable("HasChanges") == 2) {
+ $objSession->SetVariable("HasChanges", 1);
+ }
+
+ /* if ($this->adodbConnection->Affected_Rows() > 0) {
+ $objSession->SetVariable("HasChanges", 1);
+ }*/
+
+ return true;
+ }
+
+ function LoadFromDatabase($Id)
+ {
+ global $Errors;
+
+ if(!isset($Id))
+ {
+ $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase");
+ return false;
+ }
+
+ $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ImageId = '%s'",$Id);
+
+ $result = $this->adodbConnection->Execute($sql);
+ if ($result === false || $result->EOF)
+ {
+ $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
+ return false;
+ }
+
+ $data = $result->fields;
+
+ $this->SetFromArray($data);
+ $this->Clean();
+ return true;
+ }
+
+ function LoadFromResource($Id,$ImageIndex)
+ {
+ global $Errors;
+
+ if(!isset($Id) || !isset($ImageIndex))
+ {
+ $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromResource");
+ return false;
+ }
+
+ $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ResourceId = '%s'AND ImageIndex = '%s'",$Id,$ImageIndex);
+
+ $result = $this->adodbConnection->Execute($sql);
+ if ($result === false || $result->EOF)
+ {
+ // $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromResource");
+ return false;
+ }
+
+ $data = $result->fields;
+
+ $this->SetFromArray($data);
+
+ return true;
+ }
+
+ function LocalImageExists()
+ {
+ global $objConfig, $pathtoroot;
+ $result=FALSE;
+ if($this->Get("LocalImage")==1 && $this->Get("SameImages")==0)
+ {
+ $imagepath = $pathtoroot.$this->Get("LocalPath");
+ // $imagepath = $this->GetImageDir().$this->GetFileName();
+
+ // echo "PATH: ".$this->GetImageDir()."; FILE: ".$this->GetFileName()."<BR>";
+
+ if(strlen($imagepath)>0)
+ {
+ $result = file_exists($imagepath);
+ }
+ }
+ return $result;
+ }
+
+ function LocalThumbExists()
+ {
+ $result=FALSE;
+ global $objConfig, $pathtoroot;
+
+ if($this->Get("LocalThumb")==1)
+ {
+ //$imagepath = $pathtoroot.$this->Get("ThumbPath");
+ $imagepath = $this->GetImageDir().$this->GetFileName(1);
+ if(strlen($imagepath)>0)
+ {
+ $result = file_exists($imagepath);
+ }
+ }
+ return $result;
+ }
+
+
+ function DeleteLocalImage($Thumb=TRUE,$Full=TRUE)
+ {
+ global $pathtoroot;
+
+ if($Full)
+ {
+ if($this->LocalImageExists())
+ {
+ // $filename = $this->GetImageDir().$this->GetFileName();
+ $filename = $pathtoroot.$this->Get("LocalPath");
+ // echo "FULL: $filename<BR>\n";
+ @unlink($filename);
+ }
+ }
+
+ if($Thumb)
+ {
+ if($this->LocalThumbExists())
+ {
+ $filename = $this->GetImageDir().$this->GetFileName(1);
+ // echo "THUMB: $filename<BR>\n";
+ @unlink($filename);
+ }
+ }
+ }
+
+ function StoreUploadedImage($file, $rewrite_name=1,$DestDir,$IsThumb=0,$IsUpload=TRUE)
+ {
+ /* move the uploaded image to its final location and update the LocalPath property */
+ /* returns the destination filename on success */
+ global $objConfig,$pathtoroot;
+
+ $Dest_Dir = $DestDir;
+ if($this->Pending)
+ $Dest_Dir .= "pending/";
+
+ if(((int)$file["error"]==0) && (substr($file["type"],0,6)=="image/") && @getimagesize($file["tmp_name"]) )
+ {
+ $parts = pathinfo($file["name"]);
+ $ext = strtolower($parts["extension"]);
+
+ if( $GLOBALS['debuglevel'] ) echo "Processing ".$file["tmp_name"]."<br>\n";
+
+ if($rewrite_name==1)
+ {
+
+ if($IsThumb)
+ $filename = "th_";
+ $filename .= $this->Get("ResourceId")."_".$this->Get("ImageIndex").".".$ext;
+ }
+ else
+ {
+ $filename = $file["name"];
+ }
+ $destination = $pathtoroot.$Dest_Dir.$filename;
+ if( $GLOBALS['debuglevel'] ) echo $file["tmp_name"]."=>".$destination."<br>\n";
+ if($IsUpload==TRUE)
+ {
+ $result = @move_uploaded_file($file["tmp_name"],$destination);
+ }
+ else
+ $result = copy($file["tmp_name"],$destination);
+ if($result)
+ {
+ @chmod($destination, 0666);
+ return $Dest_Dir.$filename;
+ }
+ else
+ return "";
+ }
+ else
+ return "";
+ }
+
+ function CopyToPending()
+ {
+ global $pathtoroot;
+
+ $ThumbPath = (strlen($this->Get("ThumbPath"))>0) ? $pathtoroot.$this->Get("ThumbPath") : '';
+ $FullPath = strlen($this->Get("LocalPath")) ? $pathtoroot.$this->Get("LocalPath") : '';
+
+ $dest = $this->GetImageDir()."pending/";
+
+
+ // echo "DESTIN DIR: $dest<BR>";
+ // echo "THUMB PATH: $ThumbPath <BR>";
+
+ if(strlen($ThumbPath))
+ {
+ if(file_exists($ThumbPath))
+ {
+ $p = pathinfo($ThumbPath);
+ $d = $dest.$p["basename"];
+ if(file_exists($d))
+ unlink($d);
+ copy($ThumbPath,$d);
+ @chmod($ThumbPath.$d, 0666);
+ }
+ }
+
+
+ if(strlen($FullPath))
+ {
+ if(file_exists($FullPath))
+ {
+ $p = pathinfo($FullPath);
+ $d = $dest.$p["basename"];
+ if(file_exists($d))
+ unlink($d);
+ copy($FullPath,$d);
+ @chmod($FullPath.$d, 0666);
+ }
+ }
+ }
+
+ function CopyFromPending()
+ {
+ global $pathtoroot,$pathchar;
+
+ $ThumbPath = $this->Get("ThumbPath");
+ $FullPath = $this->Get("LocalPath");
+
+ // $src = $this->GetImageDir()."pending/";
+ $src = $this->GetImageDir();
+
+ if(strlen($ThumbPath))
+ {
+ if(strpos($ThumbPath,"pending/"))
+ {
+ if(file_exists($pathtoroot.$ThumbPath))
+ {
+ $path = pathinfo($pathtoroot.$ThumbPath);
+ $p = explode("/",$ThumbPath);
+ unset($p[count($p)-2]);
+
+ $d = $pathtoroot.implode("/",$p);
+
+ if(file_exists($d))
+ unlink($d);
+
+ copy($pathtoroot.$ThumbPath,$d);
+ @chmod($pathtoroot.$ThumbPath.$d, 0666);
+ unlink($pathtoroot.$ThumbPath);
+ }
+
+ }
+ }
+ if(strlen($FullPath))
+ {
+ if(file_exists($pathtoroot.$FullPath))
+ {
+ if(strpos($FullPath,"pending/"))
+ {
+ $path = pathinfo($pathtoroot.$FullPath);
+ $p = explode("/",$FullPath);
+ unset($p[count($p)-2]);
+
+ $d = $pathtoroot.implode("/",$p);
+
+ if(file_exists($d))
+ unlink($d);
+ copy($pathtoroot.$FullPath,$d);
+ @chmod($pathtoroot.$FullPath.$d, 0666);
+ unlink($pathtoroot.$FullPath);
+ }
+ }
+ }
+ }
+
+ function DeleteFromPending()
+ {
+ global $pathtoroot;
+ $ThumbPath = $pathtoroot.$this->Get("ThumbPath");
+ $FullPath = $pathtoroot.$this->Get("LocalPath");
+
+ $src = $this->GetImageDir()."pending/";
+ $p = pathinfo($ThumbPath);
+ $d = $src.$p["basename"];
+ if(file_exists($d))
+ @unlink($d);
+
+ $p = pathinfo($FullPath);
+ $d = $src.$p["basename"];
+ if(file_exists($d))
+ @unlink($d);
+ }
+
+ function RenameFiles($OldResId,$NewResId)
+ {
+ global $pathtoroot;
+
+ if($this->Pending)
+ {
+ $ThumbPath = $this->GetImageDir().$this->GetFileName(TRUE);
+ }
+ else
+ $ThumbPath = $pathtoroot.$this->Get("ThumbPath");
+ $parts = pathinfo($ThumbPath);
+ $ext = $parts["extension"];
+ $pending="";
+ if($this->Pending)
+ {
+ $pending="pending/";
+ $FullPath = $this->GetImageDir().$this->GetFileName(FALSE);
+ }
+ else
+ $FullPath = $pathtoroot.$this->Get("LocalPath");
+
+ $NewThumb = $pathtoroot."kernel/images/".$pending."th_$NewResId_".$this->Get("ImageIndex").".$ext";
+ $NewFull = $pathtoroot."kernel/images/".$pending."$NewResId_".$this->Get("ImageIndex").".$ext";
+ if(file_exists($ThumbPath))
+ {
+ @rename($ThumbPath,$NewThumb);
+ }
+
+ if(file_exists($FullPath))
+ {
+ @rename($FullPath,$NewFull);
+ }
+
+ }
+
+ function ReplaceImageFile($file)
+ {
+ global $objConfig;
+
+ if($file["error"]==0)
+ {
+ $this->DeleteLocalImage();
+ move_uploaded_file($file,$this->Get("LocalPath"));
+ @chmod($this->Get("LocalPath"), 0666);
+ }
+ }
+
+ function FullURL($ForceNoThumb=FALSE,$Default="kernel/images/noimage.gif")
+ {
+ global $rootURL, $objConfig,$pathtoroot;
+
+ if($this->Get('SameImages') && !$ForceNoThumb)
+ if (!(($this->Get('LocalImage') && strlen($this->Get('LocalPath'))) ||
+ ($this->Get('LocalImage') == 0 && strlen($this->Get('Url')))))
+ {
+ return $this->ThumbURL();
+ }
+
+ if(strlen($this->Get("Url")))
+ return $this->Get("Url");
+ if($this->Get("LocalImage")=="1")
+ {
+ $url = $this->Get("LocalPath");
+ //$url = $this->GetImageDir().$this->GetFileName();
+ if(file_exists($pathtoroot.$url))
+ {
+ if(strlen($url))
+ {
+ $url = $rootURL.$url;
+ return $url;
+ }
+ else
+ {
+ if(strlen($Default))
+ $url = $rootURL.$Default;
+ return $url;
+ }
+ }
+ else
+ {
+ if(strlen($Default))
+ {
+ return $rootURL.$Default;
+ }
+ else
+ return "";
+ }
+ }
+ else
+ {
+ if(strlen($Default))
+ {
+ return $rootURL.$Default;
+ }
+ else
+ return "";
+ }
+ }
+
+ function ThumbURL()
+ {
+ global $rootURL, $pathtoroot, $objConfig;
+
+ if(strlen($this->Get("ThumbUrl")))
+ {
+ return $this->Get("ThumbUrl");
+ }
+
+ if($this->Get("LocalThumb")=="1")
+ {
+ $url = $this->Get("ThumbPath");
+ //$url = $this->GetImageDir().$this->GetFileName();
+ if(file_exists($pathtoroot.$url))
+ {
+ if(strlen($url))
+ {
+ $url = $rootURL.$url;
+ }
+ else
+ $url = $rootURL."kernel/images/noimage.gif";
+ return $url;
+ }
+ else
+ return $rootURL."kernel/images/noimage.gif";
+ }
+ else
+ {
+ return $rootURL."kernel/images/noimage.gif";
+ }
+ }
+
+ function ParseObject($element)
+ {
+ $extra_attribs = ExtraAttributes($element->attributes);
+ if(strtolower($element->name)==$this->TagPrefix)
+ {
+ $field = strtolower($element->attributes["_field"]);
+ switch($field)
+ {
+ case "name":
+ $ret = $this->Get("Name");
+ break;
+ case "alt":
+ $ret = $this->Get("AltName");
+ break;
+ case "full_url":
+ $ret = $this->FullURL();
+ break;
+ case "thumb_url":
+ $ret = $this->ThumbURL();
+ break;
+ }
+ }
+ else
+ $ret = $element->Execute();
+ return $ret;
+ }
+
+ function parsetag($tag)
+ {
+ if(is_object($tag))
+ {
+ $tagname = $tag->name;
+ }
+ else
+ $tagname = $tag;
+ switch($tagname)
+ {
+ case "image_name":
+ $ret = $this->Get("Name");
+ break;
+ case "image_alt":
+ $ret = $this->Get("AltName");
+ break;
+ case "image_url":
+ $ret = $this->FullURL();
+ break;
+ case "thumb_url":
+ $ret = $this->ThumbURL();
+ break;
+ }
+ return $ret;
+ }
+
+ //Changes priority
+ function MoveUp()
+ {
+ $this->Increment("Priority");
+ }
+
+ function MoveDown()
+ {
+ $this->Decrement("Priority");
+ }
+
+ function GetMaxPriority()
+ {
+ $SourceId = $this->Get("ResourceId");
+ $sql = "SELECT MAX(Priority) as p from ".$this->tablename."WHERE ResourceId=$SourceId";
+ $result = $this->adodbConnection->Execute($sql);
+ return $result->fields["p"];
+ }
+
+ function GetMinPriority()
+ {
+ $SourceId = $this->Get("ResourceId");
+ $sql = "SELECT MIN(Priority) as p from ".$this->tablename."WHERE ResourceId=$SourceId";
+ $result = $this->adodbConnection->Execute($sql);
+ return $result->fields["p"];
+ }
+
+ function UpdatePriority()
+ {
+ $SourceId = $this->Get("ResourceId");
+ $sql = "SELECT MAX(Priority) as p from ".$this->tablename."WHERE ReourceId=$SourceId";
+ $result = $this->adodbConnection->Execute($sql);
+ $this->Set("Priority", $result->fields["p"]+1);
+ }
+
+ function MakeThumbnail () {
+
+ }
+}
+
+class clsImageList extends clsItemCollection
+{
+ var $Page;
+ var $PerPageVar;
+
+ function clsImageList()
+ {
+ global $objConfig;
+ $this->clsItemCollection();
+ $this->PerPageVar = "Perpage_Images";
+ $this->PerPage = $objConfig->Get($this->PerPageVar);
+ $this->SourceTable = GetTablePrefix()."Images";
+ $this->classname = "clsImage";
+ }
+
+ function LoadImages($where="",$orderBy = "")
+ {
+ global $objConfig;
+
+ $this->Clear();
+ if($this->Page<1)
+ $this->Page=1;
+
+ if(is_numeric($objConfig->Get("Perpage_Images")))
+ {
+ $Start = ($this->Page-1)*$objConfig->Get("Perpage_Images");
+ $limit = "LIMIT ".$Start.",".$objConfig->Get("Perpage_Images");
+ }
+ else
+ $limit = NULL;
+
+
+ $this->QueryItemCount=TableCount("Images",$where,0);
+ //echo $this->QueryItemCount."<br>\n";
+ if(strlen(trim($orderBy))>0)
+ {
+ $orderBy = "Priority DESC, ".$orderBy;
+ }
+ else
+ $orderBy = "Priority DESC";
+
+ return $this->Query_Images($where,$orderBy,$limit);
+ }
+
+ function Query_Images($whereClause,$orderByClause=NULL,$limit=NULL)
+ {
+ global $objSession, $Errors;
+
+ $sql = "SELECT * FROM ".$this->SourceTable;
+
+ if(isset($whereClause))
+ $sql = sprintf('%s WHERE %s',$sql,$whereClause);
+ if(isset($orderByClause) && strlen(trim($orderByClause))>0)
+ $sql = sprintf('%s ORDER BY %s',$sql,$orderByClause);
+ if(isset($limit) && strlen(trim($limit)))
+ $sql .= " ".$limit;
+ //echo $sql;
+ return $this->Query_Item($sql);
+ }
+
+ function &Add($Name, $Alt, $ResourceId, $LocalImage, $LocalThumb,
+ $Url, $ThumbUrl, $Enabled=1, $Priority=0, $DefaultImg=0, $ImageIndex=0,
+ $SameImages=0, $ImageId=-999)
+ {
+ if($DefaultImg==1)
+ {
+ $sql = "UPDATE ".$this->SourceTable." SET DefaultImg=0 WHERE ResourceId=$ResourceId";
+ $this->adodbConnection->Execute($sql);
+ }
+
+ $img = new clsImage();
+ $img->tablename = $this->SourceTable;
+ $img->Set(array("Name","AltName","ResourceId","LocalImage","LocalThumb",
+ "Url","ThumbUrl","Enabled","Priority","DefaultImg","ImageIndex","SameImages"),
+ array($Name,$Alt,$ResourceId,$LocalImage,$LocalThumb,
+ $Url,$ThumbUrl,$Enabled,$Priority,$DefaultImg,$ImageIndex,$SameImages));
+
+ if ($ImageId != -999)
+ {
+ $img->Set("ImageId", $ImageId);
+ }
+
+ if((int)$ImageIndex==0)
+ $img->Set("ImageIndex",$this->GetNextImageIndex($ResourceId));
+ $img->Create();
+ array_push($this->Items,$img);
+ return $img;
+ }
+
+
+ function Edit($ImageId,$Name, $Alt, $ResourceId, $LocalImage, $LocalThumb,
+ $Url, $ThumbUrl, $Enabled=1, $Priority=0, $DefaultImg=0, $ImageIndex=0,
+ $SameImages=0)
+ {
+ $img = $this->GetItem($ImageId);
+
+ if((int)$ImageIndex==0)
+ $ImageIndex = $img->Get("ImageIndex");
+
+ if(!strlen($ThumbUrl) && !$LocalThumb)
+ $ThumbUrl = $img->Get("ThumbUrl");
+
+ $img->Set(array("Name","AltName","ResourceId","LocalImage","LocalThumb",
+ "Url","ThumbUrl","Enabled","Priority","DefaultImg","ImageIndex","SameImages"),
+ array($Name, $Alt, $ResourceId, $LocalImage, $LocalThumb,
+ $Url, $ThumbUrl, $Enabled, $Priority, $DefaultImg, $ImageIndex,$SameImages));
+
+ if((int)$ImageIndex==0)
+ $img->Set("ImageIndex",$this->GetNextImageIndex($ResourceId));
+
+ $img->Update();
+
+ if($DefaultImg==1)
+ {
+ $sql = "UPDATE ".$this->SourceTable." SET DefaultImg=0 WHERE ResourceId=".$ResourceId." AND ImageId !=$ImageId";
+ $this->adodbConnection->Execute($sql);
+ }
+ array_push($this->Items,$img);
+
+ return $img;
+ }
+
+ function Delete_Image($ImageId)
+ {
+ $i = $this->GetItem($ImageId);
+ $i->Delete();
+ }
+
+ function DeleteResource($ResourceId)
+ {
+ $this->Clear();
+ $images = $this->Query_Images("ResourceId=".$ResourceId);
+ if(is_array($images))
+ {
+ foreach($images as $i)
+ {
+ $i->Delete();
+ }
+ }
+ }
+
+ function LoadResource($ResourceId)
+ {
+ $sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=$ResourceId";
+ $this->Query_Item($sql);
+ }
+
+ function CopyResource($SourceId, $DestId, $main_prefix)
+ {
+ global $pathtoroot;
+
+ $this->Clear();
+ $this->LoadResource($SourceId);
+ foreach($this->Items as $i)
+ {
+ if($i->Get("LocalThumb"))
+ {
+ $f = $pathtoroot.$i->Get("ThumbPath");
+ if(file_exists($f))
+ {
+ $p = pathinfo($f);
+ $dir = $p["dirname"];
+ $ext = $p["extension"];
+ $newfile = $dir."/th_".$DestId."_".$i->Get("ImageIndex").".".$ext;
+ if(file_exists($newfile))
+ @unlink($newfile);
+ // echo $f." -> ".$newfile;
+ copy($f,$newfile);
+ }
+ }
+ if($i->Get("LocalImage"))
+ {
+ $f = $pathtoroot.$i->Get("LocalPath");
+ if(file_exists($f))
+ {
+ $p = pathinfo($f);
+ $dir = $p["dirname"];
+ $ext = $p["extension"];
+ $newfile = $dir."/".$DestId."_".$i->Get("ImageIndex").".".$ext;
+ if(file_exists($newfile))
+ @unlink($newfile);
+
+ // echo $f." -> ".$newfile;
+ copy($f,$newfile);
+ }
+ }
+ }
+ parent::CopyResource($SourceId, $DestId, $main_prefix);
+ $this->Clear();
+ $this->LoadResource($DestId);
+ foreach($this->Items as $img)
+ {
+ if($img->Get("LocalThumb"))
+ {
+ $f = str_replace("th_$SourceId","th_$DestId",$img->Get("ThumbPath"));
+ $img->Set("ThumbPath",$f);
+ }
+ if($img->Get("LocalImage"))
+ {
+ $f = str_replace("/".$SourceId."_","/".$DestId."_",$img->Get("LocalPath"));
+ $img->Set("LocalPath",$f);
+ }
+ $img->Update();
+ }
+ }
+
+ function GetImageByResource($ResourceId,$Index)
+ {
+ $found=FALSE;
+ if($this->NumItems()>0)
+ {
+ foreach($this->Items as $i)
+ {
+ if($i->Get("ResourceID")==$ResourceId and ($i->Get("ImageIndex")==$Index))
+ {
+ $found=TRUE;
+ break;
+ }
+ }
+ }
+ if(!$found)
+ {
+ $i = NULL;
+ $i = new clsImage();
+ if($i->LoadFromResource($ResourceId,$Index))
+ {
+ array_push($this->Items, $i);
+ }
+ else
+ unset($i);
+ }
+ if(is_object($i))
+ {
+ return $i;
+ }
+ else
+ return FALSE;
+ }
+
+ function &GetDefaultImage($ResourceId)
+ {
+ $sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=$ResourceId AND DefaultImg=1";
+ $rs = $this->adodbConnection->Execute($sql);
+ if($rs && ! $rs->EOF)
+ {
+ $data = $rs->fields;
+ $img= new clsImage();
+ $img->SetFromArray($data);
+ $img->Clean();
+ return $img;
+ }
+ else
+ return FALSE;
+ }
+
+ function &GetAvatarImage($ResourceId)
+ {
+ $sql = 'SELECT *
+ FROM '.$this->SourceTable.'
+ WHERE ResourceId = '.(int)$ResourceId.' AND Name = "avatar" AND Enabled = 1
+ LIMIT 1';
+ $rs = $this->adodbConnection->Execute($sql);
+ if($rs && ! $rs->EOF)
+ {
+ $data = $rs->fields;
+ $img= new clsImage();
+ $img->SetFromArray($data);
+ $img->Clean();
+ return $img;
+ }
+ else {
+ return false;
+ }
+ }
+
+ function HandleImageUpload($FILE,$ResourceId,$RelatedTo,$DestDir, $Name="",$AltName="",$IsThumb=0)
+ {
+ global $objConfig;
+
+ $img = $this->GetImageByResource($ResourceId,$RelatedTo);
+
+ if(is_object($img) && $RelatedTo>0)
+ {
+ $img->Set("LocalImage",1);
+ $img->Set("Name",$Name);
+ $img->Set("AltName",$AltName);
+ $img->Set("IsThumbnail",$IsThumb);
+ $dest = $img->StoreUploadedImage($FILE,1,$DestDir);
+ if(strlen($dest))
+ {
+ $img->Set("Url", $objConfig->Get("Site_Path").$dest);
+ $img->Update();
+ }
+ }
+ else
+ {
+ $img=$this->NewLocalImage($ResourceId,$RelatedTo,$Name,$AltName,$IsThumb,$FILE,$DestDir);
+ }
+ return $img;
+ }
+
+ function GetResourceImages($ResourceId)
+ {
+ $sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=".$ResourceId;
+ $rs = $this->adodbConnection->Execute($sql);
+ while($rs && !$rs->EOF)
+ {
+ $img = new clsImage();
+ $img->LoadFromResource($ResourceId,$rs->fields["RelatedTo"]);
+ array_push($this->Images,$img);
+ $rs->MoveNext();
+ }
+ }
+
+ function GetResourceThumbnail($ResourceId)
+ {
+ $found=FALSE;
+ foreach($this->Images as $img)
+ {
+ if($img->Get("ResourceId")==$ResourceId && $img->Get("IsThumbnail")==1)
+ {
+ $found=TRUE;
+ break;
+ }
+ }
+ if($found)
+ {
+ return $img;
+ }
+ else
+ return FALSE;
+ }
+
+ function &GetImageByName($ResourceId, $name, $enabled=0)
+ {
+ $found = FALSE;
+ foreach($this->Items as $img)
+ {
+ $search_condition = ($img->Get("ResourceId")==$ResourceId && $img->Get("Name")==$name);
+ if ($enabled)
+ {
+ $search_condition = $search_condition && $img->Get("Enabled");
+ }
+ if($search_condition)
+ {
+ $found=TRUE;
+ break;
+ }
+ }
+ if($found)
+ {
+ return $img;
+ }
+ else
+ {
+ $sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=$ResourceId AND Name LIKE '$name'";
+ if ($enabled)
+ {
+ $sql = $sql.' AND Enabled=1';
+ }
+ //echo $sql;
+ $rs = $this->adodbConnection->Execute($sql);
+ if($rs && !$rs->EOF)
+ {
+ $img = $this->AddItemFromArray($rs->fields);
+ return $img;
+ }
+ else
+ return FALSE;
+ }
+ }
+
+ function CopyToPendingFiles()
+ {
+ $sql = "SELECT * FROM ".$this->SourceTable;
+ $this->Clear();
+ $this->Query_Item($sql);
+ foreach($this->Items as $i)
+ {
+ if(strlen($i->Get("LocalImage")) || strlen($i->Get("LocalThumb")))
+ {
+ $i->CopyToPending();
+ }
+ }
+ }
+
+ function CopyFromPendingFiles($edit_table)
+ {
+ $sql = "SELECT * FROM ".$edit_table;
+ $this->Clear();
+ $this->Query_Item($sql);
+ foreach($this->Items as $i)
+ {
+
+ ## Delete original Images
+ $OrgImage = new clsImage($i->Get("ImageId"));
+ $OrgImage->DeleteLocalImage();
+
+ if($i->Get("LocalImage") || $i->Get("LocalThumb"))
+ {
+ $i->CopyFromPending();
+
+ $t = $i->Get("LocalPath");
+
+ $p = pathinfo($t);
+ $p_arr = explode("/", $p['dirname']);
+ if (eregi("pending", $p_arr[count($p_arr)-1]))
+ {
+ unset($p_arr[count($p_arr)-1]);
+ $p['dirname'] = implode("/", $p_arr);
+ $LocalPath = $p['dirname']."/".$p['basename'];
+ $i->Set("LocalPath", $LocalPath);
+ }
+
+ $t = $i->Get("ThumbPath");
+ $p = pathinfo($t);
+
+ $p_arr = explode("/", $p['dirname']);
+ if (eregi("pending", $p_arr[count($p_arr)-1]))
+ {
+ unset($p_arr[count($p_arr)-1]);
+ $p['dirname'] = implode("/", $p_arr);
+ $ThumbPath = $p['dirname']."/".$p['basename'];
+ $i->Set("ThumbPath", $ThumbPath);
+ }
+
+ $i->tablename = $edit_table;
+
+ $update = 1;
+ }
+
+ ## Empty the fields if are not used
+ if (!$i->Get("LocalImage"))
+ {
+ $i->Set("LocalPath", "");
+ $update = 1;
+ }
+
+ if (!$i->Get("LocalThumb"))
+ {
+ $i->Set("ThumbPath", "");
+ $update = 1;
+ }
+
+ if ($update)
+ $i->Update();
+
+ }
+ }
+
+ function DeletePendingFiles($edit_table)
+ {
+ $sql = "SELECT * FROM ".$edit_table;
+ $this->Clear();
+ $this->Query_Item($sql);
+ foreach($this->Items as $i)
+ {
+ $i->DeleteFromPending();
+ }
+ }
+
+ function CopyToEditTable($idfield, $idlist)
+ {
+ global $objSession;
+
+ $edit_table = $objSession->GetEditTable($this->SourceTable);
+ @$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
+ if(is_array($idlist))
+ {
+ $list = implode(",",$idlist);
+ }
+ else
+ $list = $idlist;
+ $query = "SELECT * FROM ".$this->SourceTable." WHERE $idfield IN ($list)";
+ $insert = "CREATE TABLE ".$edit_table." ".$query;
+ if($objSession->HasSystemPermission("DEBUG.LIST"))
+ echo htmlentities($insert,ENT_NOQUOTES)."<br>\n";
+ $this->adodbConnection->Execute($insert);
+ $this->SourceTable = $edit_table;
+ $this->CopyToPendingFiles();
+
+ $this->UpdateFilenamesToPendings();
+ }
+
+ function UpdateFilenamesToPendings()
+ {
+ global $objSession;
+
+ $edit_table = $this->SourceTable;
+
+ $sql = "SELECT * FROM ".$edit_table." WHERE (LocalPath!='' AND LocalPath IS NOT NULL) OR (ThumbPath!='' AND ThumbPath IS NOT NULL)";
+ $this->Clear();
+ $this->Query_Item($sql);
+
+ foreach($this->Items as $i)
+ {
+ $set = "";
+ $ImageId = $i->Get("ImageId");
+
+ ## Update Local Image Path -> add "pending/" to PATH
+ if (strlen($i->Get("LocalPath")))
+ {
+ $p = pathinfo($i->Get("LocalPath"));
+ if (!eregi("/pending $", $p['dirname']))
+ {
+ $LocalPath = $p['dirname']."/pending/".$p['basename'];
+ $set = "SET LocalPath='$LocalPath'";
+ }
+ }
+
+ // echo "LocalImage: ".$i->Get("LocalImage").", PATH: ".$i->Get("LocalPath")."<BR>";
+
+ ## Update Local Thumb Path -> add "pending/" to PATH
+ if (strlen($i->Get("ThumbPath")))
+ {
+ $p = pathinfo($i->Get("ThumbPath"));
+ if (!eregi("/pending $", $p['dirname']))
+ {
+ $LocalThumb = $p['dirname']."/pending/".$p['basename'];
+ if (strlen($set))
+ $set.= ", ThumbPath='$LocalThumb'";
+ else
+ $set = "SET ThumbPath='$LocalThumb'";
+ }
+ }
+
+ // echo "LocalThumb: ".$i->Get("LocalThumb").", PATH: ".$i->Get("ThumbPath")."<BR>";
+
+ if (strlen($set))
+ {
+ $sql = "UPDATE $edit_table $set WHERE ImageId=$ImageId";
+ if($objSession->HasSystemPermission("DEBUG.LIST"))
+ echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
+ $this->adodbConnection->Execute($sql);
+ }
+ }
+ }
+
+ function CopyFromEditTable($idfield)
+ {
+ global $objSession;
+ $GLOBALS['_CopyFromEditTable']=1;
+
+ $edit_table = $objSession->GetEditTable($this->SourceTable);
+ $dummy =& $this->GetDummy();
+ if( !$dummy->TableExists($edit_table) )
+ {
+ echo 'ERROR: Table "<b>'.$edit_table.'</b>" missing (class: <b>'.get_class($this).'</b>)<br>';
+ //exit;
+ return;
+ }
+
+ $rs = $this->adodbConnection->Execute("SELECT * FROM $edit_table WHERE ResourceId=0");
+ while($rs && !$rs->EOF)
+ {
+ $id = $rs->fields["ImageId"];
+ if($id>0)
+ {
+ $img = $this->GetItem($id);
+ $img->Delete();
+ }
+ $rs->MoveNext();
+ }
+ $this->adodbConnection->Execute("DELETE FROM $edit_table WHERE ResourceId=0");
+ $this->CopyFromPendingFiles($edit_table);
+ parent::CopyFromEditTable($idfield);
+ unset($GLOBALS['_CopyFromEditTable']);
+ }
+
+ function PurgeEditTable($idfield)
+ {
+ global $objSession;
+
+ $edit_table = $objSession->GetEditTable($this->SourceTable);
+ $this->DeletePendingFiles($edit_table);
+ @$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
+ }
+
+ function GetNextImageIndex($ResourceId)
+ {
+ $sql = "SELECT MAX(ImageIndex) as MaxVal FROM ".$this->SourceTable." WHERE ResourceId=".$ResourceId;
+ $rs = $this->adodbConnection->Execute($sql);
+ if($rs)
+ {
+ $val = (int)$rs->fields["MaxVal"];
+ $val++;
+ }
+ return $val;
+ }
+
+ function GetMaxPriority($ResourceId)
+ {
+ $sql = "SELECT MAX(Priority) as p from ".$this->SourceTable."WHERE ResourceId=$ResourceId";
+ $result = $this->adodbConnection->Execute($sql);
+ return $result->fields["p"];
+ }
+
+ function GetMinPriority($ResourceId)
+ {
+ $sql = "SELECT MIN(Priority) as p from ".$this->SourceTable."WHERE ResourceId=$ResourceId";
+ $result = $this->adodbConnection->Execute($sql);
+ return $result->fields["p"];
+ }
+
+} /*clsImageList*/
+
+?>
Property changes on: branches/unlabeled/unlabeled-1.21.2/kernel/include/image.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.21
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.21.2/core/units/languages/languages_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.21.2/core/units/languages/languages_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.21.2/core/units/languages/languages_config.php (revision 7644)
@@ -0,0 +1,180 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'lang',
+ 'ItemClass' => Array('class'=>'LanguagesItem','file'=>'languages_item.php','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'LanguagesEventHandler','file'=>'languages_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'LanguagesTagProcessor','file'=>'languages_tag_processor.php','build_event'=>'OnBuild'),
+ 'RegisterClasses' => Array(
+ Array('pseudo'=>'LangXML','class'=>'LangXML_Parser','file'=>'import_xml.php'),
+ ),
+
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => Array('OnSave'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnReflectMultiLingualFields',
+ ),
+
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => Array('OnPreSave'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnCopyLabels',
+ ),
+
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnSave'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnUpdatePrimary',
+ ),
+
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'lang',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnSave','OnMassDelete'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnScheduleTopFrameReload',
+ ),
+
+ ),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+ 'IDField' => 'LanguageId',
+
+ 'StatusField' => Array('Enabled','PrimaryLang'), // field, that is affected by Approve/Decline events
+
+ 'TitleField' => 'PackName', // field, used in bluebar when editing existing item
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('lang'=>'!la_title_Adding_Language!'),
+ 'edit_status_labels' => Array('lang'=>'!la_title_Editing_Language!'),
+ 'new_titlefield' => Array('lang'=>'!la_title_New_Language!'),
+ ),
+
+ 'languages_list' => Array( 'prefixes' => Array('lang_List'), 'format' => "!la_title_Configuration! - !la_title_LanguagePacks! (#lang_recordcount#)"),
+
+ 'languages_edit_general' => Array( 'prefixes' => Array('lang'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_General!"),
+
+ 'phrases_list' => Array( 'prefixes' => Array('lang','phrases_List'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_Labels! (#phrases_recordcount#)"),
+
+ 'import_language' => Array( 'prefixes' => Array('phrases.import'), 'format' => "!la_title_InstallLanguagePackStep1!"),
+
+ 'import_language_step2' => Array( 'prefixes' => Array('phrases.import'), 'format' => "!la_title_InstallLanguagePackStep2!"),
+
+ 'export_language' => Array( 'prefixes' => Array('phrases.export'), 'format' => "!la_title_ExportLanguagePackStep1!"),
+
+ 'export_language_results' => Array( 'prefixes' => Array('phrases.export'), 'format' => "!la_title_ExportLanguagePackResults!"),
+
+ 'events_list' => Array( 'prefixes' => Array('lang','emailevents_List'), 'format' => "#lang_status# '#lang_titlefield#' - !la_title_EmailEvents! (#emailevents_recordcount#)"),
+
+ 'event_edit' => Array( 'prefixes' => Array('emailevents'),
+ 'edit_status_labels' => Array('emailevents' => '!la_title_Editing_EmailEvent!'),
+ 'format' => '#emailevents_status# - #emailevents_titlefield#'),
+
+ 'email_messages_edit' => Array( 'prefixes' => Array('lang','emailmessages'),
+ 'new_titlefield' => Array('emailmessages' => '!la_NoSubject!'),
+ 'format' => "#lang_status# '#lang_titlefield#' - !la_title_EditingEmailEvent! '#emailmessages_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-portal:configure_lang'),
+
+ 'Sections' => Array(
+ 'in-portal:configure_lang' => Array(
+ 'parent' => 'in-portal:system',
+ 'icon' => 'conf_regional',
+ 'label' => 'la_tab_Regional',
+ 'url' => Array('t' => 'regional/languages_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:set_primary', 'advanced:import', 'advanced:export'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Language',
+ 'SubItems' => Array('phrases','emailmessages'),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array(0,1), 'type' => WHERE_FILTER),
+ ),
+
+ 'Filters' => Array(
+ 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ),
+ 1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ),
+ )
+ ),
+
+ 'AutoDelete' => true,
+
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
+ ),
+ 'ListSortings' => Array(
+ '' => Array(
+ 'Sorting' => Array('PackName' => 'asc'),
+ )
+ ),
+ 'Fields' => Array(
+ 'LanguageId' => Array(),
+ 'PackName' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ 'LocalName' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ 'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Disabled', 1 => 'la_Enabled'), 'use_phrases' => 1, 'not_null' => '1', 'default' => 1),
+ 'PrimaryLang' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'IconURL' => Array('type' => 'string','default' => ''),
+ 'DateFormat' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ 'TimeFormat' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ 'InputDateFormat' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('m/d/Y' => 'm/d/Y', 'd/m/Y' => 'd/m/Y'), 'not_null' => '1','default' => 'm/d/Y', 'required' => 1),
+ 'InputTimeFormat' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('g:i:s A' => 'g:i:s A', 'g:i A' => 'g:i A', 'H:i:s' => 'H:i:s', 'H:i' => 'H:i' ), 'not_null' => '1','default' => 'g:i:s A', 'required' => 1),
+ 'DecimalPoint' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'ThousandSep' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'Charset' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
+ 'UnitSystem' => Array('type' => 'int','not_null' => '1','default' => '1','formatter' => 'kOptionsFormatter','options' => Array(1 => 'la_Metric', 2 => 'la_US_UK'),'use_phrases' => 1),
+ ),
+
+ 'VirtualFields' => Array(
+ 'CopyLabels' => Array('type' => 'int', 'default' => 0),
+ 'CopyFromLanguage' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Language ORDER BY PackName', 'option_title_field' => 'PackName', 'option_key_field' => 'LanguageId'),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif','0_0'=>'icon16_language_disabled.gif','1_0'=>'icon16_language.gif','0_1'=>'icon16_language_disabled.gif','1_1'=>'icon16_language_primary.gif'),
+ 'Fields' => Array(
+ 'PackName' => Array( 'title'=>'la_col_PackName', 'data_block' => 'grid_checkbox_td'),
+ 'LocalName' => Array( 'title'=>'la_col_LocalName' ),
+ 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.21.2/core/units/languages/languages_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.21
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.21.2/core/units/admin/admin_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.21.2/core/units/admin/admin_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.21.2/core/units/admin/admin_config.php (revision 7644)
@@ -0,0 +1,55 @@
+<?php
+
+ $config = Array(
+ 'Prefix' => 'adm',
+ 'EventHandlerClass' => Array('class' => 'AdminEventsHandler', 'file' => 'admin_events_handler.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'AdminTagProcessor', 'file' => 'admin_tag_processor.php', 'build_event' => 'OnBuild'),
+
+ 'QueryString' => Array(
+ 1 => 'event',
+ ),
+
+ 'TitlePresets' => Array(
+ 'tree_root' => Array('format' => '!la_section_overview!'),
+
+ 'tree_reports' => Array('format' => '!la_section_overview!'),
+
+ 'tree_system' => Array('format' => '!la_section_overview!'),
+
+ 'tree_tools' => Array('format' => '!la_section_overview!'),
+
+ 'system_tools' => Array('format' => '!la_title_SystemTools!'),
+
+ 'no_permissions' => Array('format' => '!la_title_NoPermissions!'),
+
+ 'column_picker' => Array('format' => '!la_title_ColumnPicker!'),
+ ),
+
+
+ 'PermSection' => array('main' => 'in-portal:service'),
+ 'Sections' => Array(
+ 'in-portal:root' => Array(
+ 'parent' => null,
+ 'icon' => 'site',
+ 'label' => $this->Application->ConfigValue('Site_Name'),
+ 'url' => Array('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
+ 'permissions' => Array('advanced:admin_login', 'advanced:front_login'),
+ 'priority' => 0,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:service' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'conf_general',
+ 'label' => 'la_tab_Service',
+ 'url' => Array('t' => 'tools/system_tools', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 10,
+ 'debug_only' => true,
+ 'type' => stTREE,
+ ),
+ ),
+
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.21.2/core/units/admin/admin_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.21
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Event Timeline
Log In to Comment