Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Thu, Jul 10, 8:48 PM

in-portal

Index: tags/release_1_1_2/admin/install/upgrades/changelog_1_1_3.txt
===================================================================
--- tags/release_1_1_2/admin/install/upgrades/changelog_1_1_3.txt (nonexistent)
+++ tags/release_1_1_2/admin/install/upgrades/changelog_1_1_3.txt (revision 3015)
@@ -0,0 +1,13 @@
+File in-portal/admin/config/edit_label.php changed
+File in-portal/admin/config/edit_template.php changed
+File in-portal/admin/install/upgrades/inportal_upgrade_v1.1.3.sql is new
+File in-portal/admin/install/upgrades/readme_1_1_3.txt is new
+File in-portal/admin/users/group_select.php changed
+File in-portal/kernel/startup.php changed
+File in-portal/kernel/include/parse.php changed
+File in-portal/kernel/include/theme.php changed
+
+
+Changes in phrases and events:
+
+
Property changes on: tags/release_1_1_2/admin/install/upgrades/changelog_1_1_3.txt
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: tags/release_1_1_3/kernel/include/parse.php
===================================================================
--- tags/release_1_1_3/kernel/include/parse.php (revision 3014)
+++ tags/release_1_1_3/kernel/include/parse.php (revision 3015)
@@ -1,1029 +1,1032 @@
<?php
class clsHtmlTag
{
var $rawtext;
var $parsed;
var $prefix;
var $name;
var $attributes;
var $inner_html;
function clsHtmlTag($text=null)
{
$this->SetRawText($text);
if(strlen($text)) $this->parse();
}
function Clear()
{
$this->parsed = FALSE;
$this->rawtext = NULL;
$this->prefix = "";
$this->name = "";
$this->attributes = NULL;
$this->inner_html = "";
}
function ValidTag()
{
return (strlen($this->prefix) && strlen($this->name));
}
function SetRawText($text)
{
$this->Clear();
if($text != NULL) $text = trim($text);
$this->rawtext = $text;
}
function GetAttributeByName($attr)
{
if(is_array($this->attributes))
{
$attr = strtolower($attr);
if( array_key_exists($attr,$this->attributes))
{
return $this->attributes[$attr];
}
else
{
return FALSE;
}
}
else
{
return FALSE;
}
}
function SetAttributeByName($attr,$value)
{
if(!is_array($this->attributes))
{
$this->attributes = array();
}
$this->attributes[$attr] = $value;
}
function GetAttributeByIndex($index)
{
if(is_array($this->attributes))
{
if($index < count($this->attributes))
{
return $this->attributes[$index];
}
else
{
return FALSE;
}
}
else
{
return FALSE;
}
}
function ParseAttributes($attributes)
{
unset($output);
$attribute = "";
$attributes = str_replace("\\>",">",$attributes);
$attributes = str_replace("\\<","<",$attributes);
$attributes = str_replace("\\\\","\\",$attributes);
while(strpos($attributes,"=")>0)
{
$pos = strpos($attributes,"=");
$attribute = trim(substr($attributes,0,$pos));
$attributes = trim(substr($attributes,$pos+1));
$pos2 = strpos($attributes,"\"");
$pos3 = strpos($attributes,"'");
if(!($pos3===false) and !($pos2===false) and ($pos3<$pos2)) $pos2 = $pos3;
if(!($pos3===false) and ($pos2===false) and (($pos3<$pos) or ($pos==0))) $pos2 = $pos3;
if(!($pos2===false) and (($pos2<$pos) or ($pos==0)))
{
if (substr($attributes,0,1) == "\"")
{
$pos = strpos($attributes,"\"",1);
$val = substr($attributes,1,$pos-1);
}
elseif (substr($attributes,0,1) == "'")
{
$pos = strpos($attributes,"'",1);
$val = substr($attributes,1,$pos-1);
}
else
{
$pos1 = strpos($attributes,"=",1);
$val = substr($attributes,0,$pos1);
$pos1a = strrpos($val," ");
$pos = $pos1-(strlen($val)-$pos1a);
$val = substr($val,0,$pos1a);
}
while (strpos($attribute," ")>0)
{
$pos1 = strpos($attribute," ");
$attr1 = substr($attribute,0,$pos1);
$output[$attr1] = null;
$attribute = trim(substr($attribute,$pos1+1));
}
$output[strtolower($attribute)] = $val;
$attributes = trim(substr($attributes,$pos+1));
}
elseif ($pos>0)
{
if (strpos($attributes,"=")>0)
{
$pos = strpos($attributes,"=");
$val = substr($attributes,0,$pos);
}
else
{
$val = $attributes;
}
$pos2 = strrpos($val," ");
if($pos2>0)
{
$len = strlen($val);
$val = substr($val,0,$pos2);
$attributes = trim(substr($attributes,($pos-$len)+$pos2));
}
else
{
$len = strlen($val);
$attributes = trim(substr($attributes,$len));
}
while (strpos($attribute," ")>0)
{
$pos1 = strpos($attribute," ");
$attr1 = substr($attribute,0,$pos1);
$output[$attr1] = null;
$attribute = trim(substr($attribute,$pos1+1));
}
$output[strtolower($attribute)] = $val;
}
else
{
while (strpos($attribute," ")>0)
{
$pos1 = strpos($attribute," ");
$attr1 = substr($attribute,0,$pos1);
$output[$attr1] = null;
$attribute = trim(substr($attribute,$pos1+1));
}
$output[strtolower($attribute)] = $attributes;
}
}
if(strlen(trim($attributes))>0)
{
while (strpos($attribute," ")>0)
{
$pos1 = strpos($attribute," ");
$attr1 = substr($attribute,0,$pos1);
$output[$attr1] = null;
$attribute = trim(substr($attribute,$pos1+1));
}
$output[strtolower($attributes)] = null;
}
if (isset($output))
return($output);
}
function parse()
{
global $objSession;
$html = $this->rawtext;
$html = substr($html,1,strlen($html)-2);
if(substr($html,strlen($html)-1,1)=="/")
{
$html = substr($html,0,strlen($html)-1);
}
$tagparts = explode(" ",$html,2);
$tagname = $tagparts[0];
$attribs = array();
if(count($tagparts)>0)
{
$attribs = $this->ParseAttributes( isset($tagparts[1]) ? $tagparts[1] : '');
}
if(is_object($objSession) && is_array($attribs))
{
$referer = $objSession->GetVariable("Template_Referer");
foreach($attribs as $key=>$value)
{
if($value=="_referer_")
$attribs[$key] = $referer;
}
}
$name = explode(":",$tagname);
$this->prefix = strtolower($name[0]);
$this->name = strtolower($name[1]);
if(is_array($attribs))
{
foreach($attribs as $key=>$value)
{
if(!strlen($value))
{
$attribs[$key]=1;
}
}
$this->attributes = $attribs;
}
else
{
$this->attributes = array();
}
$this->parsed=TRUE;
}
function Execute()
{
$func = $this->name;
$override = "_".$func;
if( function_exists($override) )
{
$ret = @$override($this->attributes);
}
else
{
if(function_exists($func))
{
$ret = @$func($this->attributes);
}
else
{
//$ret = "{Unknown Tag:" .$this->name."}";
$ret = '';
}
}
return $ret;
}
}
class clsTemplate
{
var $source;
var $name;
var $out;
var $error;
function clsTemplate($template=NULL)
{
$this->name=$template;
$this->source=NULL;
$this->out = NULL;
$this->error = "";
}
function LoadByFileName($file,$SupressError=FALSE)
{
if(file_exists($file))
{
$fp = fopen ($file, "r");
if($fp)
{
$this->source = fread($fp, filesize ($file));
$this->source = trim($this->source);
fclose($fp);
return TRUE;
}
else
{
if(!$SupressError)
$this->error = "lu_read_error";
return FALSE;
}
}
else
{
if(!$SupressError)
$this->error = "lu_missing_error";
return FALSE;
}
}
function HasExtension()
{
$t = strtolower($this->name);
if(strlen($t))
{
return (substr($t,-4)==".tpl");
}
else
return false;
}
function TemplateFilename($template_root)
{
if(!$this->HasExtension())
{
$filename = $template_root.$this->name.".tpl";
}
else
$filename = $template_root.$this->name;
return $filename;
}
function LoadFile($template_root="",$SupressError=FALSE, $tbody)
{
if (class_exists('kApplication') ) {
if ( !isset($tbody) ) {
$application =& kApplication::Instance();
$t = $this->name;
$t = preg_replace("/\.tpl$/", '', $t);
$tbody = $application->ParseBlock( Array('name' => $t, 'from_inportal' => true), null, true );
}
$this->source = $tbody;
return true;
}
$filename = $this->TemplateFilename($template_root);
if(file_exists($filename))
{
//echo "Loading $filename from Filesystem<br>\n";
$fp = @fopen ($filename, "r");
if($fp)
{
$this->source = fread($fp, filesize ($filename));
$this->source = trim($this->source);
fclose($fp);
return TRUE;
}
else
{
if(!$SupressError)
$this->error = "lu_read_error";
return FALSE;
}
}
else
{
if(!$SupressError)
$this->error = "lu_missing_error";
return FALSE;
}
}
function WriteFile($template_root="")
{
$filename = $this->TemplateFilename($template_root);
$pos = strrpos($this->name,"/");
if(!is_dir(substr($template_root,0,-1)))
@mkdir(substr($tempalate_root0,-1));
if($pos>0)
$path=$template_root.substr($this->name,0,$pos);
if(!is_dir($path))
{
@mkdir($path);
}
if(strlen($this->out))
{
$fp = @fopen($filename, "w");
if($fp)
{
fwrite($fp,$this->out);
fclose($fp);
return TRUE;
}
else
return FALSE;
}
else
return TRUE;
}
}
class clsTemplateList
{
var $templates;
var $root_dir;
var $ErrorStr;
var $ErrorNo;
var $stack;
var $SkipIncludes = 0;
function clsTemplateList($root_dir)
{
$this->templates = array();
$this->root_dir = $root_dir;
$this->ErrorStr = "";
$this->ErrorNo = 0;
$this->SkipIncludes = 0;
$this->stack = array();
}
function InStack($template)
{
return in_array($template,$this->stack) ? true : false;
}
function GetTemplate($name,$SupressError=FALSE, $tbody=null)
{
if(!strlen($name))
{
$ret = FALSE;
if(!$SupressError)
{
$this->ErrorNo = -2;
$this->ErrorStr=language("lu_template_error").":".language("lu_no_template_error");
}
}
else
{
$ret = FALSE;
if ( !isset($tbody) ) { //Kernel4 fix
$ret = isset($this->templates[$name]) ? $this->templates[$name] : false;
// this was original:
/*foreach($this->templates as $n => $t)
{
if($n == $name)
{
$ret = $t;
break;
}
}*/
}
if(!is_object($ret))
{
$ret = new clsTemplate($name);
if($ret->LoadFile($this->root_dir, $SupressError, $tbody))
{
$this->templates[$name]=$ret;
}
else
{
if( IsDebugMode() )
{
$GLOBALS['debugger']->appendHTML('<b class="debug_error">Warning</b>: Template <b>'.$name.'</b> not found');
}
if(!$SupressError)
{
$this->ErrorNo = -1;
$this->ErrorStr = language("lu_template_error").":".language($ret->error).":"."'$name'";
LogEntry($this->ErrorStr);
}
}
}
}
return $ret;
}
function GetTemplateCache($template,$SupressError=FALSE)
{
global $CurrentTheme, $pathtoroot;
$ret = '';
if( $CurrentTheme->Get("CacheTimeout") > 0)
{
$id = $CurrentTheme->GetTemplateId($template);
if($id)
{
$exp = isset($CurrentTheme->ParseCacheDate[$id]) ? $CurrentTheme->ParseCacheDate[$id] : false;
if($exp)
{
//echo "$template Cache expires: ".date("m-d-Y h:m s",$exp)."<br>\n";
if( $exp > time() )
{
/* look for a cache file */
$t = new clsTemplate($template);
$dir = $CurrentTheme->ThemeDirectory();
if( $t->LoadFile($dir."/_cache/",$SupressError) ) $ret = $t->source;
}
}
}
}
return $ret;
}
function SaveTemplateCache($objTemplate)
{
global $CurrentTheme, $objThemes, $pathtoroot;
if(!is_object($CurrentTheme))
$CurrentTheme = $objThemes->GetItem($m_var_list["theme"]);
if($CurrentTheme->Get("CacheTimeout")>0)
{
$TemplateId = $CurrentTheme->GetTemplateId($objTemplate->name);
if($TemplateId)
{
if(isset($CurrentTheme->ParseCacheDate[$TemplateId]))
{
//echo "Writing Template ".$objTemplate->name."<br>\n";
$interval = $CurrentTheme->ParseCacheTimeout[$TemplateId];
$CurrentTheme->UpdateFileCacheData($TemplateId,time()+$interval);
$dir = $CurrentTheme->ThemeDirectory()."/_cache/";
$objTemplate->WriteFile($dir);
}
}
}
}
function IncludeTemplate($tag, $SupressError=FALSE)
{
global $LogLevel, $objSession,$objLanguages, $var_list;
$t = '';
$ret = '';
$SupressError = ($SupressError || $tag->GetAttributeByName("_supresserror"));
switch($tag->name)
{
case 'perm_include':
$perms = $tag->GetAttributeByName('_permission');
if(strlen($perms))
{
$plist = explode(',',$perms);
$value=0;
$CheckSys = $tag->GetAttributeByName('_system');
for($p=0;$p<count($plist);$p++)
{
if ($plist[$p] == "login") {
$_GET["dest"] = $var_list["t"];
}
if($objSession->HasCatPermission(trim($plist[$p])))
{
$value = 1;
break;
}
else
{
if($CheckSys)
{
if($objSession->HasSystemPermission(trim($plist[$p])))
{
$value = 1;
break;
}
}
}
}
$t = $tag->GetAttributeByName( $value ? '_template' : '_noaccess');
}
else
{
$module = $tag->GetAttributeByName('_module');
if(strlen($module))
{
$t = $tag->GetAttributeByName( ModuleEnabled($module) ? '_template' : '_noaccess' );
}
}
break;
case "lang_include":
$lang = $tag->GetAttributeByName("_language");
if(strlen($lang))
{
$LangId = $objSession->Get("Language");
$l = $objLanguages->GetItem($LangId);
if(strtolower($lang)==strtolower($l->Get("PackName")))
{
$t = $tag->GetAttributeByName("_template");
}
}
break;
case 'include':
$t = $tag->GetAttributeByName("_template");
break;
}
LogEntry("Parsing $t\n");
$LogLevel++;
if($t)
{
if(!$this->InStack($t))
{
//return $this->ParseTemplate($t);
//if(!$tag->GetAttributeByName("_nocache"));
$ret = $this->GetTemplateCache($t,$SupressError);
if(!strlen($ret))
{
$req = $tag->GetAttributeByName("_dataexists");
if($req)
{
global $content_set;
$content_set=1;
$temp = $this->ParseTemplate($t,0,0,$SupressError);
if($content_set)
{
$ret = $temp;
}
else
{
$t_nodata = $tag->GetAttributeByName("_nodatatemplate");
if(strlen($t_nodata))
{
$nodata_tag = new clsHtmlTag();
$nodata = $tag;
$nodata->attributes = $tag->attributes;
$nodata->SetAttributeByName("_template",$t_nodata);
$nodata->SetAttributeByName("_nodatatemplate","");
$nodata->SetAttributeByName("_dataexists","");
$ret = $this->IncludeTemplate($nodata,$SupressError);
}
else
$ret = "";
}
}
else
$ret = $this->ParseTemplate($t,0,0,$SupressError);
}
}
else
$ret = "";
}
$LogLevel--;
if($LogLevel<0)
$LogLevel=0;
LogEntry("Finished Parsing $t\n");
return $ret;
}
/* <inp:mod_include _Template=".." [_perm=".."] [_modules=".."] [_system=".."] */
function ModuleInclude($tag)
{
global $var_list;
$o = "";
$el = new clsHtmlTag();
$el->attributes = $tag->attributes;
$el->parsed=1;
$t = $tag->attributes["_template"];
if(!strlen($t))
$t = $var_list["t"];
$el->name = "perm_include";
$tpath = GetModuleArray("template");
if(!strlen( $tag->GetAttributeByName('_modules') ))
{
$mods = array_keys($tpath);
}
else
$mods = explode(",",$tag->attributes["_modules"]);
foreach($mods as $m)
{
if($t==$var_list["t"] && !strlen($tpath[$m]))
continue;
$el->attributes = $tag->attributes;
$el->attributes["_template"] = $tpath[$m].$t;
$el->attributes["_module"] = $m;
if(strlen( $tag->GetAttributeByName('_nodatatemplate') ))
{
$el->attributes["_nodatatemplate"] = $tpath[$m].$tag->attributes["_nodatatemplate"];
}
//print_pre($el);
$o .= $this->IncludeTemplate($el,true);
}
if(!strlen($o) && strlen($tag->attributes["_nodatamaintemplate"]))
$o = $this->ParseTemplate($tag->attributes["_nodatamaintemplate"]);
return $o;
}
function ParseTag($raw)
{
$tag = new clsHtmlTag($raw);
$res = "";
switch($tag->name)
{
case "lang_include":
case "include":
case "perm_include":
$res = $this->IncludeTemplate($tag);
break;
case "mod_include":
$res = $this->ModuleInclude($tag);
break;
default:
//print_pre($tag);
$res = $tag->Execute();
break;
}
unset($tag);
return $res;
}
function ParseTemplateText($text)
{
$html = $text;
$search = "<inp:";
$next_tag = strpos($html,$search);
$left = substr($html,0,5);
while($next_tag || $left=="<inp:")
{
$left = "";
$closer = strpos(strtolower($html),">",$next_tag);
$tmp = substr($html,$next_tag,$closer+1 - $next_tag);
while(substr($html,$closer-1,1)=="\\" && $closer < strlen($html))
{
$closer = strpos(strtolower($html),">",$closer+1);
}
$end_tag = strpos($html,"/>",$next_tag);
if(($end_tag < $closer || $closer == 0))
{
$tagtext = substr($html,$next_tag,($end_tag - $next_tag)+2);
$pre = substr($html,0,$next_tag);
$post = substr($html,$end_tag+2);
$inner = $this->ParseTag($tagtext);
$html = $pre.$inner.$post;
}
else
{
$OldTagStyle = "</inp>";
## Try to find end of TagName
$TagNameEnd = strpos($html, " ", $next_tag);
## Support Old version
// $closer = strpos(strtolower($html),"</inp>",$next_tag);
if ($TagNameEnd)
{
$Tag = strtolower(substr($html, $next_tag, $TagNameEnd-$next_tag));
$TagName = explode(":", $Tag);
if (strlen($TagName[1]))
$CloserTag = "</inp:".$TagName[1].">";
}
else
{
$CloserTag = $OldTagStyle;
}
$closer = strpos(strtolower($html), $CloserTag, $next_tag);
## Try to find old tag closer
if (!$closer && ($CloserTag != $OldTagStyle))
{
$CloserTag = $OldTagStyle;
$closer = strpos(strtolower($html), $CloserTag, $next_tag);
}
$end_tag = strpos($html,">",$next_tag);
$tagtext = substr($html,$next_tag,($end_tag - $next_tag)+1);
$pre = substr($html,0,$next_tag);
$inner = substr($html,$end_tag+1,$closer-($end_tag+1));
$post = substr($html,$end_tag+1+strlen($inner) + strlen($CloserTag));
$parsed = trim($this->ParseTag($tagtext));
if(strlen($parsed))
{
$html = $pre.$this->ParseTemplateText($inner).$post;
}
else
$html = $pre.$post;
}
//$next_tag = strpos($html,"<inp:");
$next_tag = 0;
$next_tag = strpos($html,$search);
}
return $html;
}
function ParseTemplate($tname, $NoCache=0, $NoStack=0,$SupressError=FALSE)
{
$html = "";
if( defined('TEMPLATE_PREFIX') ) $tname = TEMPLATE_PREFIX.'/'.$tname;
$t = $this->GetTemplate($tname,$SupressError);
if(is_object($t))
{
if(!$NoStack)
array_push($this->stack,$tname);
$html = $t->source;
$html = $this->ParseTemplateText($html);
if(!$NoStack)
array_pop($this->stack);
$t->out = $html;
if(!$NoCache)
$this->SaveTemplateCache($t);
}
unset($t);
return $html;
}
function ParseTemplateFromBuffer($tname, $tbody, $NoCache=0, $NoStack=0,$SupressError=FALSE)
{
$html = "";
if( defined('TEMPLATE_PREFIX') ) $tname = TEMPLATE_PREFIX.'/'.$tname;
$t = $this->GetTemplate($tname, $SupressError, $tbody);
if(is_object($t))
{
if(!$NoStack)
array_push($this->stack,$tname);
$html = $t->source;
$html = $this->ParseTemplateText($html);
if(!$NoStack)
array_pop($this->stack);
$t->out = $html;
if(!$NoCache)
$this->SaveTemplateCache($t);
}
unset($t);
return $html;
}
}
class clsAdminTemplateList extends clsTemplateList
{
function clsAdminTemplateList()
{
global $TemplateRoot;
$this->clsTemplateList($TemplateRoot);
}
function GetTemplate($file)
{
$ret = FALSE;
$ret = new clsTemplate();
if(!$ret->LoadByFileName($file))
{
$this->ErrorNo = -1;
$this->ErrorStr = "Error Loading Template '$file'";
}
return $ret;
}
}
class clsTemplateChecker extends clsTemplateList
{
var $Dependencies;
var $TemplateType;
var $Tags;
function clsTemplateChecker($rootdir)
{
$this->clsTemplateList($rootdir);
$this->Dependencies = Array();
$this->Tags = array();
$this->TemplateType="global"; //default
}
function ParseTag($text)
{
$this->Tags[] = new clsHtmlTag($text);
return "";
}
function ParseTemplateText($text)
{
$html = $text;
$search = "<inp:";
$next_tag = strpos($html,$search);
$left = substr($html,0,5);
while($next_tag || $left=="<inp:")
{
$left = "";
$closer = strpos(strtolower($html),">",$next_tag);
$end_tag = strpos($html,"/>",$next_tag);
if($end_tag < $closer || $closer == 0)
{
$tagtext = substr($html,$next_tag,($end_tag - $next_tag)+2);
$pre = substr($html,0,$next_tag);
$post = substr($html,$end_tag+2);
$inner = $this->ParseTag($tagtext);
$html = $pre.$inner.$post;
}
else
{
$closer = strpos(strtolower($html),"</inp>",$next_tag);
$end_tag = strpos($html,">",$next_tag);
$tagtext = substr($html,$next_tag,($end_tag - $next_tag)+1);
$pre = substr($html,0,$next_tag);
$inner = substr($html,$end_tag+1,$closer-($end_tag+1));
$post = substr($html,$end_tag+1+strlen($inner)+6);
$parsed = $this->ParseTag($tagtext);
if(strlen($parsed))
{
$html = $pre.$inner.$post;
}
else
$html = $pre.$post;
}
//$next_tag = strpos($html,"<inp:");
$next_tag = 0;
$next_tag = strpos($html,$search);
}
return $html;
}
function ParseTemplate($tname, $NoCache=0, $NoStack=0,$SupressError=FALSE)
{
$html = "";
$t = $this->GetTemplate($tname,$SupressError);
if(is_object($t))
{
$html = $this->ParseTemplateText($t->source);
$t->out = $html;
}
unset($t);
return $html;
}
function ReadTemplateTags($tname)
{
+ $application =& kApplication::Instance();
+ $application->InitParser();
+
$this->Tags[]=Array();
$this->ParseTemplate($tname,1,1,TRUE);
return $this->Tags;
}
function GetTemplateType($tname)
{
global $ItemTypePrefixes;
$ret = "global";
$this->ReadTemplateTags($tname);
if(count($this->Tags)>0)
{
foreach($this->Tags as $t)
{
if(in_array($t->name,$ItemTypePrefixes))
{
$ret = $t->name;
break;
}
}
}
return $ret;
}
function IncludeTemplate($tag, $SupressError=FALSE)
{
$this->AddDependency($tag->GetAttributeByName("_template"));
$this->AddDependency($tag->GetAttributeByName("_noaccess"));
}
function ModuleInclude($tag)
{
}
function AddDependency($template)
{
$template = strtolower($template);
if(!in_array($template,$this->Dependencies))
$this->Dependencies[] = $template;
}
}
function admintemplate($fileh)
{
if(file_exists($fileh))
{ $fd = fopen($fileh, "r");
$ret=fread($fd, filesize($fileh));
fclose($fd);
return $ret;
}
else
echo "Unable to load $fileh";
}
function ExtraAttributes($attribs)
{
$html_attr = "";
if(is_array($attribs))
{
foreach($attribs as $name=>$value)
{
if(substr($name,0,1)!="_")
$html_attr .= $name."=\"$value\" ";
}
}
return $html_attr;
}
?>
Property changes on: tags/release_1_1_3/kernel/include/parse.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.14
\ No newline at end of property
+1.14.4.1
\ No newline at end of property
Index: tags/release_1_1_3/kernel/include/theme.php
===================================================================
--- tags/release_1_1_3/kernel/include/theme.php (revision 3014)
+++ tags/release_1_1_3/kernel/include/theme.php (revision 3015)
@@ -1,830 +1,832 @@
<?php
define('THEME_ERROR_1', 'Theme folder not writable');
define('THEME_ERROR_2', 'Template File Not Found');
class clsThemeFile extends clsItem
{
var $Contents;
var $Root;
var $Errors = Array(); // global template error messages (not db related)
function clsThemeFile($id=NULL)
{
$this->clsItem();
$this->tablename = GetTablePrefix()."ThemeFiles";
$this->id_field = "FileId";
$this->NoResourceId=1;
$this->Root = "";
$this->Contents = '';
if($id) $this->LoadFromDatabase($id);
}
function DetectChanges($name, $value)
{
global $objSession;
if ($this->Data[$name] != $value) {
//echo "$name Modified tt ".$this->Data[$name]." tt $value<br>";
if (!stristr($name, 'File') && !stristr($name, 'Theme')) {
if ($objSession->GetVariable("HasChanges") != 1) {
$objSession->SetVariable("HasChanges", 2);
}
}
}
}
function ThemeRoot()
{
if( !$this->Root )
{
$t = new clsTheme( $this->Get("ThemeId") );
$this->Root = $t->Get("Name");
}
return $this->Root;
}
function FullPath()
{
// need to rewrite (by Alex)
global $objConfig, $pathchar,$pathtoroot;
- $path = $pathtoroot."themes".$pathchar.$this->ThemeRoot();
- if(strlen(trim($this->Get("FilePath"))))
- $path .= $pathchar.$this->Get("FilePath");
- $path .= $pathchar.$this->Get("FileName");
+ $template_path = Array();
+ $template_path[] = FULL_PATH.'/themes/'.$this->ThemeRoot();
+ $sub_folder = trim( $this->Get('FilePath'), ' /');
+ if($sub_folder) $template_path[] = $sub_folder;
+ $template_path[] = trim( $this->Get('FileName'), '/');
+
//echo "Full Path is $path <br>\n";
- return str_replace('//','/',$path);
+ return implode('/', $template_path);
}
function Get($name)
{
if($name == 'Contents')
return $this->Contents;
else
return parent::Get($name);
}
function Set($name, $value)
{
if( !is_array($name) )
{
$name = Array($name);
$value = Array($value);
}
$i = 0; $field_count = count($name);
while($i < $field_count)
{
if($name[$i] == 'Contents')
$this->Contents = $value[$i];
else
parent::Set($name[$i], $value[$i]);
$i++;
}
}
/*
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 ".$this->IdField()." = '%s'",$Id);
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$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 Delete()
{
$path = $this->FullPath();
if($this->debuglevel) echo "Trying to delete file [$path]<br>";
if( file_exists($path) ) @unlink($path);
parent::Delete();
}
function LoadFileContents($want_return = true)
{
global $objConfig,$pathchar;
$this->Contents = '';
$path = $this->FullPath();
if( file_exists($path) )
$this->Contents = file_get_contents($path);
else
$this->SetError(THEME_ERROR_2, 2); // template not found
if($want_return) return $this->Contents;
}
function SetError($msg, $code, $field = 'global_error')
{
$this->Errors[$field]['msg'] = $msg;
$this->Errors[$field]['code'] = $code;
}
function HasError()
{
return count($this->Errors) ? 1 : 0;
}
function ErrorMsg()
{
return $this->Errors['global_error']['msg'];
}
function SaveFileContents($filecontents, $new_file = false)
{
$path = $this->FullPath();
if( is_array($filecontents) ) $filecontents = implode("\n",$filecontents);
if( $this->IsWriteablePath($new_file) )
{
$fp = fopen($path,"w");
if($fp)
{
fwrite($fp,$filecontents);
fclose($fp);
return true;
}
}
return false;
}
function IsWriteablePath($new_file = false)
{
$path = $this->FullPath();
- $path = str_replace('//','/',$path);
+// $path = str_replace('//','/',$path);
$ret = $new_file ? is_writable(dirname($path)): is_writable($path);
if(!$ret)
{
$this->SetError(THEME_ERROR_1, 1);
return false;
}
return $ret;
}
}
class clsThemeFileList extends clsItemCollection
{
var $Page;
var $PerPageVar;
var $ThemeId;
function clsThemeFileList($theme_id=NULL)
{
global $m_var_list;
$this->clsItemCollection();
$this->classname = "clsThemeFile";
$this->Page=(int)$m_var_list["p"];
$this->PerPageVar = "Perpage_ThemeFiles";
$this->SourceTable = GetTablePrefix()."ThemeFiles";
$this->AdminSearchFields = array("FileName","FilePath","Description");
$this->ThemeId=$theme_id;
//if($theme_id)
// $this->LoadFiles($theme_id);
}
function LoadFiles($id,$where="",$orderBy="",$limit="")
{
global $objConfig;
$this->Clear();
$this->ThemeId=$id;
$sql = "SELECT * FROM ".$this->SourceTable. " WHERE ThemeId=$id ";
if(strlen(trim($where))) $sql .= ' AND '.$where." ";
if(strlen(trim($orderBy))) $sql .= "ORDER BY $orderBy";
if(strlen(trim($limit))) $sql .= $limit;
if(strlen($this->PerPageVar))
{
$sql .= GetLimitSQL($this->Page,$objConfig->Get($this->PerPageVar));
}
//echo $sql;
return $this->Query_Item($sql);
}
function GetFileByName($path,$name,$LoadFromDB=TRUE)
{
$found = FALSE;
$f = FALSE;
//echo "Looking through ".$this->NumItems()." Files <br>\n";
if($this->NumItems()>0)
{
foreach($this->Items as $f)
{
if(($f->Get("FilePath")== $path) && ($f->Get("FileName")==$name))
{
$found = TRUE;
break;
}
}
}
if(!$found && $LoadFromDB)
{
$sql = "SELECT * FROM ".$this->SourceTable." WHERE ThemeId=".$this->ThemeId." AND FileName LIKE '$name' AND FilePath LIKE '$path'";
$rs = $this->adodbConnection->Execute($sql);
//echo $sql."<br>\n";
if($rs && !$rs->EOF)
{
$data = $rs->fields;
$f =& $this->AddItemFromArray($data);
}
else
$f = FALSE;
}
return $f;
}
function AddFile($Path,$Name,$ThemeId,$Type,$Description,$contents=NULL)
{
$f = new clsThemeFile();
$f->Set(array("FilePath","FileName","ThemeId","FileType","Description"),
array($Path,$Name,$ThemeId,$Type,$Description));
$f->Create();
if($contents!==NULL)
{
$f->SaveFileContents($contents,$Name);
}
//echo $f->Get("FilePath")."/".$f->Get("FileName")."<br>\n";
return $f;
}
function EditFile($FileId,$Path,$Name,$ThemeId,$Type,$Description,$contents=NULL)
{
$f = $this->GetItem($FileId);
$f->Set(array("FilePath","FileName","ThemeId","FileType","Description"),
array($Path,$Name,$ThemeId,$Type,$Description));
$f->Update();
if($Contents!=NULL)
$f->SaveFileContents($Contents);
return $f;
}
function DeleteFile($FileId)
{
$f = $this->GetItem($FileId);
$f->Delete();
}
function DeleteAll()
{
$this->Clear();
$this->LoadFiles($this->ThemeId);
foreach($this->Items as $f)
$f->Delete();
$this->Clear();
}
function SetFileContents($FileId,$Contents)
{
$f = $this->GetItem($FileId);
$f->SaveFileContents($Contents);
}
function GetFileContents($FileId)
{
$f = $this->GetItem($FileId);
return $f->LoadFileContents();
}
function FindMissingFiles($path, $where = null, $OrderBy = null, $limit = null)
{
global $pathtoroot;
$this->Clear();
$fullpath = $pathtoroot.'themes/'.$path;
// get all templates from database
$sql = 'SELECT FileId AS i,CONCAT(FilePath,"/",FileName) AS f FROM '.$this->SourceTable. ' WHERE ThemeId='.$this->ThemeId;
$DBfiles=Array();
if($rs = $this->adodbConnection->Execute($sql))
{
while(!$rs->EOF)
{
$DBfiles[$rs->fields['i']] = $fullpath.$rs->fields['f'];
$rs->MoveNext();
}
$rs->Free();
}
// get all templates file from disk
$HDDfiles = filelist($fullpath, NULL, "tpl");
$missingFiles=array_diff($HDDfiles,$DBfiles);
$orphanFiles=array_diff($DBfiles,$HDDfiles);
if($orphanFiles)
{
$sql = 'DELETE FROM '.$this->SourceTable.' WHERE FileId IN('.join(',',array_keys($orphanFiles)).')';
$this->adodbConnection->Execute($sql);
}
$l=strlen($fullpath);
foreach($missingFiles as $file)
$this->AddFile(substr(dirname($file),$l),basename($file),$this->ThemeId,0,'');
}
}
RegisterPrefix("clsTheme","theme","kernel/include/theme.php");
class clsTheme extends clsParsedItem
{
var $Files;
var $FileCache;
var $IdCache;
var $ParseCacheDate;
var $ParseCacheTimeout;
function clsTheme($Id = NULL)
{
$this->clsParsedItem($Id);
$this->tablename = GetTablePrefix()."Theme";
$this->id_field = "ThemeId";
$this->NoResourceId=1;
$this->TagPrefix="theme";
$this->Files = new clsThemeFileList($Id);
$this->FileCache = array();
$this->IdCache = array();
$this->ParseCacheDate=array();
$this->ParseCacheTimeout = array();
if($Id)
$this->LoadFromDatabase($Id);
}
function ThemeDirectory()
{
global $objConfig, $pathchar, $pathtoroot;
$path = $pathtoroot."themes/".strtolower($this->Get("Name"));
return $path;
}
function UpdateFileCacheData($id,$CacheDate)
{
$sql = "UPDATE ".GetTablePrefix()."ThemeFiles SET CacheDate=$CacheDate WHERE FileId=$id";
$this->adodbConnection->Execute($sql);
}
function LoadFileCache()
{
if(!is_numeric($id=$this->Get("ThemeId")))return;
$sql = "SELECT * FROM ".GetTablePrefix()."ThemeFiles WHERE ThemeId=".$id;
$rs = $this->adodbConnection->Execute($sql);
while($rs && ! $rs->EOF)
{
//$this->Files->AddItemFromArray($rs->fields,TRUE);
$f = $rs->fields["FileName"];
$t = $rs->fields["FilePath"];
if(strlen($t))
$t .= "/";
$parts = pathinfo($f);
$fname = substr($f,0,(strlen($parts["extension"])+1)*-1);
// echo "Name: $fname<br>\n";
$t .= $fname;
$this->FileCache[$t] = $rs->fields["FileId"];
$this->IdCache[$rs->fields["FileId"]] = $t;
/*
if($rs->fields["EnableCache"]) // no such field in this table (commented by Alex)
{
$this->ParseCacheDate[$rs->fields["FileId"]] = $rs->fields["CacheDate"];
$this->ParseCacheTimeout[$rs->fields["FileId"]] = $rs->fields["CacheTimeout"];
}
*/
if( defined('ADODB_EXTENSION') && constant('ADODB_EXTENSION') > 0 )
adodb_movenext($rs);
else
$rs->MoveNext();
}
//echo "<PRE>"; print_r($this->IdCache); echo "</PRE>";
}
function GetTemplateById($FileId)
{
if(count($this->FileCache)==0)
$this->LoadFileCache();
$f = $this->IdCache[$FileId];
return $f;
}
function GetTemplateId($t)
{
if( count($this->IdCache) == 0 ) $this->LoadFileCache();
$f = isset( $this->FileCache[$t] ) ? $this->FileCache[$t] : '';
return is_numeric($f) ? $f : $t;
}
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 ".$this->IdField()." = '%s'",$Id);
$result = $this->adodbConnection->Execute($sql);
if ($result === false)
{
$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
return false;
}
$data = $result->fields;
$this->SetFromArray($data);
$this->Clean();
$this->Files = new clsThemeFileList($Id);
return true;
}
function GetFileList($where,$OrderBy)
{
global $objConfig, $pathchar;
$this->Files->PerPageVar="";
$this->Files->ThemeId = $this->Get("ThemeId");
$this->Files->LoadFiles($this->Get("ThemeId"),$where,$OrderBy);
}
function VerifyTemplates($where = null,$OrderBy = null,$limit = null)
{
if(!is_object($this->Files))
$this->Files = new clsThemeFileList($this->Get("ThemeId"));
$this->Files->ThemeId = $this->Get("ThemeId");
$this->Files->FindMissingFiles(strtolower($this->Get("Name")),$where,$OrderBy,$limit);
}
function EditTemplateContents($FileId,$Contents)
{
$this->Files->SetFileContents($FileId,$Contents);
}
function ReadTemplateContents($FileId)
{
return $this->Files->GetFileContents($FileId);
}
function CreateDirectory()
{
$dir = $this->ThemeDirectory();
if(!is_dir($dir))
mkdir($dir);
if(is_dir($dir))
{
$fp = fopen($dir.'/index.tpl',"w");
if($fp)
{
fwrite($fp,'');
fclose($fp);
// $this->Files->FindMissingFiles($this->Get('name'));
/* $theme_id = $this->Get('ThemeId');
$db_dir = '/'.strtolower($this->Get('Name'));
$sql = 'INSERT INTO '.GetTablePrefix().'ThemeFiles
(ThemeId, FileName, FilePath, Description, FileType) VALUES
('.$theme_id.', "index.tpl", "'.$db_dir.'", "", 0)';
$conn = &GetADODBConnection();
$conn->Execute($sql);*/
}
}
}
function Delete()
{
$this->Files->DeleteAll();
$dir = $this->ThemeDirectory();
if(is_writable($dir)) {
$files = filelist($dir);
foreach ($files as $file) {
@unlink($file);
}
@rmdir($dir);
}
parent::Delete();
}
function AdminIcon()
{
global $imagesURL;
$file = $imagesURL."/itemicons/icon16_theme";
if($this->Get("PrimaryTheme")==1)
{
$file .= "_primary.gif";
}
else
{
if($this->Get("Enabled")==0)
{
$file .= "_disabled";
}
$file .= ".gif";
}
return $file;
}
function ParseObject($element)
{
global $var_list_update, $objSession;
$extra_attribs = ExtraAttributes($element->attributes);
if(strtolower($element->name)==$this->TagPrefix)
{
$field = strtolower($element->attributes["_field"]);
switch($field)
{
case "id":
$ret = $this->Get("ThemeId");
break;
case "name": // was "nane"
$ret = $this->Get("Name");
break;
case "description":
$ret = $this->Get("Description");
break;
case "adminicon":
$ret = $this->AdminIcon();
break;
case "directory":
$ret = $this->ThemeDirectory();
break;
case "select_url":
$var_list_update["t"] = "index";
$ret = GetIndexURL(2)."?env=".BuildEnv()."&Action=m_set_theme&ThemeId=".$this->Get("ThemeId");
break;
case "selected":
$ret = "";
if($this->Get("Name")==$objSession->Get("Theme"))
$ret = "SELECTED";
break;
default:
$tag = $this->TagPrefix."_".$field;
$ret = ""; $this->parsetag($tag);
break;
}
}
return $ret;
}
}
class clsThemeList extends clsItemCollection
{
var $Page;
var $PerPageVar;
function clsThemeList($id=NULL)
{
$this->clsItemCollection();
$this->classname="clsTheme";
$this->SourceTable=GetTablePrefix()."Theme";
$this->PerPageVar = "Perpage_Themes";
$this->AdminSearchFields = array("Name","Description");
}
function LoadThemes($where='',$orderBy='')
{
global $objConfig;
$this->Clear();
$sql = "SELECT * FROM ".$this->SourceTable." ";
if(trim($where))
$sql .= "WHERE ".$where." ";
if(trim($orderBy))
$sql .= "ORDER BY $orderBy";
$sql .= GetLimitSQL($this->Page,$objConfig->Get($this->PerPageVar));
return $this->Query_Item($sql);
}
function AddTheme($Name,$Description,$Enabled,$Primary,$CacheTimeout=3600,$StylesheetId=1)
{
$t = new clsTheme();
$t->tablename = $this->SourceTable;
$t->Set(array("Name","Description","Enabled","PrimaryTheme","CacheTimeout",'StylesheetId'),
array($Name,$Description,$Enabled,$Primary,$CacheTimeout,$StylesheetId));
$t->Create();
$t->Files->ThemeId=$t->Get("ThemeId");
if($Primary==1)
{
$sql = "UPDATE ".$this->SourceTable." SET PrimaryTheme=0 WHERE ThemeId != ".$t->Get("ThemeId");
$this->adodbConnection->Execute($sql);
}
return $t;
}
function EditTheme($ThemeId,$Name,$Description,$Enabled,$Primary, $CacheTimeout, $StylesheetId)
{
$t = $this->GetItem($ThemeId);
$oldName = $t->Get("Name");
if($oldName!=$Name)
{
$dir=dirname($t->ThemeDirectory());
if(!rename($dir.'/'.$oldName,$dir.'/'.$Name))
$Name=$oldName;
}
$t->Set(array("Name","Description","Enabled","PrimaryTheme","CacheTimeout", 'StylesheetId'),
array($Name, $Description, $Enabled, $Primary, $CacheTimeout,$StylesheetId));
$t->Dirty();
$t->Update();
if($Primary==1)
{
$sql = "UPDATE ".$this->SourceTable." SET PrimaryTheme=0 WHERE ThemeId!=$ThemeId";
$this->adodbConnection->Execute($sql);
}
return $t;
}
function DeleteTheme($ThemeId)
{
$t = $this->GetItem($ThemeId);
if (!$t->Get('PrimaryTheme'))
{
$t->Delete();
return true;
}
else
{
return false;
}
}
function SetPrimaryTheme($ThemeId)
{
$theme = $this->GetItem($ThemeId);
$theme->Dirty();
if($theme->Get("Enabled")==1)
{
$sql = "UPDATE ".$this->SourceTable." SET PrimaryTheme=0";
$this->adodbConnection->Execute($sql);
$theme->Set("PrimaryTheme","1");
$theme->Update();
}
}
function GetPrimaryTheme($field="ThemeId")
{
$sql = "SELECT * FROM ".$this->SourceTable." WHERE PrimaryTheme=1";
$rs = $this->adodbConnection->Execute($sql);
if($rs && !$rs->EOF)
{
$l = $rs->fields[$field];
}
else
$l = 0;
return $l;
}
function CreateMissingThemes($compile_css = false)
{
global $objConfig,$pathchar, $pathtoroot;
$path = $pathtoroot."themes";
$themes = array();
$HDDThemes=Array();
if ($dir = @opendir($path))
{
while (($file = readdir($dir)) !== false)
{
if($file !="." && $file !=".." && substr($file,0,1)!="_")
{
if(is_dir($path."/".$file)&&file_exists($path."/".$file.'/index.tpl'))
{
$file = strtolower($file);
$themes[$file]=0;
$HDDThemes[]=$file;
}
}
}
}
closedir($dir);
$sql = 'SELECT ThemeId AS i,Name AS n FROM '.$this->SourceTable;
$DBThemes=Array();
if($rs = $this->adodbConnection->Execute($sql))
{
while(!$rs->EOF)
{
$DBThemes[$rs->fields['i']] = $fullpath.$rs->fields['n'];
$rs->MoveNext();
}
$rs->Free();
}
$missingThemes=array_udiff($HDDThemes,$DBThemes,stricmp);
$orphanThemes=array_udiff($DBThemes,$HDDThemes,stricmp);
if($orphanThemes)
{
$sql = 'DELETE FROM '.$this->SourceTable.' WHERE ThemeId IN('.join(',',array_keys($orphanThemes)).')';
$this->adodbConnection->Execute($sql);
$sql = 'DELETE FROM '.GetTablePrefix().'ThemeFiles WHERE ThemeId IN('.join(',',array_keys($orphanThemes)).')';
$this->adodbConnection->Execute($sql);
}
// make stylesheet/theme hash
$css_hash = Array();
$css_rs = $this->adodbConnection->Execute('SELECT Name, StylesheetId FROM '.GetTablePrefix().'Stylesheets');
while(!$css_rs->EOF)
{
$css_hash[ strtolower($css_rs->fields['Name']) ] = $css_rs->fields['StylesheetId'];
$css_rs->MoveNext();
}
if($compile_css)
{
define('FULL_PATH', realpath(dirname(__FILE__).'/../..'));
define('APPLICATION_CLASS', 'MyApplication');
include_once(FULL_PATH.'/kernel/kernel4/startup.php');
$application =& kApplication::Instance();
$application->Init();
$application->setUnitOption('css', 'AutoLoad', false);
$css_table = $application->getUnitOption('css','TableName');
$css_idfield = $application->getUnitOption('css','IDField');
foreach($css_hash as $stylesheet_id)
{
$css_item =& $application->recallObject('css');
$css_item->Load($stylesheet_id);
$css_item->Compile();
}
$application->Done();
}
$this->Clear();
foreach($missingThemes as $theme)
{
$t=$this->AddTheme($theme,"New Theme",0,0, 3600, getArrayValue($css_hash, $theme) );
$t->Files->FindMissingFiles($t->Get('Name'));
}
}
function CopyFromEditTable()
{
global $objSession;
$GLOBALS['_CopyFromEditTable']=1;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$idlist = array();
$sql = "SELECT * FROM $edit_table";
$this->Clear();
$rs = $this->adodbConnection->Execute($sql);
while($rs && !$rs->EOF)
{
$data = $rs->fields;
$c = $this->AddItemFromArray($data);
$c->Dirty();
if($data["ThemeId"]>0)
{
$c->Update();
}
else
{
$c->UnsetIdField();
$c->Create();
$GLOBALS['m_var_list']['theme_id']=$c->Get('ThemeId');
$c->CreateDirectory();
}
if($c->Get("PrimaryTheme"))
{
$this->SetPrimaryTheme($c->Get("ThemeId"));
}
$rs->MoveNext();
}
$this->adodbConnection->Execute($sql);
unset($GLOBALS['_CopyFromEditTable']);
}
function PurgeEditTable()
{
global $objSession;
$edit_table = $objSession->GetEditTable($this->SourceTable);
$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table");
}
}
?>
Property changes on: tags/release_1_1_3/kernel/include/theme.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.18
\ No newline at end of property
+1.18.18.1
\ No newline at end of property
Index: tags/release_1_1_3/kernel/startup.php
===================================================================
--- tags/release_1_1_3/kernel/startup.php (revision 3014)
+++ tags/release_1_1_3/kernel/startup.php (revision 3015)
@@ -1,216 +1,217 @@
<?php
if( !defined('FULL_PATH') ) define('FULL_PATH', realpath(dirname(__FILE__).'/..') );
require_once FULL_PATH.'/globals.php';
if( !isset($FrontEnd) ) $FrontEnd = 0;
# New path detection method: begin
// safeDefine('REL_PATH', '/admin');
$k4_path_detection = false;
if( defined('REL_PATH') )
{
$ps = preg_replace("/".preg_quote(rtrim(REL_PATH, '/'), '/')."$/", '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF'])));
safeDefine('BASE_PATH', $ps); // in case in-portal has defined it before
# New path detection method: end
// KENEL4 INIT: BEGIN
if($FrontEnd != 1 && !defined('ADMIN') ) define('ADMIN', 1);
if( !defined('APPLICATION_CLASS') ) define('APPLICATION_CLASS', 'MyApplication');
include_once(FULL_PATH.'/kernel/kernel4/startup.php');
// just to make sure that this is correctly detected
if( defined('DEBUG_MODE') && DEBUG_MODE ) $debugger->appendHTML('FULL_PATH: <b>'.FULL_PATH.'</b>');
$application =& kApplication::Instance();
$application->Init();
// compatibility constants
$g_TablePrefix = TABLE_PREFIX;
$pathtoroot = FULL_PATH.'/';
- $admin = 'admin';
- $rootURL = PROTOCOL.SERVER_NAME.(defined('PORT')?':'.PORT : '').BASE_PATH.'/';
- $localURL = $rootURL.'kernel/';
- $adminURL = $rootURL.$admin;
- $imagesURL = $adminURL.'/images';
- $browseURL = $adminURL.'/browse';
- $cssURL = $adminURL.'/include';
+ $admin = 'admin';
+ $rootURL = PROTOCOL.SERVER_NAME.(defined('PORT')?':'.PORT : '').BASE_PATH.'/';
+ $localURL = $rootURL.'kernel/';
+ $adminURL = $rootURL.$admin;
+ $imagesURL = $adminURL.'/images';
+ $browseURL = $adminURL.'/browse';
+ $cssURL = $adminURL.'/include';
+ $pathchar = '/';
// KERNEL4 INIT: END
$k4_path_detection = true;
}
if(!get_magic_quotes_gpc())
{
function addSlashesA($a)
{
foreach($a as $k => $v)
{
$a[$k] = is_array($v) ? addSlashesA($v) : addslashes($v);
}
return $a;
}
foreach(Array(
'HTTP_GET_VARS','HTTP_POST_VARS','HTTP_COOKIE_VARS','HTTP_SESSION_VARS','HTTP_SERVER_VARS',
'_POST','_GET','_COOKIE','_SESSION','_SERVER','_REQUEST') as $_)
if(isset($GLOBALS[$_]))
$GLOBALS[$_]=addSlashesA($GLOBALS[$_]);
}
/*
startup.php: this is the primary startup sequence for in-portal services
*/
if( file_exists(FULL_PATH.'/debug.php') && !defined('DEBUG_MODE') ) include_once(FULL_PATH.'/debug.php');
if( !defined('DEBUG_MODE') ) error_reporting(0);
ini_set('memory_limit', '32M');
ini_set('include_path', '.');
$kernel_version = "1.0.0";
$FormError = array();
$FormValues = array();
/* include PHP version compatibility functions */
require_once(FULL_PATH.'/compat.php');
/* set global variables and module lists */
include_once(FULL_PATH.'/kernel/include/'.( IsDebugMode() ? 'debugger.php' : 'debugger_dummy.php') );
// put all non-checked checkboxes in $_POST & $_REQUEST with 0 values
if( GetVar('form_fields') )
{
$form_fields = GetVar('form_fields');
foreach($form_fields as $checkbox_name)
{
if( GetVar($checkbox_name) === false ) SetVar($checkbox_name,0);
}
}
LogEntry("Initalizing System..\n");
/* for 64 bit timestamps */
require_once(FULL_PATH.'/kernel/include/adodb/adodb-time.inc.php');
require_once(FULL_PATH.'/kernel/include/dates.php');
/* create the global error object */
require_once(FULL_PATH.'/kernel/include/error.php');
$Errors = new clsErrorManager();
require_once(FULL_PATH.'/kernel/include/itemdb.php');
require_once(FULL_PATH.'/kernel/include/db.class.php'); // moved from kernel/include/config.php
require_once(FULL_PATH.'/kernel/include/adodb/adodb.inc.php'); // moved from kernel/include/config.php
require_once(FULL_PATH.'/kernel/include/config.php');
/* create the global configuration object */
LogEntry("Creating Config Object..\n");
$objConfig = new clsConfig();
$objConfig->Load(); /* Populate our configuration data */
LogEntry("Done Loading Configuration\n");
if( defined('ADODB_EXTENSION') && constant('ADODB_EXTENSION') > 0 )
LogEntry("ADO Extension: ".ADODB_EXTENSION."\n");
require_once(FULL_PATH.'/kernel/include/parseditem.php');
require_once(FULL_PATH.'/kernel/include/itemreview.php'); // moved from kernel/include/item.php
require_once(FULL_PATH.'/kernel/include/itemrating.php'); // moved from kernel/include/item.php
require_once(FULL_PATH.'/kernel/include/item.php');
require_once(FULL_PATH.'/kernel/include/syscache.php');
require_once(FULL_PATH.'/kernel/include/modlist.php');
require_once(FULL_PATH.'/kernel/include/searchconfig.php');
require_once(FULL_PATH.'/kernel/include/banrules.php');
$objModules = new clsModList();
$objSystemCache = new clsSysCacheList();
$objSystemCache->PurgeExpired();
$objBanList = new clsBanRuleList();
require_once(FULL_PATH.'/kernel/include/image.php');
require_once(FULL_PATH.'/kernel/include/itemtypes.php');
$objItemTypes = new clsItemTypeList();
require_once(FULL_PATH.'/kernel/include/theme.php');
$objThemes = new clsThemeList();
require_once(FULL_PATH.'/kernel/include/language.php');
$objLanguages = new clsLanguageList();
$objImageList = new clsImageList();
/* Load session and user class definitions */
//require_once("include/customfield.php");
//require_once("include/custommetadata.php");
require_once(FULL_PATH.'/kernel/include/usersession.php');
require_once(FULL_PATH.'/kernel/include/favorites.php');
require_once(FULL_PATH.'/kernel/include/portaluser.php');
require_once(FULL_PATH.'/kernel/include/portalgroup.php');
/* create the user management class */
$objFavorites = new clsFavoriteList();
$objUsers = new clsUserManager();
$objGroups = new clsGroupList();
require_once(FULL_PATH.'/kernel/include/cachecount.php');
require_once(FULL_PATH.'/kernel/include/customfield.php');
require_once(FULL_PATH.'/kernel/include/custommetadata.php');
require_once(FULL_PATH.'/kernel/include/permissions.php');
require_once(FULL_PATH.'/kernel/include/relationship.php');
require_once(FULL_PATH.'/kernel/include/category.php');
require_once(FULL_PATH.'/kernel/include/statitem.php');
/* category base class, used by all the modules at some point */
$objPermissions = new clsPermList();
$objPermCache = new clsPermCacheList();
$objCatList = new clsCatList();
$objCustomFieldList = new clsCustomFieldList();
$objCustomDataList = new clsCustomDataList();
$objCountCache = new clsCacheCountList();
require_once(FULL_PATH.'/kernel/include/smtp.php');
require_once(FULL_PATH.'/kernel/include/emailmessage.php');
require_once(FULL_PATH.'/kernel/include/events.php');
LogEntry("Creating Mail Queue..\n");
$objMessageList = new clsEmailMessageList();
$objEmailQueue = new clsEmailQueue();
LogEntry("Done creating Mail Queue Objects\n");
require_once(FULL_PATH.'/kernel/include/searchitems.php');
require_once(FULL_PATH.'/kernel/include/advsearch.php');
require_once(FULL_PATH.'/kernel/include/parse.php');
require_once(FULL_PATH.'/kernel/include/socket.php');
/* responsible for including module code as required
This script also creates an instance of the user session onject and
handles all session management. The global session object is created
and populated, then the global user object is created and populated
each module's parser functions and action code is included here
*/
LogEntry("Startup complete\n");
include_once("include/modules.php");
if( defined('DEBUG_MODE') && constant('DEBUG_MODE') == 1 && function_exists('DebugByFile') ) DebugByFile();
/* startup is complete, so now check the mail queue to see if there's anything that needs to be sent*/
$objEmailQueue->SendMailQeue();
$ado=&GetADODBConnection();
$rs = $ado->Execute("SELECT * FROM ".GetTablePrefix()."Modules WHERE LoadOrder = 0");
$kernel_version = $rs->fields['Version'];
$adminDir = $objConfig->Get("AdminDirectory");
if ($adminDir == '') {
$adminDir = 'admin';
}
if (strstr(__FILE__, $adminDir) && !GetVar('logout') && !strstr(__FILE__, "install") && !strstr(__FILE__, "index")) {
//echo "testz [".admin_login()."]<br>";
require_login(null, 'expired='.(int)GetVar('expired') );
}
?>
\ No newline at end of file
Property changes on: tags/release_1_1_3/kernel/startup.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.28
\ No newline at end of property
+1.28.4.1
\ No newline at end of property
Index: tags/release_1_1_3/admin/users/group_select.php
===================================================================
--- tags/release_1_1_3/admin/users/group_select.php (revision 3014)
+++ tags/release_1_1_3/admin/users/group_select.php (revision 3015)
@@ -1,187 +1,189 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
+define('IS_POPUP', 1);
+
// new startup: begin
define('REL_PATH', 'admin/users');
$relation_level = count( explode('/', REL_PATH) );
define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
require_once FULL_PATH.'/kernel/startup.php';
// new startup: end
$pathtolocal = $pathtoroot."kernel/";
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
$pathtolocal = $pathtoroot;
//Set Section
$section = 'in-portal:groupselect';
//Set Environment Variable
$envar = "env=" . BuildEnv();
//Display header
$objListToolBar = new clsToolBar();
$objListToolBar->Set("section",$section);
$objListToolBar->Set("load_menu_func","");
$objListToolBar->Set("CheckClass","GroupChecks");
$listImages = array();
//$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
$objListToolBar->Add("select", "la_ToolTip_Select","#","swap('select','toolbar/tool_select_f2.gif');",
"swap('select', 'toolbar/tool_select.gif');",
"SelectSubmit();",
"tool_select.gif");
$objListToolBar->Add("cancel", "la_ToolTip_Stop","#","swap('cancel','toolbar/tool_stop_f2.gif');",
"swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif");
/*$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);
$objListToolBar->AddToInitScript("fwLoadMenus();");
$order = $objConfig->Get("GroupSelect_SortOrder");
$SelectorType = GetVar('Selector');
if(!$SelectorType) $SelectorType = 'checkbox';
$source = GetVar('source');
$objGroups->Page = GetVar('lpn');
if($source)
{
switch($source)
{
case "addcategory_permissions":
$SelectorType = "radio";
$ado = &GetADODBConnection();
$sql = "SELECT Distinct(GroupId) FROM ".GetTablePrefix()."Permissions WHERE CatId=".$_GET["CatId"];
//$sql = "SELECT Distinct(p.GroupId) FROM ".GetTablePrefix()."Permissions AS p LEFT JOIN ".GetTablePrefix()."PortalGroup AS pg ON p.GroupId = pg.GroupId WHERE p.CatId=".$_GET["CatId"]." AND pg.Personal=0";
//echo "SQL 1: $sql<br>";
$rs = $ado->Execute($sql);
$inlist = array();
while($rs && !$rs->EOF)
{
array_push($inlist,$rs->fields["GroupId"]);
$rs->MoveNext();
}
if(count($inlist)>0)
{
$catlist = implode(",",$inlist);
$field = $objConfig->Get("GroupSelect_SortField");
if(!strlen($field))
$field = "Name";
$orderby = trim($field." ".$order);
$sql = "SELECT * FROM ".GetTablePrefix()."PortalGroup WHERE GroupId NOT IN (".$catlist.") AND Personal = 0 ORDER BY $orderby";
//echo "SQL 4: $sql<br>";
$objGroups->Query_Item($sql);
}
else
$objGroups->LoadGroups("Personal = 0",trim($objConfig->Get("GroupSelect_SortField")." ".$order));
break;
case "adduser_groups":
$SelectorType = "radio";
$ado = &GetADODBConnection();
//$sql = sprintf('SELECT GroupId FROM '.GetTablePrefix().'UserGroup WHERE PortalUserId = %s', $_GET["UserId"]);
$sql = sprintf('SELECT GroupId FROM '.$objSession->GetEditTable("UserGroup").' WHERE PortalUserId = %s', $_GET["UserId"]);
$inlist = $ado->GetCol($sql);
if($inlist !== false)
{
$catlist = implode(',', $inlist);
$field = $objConfig->Get("GroupSelect_SortField");
if( !strlen($field) ) $field = "Name";
$orderby = $field." ".$order;
$sql = "SELECT * FROM ".GetTablePrefix()."PortalGroup WHERE GroupId NOT IN (".$catlist.") ORDER BY $orderby";
$objGroups->Query_Item($sql);
}
else
$objGroups->LoadGroups('',trim($objConfig->Get("GroupSelect_SortField")." ".$order));
break;
default:
$objGroups->LoadGroups('',trim($objConfig->Get("GroupSelect_SortField")." ".$order));
break;
}
}
else
{
//echo "Loading Groups..<br>\n";
$objGroups->LoadGroups("",trim($objConfig->Get("GroupSelect_SortField")." ".$order));
}
$objListView = new clsListView($objListToolBar,$objGroups);
$objListView->IdField = "ResourceId";
$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl";
$objListView->ColumnHeaders->Add("Name", admin_language("la_prompt_Name"),1,0,$order,"width=\"20%\"","GroupSelect_SortField","GroupSelect_SortOrder","Name");
$objListView->ColumnHeaders->Add("Description", admin_language("la_prompt_Description"),1,0,$order,"width=\"30%\"","GroupSelect_SortField","GroupSelect_SortOrder","Description");
$objListView->ColumnHeaders->SetSort($objConfig->Get("GroupSelect_SortField"),$order);
$objListView->PrintToolBar = FALSE;
$objListView->CurrentPageVar = "Page_Grouplist";
$objListView->PerPageVar = "Perpage_Grouplist";
$objListView->CheckboxName = "itemlist[]";
$objListView->TotalItemCount = $objGroups->QueryItemCount;
$objListView->SelectorType = $SelectorType;
$objListView->extra_env = 'destform='.GetVar('destform').'&destfield='.GetVar('destfield').'&Selector='.GetVar('Selector');
$title = 'Select Group';
int_header($objListToolBar,NULL,$title);
$values = GetVar('values');
if($values) $current_value = explode(',', $values);
?>
<FORM method="POST" ACTION="" NAME="grouplistform" ID="grouplistform">
<?php
print $objListView->PrintList();
?>
<input type="hidden" name="Action" value="">
</FORM>
<!-- CODE FOR VIEW MENU -->
<form method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]; ?>" name="viewmenu">
<input type="hidden" name="fieldname" value="">
<input type="hidden" name="varvalue" value="">
<input type="hidden" name="varvalue2" value="">
<input type="hidden" name="Action" value="">
</form>
<script src="<?php echo $adminURL; ?>/listview/listview.js"></script>
<script>
initSelectiorContainers();
<?php echo $objListToolBar->Get("CheckClass").".setImages();"; ?>
</script>
<!-- END CODE-->
<?php int_footer(); ?>
Property changes on: tags/release_1_1_3/admin/users/group_select.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10
\ No newline at end of property
+1.10.4.1
\ No newline at end of property
Index: tags/release_1_1_3/admin/config/edit_template.php
===================================================================
--- tags/release_1_1_3/admin/config/edit_template.php (revision 3014)
+++ tags/release_1_1_3/admin/config/edit_template.php (revision 3015)
@@ -1,236 +1,238 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
+define('IS_POPUP', 1);
+
// new startup: begin
define('REL_PATH', 'admin/config');
$relation_level = count( explode('/', REL_PATH) );
define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
require_once FULL_PATH.'/kernel/startup.php';
// new startup: end
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
require_once($pathtoroot."kernel/include/tag-class.php");
$objTagList = new clsTagList();
//$objTagList->LoadGlobalTags();
$section = "in-portal:template_editor";
$ThemeId = GetVar('ThemeId');
$FileId = GetVar('FileId');
if(!GetVar('Action',true) || !is_object($f) ) $f = new clsThemeFile($FileId);
if($FileId)
{
$theme = new clsTheme( $f->Get("ThemeId") ); // create theme from file
$f->LoadFileContents(false);
$name = $f->Get("FileName");
$Action="m_template_edit";
}
else
{
if($ThemeId) // if theme is set
{
$theme = new clsTheme($ThemeId);
$f->Set("ThemeId",$ThemeId);
$f->Set("FilePath",$theme->Get("name"));
$name = "New Template";
$Action = "m_template_add";
}
}
if( is_object($f) && isset($_POST['Action']) )
{
// aka SetFieldsFromHash
//print_pre($_POST);
//echo "SetFields From POST<br>";
$f->Set( Array('FileName','Description','Contents'),
Array(basename($_POST['name']), $_POST['Description'], $_POST['contents']) );
}
$objTemplateCheck = new clsTemplateChecker($theme->ThemeDirectory()."/");
if(count($f->Contents)>0)
{
$fullname = $f->Get("FilePath")."/".$name;
$TemplateType = $objTemplateCheck->GetTemplateType($fullname);
}
else
$TemplateType="new";
if($ThemeId)
{
$m_var_list_update["theme"]=$ThemeId;
$cat = 0;
$template = "index";
if(is_object($f))
{
$p = $f->Get("FilePath");
if(strlen($p))
{
if(substr($p,0,1)=="/")
$p = substr($p,1);
$p .= "/";
$mod = $objModules->GetModuleByPath($p);
if(is_object($mod))
{
$cat = $mod->Get("RootCat");
$template=$mod->Get("TemplatePath")."index";
}
}
}
$m_var_list_update["t"] = $template;
$m_var_list_update["cat"] = $cat;
$PreviewUrl ="http://".ThisDomain().$objConfig->Get("Site_Path")."index.php?env=".BuildEnv();
}
unset($objEditItems);
$envar = "env=".BuildEnv();
$formaction = $_SERVER["PHP_SELF"]."?".$envar;
$sec = $objSections->GetSection($section);
$objListToolBar = new clsToolBar();
$objListToolBar->Set("section",$section);
$objListToolBar->Set("load_menu_func","");
$objListToolBar->Set("CheckClass","ThemeChecks");
$objListToolBar->Add("select", "la_ToolTip_Save","#","swap('select','toolbar/tool_select_f2.gif');",
"swap('select', 'toolbar/tool_select.gif');",
"SelectSubmit();",
"tool_select.gif");
$objListToolBar->Add("cancel", "la_ToolTip_Close","#","swap('cancel','toolbar/tool_stop_f2.gif');",
"swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif");
$objListToolBar->Add("divider");
$objListToolBar->Add("template_preview","la_ToolTip_Preview","#", "swap('template_preview','toolbar/tool_preview_template_f2.gif');",
"swap('template_preview', 'toolbar/tool_preview_template.gif');",
"ShowPreview('$PreviewUrl');","tool_preview_template.gif");
//$objListToolBar->AddToInitScript("fwLoadMenus();");
$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Theme")." '".$theme->Get("Name")."' - ".prompt_language("la_Text_Template");
$title .= " '".$name."'";
$path = $f->FullPath();
if(!is_writable($path))
$title .= " (".admin_language("la_text_ReadOnly").")";
int_header($objListToolBar,NULL,$title);
?>
<TABLE cellSpacing="0" cellPadding="2" width="100%" border="0" class="tableborder">
<form name="template" ID="template" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar;?>" method=POST>
<?php if( $f->HasError() ) { ?>
<TR <?php int_table_color(); ?> style="color: red;">
<TD>ERROR:</TD>
<TD><?php echo $f->ErrorMsg(); ?></TD>
<TD></TD>
</TR>
<?php } ?>
<?php int_subsection_title(prompt_language("la_tab_General")); ?>
<TR <?php int_table_color(); ?> >
<TD><?php echo prompt_language("la_prompt_FileId"); ?></TD>
<TD><?php echo $f->Get("FileId"); ?></TD>
<TD></TD>
</TR>
<TR <?php int_table_color(); ?> >
<TD><SPAN id="prompt_name" CLASS="text"><?php echo prompt_language("la_prompt_FileName"); ?></SPAN></TD>
<TD><input type="text" NAME="name" <?php if($Action == 'm_template_edit') echo 'Readonly'; ?> VALUE="<?php echo $f->Get("FileName"); ?>"> <?php if($Action == 'm_template_edit') echo '&nbsp;(read only)'; ?></TD>
<TD></TD>
</TR>
<TR <?php int_table_color(); ?> >
<TD><SPAN id="prompt_description" CLASS="text"><?php echo prompt_language("la_prompt_Description"); ?></SPAN></TD>
<TD><input type="text" NAME="Description" VALUE="<?php echo $f->Get("Description"); ?>"></TD>
<TD></TD>
</TR>
<!--
<tr <?php int_table_color(); ?>>
<td valign="top" class="text"><?php echo prompt_language("la_prompt_EnableCache"); ?></td>
<td>
<input type="checkbox" name="enable_cache" class="text" value="1" <?php if($f->Get("EnableCache") == 1) echo "checked"; ?>>
<input type=text NAME="cache_timeout" VALUE="<?php echo $f->Get("CacheTimeout"); ?>">
</td>
<td class="text">&nbsp;</td>
</tr>
-->
<?php int_subsection_title(prompt_language("la_Text_Template")); ?>
<tr <?php int_table_color(); ?> >
<td colspan="3">
Item Tags:
<SELECT id="itemtags" name="itemtags" onChange="TagSelectChange(this,'tagattribs',true);"></select>
&nbsp;
<a href="javascript:InsertTag('itemtags');">Insert Tag</a>
&nbsp;
Global Tags:
<SELECT id="taglib" name="taglib" onChange="TagSelectChange(this,'tagattribs',true);"></select>
&nbsp;
<a href="javascript:InsertTag('taglib');">Insert Tag</a>
</td>
</tr>
<TR <?php int_table_color(); ?> >
<td colspan="3" align="center">
<textarea NAME="contents" id="contents" rows="20" cols="95" nowrap><?php echo stripslashes($f->Get('Contents')); ?></textarea>
</td>
</TR>
<tr <?php int_table_color(); ?> >
<td colspan="3">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="30%" align="left" id="taghelp">&nbsp;</td>
<td width="70%" align="left" id="tagexample">&nbsp;</td>
<!--<td width="33%" align="left" id="attrhelp">&nbsp;</td>-->
<!--<td id="tagattribs" valign="top">&nbsp;</td>-->
</tr>
</table>
</td>
</tr>
<TR <?php int_table_color(); ?> >
<td colspan="3">
<input type="hidden" NAME="Action" VALUE="<?php echo $Action; ?>">
<INPUT TYPE="hidden" NAME="ThemeId" VALUE="<?php echo $f->Get("ThemeId"); ?>">
<INPUT TYPE="hidden" NAME="FileId" VALUE="<?php echo $f->Get("FileId"); ?>">
<INPUT TYPE="hidden" NAME="FilePath" VALUE="<?php echo $f->Get("FilePath"); ?>">
<input type="hidden" name="ThemeEditStatus" VALUE="0">
</td>
</tr>
</FORM>
</TABLE>
<SCRIPT language="JavaScript">
init('template','contents');
LoadTags('taglib','global',false);
LoadTags('itemtags','global',true);
</SCRIPT>
<?php int_footer(); ?>
Property changes on: tags/release_1_1_3/admin/config/edit_template.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7
\ No newline at end of property
+1.7.4.1
\ No newline at end of property
Index: tags/release_1_1_3/admin/config/edit_label.php
===================================================================
--- tags/release_1_1_3/admin/config/edit_label.php (revision 3014)
+++ tags/release_1_1_3/admin/config/edit_label.php (revision 3015)
@@ -1,290 +1,292 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
+define('IS_POPUP', 1);
+
// new startup: begin
define('REL_PATH', 'admin/config');
$relation_level = count( explode('/', REL_PATH) );
define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
require_once FULL_PATH.'/kernel/startup.php';
// new startup: end
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
if(count($_POST)>0 && !$_GET['PhraseId'] && $add_error == '')
{
echo "<SCRIPT language=\"JavaScript\">\n";
echo " if(window.opener) window.opener.location=window.opener.location;\n";
echo " window.close();";
echo "</SCRIPT>";
die();
}
$section = "in-portal:phrase_editor";
$ids = GetVar('PhraseId');
if(strlen($ids))
{
$ids = str_replace("[","",$ids);
$ids = str_replace("]","",$ids);
$ids = str_replace("\"","",$ids);
$ids = str_replace("\\","",$ids);
$PhraseIds = explode(",",$ids);
$LangId = 0;
}
else
{
$LangId = GetVar('LanguageId');
$PhraseIds = Array();
}
$EditDirect = (int)GetVar('direct');
if($EditDirect)
{
$NewLabel = GetVar('label');
if(!$LangId)
{
$LangId = $objSession->Get("Language");
}
SetVar( 'name', Array($NewLabel) );
}
else
{
$NewLabel = '';
}
unset($objEditItems);
if (count($PhraseIds) > 1) {
$print_list = true;
}
else {
$ado = &GetADODBConnection();
$table=$EditDirect?GetTablePrefix().'Phrase':$objSession->GetEditTable("Phrase");
$sql = "SELECT PhraseId FROM ".$table;
if ($LangId) {
$sql .= " WHERE LanguageId = $LangId";
}
$rs = $ado->Execute($sql);
$selected_id = !GetVar('en') ? $PhraseIds[0] : $_GET['PhraseId'];
$PhraseIdList = '';
while ($rs && !$rs->EOF) {
$PhraseIdList .= $rs->fields['PhraseId'].",";
$rs->MoveNext();
}
$PhraseIdList = substr($PhraseIdList, 0, strlen($PhraseIdList));
$PhraseIdArr = explode(",", $PhraseIdList);
$print_list = false;
}
$envar = "env=".BuildEnv();
$formaction = $_SERVER["PHP_SELF"]."?".$envar;
$sec = $objSections->GetSection($section);
$objListToolBar = new clsToolBar();
$objListToolBar->Set("section",$section);
$objListToolBar->Set("load_menu_func","");
$objListToolBar->Set("CheckClass","ThemeChecks");
$objListToolBar->Add("select", "la_ToolTip_Select","#","swap('select','toolbar/tool_select_f2.gif');",
"swap('select', 'toolbar/tool_select.gif');",
"LangSubmit();",
"tool_select.gif");
$objListToolBar->Add("cancel", "la_ToolTip_Stop","#","swap('cancel','toolbar/tool_stop_f2.gif');",
"swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif");
if (!$print_list) {
$x = -1;
foreach ($PhraseIdArr as $key => $value) {
if ($value == $selected_id) {
$x = $key;
}
}
if ($x <= 0) {
$en_next = $PhraseIdArr[$x+1];
$en_prev = false;
}
else if ($x >= count($PhraseIdArr) - 1) {
$en_next = false;
$en_prev = $PhraseIdArr[$x - 1];
}
else {
$en_next = $PhraseIdArr[$x+1];
$en_prev = $PhraseIdArr[$x-1];
}
$url = "edit_label.php?$envar&en=0";
$form = "frmPhrase";
MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,1,$url, "LangSubmitMove");
}
$title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Label");
// substitute charset to match the ones from phrase: begin
$tmp_id=GetVar('PhraseId');
if($tmp_id)
{
$tmp_id=explode(',',$tmp_id);
$db=&GetADODBConnection();
$LangId=$db->GetOne('SELECT LanguageId FROM '.GetTablePrefix().'Phrase WHERE PhraseId='.$tmp_id[0]);
$c = $objLanguages->GetItem($LangId);
define('FORCE_CHARSET', $c->Get("Charset") );
}
// substitute charset to match the ones from phrase: end
int_header($objListToolBar,NULL,$title);
?>
<form name="frmPhrase" ID="frmPhrase" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar;?>" method=POST>
<TABLE cellSpacing="0" cellPadding="2" width="100%" class="tableborder">
<?php
if( !isset($objPhraseList) || !is_object($objPhraseList) )
{
$objPhraseList = new clsPhraseList();
}
if(!$EditDirect)
{
$objPhraseList->SourceTable = $objSession->GetEditTable("Phrase");
}
$count_ids = 1;
if ($print_list) {
$count_ids = count($PhraseIds);
}
else {
foreach($PhraseIdArr as $key => $value) {
if ($value == $selected_id) {
$PhraseIds[0] = $value;
}
}
}
for($x=0;$x<$count_ids;$x++)
{
$p = $objPhraseList->GetItem($PhraseIds[$x]);
//echo "<pre>"; print_r($p); echo "</pre>";
if(!$LangId)
$LangId = $p->Get("LanguageId");
if(is_object($p) && ($selected_id != '' || $count_ids > 1))
{
echo int_subsection_title_ret(admin_language("la_tab_General")." :: ".GetPrimaryTranslation($p->Get("Phrase")));
echo "<TR ".int_table_color_ret()." >\n";
echo " <TD>".admin_language("la_prompt_PhraseId")."</TD>\n";
echo " <TD>".$p->Get("PhraseId")."</TD>\n";
echo " <TD></TD>\n";
echo "</TR>\n";
echo "<TR ".int_table_color_ret()." >\n";
echo " <TD>".admin_language("la_prompt_Label")."</TD>\n";
echo " <TD><input size=60 type=text tabindex=\"1\" ValidationType=\"exists\" NAME=\"name[".$p->Get("PhraseId")."]\" VALUE=\"".inp_htmlize($p->Get("Phrase"))."\"></TD>\n";
echo " <TD></TD>\n";
echo "</TR>\n";
echo "<TR ".int_table_color_ret()." >\n";
echo " <TD>".admin_language("la_prompt_Value")."</TD>\n";
echo " <TD><input size=60 type=text tabindex=\"2\" ValidationType=\"exists\" NAME=\"translation[".$p->Get("PhraseId")."]\" VALUE=\"".inp_htmlize($p->Get("Translation"))."\"></TD>\n";
echo " <TD></TD>\n";
echo "</TR>\n";
echo "<TR ".int_table_color_ret()." >\n";
echo " <TD>".admin_language("la_prompt_PhraseType")."</TD>\n";
echo " <TD COLSPAN=2>\n";
echo " <input type=radio tabindex=\"3\" NAME=\"phrasetype[".$p->Get("PhraseId")."]\" VALUE=\"0\"";
if($p->Get("PhraseType")==0)
echo "CHECKED";
echo ">";
echo admin_language("la_Text_Front");
echo " <input type=radio tabindex=\"3\" NAME=\"phrasetype[".$p->Get("PhraseId")."]\" VALUE=\"1\"";
if($p->Get("PhraseType")==1)
echo "CHECKED";
echo ">";
echo admin_language("la_Text_Admin");
echo " <input type=radio tabindex=\"3\" NAME=\"phrasetype[".$p->Get("PhraseId")."]\" VALUE=\"2\"";
if($p->Get("PhraseType")==2)
echo "CHECKED";
echo ">";
echo admin_language("la_Text_Both");
echo " </TD>\n";
echo "</TR>\n";
unset($p);
}
}
?>
<?php
if(strlen($NewLabel)>0)
{
"::".$PriTrans = GetPrimaryTranslation($NewLabel);
}
else
{
$PriTrans = '';
}
?>
<?php if ( !GetVar('PhraseId') ) { ?>
<?php int_subsection_title(admin_language("la_tab_General")." :: New Phrase ".$PriTrans); ?>
<TR <?php int_table_color(); ?> >
<td><?php echo admin_language("la_prompt_Label"); ?></td>
<td><input type=text size=60 tabindex="4" NAME="name[0]" VALUE="<?php $names = GetVar('name'); if($names !== false) echo $names[0]; ?>"></td>
<td></td>
</tr>
<TR <?php int_table_color(); ?> >
<td><?php echo admin_language("la_prompt_Value"); ?></td>
<td><input type=text size=60 tabindex="5" NAME="translation[0]" VALUE="<?php $traslations = GetVar('translation'); if($traslations !== false) echo $traslations[0]; ?>"></td>
<td></td>
</tr>
<TR <?php int_table_color(); ?> >
<TD><?php echo admin_language("la_prompt_PhraseType"); ?></TD>
<TD COLSPAN=2>
<input type="radio" tabindex="6" name="phrasetype[0]" id="phrasetype_0" value="0">
<label for="phrasetype_0"><?php echo admin_language("la_Text_Front"); ?></label>
<input type="radio" tabindex="7" name="phrasetype[0]" id="phrasetype_1" value="1"<?php if($EditDirect) echo ' checked'; ?>>
<label for="phrasetype_1"><?php echo admin_language("la_Text_Admin"); ?></label>
<input type="radio" tabindex="8" name="phrasetype[0]" id="phrasetype_2" value="2">
<label for="phrasetype_2"><?php echo admin_language("la_Text_Both"); ?></label>
</TD>
</tr>
<tr>
<td colspan="3" align="center"><font color="#FF0000"><?php if( isset($add_error) ) echo $add_error; ?></font></td>
</tr>
<INPUT type=hidden name="Action1" VALUE="new">
<?php } ?>
<INPUT TYPE=HIDDEN NAME="LanguageId" VALUE="<?php echo $LangId; ?>">
<INPUT type=hidden name="Action" VALUE="m_phrase_edit">
<input type=hidden name="direct" VALUE="<?php echo $EditDirect; ?>">
</FORM>
</TABLE>
<?php int_footer(); ?>
Property changes on: tags/release_1_1_3/admin/config/edit_label.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.13
\ No newline at end of property
+1.13.4.1
\ No newline at end of property
Index: tags/release_1_1_3/admin/install/upgrades/readme_1_1_3.txt
===================================================================
--- tags/release_1_1_3/admin/install/upgrades/readme_1_1_3.txt (nonexistent)
+++ tags/release_1_1_3/admin/install/upgrades/readme_1_1_3.txt (revision 3015)
@@ -0,0 +1,6 @@
+Readme notes for In-portal Platform 1.1.3
+Intechnic Corporation, November 4, 2005
+
+Bug fixes:
+- Session expiration in some pop-up windows in the adminstrative console while using Microsoft Internet Explorer
+
Property changes on: tags/release_1_1_3/admin/install/upgrades/readme_1_1_3.txt
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: tags/release_1_1_3/admin/install/upgrades/inportal_upgrade_v1.1.3.sql
===================================================================
--- tags/release_1_1_3/admin/install/upgrades/inportal_upgrade_v1.1.3.sql (nonexistent)
+++ tags/release_1_1_3/admin/install/upgrades/inportal_upgrade_v1.1.3.sql (revision 3015)
@@ -0,0 +1 @@
+UPDATE Modules SET Version = '1.1.3' WHERE Name = 'In-Portal';
Property changes on: tags/release_1_1_3/admin/install/upgrades/inportal_upgrade_v1.1.3.sql
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline