Index: trunk/themes/default/img/envelope.gif =================================================================== diff -u Binary files differ Index: trunk/png_replace.php =================================================================== diff -u --- trunk/png_replace.php (revision 0) +++ trunk/png_replace.php (revision 13) @@ -0,0 +1,93 @@ +|)/Uis',$x,$images); + while(list($imgnum,$v)=@each($images[0])){ + $original=$v; + $atts=''; $width=0; $height=0; + // If the size is defined by styles, find + preg_match_all('/style=".*(width: ([0-9]+))px.*'. + '(height: ([0-9]+))px.*"/Ui',$v,$arr2); + if(is_array($arr2) && count($arr2[0])){ + // size was defined by styles, get values + $width=$arr2[2][0]; + $height=$arr2[4][0]; + } + // size was not defined by styles, get values + preg_match_all('/width=\"?([0-9]+)\"?/i',$v,$arr2); + if(is_array($arr2) && count($arr2[0])){ + $width=$arr2[1][0]; + } + preg_match_all('/height=\"?([0-9]+)\"?/i',$v,$arr2); + if(is_array($arr2) && count($arr2[0])){ + $height=$arr2[1][0]; + } + preg_match_all('/src=\"([^\"]+\.png)\"/i',$v,$arr2); + if(isset($arr2[1][0]) && !empty($arr2[1][0])) + $image=$arr2[1][0]; + else + $image=NULL; + + // We do this so that we can put our spacer.gif image in the same + // directory as the image + $tmp=split('[\\/]',$image); + array_pop($tmp); + $image_path=join('/',$tmp); + if(strlen($image_path)) $image_path.='/'; + + // end quote is already supplied by originial src attribute + $replace_src_with=$spacer.'" style="width: '.$width. + 'px; height: '.$height.'px; filter: progid:DXImageTransform.'. + 'Microsoft.AlphaImageLoader(src=\''.$image.'\', sizingMethod='. + '\'scale\')'; + + // now create the new tag from the old + $new_tag=str_replace($image,$replace_src_with,$original); + + // now place the new tag into the content + $x=str_replace($original,$new_tag,$x); + } + return $x; +} +?> \ No newline at end of file Index: trunk/themes/default/login/right_limited.tpl =================================================================== diff -u --- trunk/themes/default/login/right_limited.tpl (revision 0) +++ trunk/themes/default/login/right_limited.tpl (revision 13) @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_import_language.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/browse.php =================================================================== diff -u --- trunk/kernel/admin/include/browse.php (revision 0) +++ trunk/kernel/admin/include/browse.php (revision 13) @@ -0,0 +1,198 @@ + + + + + + + + + +END; + +?> Index: trunk/admin/icons/icon46_settings_output.gif =================================================================== diff -u Binary files differ Index: trunk/admin/logs/searchlog.php =================================================================== diff -u --- trunk/admin/logs/searchlog.php (revision 0) +++ trunk/admin/logs/searchlog.php (revision 13) @@ -0,0 +1,214 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//admin only util + +$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:searchlog'; + +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +//Display header + +$objListToolBar = new clsToolBar(); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass","ListChecks"); +$objListToolBar->Set("CheckForm","searchlistform"); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("log_refresh", "la_ToolTip_Refresh","#","swap('log_refresh','toolbar/tool_refresh_f2.gif');", + "swap('log_refresh', 'toolbar/tool_refresh.gif');","window.location.reload(true);", + "tool_refresh.gif", FALSE, TRUE); + +$objListToolBar->Add("log_reset","la_ToolTip_Reset","#", "if (ListChecks.itemChecked()) swap('log_reset','toolbar/tool_reset_f2.gif');", + "if (ListChecks.itemChecked()) swap('log_reset', 'toolbar/tool_reset.gif');","if (ListChecks.itemChecked()) ListChecks.check_submit('searchlog','m_keyword_reset');", + "tool_reset.gif", TRUE, TRUE); + +$listImages[] = "ListChecks.addImage('log_reset','$imagesURL/toolbar/tool_reset.gif','$imagesURL/toolbar/tool_reset_f3.gif',1); "; + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("user_print", "la_ToolTip_Print","#","swap('user_print','toolbar/tool_print_f2.gif');", + "swap('user_print', 'toolbar/tool_print.gif');","window.print();","tool_print.gif"); + +/*$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();"); + +$objSearchList = new clsSearchLogList(); + +$order = $objConfig->Get("SearchLog_SortOrder"); +$SearchWords = $objSession->GetVariable("KeywordSearchWord"); +if(strlen($SearchWords)) +{ + $where = $objSearchWords->AdminSearchWhereClause($SearchWords); +} +else + $where = ""; + +$sql = "SELECT ELT(sl.SearchType+1,'".admin_language("la_Text_Simple")."','".admin_language("la_Text_Advanced")."') as TextType,sl.* FROM ".GetTablePrefix()."SearchLog as sl"; + +if(strlen($where)) + $sql .= " WHERE ".$where; + +$orderBy = trim($objConfig->Get("SearchLog_SortField")." ".$objConfig->Get("SearchLog_SortOrder")); +if(strlen($orderBy)) + $sql .=" ORDER BY ".$orderBy; + +$sql .=" ".GetLimitSQL($objSession->GetVariable("Page_SearchLog"),$objConfig->Get("Perpage_SearchLog")); + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + +$objSearchList->Query_Item($sql); +$itemcount = TableCount(GetTablePrefix()."SearchLog", $where,0); + +$objListView = new clsListView($objListToolBar,$objSearchList); +$objListView->IdField = "SearchLogId"; +$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl"; + +$objListView->ColumnHeaders->Add("TextType",admin_language("la_prompt_SearchType"),1,0,$order,"width=\"20%\"","SearchLog_SortField","SearchLog_SortOrder","TextType"); +$objListView->ColumnHeaders->Add("Keyword",admin_language("la_prompt_Keyword"),1,0,$order,"width=\"20%\"","SearchLog_SortField","SearchLog_SortOrder","Keyword"); +$objListView->ColumnHeaders->Add("Indices",admin_language("la_prompt_Frequency"),1,0,$order,"width=\"30%\"","SearchLog_SortField","SearchLog_SortOrder","Indices"); +$objListView->ColumnHeaders->SetSort($objConfig->Get("SearchLog_SortField"),$order); + +$objListView->PrintToolBar = FALSE; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_searchword_search"; +$objListView->CurrentPageVar = "Page_SearchLog"; +$objListView->PerPageVar = "Perpage_SearchLog"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->TotalItemCount = $itemcount; + +$objListView->ConfigureViewMenu("SearchLog_SortField","SearchLog_SortOrder","TextType","","",0); + +$title = admin_language("la_Show_Log")." (".$itemcount.")"; +$h = "\n\n\n"; +int_header($objListToolBar,NULL,$title, NULL, $h); +?> +
+PrintList(); +?> + +
+ + +
+ + + + +
+
+ + +
+ + + + + Index: trunk/kernel/include/adodb/adodb.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb.inc.php (revision 13) @@ -0,0 +1,3377 @@ + + Manual is at http://php.weblogs.com/adodb_manual + + */ + + if (!defined('_ADODB_LAYER')) { + define('_ADODB_LAYER',1); + + //============================================================================================== + // CONSTANT DEFINITIONS + //============================================================================================== + + define('ADODB_BAD_RS','

Bad $rs in %s. Connection or SQL invalid. Try using $connection->debug=true;

'); + + define('ADODB_FETCH_DEFAULT',0); + define('ADODB_FETCH_NUM',1); + define('ADODB_FETCH_ASSOC',2); + define('ADODB_FETCH_BOTH',3); + + /* + Controls ADODB_FETCH_ASSOC field-name case. Default is 2, use native case-names. + This currently works only with mssql, odbc, oci8po and ibase derived drivers. + + 0 = assoc lowercase field names. $rs->fields['orderid'] + 1 = assoc uppercase field names. $rs->fields['ORDERID'] + 2 = use native-case field names. $rs->fields['OrderID'] + */ + if (!defined('ADODB_ASSOC_CASE')) define('ADODB_ASSOC_CASE',2); + + // allow [ ] @ ` and . in table names + define('ADODB_TABLE_REGEX','([]0-9a-z_\`\.\@\[-]*)'); + + + if (!defined('ADODB_PREFETCH_ROWS')) define('ADODB_PREFETCH_ROWS',10); + + /** + * Set ADODB_DIR to the directory where this file resides... + * This constant was formerly called $ADODB_RootPath + */ + if (!defined('ADODB_DIR')) define('ADODB_DIR',dirname(__FILE__)); + + if (!defined('TIMESTAMP_FIRST_YEAR')) define('TIMESTAMP_FIRST_YEAR',100); + + //============================================================================================== + // GLOBAL VARIABLES + //============================================================================================== + + GLOBAL + $ADODB_vers, // database version + $ADODB_Database, // last database driver used + $ADODB_COUNTRECS, // count number of records returned - slows down query + $ADODB_CACHE_DIR, // directory to cache recordsets + $ADODB_EXTENSION, // ADODB extension installed + $ADODB_COMPAT_PATCH, // If $ADODB_COUNTRECS and this is true, $rs->fields is available on EOF + $ADODB_FETCH_MODE; // DEFAULT, NUM, ASSOC or BOTH. Default follows native driver default... + + //============================================================================================== + // GLOBAL SETUP + //============================================================================================== + + if (strnatcmp(PHP_VERSION,'4.3.0')>=0) { + define('ADODB_PHPVER',0x4300); + } else if (strnatcmp(PHP_VERSION,'4.2.0')>=0) { + define('ADODB_PHPVER',0x4200); + } else if (strnatcmp(PHP_VERSION,'4.0.5')>=0) { + define('ADODB_PHPVER',0x4050); + } else { + define('ADODB_PHPVER',0x4000); + } + $ADODB_EXTENSION = defined('ADODB_EXTENSION'); + //if (extension_loaded('dbx')) define('ADODB_DBX',1); + + /** + Accepts $src and $dest arrays, replacing string $data + */ + function ADODB_str_replace($src, $dest, $data) + { + if (ADODB_PHPVER >= 0x4050) return str_replace($src,$dest,$data); + + $s = reset($src); + $d = reset($dest); + while ($s !== false) { + $data = str_replace($s,$d,$data); + $s = next($src); + $d = next($dest); + } + return $data; + } + + function ADODB_Setup() + { + GLOBAL + $ADODB_vers, // database version + $ADODB_Database, // last database driver used + $ADODB_COUNTRECS, // count number of records returned - slows down query + $ADODB_CACHE_DIR, // directory to cache recordsets + $ADODB_FETCH_MODE; + + $ADODB_FETCH_MODE = ADODB_FETCH_DEFAULT; + + if (!isset($ADODB_CACHE_DIR)) { + $ADODB_CACHE_DIR = '/tmp'; + } else { + // do not accept url based paths, eg. http:/ or ftp:/ + if (strpos($ADODB_CACHE_DIR,'://') !== false) + die("Illegal path http:// or ftp://"); + } + + + // Initialize random number generator for randomizing cache flushes + srand(((double)microtime())*1000000); + + /** + * Name of last database driver loaded into memory. Set by ADOLoadCode(). + */ + $ADODB_Database = ''; + + /** + * ADODB version as a string. + */ + $ADODB_vers = 'V3.60 16 June 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved. Released BSD & LGPL.'; + + /** + * Determines whether recordset->RecordCount() is used. + * Set to false for highest performance -- RecordCount() will always return -1 then + * for databases that provide "virtual" recordcounts... + */ + $ADODB_COUNTRECS = true; + } + + + //============================================================================================== + // CHANGE NOTHING BELOW UNLESS YOU ARE CODING + //============================================================================================== + + ADODB_Setup(); + + //============================================================================================== + // CLASS ADOFieldObject + //============================================================================================== + /** + * Helper class for FetchFields -- holds info on a column + */ + class ADOFieldObject { + var $name = ''; + var $max_length=0; + var $type=""; + + // additional fields by dannym... (danny_milo@yahoo.com) + var $not_null = false; + // actually, this has already been built-in in the postgres, fbsql AND mysql module? ^-^ + // so we can as well make not_null standard (leaving it at "false" does not harm anyways) + + var $has_default = false; // this one I have done only in mysql and postgres for now ... + // others to come (dannym) + var $default_value; // default, if any, and supported. Check has_default first. + } + + + + function ADODB_TransMonitor($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection) + { + //print "Errorno ($fn errno=$errno m=$errmsg) "; + + $thisConnection->_transOK = false; + if ($thisConnection->_oldRaiseFn) { + $fn = $thisConnection->_oldRaiseFn; + $fn($dbms, $fn, $errno, $errmsg, $p1, $p2,$thisConnection); + } + } + + //============================================================================================== + // CLASS ADOConnection + //============================================================================================== + + /** + * Connection object. For connecting to databases, and executing queries. + */ + class ADOConnection { + // + // PUBLIC VARS + // + var $dataProvider = 'native'; + var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql + var $database = ''; /// Name of database to be used. + var $host = ''; /// The hostname of the database server + var $user = ''; /// The username which is used to connect to the database server. + var $password = ''; /// Password for the username. For security, we no longer store it. + var $debug = false; /// if set to true will output sql statements + var $maxblobsize = 256000; /// maximum size of blobs or large text fields -- some databases die otherwise like foxpro + var $concat_operator = '+'; /// default concat operator -- change to || for Oracle/Interbase + var $fmtDate = "'Y-m-d'"; /// used by DBDate() as the default date format used by the database + var $fmtTimeStamp = "'Y-m-d, h:i:s A'"; /// used by DBTimeStamp as the default timestamp fmt. + var $true = '1'; /// string that represents TRUE for a database + var $false = '0'; /// string that represents FALSE for a database + var $replaceQuote = "\\'"; /// string to use to replace quotes + var $charSet=false; /// character set to use - only for interbase + var $metaDatabasesSQL = ''; + var $metaTablesSQL = ''; + var $uniqueOrderBy = false; /// All order by columns have to be unique + var $emptyDate = ' '; + //-- + var $hasInsertID = false; /// supports autoincrement ID? + var $hasAffectedRows = false; /// supports affected rows for update/delete? + var $hasTop = false; /// support mssql/access SELECT TOP 10 * FROM TABLE + var $hasLimit = false; /// support pgsql/mysql SELECT * FROM TABLE LIMIT 10 + var $readOnly = false; /// this is a readonly database - used by phpLens + var $hasMoveFirst = false; /// has ability to run MoveFirst(), scrolling backwards + var $hasGenID = false; /// can generate sequences using GenID(); + var $hasTransactions = true; /// has transactions + //-- + var $genID = 0; /// sequence id used by GenID(); + var $raiseErrorFn = false; /// error function to call + var $upperCase = false; /// uppercase function to call for searching/where + var $isoDates = false; /// accepts dates in ISO format + var $cacheSecs = 3600; /// cache for 1 hour + var $sysDate = false; /// name of function that returns the current date + var $sysTimeStamp = false; /// name of function that returns the current timestamp + var $arrayClass = 'ADORecordSet_array'; /// name of class used to generate array recordsets, which are pre-downloaded recordsets + + var $noNullStrings = false; /// oracle specific stuff - if true ensures that '' is converted to ' ' + var $numCacheHits = 0; + var $numCacheMisses = 0; + var $pageExecuteCountRows = true; + var $uniqueSort = false; /// indicates that all fields in order by must be unique + var $leftOuter = false; /// operator to use for left outer join in WHERE clause + var $rightOuter = false; /// operator to use for right outer join in WHERE clause + var $ansiOuter = false; /// whether ansi outer join syntax supported + var $autoRollback = false; // autoRollback on PConnect(). + var $poorAffectedRows = false; // affectedRows not working or unreliable + + var $fnExecute = false; + var $fnCacheExecute = false; + var $blobEncodeType = false; // false=not required, 'I'=encode to integer, 'C'=encode to char + var $dbxDriver = false; + + // + // PRIVATE VARS + // + var $_oldRaiseFn = false; + var $_transOK = null; + var $_connectionID = false; /// The returned link identifier whenever a successful database connection is made. + var $_errorMsg = ''; /// A variable which was used to keep the returned last error message. The value will + /// then returned by the errorMsg() function + + var $_queryID = false; /// This variable keeps the last created result link identifier + + var $_isPersistentConnection = false; /// A boolean variable to state whether its a persistent connection or normal connection. */ + var $_bindInputArray = false; /// set to true if ADOConnection.Execute() permits binding of array parameters. + var $autoCommit = true; /// do not modify this yourself - actually private + var $transOff = 0; /// temporarily disable transactions + var $transCnt = 0; /// count of nested transactions + + var $fetchMode=false; + + /** + * Constructor + */ + function ADOConnection() + { + die('Virtual Class -- cannot instantiate'); + } + + /** + Get server version info... + + @returns An array with 2 elements: $arr['string'] is the description string, + and $arr[version] is the version (also a string). + */ + function ServerInfo() + { + return array('description' => '', 'version' => ''); + } + + function _findvers($str) + { + if (preg_match('/([0-9]+\.([0-9\.])+)/',$str, $arr)) return $arr[1]; + else return ''; + } + + /** + * All error messages go through this bottleneck function. + * You can define your own handler by defining the function name in ADODB_OUTP. + */ + function outp($msg,$newline=true) + { + global $HTTP_SERVER_VARS; + + if (defined('ADODB_OUTP')) { + $fn = ADODB_OUTP; + $fn($msg,$newline); + return; + } + + if ($newline) $msg .= "
\n"; + + if (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) echo $msg; + else echo strip_tags($msg); + flush(); + } + + /** + * Connect to database + * + * @param [argHostname] Host to connect to + * @param [argUsername] Userid to login + * @param [argPassword] Associated password + * @param [argDatabaseName] database + * @param [forceNew] force new connection + * + * @return true or false + */ + function Connect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "", $forceNew = false) + { + if ($argHostname != "") $this->host = $argHostname; + if ($argUsername != "") $this->user = $argUsername; + if ($argPassword != "") $this->password = $argPassword; // not stored for security reasons + if ($argDatabaseName != "") $this->database = $argDatabaseName; + + $this->_isPersistentConnection = false; + if ($fn = $this->raiseErrorFn) { + if ($forceNew) { + if ($this->_nconnect($this->host, $this->user, $this->password, $this->database)) return true; + } else { + if ($this->_connect($this->host, $this->user, $this->password, $this->database)) return true; + } + $err = $this->ErrorMsg(); + if (empty($err)) $err = "Connection error to server '$argHostname' with user '$argUsername'"; + $fn($this->databaseType,'CONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this); + } else { + if ($forceNew) { + if ($this->_nconnect($this->host, $this->user, $this->password, $this->database)) return true; + } else { + if ($this->_connect($this->host, $this->user, $this->password, $this->database)) return true; + } + } + if ($this->debug) ADOConnection::outp( $this->host.': '.$this->ErrorMsg()); + return false; + } + + function _nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName) + { + return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabaseName); + } + + + /** + * Always force a new connection to database - currently only works with oracle + * + * @param [argHostname] Host to connect to + * @param [argUsername] Userid to login + * @param [argPassword] Associated password + * @param [argDatabaseName] database + * + * @return true or false + */ + function NConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "") + { + return $this->Connect($argHostname, $argUsername, $argPassword, $argDatabaseName, true); + } + + /** + * Establish persistent connect to database + * + * @param [argHostname] Host to connect to + * @param [argUsername] Userid to login + * @param [argPassword] Associated password + * @param [argDatabaseName] database + * + * @return return true or false + */ + function PConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "") + { + if (defined('ADODB_NEVER_PERSIST')) + return $this->Connect($argHostname,$argUsername,$argPassword,$argDatabaseName); + + if ($argHostname != "") $this->host = $argHostname; + if ($argUsername != "") $this->user = $argUsername; + if ($argPassword != "") $this->password = $argPassword; + if ($argDatabaseName != "") $this->database = $argDatabaseName; + + $this->_isPersistentConnection = true; + + if ($fn = $this->raiseErrorFn) { + if ($this->_pconnect($this->host, $this->user, $this->password, $this->database)) return true; + $err = $this->ErrorMsg(); + if (empty($err)) $err = "Connection error to server '$argHostname' with user '$argUsername'"; + $fn($this->databaseType,'PCONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this); + } else + if ($this->_pconnect($this->host, $this->user, $this->password, $this->database)) return true; + + if ($this->debug) ADOConnection::outp( $this->host.': '.$this->ErrorMsg()); + return false; + } + + // Format date column in sql string given an input format that understands Y M D + function SQLDate($fmt, $col=false) + { + if (!$col) $col = $this->sysDate; + return $col; // child class implement + } + + /** + * Should prepare the sql statement and return the stmt resource. + * For databases that do not support this, we return the $sql. To ensure + * compatibility with databases that do not support prepare: + * + * $stmt = $db->Prepare("insert into table (id, name) values (?,?)"); + * $db->Execute($stmt,array(1,'Jill')) or die('insert failed'); + * $db->Execute($stmt,array(2,'Joe')) or die('insert failed'); + * + * @param sql SQL to send to database + * + * @return return FALSE, or the prepared statement, or the original sql if + * if the database does not support prepare. + * + */ + function Prepare($sql) + { + return $sql; + } + + /** + * Some databases, eg. mssql require a different function for preparing + * stored procedures. So we cannot use Prepare(). + * + * Should prepare the stored procedure and return the stmt resource. + * For databases that do not support this, we return the $sql. To ensure + * compatibility with databases that do not support prepare: + * + * @param sql SQL to send to database + * + * @return return FALSE, or the prepared statement, or the original sql if + * if the database does not support prepare. + * + */ + function PrepareSP($sql) + { + return $this->Prepare($sql); + } + + /** + * PEAR DB Compat + */ + function Quote($s) + { + return $this->qstr($s,false); + } + + function q(&$s) + { + $s = $this->qstr($s,false); + } + + /** + * PEAR DB Compat - do not use internally. + */ + function ErrorNative() + { + return $this->ErrorNo(); + } + + + /** + * PEAR DB Compat - do not use internally. + */ + function nextId($seq_name) + { + return $this->GenID($seq_name); + } + + /** + * Lock a row, will escalate and lock the table if row locking not supported + * will normally free the lock at the end of the transaction + * + * @param $table name of table to lock + * @param $where where clause to use, eg: "WHERE row=12". If left empty, will escalate to table lock + */ + function RowLock($table,$where) + { + return false; + } + + function CommitLock($table) + { + return $this->CommitTrans(); + } + + function RollbackLock($table) + { + return $this->RollbackTrans(); + } + + /** + * PEAR DB Compat - do not use internally. + * + * The fetch modes for NUMERIC and ASSOC for PEAR DB and ADODB are identical + * for easy porting :-) + * + * @param mode The fetchmode ADODB_FETCH_ASSOC or ADODB_FETCH_NUM + * @returns The previous fetch mode + */ + function SetFetchMode($mode) + { + $old = $this->fetchMode; + $this->fetchMode = $mode; + + if ($old === false) { + global $ADODB_FETCH_MODE; + return $ADODB_FETCH_MODE; + } + return $old; + } + + + /** + * PEAR DB Compat - do not use internally. + */ + function &Query($sql, $inputarr=false) + { + $rs = &$this->Execute($sql, $inputarr); + if (!$rs && defined('ADODB_PEAR')) return ADODB_PEAR_Error(); + return $rs; + } + + + /** + * PEAR DB Compat - do not use internally + */ + function &LimitQuery($sql, $offset, $count) + { + $rs = &$this->SelectLimit($sql, $count, $offset); // swap + if (!$rs && defined('ADODB_PEAR')) return ADODB_PEAR_Error(); + return $rs; + } + + + /** + * PEAR DB Compat - do not use internally + */ + function Disconnect() + { + return $this->Close(); + } + + /* + Usage in oracle + $stmt = $db->Prepare('select * from table where id =:myid and group=:group'); + $db->Parameter($stmt,$id,'myid'); + $db->Parameter($stmt,$group,'group',64); + $db->Execute(); + + @param $stmt Statement returned by Prepare() or PrepareSP(). + @param $var PHP variable to bind to + @param $name Name of stored procedure variable name to bind to. + @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8. + @param [$maxLen] Holds an maximum length of the variable. + @param [$type] The data type of $var. Legal values depend on driver. + + */ + function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false) + { + return false; + } + + /** + Improved method of initiating a transaction. Used together with CompleteTrans(). + Advantages include: + + a. StartTrans/CompleteTrans is nestable, unlike BeginTrans/CommitTrans/RollbackTrans. + Only the outermost block is treated as a transaction.
+ b. CompleteTrans auto-detects SQL errors, and will rollback on errors, commit otherwise.
+ c. All BeginTrans/CommitTrans/RollbackTrans inside a StartTrans/CompleteTrans block + are disabled, making it backward compatible. + */ + function StartTrans($errfn = 'ADODB_TransMonitor') + { + + if ($this->transOff > 0) { + $this->transOff += 1; + return; + } + + $this->_oldRaiseFn = $this->raiseErrorFn; + $this->raiseErrorFn = $errfn; + $this->_transOK = true; + + if ($this->debug && $this->transCnt > 0) ADOConnection::outp("Bad Transaction: StartTrans called within BeginTrans"); + $this->BeginTrans(); + $this->transOff = 1; + } + + /** + Used together with StartTrans() to end a transaction. Monitors connection + for sql errors, and will commit or rollback as appropriate. + + @autoComplete if true, monitor sql errors and commit and rollback as appropriate, + and if set to false force rollback even if no SQL error detected. + @returns true on commit, false on rollback. + */ + function CompleteTrans($autoComplete = true) + { + if ($this->transOff > 1) { + $this->transOff -= 1; + return true; + } + $this->raiseErrorFn = $this->_oldRaiseFn; + + $this->transOff = 0; + if ($this->_transOK && $autoComplete) $this->CommitTrans(); + else $this->RollbackTrans(); + + return $this->_transOK; + } + + /* + At the end of a StartTrans/CompleteTrans block, perform a rollback. + */ + function FailTrans() + { + if ($this->debug && $this->transOff == 0) { + ADOConnection::outp("FailTrans outside StartTrans/CompleteTrans"); + } + $this->_transOK = false; + } + + function getmicrotime() + { + list($usec, $sec) = explode(" ",microtime()); + return ((float)$usec + (float)$sec); + } + + /** + * Execute SQL + * + * @param sql SQL statement to execute, or possibly an array holding prepared statement ($sql[0] will hold sql text) + * @param [inputarr] holds the input data to bind to. Null elements will be set to null. + * @param [arg3] reserved for john lim for future use + * @return RecordSet or false + */ + function &Execute($sql,$inputarr=false,$arg3=false) + { + global $pathtoroot, $totalsql, $sqlcount; + + if ($this->fnExecute) { + $fn = $this->fnExecute; + $fn($this,$sql,$inputarr); + } + if (!$this->_bindInputArray && $inputarr) { + $sqlarr = explode('?',$sql); + $sql = ''; + $i = 0; + foreach($inputarr as $v) { + + $sql .= $sqlarr[$i]; + // from Ron Baldwin + // Only quote string types + if (gettype($v) == 'string') + $sql .= $this->qstr($v); + else if ($v === null) + $sql .= 'NULL'; + else + $sql .= $v; + $i += 1; + + } + $sql .= $sqlarr[$i]; + if ($i+1 != sizeof($sqlarr)) + ADOConnection::outp( "Input Array does not match ?: ".htmlspecialchars($sql)); + $inputarr = false; + } + // debug version of query + if ($this->debug) { + global $HTTP_SERVER_VARS; + + $ss = ''; + if ($inputarr) { + foreach ($inputarr as $kk => $vv) { + if (is_string($vv) && strlen($vv)>64) $vv = substr($vv,0,64).'...'; + $ss .= "($kk=>'$vv') "; + } + $ss = "[ $ss ]"; + } + $sqlTxt = str_replace(',',', ',is_array($sql) ?$sql[0] : $sql); + + // check if running from browser or command-line + $inBrowser = isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']); + + if ($inBrowser) + ADOConnection::outp( "
\n($this->databaseType): ".htmlspecialchars($sqlTxt)."   $ss\n
\n",false); + else + ADOConnection::outp( "=----\n($this->databaseType): ".($sqlTxt)." \n-----\n",false); + flush(); + + $this->_queryID = $this->_query($sql,$inputarr,$arg3); + + /* + Alexios Fakios notes that ErrorMsg() must be called before ErrorNo() for mssql + because ErrorNo() calls Execute('SELECT @ERROR'), causing recure + */ + if ($this->databaseType == 'mssql') { + // ErrorNo is a slow function call in mssql, and not reliable + // in PHP 4.0.6 + if($emsg = $this->ErrorMsg()) { + $err = $this->ErrorNo(); + if ($err) { + ADOConnection::outp($err.': '.$emsg); + flush(); + } + } + } else + if (!$this->_queryID) { + $e = $this->ErrorNo(); + $m = $this->ErrorMsg(); + ADOConnection::outp($e .': '. $m ); + flush(); + } + } else { + // non-debug version of query + + + $sqlcount++; + $sql_start = $this->getmicrotime(); + $this->_queryID =@$this->_query($sql,$inputarr,$arg3); + $sql_end = $this->getmicrotime(); + $elapsed = $sql_end - $sql_start; + $totalsql += $elapsed; + //$fp = @fopen ($pathtoroot."log.sql", "aw"); + $starttime = 0; // by Alex (variable was not defined) + $d=time()-$starttime; + $t=date("Y-m-d\tH:i:s",$starttime); + $e = round($elapsed,5); + if(function_exists("LogEntry")) + @LogEntry("\t\t$sqlcount|$e:|$sql\n"); + + } + // error handling if query fails + if ($this->_queryID === false) { + $fn = $this->raiseErrorFn; + if ($fn) { + $fn($this->databaseType,'EXECUTE',$this->ErrorNo(),$this->ErrorMsg(),$sql,$inputarr,$this); + } + return false; + } else if ($this->_queryID === true) { + // return simplified empty recordset for inserts/updates/deletes with lower overhead + $rs = new ADORecordSet_empty(); + return $rs; + } + + // return real recordset from select statement + $rsclass = "ADORecordSet_".$this->databaseType; + $rs = new $rsclass($this->_queryID,$this->fetchMode); // &new not supported by older PHP versions + $rs->connection = &$this; // Pablo suggestion + $rs->Init(); + if (is_array($sql)) $rs->sql = $sql[0]; + else $rs->sql = $sql; + + if ($rs->_numOfRows <= 0) { + global $ADODB_COUNTRECS; + + if ($ADODB_COUNTRECS) { + if (!$rs->EOF){ + $rs = &$this->_rs2rs($rs,-1,-1,!is_array($sql)); + $rs->_queryID = $this->_queryID; + } else + $rs->_numOfRows = 0; + } + } + return $rs; + } + + function CreateSequence($seqname='adodbseq',$startID=1) + { + if (empty($this->_genSeqSQL)) return false; + return $this->Execute(sprintf($this->_genSeqSQL,$seqname,$startID)); + } + + function DropSequence($seqname) + { + if (empty($this->_dropSeqSQL)) return false; + return $this->Execute(sprintf($this->_dropSeqSQL,$seqname)); + } + + /** + * Generates a sequence id and stores it in $this->genID; + * GenID is only available if $this->hasGenID = true; + * + * @param seqname name of sequence to use + * @param startID if sequence does not exist, start at this ID + * @return 0 if not supported, otherwise a sequence id + */ + + function GenID($seqname='adodbseq',$startID=1) + { + if (!$this->hasGenID) { + return 0; // formerly returns false pre 1.60 + } + + $getnext = sprintf($this->_genIDSQL,$seqname); + $rs = @$this->Execute($getnext); + if (!$rs) { + $createseq = $this->Execute(sprintf($this->_genSeqSQL,$seqname,$startID)); + $rs = $this->Execute($getnext); + } + if ($rs && !$rs->EOF) $this->genID = reset($rs->fields); + else $this->genID = 0; // false + + if ($rs) $rs->Close(); + + return $this->genID; + } + + /** + * @return the last inserted ID. Not all databases support this. + */ + function Insert_ID() + { + if ($this->hasInsertID) return $this->_insertid(); + if ($this->debug) ADOConnection::outp( '

Insert_ID error

'); + return false; + } + + + /** + * Portable Insert ID. Pablo Roca + * + * @return the last inserted ID. All databases support this. But aware possible + * problems in multiuser environments. Heavy test this before deploying. + */ + function PO_Insert_ID($table="", $id="") + { + if ($this->hasInsertID){ + return $this->Insert_ID(); + } else { + return $this->GetOne("SELECT MAX($id) FROM $table"); + } + } + + + /** + * @return # rows affected by UPDATE/DELETE + */ + function Affected_Rows() + { + if ($this->hasAffectedRows) { + $val = $this->_affectedrows(); + return ($val < 0) ? false : $val; + } + + if ($this->debug) ADOConnection::outp( '

Affected_Rows error

',false); + return false; + } + + + /** + * @return the last error message + */ + function ErrorMsg() + { + return '!! '.strtoupper($this->dataProvider.' '.$this->databaseType).': '.$this->_errorMsg; + } + + + /** + * @return the last error number. Normally 0 means no error. + */ + function ErrorNo() + { + return ($this->_errorMsg) ? -1 : 0; + } + + function MetaError($err=false) + { + include_once(ADODB_DIR."/adodb-error.inc.php"); + if ($err === false) $err = $this->ErrorNo(); + return adodb_error($this->dataProvider,$this->databaseType,$err); + } + + function MetaErrorMsg($errno) + { + include_once(ADODB_DIR."/adodb-error.inc.php"); + return adodb_errormsg($errno); + } + + /** + * @returns an array with the primary key columns in it. + */ + function MetaPrimaryKeys($table, $owner=false) + { + // owner not used in base class - see oci8 + $p = array(); + $objs =& $this->MetaColumns($table); + if ($objs) { + foreach($objs as $v) { + if (!empty($v->primary_key)) + $p[] = $v->name; + } + } + if (sizeof($p)) return $p; + return false; + } + + + /** + * Choose a database to connect to. Many databases do not support this. + * + * @param dbName is the name of the database to select + * @return true or false + */ + function SelectDB($dbName) + {return false;} + + + /** + * Will select, getting rows from $offset (1-based), for $nrows. + * This simulates the MySQL "select * from table limit $offset,$nrows" , and + * the PostgreSQL "select * from table limit $nrows offset $offset". Note that + * MySQL and PostgreSQL parameter ordering is the opposite of the other. + * eg. + * SelectLimit('select * from table',3); will return rows 1 to 3 (1-based) + * SelectLimit('select * from table',3,2); will return rows 3 to 5 (1-based) + * + * Uses SELECT TOP for Microsoft databases (when $this->hasTop is set) + * BUG: Currently SelectLimit fails with $sql with LIMIT or TOP clause already set + * + * @param sql + * @param [offset] is the row to start calculations from (1-based) + * @param [nrows] is the number of rows to get + * @param [inputarr] array of bind variables + * @param [arg3] is a private parameter only used by jlim + * @param [secs2cache] is a private parameter only used by jlim + * @return the recordset ($rs->databaseType == 'array') + */ + function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$arg3=false,$secs2cache=0) + { + if ($this->hasTop && $nrows > 0) { + // suggested by Reinhard Balling. Access requires top after distinct + // Informix requires first before distinct - F Riosa + $ismssql = (strpos($this->databaseType,'mssql') !== false); + if ($ismssql) $isaccess = false; + else $isaccess = (strpos($this->databaseType,'access') !== false); + + if ($offset <= 0) { + + // access includes ties in result + if ($isaccess) { + $sql = preg_replace( + '/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql); + + if ($secs2cache>0) return $this->CacheExecute($secs2cache, $sql,$inputarr,$arg3); + else return $this->Execute($sql,$inputarr,$arg3); + } else if ($ismssql){ + $sql = preg_replace( + '/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql); + } else { + $sql = preg_replace( + '/(^\s*select\s)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql); + } + } else { + $nn = $nrows + $offset; + if ($isaccess || $ismssql) { + $sql = preg_replace( + '/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nn.' ',$sql); + } else { + $sql = preg_replace( + '/(^\s*select\s)/i','\\1 '.$this->hasTop.' '.$nn.' ',$sql); + } + } + } + + // if $offset>0, we want to skip rows, and $ADODB_COUNTRECS is set, we buffer rows + // 0 to offset-1 which will be discarded anyway. So we disable $ADODB_COUNTRECS. + global $ADODB_COUNTRECS; + + $savec = $ADODB_COUNTRECS; + $ADODB_COUNTRECS = false; + + if ($offset>0){ + if ($secs2cache>0) $rs = &$this->CacheExecute($secs2cache,$sql,$inputarr,$arg3); + else $rs = &$this->Execute($sql,$inputarr,$arg3); + } else { + if ($secs2cache>0) $rs = &$this->CacheExecute($secs2cache,$sql,$inputarr,$arg3); + else $rs = &$this->Execute($sql,$inputarr,$arg3); + } + $ADODB_COUNTRECS = $savec; + if ($rs && !$rs->EOF) { + return $this->_rs2rs($rs,$nrows,$offset); + } + //print_r($rs); + return $rs; + } + + + /** + * Convert database recordset to an array recordset + * input recordset's cursor should be at beginning, and + * old $rs will be closed. + * + * @param rs the recordset to copy + * @param [nrows] number of rows to retrieve (optional) + * @param [offset] offset by number of rows (optional) + * @return the new recordset + */ + function &_rs2rs(&$rs,$nrows=-1,$offset=-1,$close=true) + { + if (! $rs) return false; + + $dbtype = $rs->databaseType; + if (!$dbtype) { + $rs = &$rs; // required to prevent crashing in 4.2.1, but does not happen in 4.3.1 -- why ? + return $rs; + } + if (($dbtype == 'array' || $dbtype == 'csv') && $nrows == -1 && $offset == -1) { + $rs->MoveFirst(); + $rs = &$rs; // required to prevent crashing in 4.2.1, but does not happen in 4.3.1-- why ? + return $rs; + } + $flds = array(); + for ($i=0, $max=$rs->FieldCount(); $i < $max; $i++) { + $flds[] = $rs->FetchField($i); + } + $arr =& $rs->GetArrayLimit($nrows,$offset); + //print_r($arr); + if ($close) $rs->Close(); + + $arrayClass = $this->arrayClass; + + $rs2 = new $arrayClass(); + $rs2->connection = &$this; + $rs2->sql = $rs->sql; + $rs2->dataProvider = $this->dataProvider; + $rs2->InitArrayFields($arr,$flds); + return $rs2; + } + + + function &GetArray($sql, $inputarr=false) + { + return $this->GetAll($sql,$inputarr); + } + + /** + * Return first element of first row of sql statement. Recordset is disposed + * for you. + * + * @param sql SQL statement + * @param [inputarr] input bind array + */ + function GetOne($sql,$inputarr=false) + { + global $ADODB_COUNTRECS; + $crecs = $ADODB_COUNTRECS; + $ADODB_COUNTRECS = false; + + $ret = false; + $rs = &$this->Execute($sql,$inputarr); + if ($rs) { + if (!$rs->EOF) $ret = reset($rs->fields); + $rs->Close(); + } + $ADODB_COUNTRECS = $crecs; + return $ret; + } + + function CacheGetOne($secs2cache,$sql=false,$inputarr=false) + { + $ret = false; + $rs = &$this->CacheExecute($secs2cache,$sql,$inputarr); + if ($rs) { + if (!$rs->EOF) $ret = reset($rs->fields); + $rs->Close(); + } + + return $ret; + } + + function GetCol($sql, $inputarr = false, $trim = false) + { + $rv = false; + $rs = &$this->Execute($sql, $inputarr); + if ($rs) { + if ($trim) { + while (!$rs->EOF) { + $rv[] = trim(reset($rs->fields)); + $rs->MoveNext(); + } + } else { + while (!$rs->EOF) { + $rv[] = reset($rs->fields); + $rs->MoveNext(); + } + } + $rs->Close(); + } + return $rv; + } + + function CacheGetCol($secs, $sql = false, $inputarr = false,$trim=false) + { + $rv = false; + $rs = &$this->CacheExecute($secs, $sql, $inputarr); + if ($rs) { + if ($trim) { + while (!$rs->EOF) { + $rv[] = trim(reset($rs->fields)); + $rs->MoveNext(); + } + } else { + while (!$rs->EOF) { + $rv[] = reset($rs->fields); + $rs->MoveNext(); + } + } + $rs->Close(); + } + return $rv; + } + + /* + Calculate the offset of a date for a particular database and generate + appropriate SQL. Useful for calculating future/past dates and storing + in a database. + + If dayFraction=1.5 means 1.5 days from now, 1.0/24 for 1 hour. + */ + function OffsetDate($dayFraction,$date=false) + { + if (!$date) $date = $this->sysDate; + return '('.$date.'+'.$dayFraction.')'; + } + + + /** + * Return all rows. Compat with PEAR DB + * + * @param sql SQL statement + * @param [inputarr] input bind array + */ + function &GetAll($sql,$inputarr=false) + { + global $ADODB_COUNTRECS; + + $savec = $ADODB_COUNTRECS; + $ADODB_COUNTRECS = false; + $rs = $this->Execute($sql,$inputarr); + $ADODB_COUNTRECS = $savec; + + if (!$rs) + if (defined('ADODB_PEAR')) return ADODB_PEAR_Error(); + else return false; + $arr =& $rs->GetArray(); + $rs->Close(); + return $arr; + } + + function &CacheGetAll($secs2cache,$sql=false,$inputarr=false) + { + global $ADODB_COUNTRECS; + + $savec = $ADODB_COUNTRECS; + $ADODB_COUNTRECS = false; + $rs = $this->CacheExecute($secs2cache,$sql,$inputarr); + $ADODB_COUNTRECS = $savec; + + if (!$rs) + if (defined('ADODB_PEAR')) return ADODB_PEAR_Error(); + else return false; + + $arr =& $rs->GetArray(); + $rs->Close(); + return $arr; + } + + + + /** + * Return one row of sql statement. Recordset is disposed for you. + * + * @param sql SQL statement + * @param [inputarr] input bind array + */ + function &GetRow($sql,$inputarr=false) + { + global $ADODB_COUNTRECS; + $crecs = $ADODB_COUNTRECS; + $ADODB_COUNTRECS = false; + + $rs = $this->Execute($sql,$inputarr); + + $ADODB_COUNTRECS = $crecs; + if ($rs) { + $arr = array(); + if (!$rs->EOF) $arr = $rs->fields; + $rs->Close(); + return $arr; + } + + return false; + } + + function &CacheGetRow($secs2cache,$sql=false,$inputarr=false) + { + $rs = $this->CacheExecute($secs2cache,$sql,$inputarr); + if ($rs) { + $arr = false; + if (!$rs->EOF) $arr = $rs->fields; + $rs->Close(); + return $arr; + } + return false; + } + + /** + * Insert or replace a single record. Note: this is not the same as MySQL's replace. + * ADOdb's Replace() uses update-insert semantics, not insert-delete-duplicates of MySQL. + * Also note that no table locking is done currently, so it is possible that the + * record be inserted twice by two programs... + * + * $this->Replace('products', array('prodname' =>"'Nails'","price" => 3.99), 'prodname'); + * + * $table table name + * $fieldArray associative array of data (you must quote strings yourself). + * $keyCol the primary key field name or if compound key, array of field names + * autoQuote set to true to use a hueristic to quote strings. Works with nulls and numbers + * but does not work with dates nor SQL functions. + * has_autoinc the primary key is an auto-inc field, so skip in insert. + * + * Currently blob replace not supported + * + * returns 0 = fail, 1 = update, 2 = insert + */ + + function Replace($table, $fieldArray, $keyCol, $autoQuote=false, $has_autoinc=false) + { + if (count($fieldArray) == 0) return 0; + $first = true; + $uSet = ''; + + if (!is_array($keyCol)) { + $keyCol = array($keyCol); + } + foreach($fieldArray as $k => $v) { + if ($autoQuote && !is_numeric($v) and substr($v,0,1) != "'" and strcasecmp($v,'null')!=0) { + $v = $this->qstr($v); + $fieldArray[$k] = $v; + } + if (in_array($k,$keyCol)) continue; // skip UPDATE if is key + + if ($first) { + $first = false; + $uSet = "$k=$v"; + } else + $uSet .= ",$k=$v"; + } + + $first = true; + foreach ($keyCol as $v) { + if ($first) { + $first = false; + $where = "$v=$fieldArray[$v]"; + } else { + $where .= " and $v=$fieldArray[$v]"; + } + } + + if ($uSet) { + $update = "UPDATE $table SET $uSet WHERE $where"; + + $rs = $this->Execute($update); + if ($rs) { + if ($this->poorAffectedRows) { + /* + The Select count(*) wipes out any errors that the update would have returned. + http://phplens.com/lens/lensforum/msgs.php?id=5696 + */ + if ($this->ErrorNo()<>0) return 0; + + # affected_rows == 0 if update field values identical to old values + # for mysql - which is silly. + + $cnt = $this->GetOne("select count(*) from $table where $where"); + if ($cnt > 0) return 1; // record already exists + } else + if (($this->Affected_Rows()>0)) return 1; + } + + } + // print "

Error=".$this->ErrorNo().'

'; + $first = true; + foreach($fieldArray as $k => $v) { + if ($has_autoinc && in_array($k,$keyCol)) continue; // skip autoinc col + + if ($first) { + $first = false; + $iCols = "$k"; + $iVals = "$v"; + } else { + $iCols .= ",$k"; + $iVals .= ",$v"; + } + } + $insert = "INSERT INTO $table ($iCols) VALUES ($iVals)"; + $rs = $this->Execute($insert); + return ($rs) ? 2 : 0; + } + + + /** + * Will select, getting rows from $offset (1-based), for $nrows. + * This simulates the MySQL "select * from table limit $offset,$nrows" , and + * the PostgreSQL "select * from table limit $nrows offset $offset". Note that + * MySQL and PostgreSQL parameter ordering is the opposite of the other. + * eg. + * CacheSelectLimit(15,'select * from table',3); will return rows 1 to 3 (1-based) + * CacheSelectLimit(15,'select * from table',3,2); will return rows 3 to 5 (1-based) + * + * BUG: Currently CacheSelectLimit fails with $sql with LIMIT or TOP clause already set + * + * @param [secs2cache] seconds to cache data, set to 0 to force query. This is optional + * @param sql + * @param [offset] is the row to start calculations from (1-based) + * @param [nrows] is the number of rows to get + * @param [inputarr] array of bind variables + * @param [arg3] is a private parameter only used by jlim + * @return the recordset ($rs->databaseType == 'array') + */ + function &CacheSelectLimit($secs2cache,$sql,$nrows=-1,$offset=-1,$inputarr=false, $arg3=false) + { + if (!is_numeric($secs2cache)) { + if ($sql === false) $sql = -1; + if ($offset == -1) $offset = false; + // sql, nrows, offset,inputarr,arg3 + return $this->SelectLimit($secs2cache,$sql,$nrows,$offset,$inputarr,$this->cacheSecs); + } else { + if ($sql === false) ADOConnection::outp( "Warning: \$sql missing from CacheSelectLimit()"); + return $this->SelectLimit($sql,$nrows,$offset,$inputarr,$arg3,$secs2cache); + } + } + + /** + * Flush cached recordsets that match a particular $sql statement. + * If $sql == false, then we purge all files in the cache. + */ + function CacheFlush($sql=false,$inputarr=false) + { + global $ADODB_CACHE_DIR; + + if (strlen($ADODB_CACHE_DIR) > 1 && !$sql) { + if (strpos(strtoupper(PHP_OS),'WIN') !== false) { + $cmd = 'del /s '.str_replace('/','\\',$ADODB_CACHE_DIR).'\adodb_*.cache'; + } else { + $cmd = 'rm -rf '.$ADODB_CACHE_DIR.'/??/adodb_*.cache'; + // old version 'rm -f `find '.$ADODB_CACHE_DIR.' -name adodb_*.cache`'; + } + if ($this->debug) { + ADOConnection::outp( "CacheFlush: $cmd

\n", system($cmd),"
"); + } else { + exec($cmd); + } + return; + } + $f = $this->_gencachename($sql.serialize($inputarr),false); + adodb_write_file($f,''); // is adodb_write_file needed? + @unlink($f); + } + + /** + * Private function to generate filename for caching. + * Filename is generated based on: + * + * - sql statement + * - database type (oci8, ibase, ifx, etc) + * - database name + * - userid + * + * We create 256 sub-directories in the cache directory ($ADODB_CACHE_DIR). + * Assuming that we can have 50,000 files per directory with good performance, + * then we can scale to 12.8 million unique cached recordsets. Wow! + */ + function _gencachename($sql,$createdir) + { + global $ADODB_CACHE_DIR; + + $m = md5($sql.$this->databaseType.$this->database.$this->user); + $dir = $ADODB_CACHE_DIR.'/'.substr($m,0,2); + if ($createdir && !file_exists($dir)) { + $oldu = umask(0); + if (!mkdir($dir,0771)) + if ($this->debug) ADOConnection::outp( "Unable to mkdir $dir for $sql"); + umask($oldu); + } + return $dir.'/adodb_'.$m.'.cache'; + } + + + /** + * Execute SQL, caching recordsets. + * + * @param [secs2cache] seconds to cache data, set to 0 to force query. + * This is an optional parameter. + * @param sql SQL statement to execute + * @param [inputarr] holds the input data to bind to + * @param [arg3] reserved for john lim for future use + * @return RecordSet or false + */ + function &CacheExecute($secs2cache,$sql=false,$inputarr=false,$arg3=false) + { + if (!is_numeric($secs2cache)) { + $arg3 = $inputarr; + $inputarr = $sql; + $sql = $secs2cache; + $secs2cache = $this->cacheSecs; + } + include_once(ADODB_DIR.'/adodb-csvlib.inc.php'); + + $md5file = $this->_gencachename($sql.serialize($inputarr),true); + $err = ''; + + if ($secs2cache > 0){ + $rs = &csv2rs($md5file,$err,$secs2cache); + $this->numCacheHits += 1; + } else { + $err='Timeout 1'; + $rs = false; + $this->numCacheMisses += 1; + } + if (!$rs) { + // no cached rs found + if ($this->debug) { + if (get_magic_quotes_runtime()) { + ADOConnection::outp("Please disable magic_quotes_runtime - it corrupts cache files :("); + } + ADOConnection::outp( " $md5file cache failure: $err (see sql below)"); + } + $rs = &$this->Execute($sql,$inputarr,$arg3); + if ($rs) { + $eof = $rs->EOF; + $rs = &$this->_rs2rs($rs); // read entire recordset into memory immediately + $txt = _rs2serialize($rs,false,$sql); // serialize + + if (!adodb_write_file($md5file,$txt,$this->debug)) { + if ($fn = $this->raiseErrorFn) { + $fn($this->databaseType,'CacheExecute',-32000,"Cache write error",$md5file,$sql,$this); + } + if ($this->debug) ADOConnection::outp( " Cache write error"); + } + if ($rs->EOF && !$eof) { + $rs->MoveFirst(); + //$rs = &csv2rs($md5file,$err); + $rs->connection = &$this; // Pablo suggestion + } + + } else + @unlink($md5file); + } else { + if ($this->fnCacheExecute) { + $fn = $this->fnCacheExecute; + $fn($this, $secs2cache, $sql, $inputarr); + } + // ok, set cached object found + $rs->connection = &$this; // Pablo suggestion + if ($this->debug){ + global $HTTP_SERVER_VARS; + + $inBrowser = isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']); + $ttl = $rs->timeCreated + $secs2cache - time(); + $s = is_array($sql) ? $sql[0] : $sql; + if ($inBrowser) $s = ''.htmlspecialchars($s).''; + + ADOConnection::outp( " $md5file reloaded, ttl=$ttl [ $s ]"); + } + } + return $rs; + } + + + /** + * Generates an Update Query based on an existing recordset. + * $arrFields is an associative array of fields with the value + * that should be assigned. + * + * Note: This function should only be used on a recordset + * that is run against a single table and sql should only + * be a simple select stmt with no groupby/orderby/limit + * + * "Jonathan Younger" + */ + function GetUpdateSQL(&$rs, $arrFields,$forceUpdate=false,$magicq=false) + { + include_once(ADODB_DIR.'/adodb-lib.inc.php'); + return _adodb_getupdatesql($this,$rs,$arrFields,$forceUpdate,$magicq); + } + + + /** + * Generates an Insert Query based on an existing recordset. + * $arrFields is an associative array of fields with the value + * that should be assigned. + * + * Note: This function should only be used on a recordset + * that is run against a single table. + */ + function GetInsertSQL(&$rs, $arrFields,$magicq=false) + { + include_once(ADODB_DIR.'/adodb-lib.inc.php'); + return _adodb_getinsertsql($this,$rs,$arrFields,$magicq); + } + + + /** + * Update a blob column, given a where clause. There are more sophisticated + * blob handling functions that we could have implemented, but all require + * a very complex API. Instead we have chosen something that is extremely + * simple to understand and use. + * + * Note: $blobtype supports 'BLOB' and 'CLOB', default is BLOB of course. + * + * Usage to update a $blobvalue which has a primary key blob_id=1 into a + * field blobtable.blobcolumn: + * + * UpdateBlob('blobtable', 'blobcolumn', $blobvalue, 'blob_id=1'); + * + * Insert example: + * + * $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); + * $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1'); + */ + + function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') + { + return $this->Execute("UPDATE $table SET $column=? WHERE $where",array($val)) != false; + } + + /** + * Usage: + * UpdateBlob('TABLE', 'COLUMN', '/path/to/file', 'ID=1'); + * + * $blobtype supports 'BLOB' and 'CLOB' + * + * $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); + * $conn->UpdateBlob('blobtable','blobcol',$blobpath,'id=1'); + */ + function UpdateBlobFile($table,$column,$path,$where,$blobtype='BLOB') + { + $fd = fopen($path,'rb'); + if ($fd === false) return false; + $val = fread($fd,filesize($path)); + fclose($fd); + return $this->UpdateBlob($table,$column,$val,$where,$blobtype); + } + + function BlobDecode($blob) + { + return $blob; + } + + function BlobEncode($blob) + { + return $blob; + } + + /** + * Usage: + * UpdateClob('TABLE', 'COLUMN', $var, 'ID=1', 'CLOB'); + * + * $conn->Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, null)'); + * $conn->UpdateClob('clobtable','clobcol',$clob,'id=1'); + */ + function UpdateClob($table,$column,$val,$where) + { + return $this->UpdateBlob($table,$column,$val,$where,'CLOB'); + } + + + /** + * $meta contains the desired type, which could be... + * C for character. You will have to define the precision yourself. + * X for teXt. For unlimited character lengths. + * B for Binary + * F for floating point, with no need to define scale and precision + * N for decimal numbers, you will have to define the (scale, precision) yourself + * D for date + * T for timestamp + * L for logical/Boolean + * I for integer + * R for autoincrement counter/integer + * and if you want to use double-byte, add a 2 to the end, like C2 or X2. + * + * + * @return the actual type of the data or false if no such type available + */ + function ActualType($meta) + { + switch($meta) { + case 'C': + case 'X': + return 'VARCHAR'; + case 'B': + + case 'D': + case 'T': + case 'L': + + case 'R': + + case 'I': + case 'N': + return false; + } + } + + /* + * Maximum size of C field + */ + function CharMax() + { + return 255; // make it conservative if not defined + } + + + /* + * Maximum size of X field + */ + function TextMax() + { + return 4000; // make it conservative if not defined + } + + /** + * Close Connection + */ + function Close() + { + return $this->_close(); + + // "Simon Lee" reports that persistent connections need + // to be closed too! + //if ($this->_isPersistentConnection != true) return $this->_close(); + //else return true; + } + + /** + * Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans(). + * + * @return true if succeeded or false if database does not support transactions + */ + function BeginTrans() {return false;} + + + /** + * If database does not support transactions, always return true as data always commited + * + * @param $ok set to false to rollback transaction, true to commit + * + * @return true/false. + */ + function CommitTrans($ok=true) + { return true;} + + + /** + * If database does not support transactions, rollbacks always fail, so return false + * + * @return true/false. + */ + function RollbackTrans() + { return false;} + + + /** + * return the databases that the driver can connect to. + * Some databases will return an empty array. + * + * @return an array of database names. + */ + function MetaDatabases() + { + global $ADODB_FETCH_MODE; + + if ($this->metaDatabasesSQL) { + $save = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + + if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false); + + $arr = $this->GetCol($this->metaDatabasesSQL); + if (isset($savem)) $this->SetFetchMode($savem); + $ADODB_FETCH_MODE = $save; + + return $arr; + } + + return false; + } + + /** + * @return array of tables for current database. + */ + function &MetaTables() + { + global $ADODB_FETCH_MODE; + + if ($this->metaTablesSQL) { + // complicated state saving by the need for backward compat + $save = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + + if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false); + + $rs = $this->Execute($this->metaTablesSQL); + if (isset($savem)) $this->SetFetchMode($savem); + $ADODB_FETCH_MODE = $save; + + if ($rs === false) return false; + $arr =& $rs->GetArray(); + $arr2 = array(); + for ($i=0; $i < sizeof($arr); $i++) { + $arr2[] = $arr[$i][0]; + } + $rs->Close(); + return $arr2; + } + return false; + } + + + /** + * List columns in a database as an array of ADOFieldObjects. + * See top of file for definition of object. + * + * @param table table name to query + * @param upper uppercase table name (required by some databases) + * + * @return array of ADOFieldObjects for current table. + */ + function &MetaColumns($table,$upper=true) + { + global $ADODB_FETCH_MODE; + + if (!empty($this->metaColumnsSQL)) { + $save = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false); + $rs = $this->Execute(sprintf($this->metaColumnsSQL,($upper)?strtoupper($table):$table)); + if (isset($savem)) $this->SetFetchMode($savem); + $ADODB_FETCH_MODE = $save; + if ($rs === false) return false; + + $retarr = array(); + while (!$rs->EOF) { //print_r($rs->fields); + $fld = new ADOFieldObject(); + $fld->name = $rs->fields[0]; + $fld->type = $rs->fields[1]; + if (isset($rs->fields[3]) && $rs->fields[3]) { + if ($rs->fields[3]>0) $fld->max_length = $rs->fields[3]; + $fld->scale = $rs->fields[4]; + if ($fld->scale>0) $fld->max_length += 1; + } else + $fld->max_length = $rs->fields[2]; + + + $retarr[strtoupper($fld->name)] = $fld; + + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + return false; + } + + /** + * List columns names in a table as an array. + * @param table table name to query + * + * @return array of column names for current table. + */ + function &MetaColumnNames($table) + { + $objarr =& $this->MetaColumns($table); + if (!is_array($objarr)) return false; + + $arr = array(); + foreach($objarr as $v) { + $arr[] = $v->name; + } + return $arr; + } + + /** + * Different SQL databases used different methods to combine strings together. + * This function provides a wrapper. + * + * param s variable number of string parameters + * + * Usage: $db->Concat($str1,$str2); + * + * @return concatenated string + */ + function Concat() + { + $arr = func_get_args(); + return implode($this->concat_operator, $arr); + } + + + /** + * Converts a date "d" to a string that the database can understand. + * + * @param d a date in Unix date time format. + * + * @return date string in database date format + */ + function DBDate($d) + { + + if (empty($d) && $d !== 0) return 'null'; + + if (is_string($d) && !is_numeric($d)) { + if ($d === 'null') return $d; + if ($this->isoDates) return "'$d'"; + $d = ADOConnection::UnixDate($d); + } + + return adodb_date($this->fmtDate,$d); + } + + + /** + * Converts a timestamp "ts" to a string that the database can understand. + * + * @param ts a timestamp in Unix date time format. + * + * @return timestamp string in database timestamp format + */ + function DBTimeStamp($ts) + { + if (empty($ts) && $ts !== 0) return 'null'; + + if (is_string($ts) && !is_numeric($ts)) { + if ($ts === 'null') return $ts; + if ($this->isoDates) return "'$ts'"; + else $ts = ADOConnection::UnixTimeStamp($ts); + } + + return adodb_date($this->fmtTimeStamp,$ts); + } + + /** + * Also in ADORecordSet. + * @param $v is a date string in YYYY-MM-DD format + * + * @return date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format + */ + function UnixDate($v) + { + if (!preg_match( "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})|", + ($v), $rr)) return false; + + if ($rr[1] <= TIMESTAMP_FIRST_YEAR) return 0; + // h-m-s-MM-DD-YY + return @adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1]); + } + + + /** + * Also in ADORecordSet. + * @param $v is a timestamp string in YYYY-MM-DD HH-NN-SS format + * + * @return date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format + */ + function UnixTimeStamp($v) + { + if (!preg_match( + "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ -]?(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|", + ($v), $rr)) return false; + if ($rr[1] <= TIMESTAMP_FIRST_YEAR && $rr[2]<= 1) return 0; + + // h-m-s-MM-DD-YY + if (!isset($rr[5])) return adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1]); + return @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1]); + } + + /** + * Also in ADORecordSet. + * + * Format database date based on user defined format. + * + * @param v is the character date in YYYY-MM-DD format, returned by database + * @param fmt is the format to apply to it, using date() + * + * @return a date formated as user desires + */ + + function UserDate($v,$fmt='Y-m-d') + { + $tt = $this->UnixDate($v); + // $tt == -1 if pre TIMESTAMP_FIRST_YEAR + if (($tt === false || $tt == -1) && $v != false) return $v; + else if ($tt == 0) return $this->emptyDate; + else if ($tt == -1) { // pre-TIMESTAMP_FIRST_YEAR + } + + return adodb_date($fmt,$tt); + + } + + + /** + * Correctly quotes a string so that all strings are escaped. We prefix and append + * to the string single-quotes. + * An example is $db->qstr("Don't bother",magic_quotes_runtime()); + * + * @param s the string to quote + * @param [magic_quotes] if $s is GET/POST var, set to get_magic_quotes_gpc(). + * This undoes the stupidity of magic quotes for GPC. + * + * @return quoted string to be sent back to database + */ + function qstr($s,$magic_quotes=false) + { + if (!$magic_quotes) { + + if ($this->replaceQuote[0] == '\\'){ + // only since php 4.0.5 + $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s); + //$s = str_replace("\0","\\\0", str_replace('\\','\\\\',$s)); + } + return "'".str_replace("'",$this->replaceQuote,$s)."'"; + } + + // undo magic quotes for " + $s = str_replace('\\"','"',$s); + + if ($this->replaceQuote == "\\'") // ' already quoted, no need to change anything + return "'$s'"; + else {// change \' to '' for sybase/mssql + $s = str_replace('\\\\','\\',$s); + return "'".str_replace("\\'",$this->replaceQuote,$s)."'"; + } + } + + + /** + * Will select the supplied $page number from a recordset, given that it is paginated in pages of + * $nrows rows per page. It also saves two boolean values saying if the given page is the first + * and/or last one of the recordset. Added by Iv�n Oliva to provide recordset pagination. + * + * See readme.htm#ex8 for an example of usage. + * + * @param sql + * @param nrows is the number of rows per page to get + * @param page is the page number to get (1-based) + * @param [inputarr] array of bind variables + * @param [arg3] is a private parameter only used by jlim + * @param [secs2cache] is a private parameter only used by jlim + * @return the recordset ($rs->databaseType == 'array') + * + * NOTE: phpLens uses a different algorithm and does not use PageExecute(). + * + */ + function &PageExecute($sql, $nrows, $page, $inputarr=false, $arg3=false, $secs2cache=0) + { + include_once(ADODB_DIR.'/adodb-lib.inc.php'); + if ($this->pageExecuteCountRows) return _adodb_pageexecute_all_rows($this, $sql, $nrows, $page, $inputarr, $arg3, $secs2cache); + return _adodb_pageexecute_no_last_page($this, $sql, $nrows, $page, $inputarr, $arg3, $secs2cache); + + } + + + /** + * Will select the supplied $page number from a recordset, given that it is paginated in pages of + * $nrows rows per page. It also saves two boolean values saying if the given page is the first + * and/or last one of the recordset. Added by Iv�n Oliva to provide recordset pagination. + * + * @param secs2cache seconds to cache data, set to 0 to force query + * @param sql + * @param nrows is the number of rows per page to get + * @param page is the page number to get (1-based) + * @param [inputarr] array of bind variables + * @param [arg3] is a private parameter only used by jlim + * @return the recordset ($rs->databaseType == 'array') + */ + function &CachePageExecute($secs2cache, $sql, $nrows, $page,$inputarr=false, $arg3=false) + { + /*switch($this->dataProvider) { + case 'postgres': + case 'mysql': + break; + default: $secs2cache = 0; break; + }*/ + return $this->PageExecute($sql,$nrows,$page,$inputarr,$arg3,$secs2cache); + } + +} // end class ADOConnection + + + + //============================================================================================== + // CLASS ADOFetchObj + //============================================================================================== + + /** + * Internal placeholder for record objects. Used by ADORecordSet->FetchObj(). + */ + class ADOFetchObj { + }; + + //============================================================================================== + // CLASS ADORecordSet_empty + //============================================================================================== + + /** + * Lightweight recordset when there are no records to be returned + */ + class ADORecordSet_empty + { + var $dataProvider = 'empty'; + var $databaseType = false; + var $EOF = true; + var $_numOfRows = 0; + var $fields = false; + var $connection = false; + function RowCount() {return 0;} + function RecordCount() {return 0;} + function PO_RecordCount(){return 0;} + function Close(){return true;} + function FetchRow() {return false;} + function FieldCount(){ return 0;} + } + + //============================================================================================== + // DATE AND TIME FUNCTIONS + //============================================================================================== + include_once(ADODB_DIR.'/adodb-time.inc.php'); + + //============================================================================================== + // CLASS ADORecordSet + //============================================================================================== + + + /** + * RecordSet class that represents the dataset returned by the database. + * To keep memory overhead low, this class holds only the current row in memory. + * No prefetching of data is done, so the RecordCount() can return -1 ( which + * means recordcount not known). + */ + class ADORecordSet { + /* + * public variables + */ + var $dataProvider = "native"; + var $fields = false; /// holds the current row data + var $blobSize = 100; /// any varchar/char field this size or greater is treated as a blob + /// in other words, we use a text area for editting. + var $canSeek = false; /// indicates that seek is supported + var $sql; /// sql text + var $EOF = false; /// Indicates that the current record position is after the last record in a Recordset object. + + var $emptyTimeStamp = ' '; /// what to display when $time==0 + var $emptyDate = ' '; /// what to display when $time==0 + var $debug = false; + var $timeCreated=0; /// datetime in Unix format rs created -- for cached recordsets + + var $bind = false; /// used by Fields() to hold array - should be private? + var $fetchMode; /// default fetch mode + var $connection = false; /// the parent connection + /* + * private variables + */ + var $_numOfRows = -1; /** number of rows, or -1 */ + var $_numOfFields = -1; /** number of fields in recordset */ + var $_queryID = -1; /** This variable keeps the result link identifier. */ + var $_currentRow = -1; /** This variable keeps the current row in the Recordset. */ + var $_closed = false; /** has recordset been closed */ + var $_inited = false; /** Init() should only be called once */ + var $_obj; /** Used by FetchObj */ + var $_names; /** Used by FetchObj */ + + var $_currentPage = -1; /** Added by Iv�n Oliva to implement recordset pagination */ + var $_atFirstPage = false; /** Added by Iv�n Oliva to implement recordset pagination */ + var $_atLastPage = false; /** Added by Iv�n Oliva to implement recordset pagination */ + var $_lastPageNo = -1; + var $_maxRecordCount = 0; + var $dateHasTime = false; + + /** + * Constructor + * + * @param queryID this is the queryID returned by ADOConnection->_query() + * + */ + function ADORecordSet($queryID) + { + $this->_queryID = $queryID; + } + + + + function Init() + { + if ($this->_inited) return; + $this->_inited = true; + if ($this->_queryID) @$this->_initrs(); + else { + $this->_numOfRows = 0; + $this->_numOfFields = 0; + } + + if ($this->_numOfRows != 0 && $this->_numOfFields && $this->_currentRow == -1) { + + $this->_currentRow = 0; + if ($this->EOF = ($this->_fetch() === false)) { + $this->_numOfRows = 0; // _numOfRows could be -1 + } + } else { + $this->EOF = true; + } + } + + + /** + * Generate a SELECT tag string from a recordset, and return the string. + * If the recordset has 2 cols, we treat the 1st col as the containing + * the text to display to the user, and 2nd col as the return value. Default + * strings are compared with the FIRST column. + * + * @param name name of SELECT tag + * @param [defstr] the value to hilite. Use an array for multiple hilites for listbox. + * @param [blank1stItem] true to leave the 1st item in list empty + * @param [multiple] true for listbox, false for popup + * @param [size] #rows to show for listbox. not used by popup + * @param [selectAttr] additional attributes to defined for SELECT tag. + * useful for holding javascript onChange='...' handlers. + & @param [compareFields0] when we have 2 cols in recordset, we compare the defstr with + * column 0 (1st col) if this is true. This is not documented. + * + * @return HTML + * + * changes by glen.davies@cce.ac.nz to support multiple hilited items + */ + function GetMenu($name,$defstr='',$blank1stItem=true,$multiple=false, + $size=0, $selectAttr='',$compareFields0=true) + { + include_once(ADODB_DIR.'/adodb-lib.inc.php'); + return _adodb_getmenu($this, $name,$defstr,$blank1stItem,$multiple, + $size, $selectAttr,$compareFields0); + } + + /** + * Generate a SELECT tag string from a recordset, and return the string. + * If the recordset has 2 cols, we treat the 1st col as the containing + * the text to display to the user, and 2nd col as the return value. Default + * strings are compared with the SECOND column. + * + */ + function GetMenu2($name,$defstr='',$blank1stItem=true,$multiple=false,$size=0, $selectAttr='') + { + include_once(ADODB_DIR.'/adodb-lib.inc.php'); + return _adodb_getmenu($this,$name,$defstr,$blank1stItem,$multiple, + $size, $selectAttr,false); + } + + + /** + * return recordset as a 2-dimensional array. + * + * @param [nRows] is the number of rows to return. -1 means every row. + * + * @return an array indexed by the rows (0-based) from the recordset + */ + function &GetArray($nRows = -1) + { + global $ADODB_EXTENSION; if ($ADODB_EXTENSION) return adodb_getall($this,$nRows); + + $results = array(); + $cnt = 0; + while (!$this->EOF && $nRows != $cnt) { + $results[] = $this->fields; + $this->MoveNext(); + $cnt++; + } + return $results; + } + + /* + * Some databases allow multiple recordsets to be returned. This function + * will return true if there is a next recordset, or false if no more. + */ + function NextRecordSet() + { + return false; + } + + /** + * return recordset as a 2-dimensional array. + * Helper function for ADOConnection->SelectLimit() + * + * @param offset is the row to start calculations from (1-based) + * @param [nrows] is the number of rows to return + * + * @return an array indexed by the rows (0-based) from the recordset + */ + function &GetArrayLimit($nrows,$offset=-1) + { + if ($offset <= 0) { + return $this->GetArray($nrows); + } + + $this->Move($offset); + + $results = array(); + $cnt = 0; + while (!$this->EOF && $nrows != $cnt) { + $results[$cnt++] = $this->fields; + $this->MoveNext(); + } + + return $results; + } + + + /** + * Synonym for GetArray() for compatibility with ADO. + * + * @param [nRows] is the number of rows to return. -1 means every row. + * + * @return an array indexed by the rows (0-based) from the recordset + */ + function &GetRows($nRows = -1) + { + return $this->GetArray($nRows); + } + + /** + * return whole recordset as a 2-dimensional associative array if there are more than 2 columns. + * The first column is treated as the key and is not included in the array. + * If there is only 2 columns, it will return a 1 dimensional array of key-value pairs unless + * $force_array == true. + * + * @param [force_array] has only meaning if we have 2 data columns. If false, a 1 dimensional + * array is returned, otherwise a 2 dimensional array is returned. If this sounds confusing, + * read the source. + * + * @param [first2cols] means if there are more than 2 cols, ignore the remaining cols and + * instead of returning array[col0] => array(remaining cols), return array[col0] => col1 + * + * @return an associative array indexed by the first column of the array, + * or false if the data has less than 2 cols. + */ + function &GetAssoc($force_array = false, $first2cols = false) { + $cols = $this->_numOfFields; + if ($cols < 2) { + return false; + } + $numIndex = isset($this->fields[0]); + $results = array(); + + if (!$first2cols && ($cols > 2 || $force_array)) { + if ($numIndex) { + while (!$this->EOF) { + $results[trim($this->fields[0])] = array_slice($this->fields, 1); + $this->MoveNext(); + } + } else { + while (!$this->EOF) { + $results[trim(reset($this->fields))] = array_slice($this->fields, 1); + $this->MoveNext(); + } + } + } else { + // return scalar values + if ($numIndex) { + while (!$this->EOF) { + // some bug in mssql PHP 4.02 -- doesn't handle references properly so we FORCE creating a new string + $results[trim(($this->fields[0]))] = $this->fields[1]; + $this->MoveNext(); + } + } else { + while (!$this->EOF) { + // some bug in mssql PHP 4.02 -- doesn't handle references properly so we FORCE creating a new string + $v1 = trim(reset($this->fields)); + $v2 = ''.next($this->fields); + $results[$v1] = $v2; + $this->MoveNext(); + } + } + } + return $results; + } + + + /** + * + * @param v is the character timestamp in YYYY-MM-DD hh:mm:ss format + * @param fmt is the format to apply to it, using date() + * + * @return a timestamp formated as user desires + */ + function UserTimeStamp($v,$fmt='Y-m-d H:i:s') + { + $tt = $this->UnixTimeStamp($v); + // $tt == -1 if pre TIMESTAMP_FIRST_YEAR + if (($tt === false || $tt == -1) && $v != false) return $v; + if ($tt == 0) return $this->emptyTimeStamp; + return adodb_date($fmt,$tt); + } + + + /** + * @param v is the character date in YYYY-MM-DD format, returned by database + * @param fmt is the format to apply to it, using date() + * + * @return a date formated as user desires + */ + function UserDate($v,$fmt='Y-m-d') + { + $tt = $this->UnixDate($v); + // $tt == -1 if pre TIMESTAMP_FIRST_YEAR + if (($tt === false || $tt == -1) && $v != false) return $v; + else if ($tt == 0) return $this->emptyDate; + else if ($tt == -1) { // pre-TIMESTAMP_FIRST_YEAR + } + return adodb_date($fmt,$tt); + + } + + + /** + * @param $v is a date string in YYYY-MM-DD format + * + * @return date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format + */ + function UnixDate($v) + { + + if (!preg_match( "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})|", + ($v), $rr)) return false; + + if ($rr[1] <= TIMESTAMP_FIRST_YEAR) return 0; + // h-m-s-MM-DD-YY + return @adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1]); + } + + + /** + * @param $v is a timestamp string in YYYY-MM-DD HH-NN-SS format + * + * @return date in unix timestamp format, or 0 if before TIMESTAMP_FIRST_YEAR, or false if invalid date format + */ + function UnixTimeStamp($v) + { + + if (!preg_match( + "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ -]?(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|", + ($v), $rr)) return false; + if ($rr[1] <= TIMESTAMP_FIRST_YEAR && $rr[2]<= 1) return 0; + + // h-m-s-MM-DD-YY + if (!isset($rr[5])) return adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1]); + return @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1]); + } + + + /** + * PEAR DB Compat - do not use internally + */ + function Free() + { + return $this->Close(); + } + + + /** + * PEAR DB compat, number of rows + */ + function NumRows() + { + return $this->_numOfRows; + } + + + /** + * PEAR DB compat, number of cols + */ + function NumCols() + { + return $this->_numOfFields; + } + + /** + * Fetch a row, returning false if no more rows. + * This is PEAR DB compat mode. + * + * @return false or array containing the current record + */ + function FetchRow() + { + if ($this->EOF) return false; + $arr = $this->fields; + $this->_currentRow++; + if (!$this->_fetch()) $this->EOF = true; + return $arr; + } + + + /** + * Fetch a row, returning PEAR_Error if no more rows. + * This is PEAR DB compat mode. + * + * @return DB_OK or error object + */ + function FetchInto(&$arr) + { + if ($this->EOF) return (defined('PEAR_ERROR_RETURN')) ? new PEAR_Error('EOF',-1): false; + $arr = $this->fields; + $this->MoveNext(); + return 1; // DB_OK + } + + + /** + * Move to the first row in the recordset. Many databases do NOT support this. + * + * @return true or false + */ + function MoveFirst() + { + if ($this->_currentRow == 0) return true; + return $this->Move(0); + } + + + /** + * Move to the last row in the recordset. + * + * @return true or false + */ + function MoveLast() + { + if ($this->_numOfRows >= 0) return $this->Move($this->_numOfRows-1); + if ($this->EOF) return false; + while (!$this->EOF) { + $f = $this->fields; + $this->MoveNext(); + } + $this->fields = $f; + $this->EOF = false; + return true; + } + + + /** + * Move to next record in the recordset. + * + * @return true if there still rows available, or false if there are no more rows (EOF). + */ + function MoveNext() + { + if (!$this->EOF) { + $this->_currentRow++; + if ($this->_fetch()) return true; + } + $this->EOF = true; + /* -- tested error handling when scrolling cursor -- seems useless. + $conn = $this->connection; + if ($conn && $conn->raiseErrorFn && ($errno = $conn->ErrorNo())) { + $fn = $conn->raiseErrorFn; + $fn($conn->databaseType,'MOVENEXT',$errno,$conn->ErrorMsg().' ('.$this->sql.')',$conn->host,$conn->database); + } + */ + return false; + } + + /** + * Random access to a specific row in the recordset. Some databases do not support + * access to previous rows in the databases (no scrolling backwards). + * + * @param rowNumber is the row to move to (0-based) + * + * @return true if there still rows available, or false if there are no more rows (EOF). + */ + function Move($rowNumber = 0) + { + $this->EOF = false; + if ($rowNumber == $this->_currentRow) return true; + if ($rowNumber >= $this->_numOfRows) + if ($this->_numOfRows != -1) $rowNumber = $this->_numOfRows-2; + + if ($this->canSeek) { + + if ($this->_seek($rowNumber)) { + $this->_currentRow = $rowNumber; + if ($this->_fetch()) { + return true; + } + } else { + $this->EOF = true; + return false; + } + } else { + if ($rowNumber < $this->_currentRow) return false; + global $ADODB_EXTENSION; + if ($ADODB_EXTENSION) { + while (!$this->EOF && $this->_currentRow < $rowNumber) { + adodb_movenext($this); + } + } else { + + while (! $this->EOF && $this->_currentRow < $rowNumber) { + $this->_currentRow++; + + if (!$this->_fetch()) $this->EOF = true; + } + } + return !($this->EOF); + } + + $this->fields = false; + $this->EOF = true; + return false; + } + + + /** + * Get the value of a field in the current row by column name. + * Will not work if ADODB_FETCH_MODE is set to ADODB_FETCH_NUM. + * + * @param colname is the field to access + * + * @return the value of $colname column + */ + function Fields($colname) + { + return $this->fields[$colname]; + } + + function GetAssocKeys($upper=true) + { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + if ($upper === 2) $this->bind[$o->name] = $i; + else $this->bind[($upper) ? strtoupper($o->name) : strtolower($o->name)] = $i; + } + } + + /** + * Use associative array to get fields array for databases that do not support + * associative arrays. Submitted by Paolo S. Asioli paolo.asioli@libero.it + * + * If you don't want uppercase cols, set $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC + * before you execute your SQL statement, and access $rs->fields['col'] directly. + * + * $upper 0 = lowercase, 1 = uppercase, 2 = whatever is returned by FetchField + */ + function GetRowAssoc($upper=1) + { + + if (!$this->bind) { + $this->GetAssocKeys($upper); + } + + $record = array(); + foreach($this->bind as $k => $v) { + $record[$k] = $this->fields[$v]; + } + + return $record; + } + + + /** + * Clean up recordset + * + * @return true or false + */ + function Close() + { + // free connection object - this seems to globally free the object + // and not merely the reference, so don't do this... + // $this->connection = false; + if (!$this->_closed) { + $this->_closed = true; + return $this->_close(); + } else + return true; + } + + /** + * synonyms RecordCount and RowCount + * + * @return the number of rows or -1 if this is not supported + */ + function RecordCount() {return $this->_numOfRows;} + + + /* + * If we are using PageExecute(), this will return the maximum possible rows + * that can be returned when paging a recordset. + */ + function MaxRecordCount() + { + return ($this->_maxRecordCount) ? $this->_maxRecordCount : $this->RecordCount(); + } + + /** + * synonyms RecordCount and RowCount + * + * @return the number of rows or -1 if this is not supported + */ + function RowCount() {return $this->_numOfRows;} + + + /** + * Portable RecordCount. Pablo Roca + * + * @return the number of records from a previous SELECT. All databases support this. + * + * But aware possible problems in multiuser environments. For better speed the table + * must be indexed by the condition. Heavy test this before deploying. + */ + function PO_RecordCount($table="", $condition="") { + + $lnumrows = $this->_numOfRows; + // the database doesn't support native recordcount, so we do a workaround + if ($lnumrows == -1 && $this->connection) { + IF ($table) { + if ($condition) $condition = " WHERE " . $condition; + $resultrows = &$this->connection->Execute("SELECT COUNT(*) FROM $table $condition"); + if ($resultrows) $lnumrows = reset($resultrows->fields); + } + } + return $lnumrows; + } + + /** + * @return the current row in the recordset. If at EOF, will return the last row. 0-based. + */ + function CurrentRow() {return $this->_currentRow;} + + /** + * synonym for CurrentRow -- for ADO compat + * + * @return the current row in the recordset. If at EOF, will return the last row. 0-based. + */ + function AbsolutePosition() {return $this->_currentRow;} + + /** + * @return the number of columns in the recordset. Some databases will set this to 0 + * if no records are returned, others will return the number of columns in the query. + */ + function FieldCount() {return $this->_numOfFields;} + + + /** + * Get the ADOFieldObject of a specific column. + * + * @param fieldoffset is the column position to access(0-based). + * + * @return the ADOFieldObject for that column, or false. + */ + function &FetchField($fieldoffset) + { + // must be defined by child class + } + + /** + * Get the ADOFieldObjects of all columns in an array. + * + */ + function FieldTypesArray() + { + $arr = array(); + for ($i=0, $max=$this->_numOfFields; $i < $max; $i++) + $arr[] = $this->FetchField($i); + return $arr; + } + + /** + * Return the fields array of the current row as an object for convenience. + * The default case is lowercase field names. + * + * @return the object with the properties set to the fields of the current row + */ + function &FetchObj() + { + return FetchObject(false); + } + + /** + * Return the fields array of the current row as an object for convenience. + * The default case is uppercase. + * + * @param $isupper to set the object property names to uppercase + * + * @return the object with the properties set to the fields of the current row + */ + function &FetchObject($isupper=true) + { + if (empty($this->_obj)) { + $this->_obj = new ADOFetchObj(); + $this->_names = array(); + for ($i=0; $i <$this->_numOfFields; $i++) { + $f = $this->FetchField($i); + $this->_names[] = $f->name; + } + } + $i = 0; + $o = &$this->_obj; + for ($i=0; $i <$this->_numOfFields; $i++) { + $name = $this->_names[$i]; + if ($isupper) $n = strtoupper($name); + else $n = $name; + + $o->$n = $this->Fields($name); + } + return $o; + } + + /** + * Return the fields array of the current row as an object for convenience. + * The default is lower-case field names. + * + * @return the object with the properties set to the fields of the current row, + * or false if EOF + * + * Fixed bug reported by tim@orotech.net + */ + function &FetchNextObj() + { + return $this->FetchNextObject(false); + } + + + /** + * Return the fields array of the current row as an object for convenience. + * The default is upper case field names. + * + * @param $isupper to set the object property names to uppercase + * + * @return the object with the properties set to the fields of the current row, + * or false if EOF + * + * Fixed bug reported by tim@orotech.net + */ + function &FetchNextObject($isupper=true) + { + $o = false; + if ($this->_numOfRows != 0 && !$this->EOF) { + $o = $this->FetchObject($isupper); + $this->_currentRow++; + if ($this->_fetch()) return $o; + } + $this->EOF = true; + return $o; + } + + /** + * Get the metatype of the column. This is used for formatting. This is because + * many databases use different names for the same type, so we transform the original + * type to our standardised version which uses 1 character codes: + * + * @param t is the type passed in. Normally is ADOFieldObject->type. + * @param len is the maximum length of that field. This is because we treat character + * fields bigger than a certain size as a 'B' (blob). + * @param fieldobj is the field object returned by the database driver. Can hold + * additional info (eg. primary_key for mysql). + * + * @return the general type of the data: + * C for character < 200 chars + * X for teXt (>= 200 chars) + * B for Binary + * N for numeric floating point + * D for date + * T for timestamp + * L for logical/Boolean + * I for integer + * R for autoincrement counter/integer + * + * + */ + function MetaType($t,$len=-1,$fieldobj=false) + { + if (is_object($t)) { + $fieldobj = $t; + $t = $fieldobj->type; + $len = $fieldobj->max_length; + } + // changed in 2.32 to hashing instead of switch stmt for speed... + static $typeMap = array( + 'VARCHAR' => 'C', + 'VARCHAR2' => 'C', + 'CHAR' => 'C', + 'C' => 'C', + 'STRING' => 'C', + 'NCHAR' => 'C', + 'NVARCHAR' => 'C', + 'VARYING' => 'C', + 'BPCHAR' => 'C', + 'CHARACTER' => 'C', + 'INTERVAL' => 'C', # Postgres + ## + 'LONGCHAR' => 'X', + 'TEXT' => 'X', + 'NTEXT' => 'X', + 'M' => 'X', + 'X' => 'X', + 'CLOB' => 'X', + 'NCLOB' => 'X', + 'LVARCHAR' => 'X', + ## + 'BLOB' => 'B', + 'IMAGE' => 'B', + 'BINARY' => 'B', + 'VARBINARY' => 'B', + 'LONGBINARY' => 'B', + 'B' => 'B', + ## + 'YEAR' => 'D', // mysql + 'DATE' => 'D', + 'D' => 'D', + ## + 'TIME' => 'T', + 'TIMESTAMP' => 'T', + 'DATETIME' => 'T', + 'TIMESTAMPTZ' => 'T', + 'T' => 'T', + ## + 'BOOLEAN' => 'L', + 'BIT' => 'L', + 'L' => 'L', + ## + 'COUNTER' => 'R', + 'R' => 'R', + 'SERIAL' => 'R', // ifx + 'INT IDENTITY' => 'R', + ## + 'INT' => 'I', + 'INTEGER' => 'I', + 'SHORT' => 'I', + 'TINYINT' => 'I', + 'SMALLINT' => 'I', + 'I' => 'I', + ## + 'LONG' => 'N', // interbase is numeric, oci8 is blob + 'BIGINT' => 'N', // this is bigger than PHP 32-bit integers + 'DECIMAL' => 'N', + 'DEC' => 'N', + 'REAL' => 'N', + 'DOUBLE' => 'N', + 'DOUBLE PRECISION' => 'N', + 'SMALLFLOAT' => 'N', + 'FLOAT' => 'N', + 'NUMBER' => 'N', + 'NUM' => 'N', + 'NUMERIC' => 'N', + 'MONEY' => 'N', + + ## informix 9.2 + 'SQLINT' => 'I', + 'SQLSERIAL' => 'I', + 'SQLSMINT' => 'I', + 'SQLSMFLOAT' => 'N', + 'SQLFLOAT' => 'N', + 'SQLMONEY' => 'N', + 'SQLDECIMAL' => 'N', + 'SQLDATE' => 'D', + 'SQLVCHAR' => 'C', + 'SQLCHAR' => 'C', + 'SQLDTIME' => 'T', + 'SQLINTERVAL' => 'N', + 'SQLBYTES' => 'B', + 'SQLTEXT' => 'X' + ); + + $tmap = false; + $t = strtoupper($t); + $tmap = @$typeMap[$t]; + switch ($tmap) { + case 'C': + + // is the char field is too long, return as text field... + if (!empty($this->blobSize)) { + if ($len > $this->blobSize) return 'X'; + } else if ($len > 250) { + return 'X'; + } + return 'C'; + + case 'I': + if (!empty($fieldobj->primary_key)) return 'R'; + return 'I'; + + case false: + return 'N'; + + case 'B': + if (isset($fieldobj->binary)) + return ($fieldobj->binary) ? 'B' : 'X'; + return 'B'; + + case 'D': + if (!empty($this->dateHasTime)) return 'T'; + return 'D'; + + default: + if ($t == 'LONG' && $this->dataProvider == 'oci8') return 'B'; + return $tmap; + } + } + + function _close() {} + + /** + * set/returns the current recordset page when paginating + */ + function AbsolutePage($page=-1) + { + if ($page != -1) $this->_currentPage = $page; + return $this->_currentPage; + } + + /** + * set/returns the status of the atFirstPage flag when paginating + */ + function AtFirstPage($status=false) + { + if ($status != false) $this->_atFirstPage = $status; + return $this->_atFirstPage; + } + + function LastPageNo($page = false) + { + if ($page != false) $this->_lastPageNo = $page; + return $this->_lastPageNo; + } + + /** + * set/returns the status of the atLastPage flag when paginating + */ + function AtLastPage($status=false) + { + if ($status != false) $this->_atLastPage = $status; + return $this->_atLastPage; + } +} // end class ADORecordSet + + //============================================================================================== + // CLASS ADORecordSet_array + //============================================================================================== + + /** + * This class encapsulates the concept of a recordset created in memory + * as an array. This is useful for the creation of cached recordsets. + * + * Note that the constructor is different from the standard ADORecordSet + */ + + class ADORecordSet_array extends ADORecordSet + { + var $databaseType = 'array'; + + var $_array; // holds the 2-dimensional data array + var $_types; // the array of types of each column (C B I L M) + var $_colnames; // names of each column in array + var $_skiprow1; // skip 1st row because it holds column names + var $_fieldarr; // holds array of field objects + var $canSeek = true; + var $affectedrows = false; + var $insertid = false; + var $sql = ''; + var $compat = false; + /** + * Constructor + * + */ + function ADORecordSet_array($fakeid=1) + { + global $ADODB_FETCH_MODE,$ADODB_COMPAT_FETCH; + + // fetch() on EOF does not delete $this->fields + $this->compat = !empty($ADODB_COMPAT_FETCH); + $this->ADORecordSet($fakeid); // fake queryID + $this->fetchMode = $ADODB_FETCH_MODE; + } + + + /** + * Setup the Array. Later we will have XML-Data and CSV handlers + * + * @param array is a 2-dimensional array holding the data. + * The first row should hold the column names + * unless paramter $colnames is used. + * @param typearr holds an array of types. These are the same types + * used in MetaTypes (C,B,L,I,N). + * @param [colnames] array of column names. If set, then the first row of + * $array should not hold the column names. + */ + function InitArray($array,$typearr,$colnames=false) + { + $this->_array = $array; + $this->_types = $typearr; + if ($colnames) { + $this->_skiprow1 = false; + $this->_colnames = $colnames; + } else $this->_colnames = $array[0]; + + $this->Init(); + } + /** + * Setup the Array and datatype file objects + * + * @param array is a 2-dimensional array holding the data. + * The first row should hold the column names + * unless paramter $colnames is used. + * @param fieldarr holds an array of ADOFieldObject's. + */ + function InitArrayFields($array,$fieldarr) + { + $this->_array = $array; + $this->_skiprow1= false; + if ($fieldarr) { + $this->_fieldobjects = $fieldarr; + } + $this->Init(); + } + + function &GetArray($nRows=-1) + { + if ($nRows == -1 && $this->_currentRow <= 0 && !$this->_skiprow1) { + return $this->_array; + } else { + return ADORecordSet::GetArray($nRows); + } + } + + function _initrs() + { + $this->_numOfRows = sizeof($this->_array); + if ($this->_skiprow1) $this->_numOfRows -= 1; + + $this->_numOfFields =(isset($this->_fieldobjects)) ? + sizeof($this->_fieldobjects):sizeof($this->_types); + } + + /* Use associative array to get fields array */ + function Fields($colname) + { + if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname]; + + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + return $this->fields[$this->bind[strtoupper($colname)]]; + } + + function &FetchField($fieldOffset = -1) + { + if (isset($this->_fieldobjects)) { + return $this->_fieldobjects[$fieldOffset]; + } + $o = new ADOFieldObject(); + $o->name = $this->_colnames[$fieldOffset]; + $o->type = $this->_types[$fieldOffset]; + $o->max_length = -1; // length not known + + return $o; + } + + function _seek($row) + { + if (sizeof($this->_array) && $row < $this->_numOfRows) { + $this->fields = $this->_array[$row]; + return true; + } + return false; + } + + function MoveNext() + { + if (!$this->EOF) { + $this->_currentRow++; + + $pos = $this->_currentRow; + if ($this->_skiprow1) $pos += 1; + + if ($this->_numOfRows <= $pos) { + if (!$this->compat) $this->fields = false; + } else { + $this->fields = $this->_array[$pos]; + return true; + } + $this->EOF = true; + } + + return false; + } + + function _fetch() + { + $pos = $this->_currentRow; + if ($this->_skiprow1) $pos += 1; + + if ($this->_numOfRows <= $pos) { + if (!$this->compat) $this->fields = false; + return false; + } + + $this->fields = $this->_array[$pos]; + return true; + } + + function _close() + { + return true; + } + + } // ADORecordSet_array + + //============================================================================================== + // HELPER FUNCTIONS + //============================================================================================== + + /** + * Synonym for ADOLoadCode. + * + * @deprecated + */ + function ADOLoadDB($dbType) + { + return ADOLoadCode($dbType); + } + + /** + * Load the code for a specific database driver + */ + function ADOLoadCode($dbType) + { + GLOBAL $ADODB_Database; + + if (!$dbType) return false; + $ADODB_Database = strtolower($dbType); + switch ($ADODB_Database) { + case 'maxsql': $ADODB_Database = 'mysqlt'; break; + case 'postgres': + case 'pgsql': $ADODB_Database = 'postgres7'; break; + } + // Karsten Kraus + return @include_once(ADODB_DIR."/drivers/adodb-".$ADODB_Database.".inc.php"); + } + + /** + * synonym for ADONewConnection for people like me who cannot remember the correct name + */ + function &NewADOConnection($db='') + { + return ADONewConnection($db); + } + + /** + * Instantiate a new Connection class for a specific database driver. + * + * @param [db] is the database Connection object to create. If undefined, + * use the last database driver that was loaded by ADOLoadCode(). + * + * @return the freshly created instance of the Connection class. + */ + function &ADONewConnection($db='') + { + global $ADODB_Database; + + $rez = true; + if ($db) { + if ($ADODB_Database != $db) ADOLoadCode($db); + } else { + if (!empty($ADODB_Database)) { + ADOLoadCode($ADODB_Database); + } else { + $rez = false; + } + } + + $errorfn = (defined('ADODB_ERROR_HANDLER')) ? ADODB_ERROR_HANDLER : false; + if (!$rez) { + if ($errorfn) { + // raise an error + $errorfn('ADONewConnection', 'ADONewConnection', -998, + "could not load the database driver for '$db", + $dbtype); + } else + ADOConnection::outp( "

ADONewConnection: Unable to load database driver '$db'

",false); + + return false; + } + + $cls = 'ADODB_'.$ADODB_Database; + $obj = new $cls(); + if ($errorfn) $obj->raiseErrorFn = $errorfn; + + return $obj; + } + + function &NewDataDictionary(&$conn) + { + $provider = $conn->dataProvider; + $drivername = $conn->databaseType; + if ($provider !== 'native' && $provider != 'odbc' && $provider != 'ado') + $drivername = $conn->dataProvider; + else { + if (substr($drivername,0,5) == 'odbc_') $drivername = substr($drivername,5); + else if (substr($drivername,0,4) == 'ado_') $drivername = substr($drivername,4); + else + switch($drivername) { + case 'oracle': $drivername = 'oci8';break; + case 'sybase': $drivername = 'mssql';break; + case 'access': + case 'db2': + break; + default: + $drivername = 'generic'; + break; + } + } + include_once(ADODB_DIR.'/adodb-lib.inc.php'); + include_once(ADODB_DIR.'/adodb-datadict.inc.php'); + $path = ADODB_DIR."/datadict/datadict-$drivername.inc.php"; + + if (!file_exists($path)) { + ADOConnection::outp("Database driver '$path' not available"); + return false; + } + include_once($path); + $class = "ADODB2_$drivername"; + $dict =& new $class(); + $dict->dataProvider = $conn->dataProvider; + $dict->connection = &$conn; + $dict->upperName = strtoupper($drivername); + if (is_resource($conn->_connectionID)) + $dict->serverInfo = $conn->ServerInfo(); + + return $dict; + } + + + /** + * Save a file $filename and its $contents (normally for caching) with file locking + */ + function adodb_write_file($filename, $contents,$debug=false) + { + # http://www.php.net/bugs.php?id=9203 Bug that flock fails on Windows + # So to simulate locking, we assume that rename is an atomic operation. + # First we delete $filename, then we create a $tempfile write to it and + # rename to the desired $filename. If the rename works, then we successfully + # modified the file exclusively. + # What a stupid need - having to simulate locking. + # Risks: + # 1. $tempfile name is not unique -- very very low + # 2. unlink($filename) fails -- ok, rename will fail + # 3. adodb reads stale file because unlink fails -- ok, $rs timeout occurs + # 4. another process creates $filename between unlink() and rename() -- ok, rename() fails and cache updated + if (strpos(strtoupper(PHP_OS),'WIN') !== false) { + // skip the decimal place + $mtime = substr(str_replace(' ','_',microtime()),2); + // unlink will let some latencies develop, so uniqid() is more random + @unlink($filename); + // getmypid() actually returns 0 on Win98 - never mind! + $tmpname = $filename.uniqid($mtime).getmypid(); + if (!($fd = fopen($tmpname,'a'))) return false; + $ok = ftruncate($fd,0); + if (!fwrite($fd,$contents)) $ok = false; + fclose($fd); + chmod($tmpname,0644); + if (!@rename($tmpname,$filename)) { + unlink($tmpname); + $ok = false; + } + if (!$ok) { + if ($debug) ADOConnection::outp( " Rename $tmpname ".($ok? 'ok' : 'failed')); + } + return $ok; + } + if (!($fd = fopen($filename, 'a'))) return false; + if (flock($fd, LOCK_EX) && ftruncate($fd, 0)) { + $ok = fwrite( $fd, $contents ); + fclose($fd); + chmod($filename,0644); + }else { + fclose($fd); + if ($debug)ADOConnection::outp( " Failed acquiring lock for $filename
\n"); + $ok = false; + } + + return $ok; + } + + + function adodb_backtrace($print=true) + { + $s = ''; + if (PHPVERSION() >= 4.3) { + + $MAXSTRLEN = 64; + + $s = '
';
+			$traceArr = debug_backtrace();
+			array_shift($traceArr);
+			$tabs = sizeof($traceArr)-1;
+			
+			foreach ($traceArr as $arr) {
+				$args = array();
+				for ($i=0; $i < $tabs; $i++) $s .= '   ';
+				$tabs -= 1;
+				$s .= '';
+				if (isset($arr['class'])) $s .= $arr['class'].'.';
+				if (isset($arr['args']))
+				 foreach($arr['args'] as $v) {
+					if (is_null($v)) $args[] = 'null';
+					else if (is_array($v)) $args[] = 'Array['.sizeof($v).']';
+					else if (is_object($v)) $args[] = 'Object:'.get_class($v);
+					else if (is_bool($v)) $args[] = $v ? 'true' : 'false';
+					else { 
+						$v = (string) @$v;
+						$str = htmlspecialchars(substr($v,0,$MAXSTRLEN));
+						if (strlen($v) > $MAXSTRLEN) $str .= '...';
+						$args[] = $str;
+					}
+				}
+				$s .= $arr['function'].'('.implode(', ',$args).')';
+				$s .= @sprintf(" # line %4d, file: %s",
+					$arr['line'],$arr['file'],$arr['file']);
+				$s .= "\n";
+			}	
+			$s .= '
'; + if ($print) print $s; + } + return $s; + } + +} // defined +?> \ No newline at end of file Index: trunk/admin/icons/icon46_list_banlist.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/urgeman.gif =================================================================== diff -u Binary files differ Index: trunk/admin/include/images.php =================================================================== diff -u --- trunk/admin/include/images.php (revision 0) +++ trunk/admin/include/images.php (revision 13) @@ -0,0 +1,274 @@ + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_usertogroup.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_preview_theme_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/plugin.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_search_reset.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_print_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_editcat_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/dialog/fck_about/logo_fckeditor_2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/menu_bar.gif =================================================================== diff -u Binary files differ Index: trunk/compat/array_change_key_case.php =================================================================== diff -u --- trunk/compat/array_change_key_case.php (revision 0) +++ trunk/compat/array_change_key_case.php (revision 13) @@ -0,0 +1,65 @@ + | +// | Aidan Lister | +// +----------------------------------------------------------------------+ +// +// $Id: array_change_key_case.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +if (!defined('CASE_LOWER')) { + define('CASE_LOWER', 0); +} + +if (!defined('CASE_UPPER')) { + define('CASE_UPPER', 1); +} + + +/** + * Replace array_change_key_case() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.array_change_key_case + * @author Stephan Schmidt + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.2.0 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('array_change_key_case')) +{ + function array_change_key_case ($input, $case = CASE_LOWER) + { + if (!is_array($input)) { + trigger_error('array_change_key_case(): The argument should be an array', E_USER_WARNING); + return false; + } + + $output = array (); + $keys = array_keys($input); + $casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper'; + + foreach ($keys as $key) { + $output[$casefunc($key)] = $input[$key]; + } + + return $output; + } +} +?> \ No newline at end of file Index: trunk/admin/category/addcategory.php =================================================================== diff -u --- trunk/admin/category/addcategory.php (revision 0) +++ trunk/admin/category/addcategory.php (revision 13) @@ -0,0 +1,374 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; + +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"); + +unset($objEditItems); + +$objEditItems = new clsCatList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Category"); +$objCustomFields = new clsCustomFieldList(1); +$objCustomDataList = new clsCustomDataList(); +$objRelList = new clsRelationshipList(); +$objImages = new clsImageList(); + +//Multiedit init +if ($_GET["new"] == 1) +{ + $c = new clsCategory(NULL); + $c->Set("CreatedOn", time()); + $c->Set("EndOn", time()); + $c->Set("ParentId",$objCatList->CurrentCategoryID()); + $c->Set("NewItem",2); //auto + $c->Set("Status",2); //pending + $en = 0; + $action = "m_add_category"; + $objCatList->CreateEmptyEditTable("CategoryId"); + $objRelList->CreateEmptyEditTable("RelationshipId"); + $objCustomDataList->CreateEmptyEditTable("CustomDataId"); + $objImages->CreateEmptyEditTable("ResourceId"); + + $TitleVerb = prompt_language("la_Text_Adding"); +} +else +{ + if(isset($_POST["catlist"])) + { + $cats = $_POST["catlist"]; + $objCatList->CopyToEditTable("CategoryId",$cats); + $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); + /* make a copy of the relationship records */ + $ids = $objEditItems->GetResourceIDList(); + $objRelList->CopyToEditTable("SourceId", $ids); + $objCustomDataList->CopyToEditTable("ResourceId",$ids); + $objImages->CopyToEditTable("ResourceId", $ids); + $c = $objEditItems->GetItemByIndex(0); + $itemcount=$objEditItems->NumItems(); + $en = 0; + } + else + { + if($_GET["item"]) + { + /*shortcut to edit link */ + $objCatList->CopyToEditTable("ResourceId",$_GET["item"]); + $backurl = $_GET["return"]; + } + + //Multiedit init + $en = (int)$_GET["en"]; + $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); + + //$ids = $objEditItems->GetResourceIDList(); + //$objRelList->CopyToEditTable("SourceId", $ids); + //$objCustomDataList->CopyToEditTable("ResourceId",$ids); + //$objImages->CopyToEditTable("ResourceId", $ids); + + $itemcount=$objEditItems->NumItems(); + $c = $objEditItems->GetItemByIndex($en); + } + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + + $action = "m_edit_category"; + $TitleVerb = prompt_language("la_Text_Editing"); +} + +$envar = "env=" . BuildEnv() . "&en=$en"; +$section = 'in-portal:editcategory_general'; + +if (strlen($c->Get("Name"))) + $editing_category_title = "'".$c->Get("Name")."' "; +else + $editing_category_title = ""; + +$title = $TitleVerb." ".prompt_language("la_Text_Category")." $editing_category_title- ".prompt_language("la_tab_General"); + +//$saveURL = $admin."/browse.php"; +$saveURL = $admin."/category/category_maint.php"; +$cancelURL = $admin."/browse.php"; + +//Display header +$sec = $objSections->GetSection($section); + +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('category','CatEditStatus','$saveURL',1,'');","tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('category','CatEditStatus','$cancelURL',2,'');","tool_cancel.gif"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/category/addcategory.php"; + $StatusField = "CatEditStatus"; + $form = "category"; + MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevCategory','la_NextCategory'); +} + +int_header($objCatToolBar,NULL,$title); + +if ($objSession->GetVariable("HasChanges") == 1) { +?> + + + + +
+ +
+ + + + > + + + + Get("CategoryId") > 0 ) { ?> + > + + + + + + > + + + + + > + + + + + + + > + + + + + > + + + + + > + + + + + > + + + + + > + + + + + + + > + + + + + > + + + + +GetFieldUIList(TRUE); +if($CustomFieldUI->NumItems()>0) +{ + $objCustomDataList->SourceTable = $objSession->GetEditTable("CustomMetaData"); + if((int)$c->Get("ResourceId")>0) + { + $objCustomDataList->LoadResource($c->Get("ResourceId")); + } + $headings = $CustomFieldUI->GetHeadingList(); + //echo "
";print_r($objCustomFields); echo "
"; + for($i=0;$i<=count($headings);$i++) + { + $h = $headings[$i]; + if(strlen($h)) + { + int_subsection_title(prompt_language($h)); + $Items = $CustomFieldUI->GetHeadingItems($h); + foreach($Items as $f) + { + $n = substr($f->name,1); + $cfield = $objCustomFields->GetItemByField("FieldName",$n,FALSE); + if(is_object($cfield)) + { + $cv = $objCustomDataList->GetDataItem($cfield->Get("CustomFieldId")); + if(is_object($cv)) + { + $f->default_value = $cv->Get("Value"); + } + } + print "\n"; + print " \n"; + print " "; + if(is_object($f->NextItem)) + { + $n = $f->NextItem; + print " "; + } + else + print " \n"; + print "\n"; + } + } + } +} +?> + "> + "> + + + + +
+ +
+ +
Get("CategoryId"); ?> 
+ "> +
+
+ + + +
+ +
+ Get("Status") == 1) echo "checked"; ?>> + Get("Status") == 2) echo "checked"; ?>> + Get("Status") == 0) echo "checked"; ?>> +  
+ Get("NewItem") == 2) echo "checked"; ?>> + Get("NewItem") == 1) echo "checked"; ?>> + Get("NewItem") == 0) echo "checked"; ?>> + +  
+ Get("EditorsPick") == 1) echo "checked"; ?>> +  
"> 
+ "> +
+ "> +  
+ +  
".$f->GetPrompt()."".$f->ItemFormElement()."".$n->ItemFormElement()." 
+ + + +
+ +
+ + + + Index: trunk/admin/images/toolbar/tool_validate_restart.gif =================================================================== diff -u Binary files differ Index: trunk/compat/var_export.php =================================================================== diff -u --- trunk/compat/var_export.php (revision 0) +++ trunk/compat/var_export.php (revision 13) @@ -0,0 +1,103 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: var_export.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace var_export() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.var_export + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.2.0 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('var_export')) +{ + function var_export ($array, $return = false) + { + // Common output variables + $indent = ' '; + $doublearrow = ' => '; + $lineend = ",\n"; + $stringdelim = '\''; + $newline = "\n"; + + // Check the export isn't a simple string / int + if (is_string($array)) { + $out = $stringdelim . $array . $stringdelim; + } + elseif (is_int($array)) { + $out = (string)$array; + } + + // Begin the array export + else + { + // Start the string + $out = "array (\n"; + + // Loop through each value in array + foreach ($array as $key => $value) + { + // If the key is a string, delimit it + if (is_string($key)) { + $key = $stringdelim . addslashes($key) . $stringdelim; + } + + // If the value is a string, delimit it + if (is_string($value)) { + $value = $stringdelim . addslashes($value) . $stringdelim; + } + + // We have an array, so do some recursion + elseif (is_array($value)) + { + // Do some basic recursion while increasing the indent + $recur_array = explode($newline, var_export($value, true)); + $recur_newarr = array (); + foreach ($recur_array as $recur_line) { + $recur_newarr[] = $indent . $recur_line; + } + $recur_array = implode($newline, $recur_newarr); + $value = $newline . $recur_array; + } + + // Piece together the line + $out .= $indent . $key . $doublearrow . $value . $lineend; + } + + // End our string + $out .= ")"; + } + + + // Decide method of output + if ($return === true) { + return $out; + } else { + echo $out; + return null; + } + } +} +?> \ No newline at end of file Index: trunk/themes/default/img/bgr_post.jpg =================================================================== diff -u Binary files differ Index: trunk/themes/default/misc/right_loggedin.tpl =================================================================== diff -u --- trunk/themes/default/misc/right_loggedin.tpl (revision 0) +++ trunk/themes/default/misc/right_loggedin.tpl (revision 13) @@ -0,0 +1,59 @@ + + + + + + + + + + +
+ + + + + + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
">
">
">
">
">
">
">
">
">
">



+
+
+ Index: trunk/kernel/include/parseditem.php =================================================================== diff -u --- trunk/kernel/include/parseditem.php (revision 0) +++ trunk/kernel/include/parseditem.php (revision 13) @@ -0,0 +1,2748 @@ +clsItemDB(); + $this->Parser = new clsTemplateList($TemplateRoot); + $this->AdminParser = new clsAdminTemplateList(); + } + +/* function ParseObject($element) + { + $extra_attribs = ExtraAttributes($element->attributes); + if(strtolower($element->name)==$this->TagPrefix) + { + $field = strtolower($element->attributes["_field"]); + $tag = $this->TagPrefix."_".$field; + $ret = $this->parsetag($tag); + } + return $ret; + } +*/ + function ParseTimeStamp($d,$attribs=array()) + { + if($attribs["_tz"]) + { + $d = GetLocalTime($d,$objSession->Get("tz")); + } + $part = strtolower($attribs["_part"]); + if(strlen($part)) + { + $ret = ExtractDatePart($part,$d); + } + else + { + if($d<=0) + { + $ret = ""; + } + else + $ret = LangDate($d); + } + return $ret; + } + + function ParseObject($element) + { + global $objConfig, $objCatList, $var_list_update, $var_list, $n_var_list_update, $m_var_list_update; + + $extra_attribs = ExtraAttributes($element->attributes); + $ret = ""; + + if ($this->TagPrefix == "email" && strtolower($element->name) == "touser") { + $this->TagPrefix = "touser"; + } + + if(strtolower($element->name)==$this->TagPrefix) + { + $field = strtolower($element->attributes["_field"]); + switch($field) + { + case "id": + $ret = $this->Get($this->id_field); + break; + case "resourceid": + if(!$this->NoResourceId) + $ret = $this->Get("ResourceId"); + break; + case "category": + $c = $objCatList->GetItem($this->Get("CategoryId")); + if(is_object($c)) + { + $ret = $c->parsetag($element->attributes["_cattag"]); + } + break; + case "priority": + if($this->Get("Priority")!=0) + { + $ret = (int)$this->Get("Priority"); + } + else + $ret = ""; + break; + case "link": + if(method_exists($this,"ItemURL")) + { + $ret = $this->ItemURL($element->attributes["_template"],FALSE,""); + } + break; + case "cat_link": + if(method_exists($this,"ItemURL")) + { + $ret = $this->ItemURL($element->attributes["_template"],TRUE,""); + } + break; + case "fullpath": + $ret = $this->Get("CachedNavbar"); + if(!strlen($ret)) + { + if(is_numeric($this->Get("CategoryId"))) + { + $c = $objCatList->GetItem($this->Get("CategoryId")); + if(is_object($c)) + $ret = $c->Get("CachedNavbar"); + } + else + { + if(method_exists($this,"GetPrimaryCategory")) + { + $cat = $this->GetPrimaryCategory(); + $c = $objCatList->GetItem($cat); + if(is_object($c)) + $ret = $c->Get("CachedNavbar"); + } + } + } + // $ret = $this->HighlightText($ret); + break; + + case "relevance": + $style = $element->attributes["_displaymode"]; + if(!strlen($style)) + $style = "numerical"; + switch ($style) + { + case "numerical": + $ret = (100 * LangNumber($this->Get("Relevance"),1))."%"; + break; + case "bar": + $OffColor = $element->attributes["_offbackgroundcolor"]; + $OnColor = $element->attributes["_onbackgroundcolor"]; + $percentsOff = (int)(100 - (100 * $this->Get("Relevance"))); if ($percentsOff) + { + $percentsOn = 100 - $percentsOff; + $ret = ""; + } + else + $ret = ""; + break; + case "graphical": + $OnImage = $element->attributes["_onimage"]; + if (!strlen($OnImage)) + break; + // Get image extension + $image_data = explode(".", $OnImage); + $image_ext = $image_data[count($image_data)-1]; + unset($image_data[count($image_data)-1]); + $rel = (10 * LangNumber($this->Get("Relevance"),1)); + $OnImage1 = join(".", $image_data); + + if ($rel) + $img_src = $OnImage1."_".$rel.".".$image_ext; + else + $img_src = $OnImage; + + $ret = "\"".(10*$rel)."\""; + break; + } + + break; + + case "rating": + $style = $element->attributes["_displaymode"]; + if(!strlen($style)) + $style = "numerical"; + switch($style) + { + case "numerical": + $ret = LangNumber($this->Get("CachedRating"),1); + break; + case "text": + $ret = RatingText($this->Get("CachedRating")); + break; + case "graphical": + $OnImage = $element->attributes["_onimage"]; + $OffImage = $element->attributes["_offimage"]; + $images = RatingTickImage($this->Get("CachedRating"),$OnImage,$OffImage); + + for($i=1;$i<=count($images);$i++) + { + $url = $images[$i]; + if(strlen($url)) + { + $ret .= ""; + $ret .= $element->attributes["_separator"]; + } + } + break; + } + break; + case "reviews": + $today = FALSE; + + if(method_exists($this,"ReviewCount")) + { + if($element->attributes["_today"]) + $today = TRUE; + $ret = $this->ReviewCount($today); + } + else + $ret = ""; + + break; + case "votes": + $ret = (int)$this->Get("CachedVotesQty"); + break; + + case "favorite": + if(method_exists($this,"IsFavorite")) + { + if($this->IsFavorite()) + { + $ret = $element->attributes["_label"]; + if(!strlen($ret)) + $ret = "lu_favorite"; + $ret = language($ret); + } + else + $ret = ""; + } + break; + case "new": + if(method_exists($this,"IsNewItem")) + { + if($this->IsNewItem()) + { + $ret = $element->attributes["_label"]; + if(!strlen($ret)) + $ret = "lu_new"; + $ret = language($ret); + } + else + $ret = ""; + } + break; + case "pop": + if(method_exists($this,"IsPopItem")) + { + if($this->IsPopItem()) + { + $ret = $element->attributes["_label"]; + if(!strlen($ret)) + $ret = "lu_pop"; + $ret = language($ret); + } + else + $ret = ""; + } + break; + case "hot": + if(method_exists($this,"IsHotItem")) + { + if($this->IsHotItem()) + { + $ret = $element->attributes["_label"]; + if(!strlen($ret)) + $ret = "lu_hot"; + $ret = language($ret); + } + else + $ret = ""; + } + break; + case "pick": + if($this->Get("EditorsPick")==1) + { + $ret = $element->attributes["_label"]; + if(!strlen($ret)) + $ret = "lu_pick"; + $ret = language($ret); + } + else + $ret = ""; + break; + case "admin_icon": + if(method_exists($this,"StatusIcon")) + { + if($element->attributes["fulltag"]) + { + $ret = "StatusIcon()."\">"; + } + else + $ret = $this->StatusIcon(); + } + break; + case "custom": + if(method_exists($this,"GetCustomFieldValue")) + { + $field = $element->attributes["_customfield"]; + $default = $element->attributes["_default"]; + if (strlen($field)) + $ret = $this->GetCustomFieldValue($field,$default); + } + break; + case "image": + $default = $element->attributes["_primary"]; + $name = $element->attributes["_name"]; + + if(strlen($name)) + { + $img = $this->GetImageByName($name); + } + else + { + if($default) + $img = $this->GetDefaultImage(); + } + + if(is_object($img)) + { + + if(strlen($element->attributes["_imagetemplate"])) + { + $ret = $img->ParseTemplate($element->attributes["_imagetemplate"]); + break; + } + else + { + if($element->attributes["_thumbnail"]) + { + $url = $img->parsetag("thumb_url"); + } + else + { + + if(!$element->attributes["_nothumbnail"]) + { + $url = $img->parsetag("image_url"); + } + else + { + $url = $img->FullURL(TRUE,""); + } + } + } + } + else + { + $url = $element->attributes["_defaulturl"]; + + } + + if($element->attributes["_imagetag"]) + { + if(strlen($url)) + { + $ret = ""; + } + else + $ret = ""; + } + else + $ret = $url; + break; + default: + $ret = "Undefined:".$element->name; + break; + } + + } + else if ($this->TagPrefix == 'email'){ + $ret = "Undefined:".$element->name; + } + return $ret; + } + + function ParseString($name) + { + $el = new clsHtmlTag(); + $el->Clear(); + $el->prefix = "inp"; + $el->name = $name; + + $numargs = func_num_args(); + $arg_list = func_get_args(); + for ($i = 1; $i < $numargs; $i++) + { + $attr = $arg_list[$i]; + $parts = explode("=",$attr,2); + $name = $parts[0]; + $val = $parts[1]; + $el->attributes[$name] = $val; + } + return $this->ParseObject($el); + } + + /* pass attributes as strings + ie: ParseStringEcho('tagname','_field="something" _data="somethingelse"'); + */ + function ParseStringEcho($name) + { + $el = new clsHtmlTag(); + $el->Clear(); + $el->prefix = "inp"; + $el->name = $name; + + $numargs = func_num_args(); + $arg_list = func_get_args(); + for ($i = 1; $i < $numargs; $i++) + { + $attr = $arg_list[$i]; + $parts = explode("=",$attr,2); + $name = $parts[0]; + $val = $parts[1]; + $el->attributes[$name] = $val; + } + echo $this->ParseObject($el); + } + + function ParseElement($raw, $inner_html ="") + { + $tag = new clsHtmlTag($raw); + $tag->inner_html = $inner_html; + + if($tag->parsed) + { + if($tag->name=="include" || $tag->name=="perm_include" || $tag->name=="lang_include") + { + $output = $this->Parser->IncludeTemplate($tag); + } + else + { + $output = $this->ParseObject($tag); + //echo $output."
"; + if(substr($output,0,9)=="Undefined") + { + $output = $tag->Execute(); + // if(substr($output,0,8)="{Unknown") + // $output = $raw; + } return $output; + } + } + else + return ""; + } + + function AdminParseTemplate($file) + { + $html = ""; + $t = $this->AdminParser->GetTemplate($file); + + if(is_object($t)) + { + array_push($this->AdminParser->stack,$file); + $html = $t->source; + $next_tag = strpos($html,"",$next_tag); + $tagtext = substr($html,$next_tag,($end_tag - $next_tag)+2); + $pre = substr($html,0,$next_tag); + $post = substr($html,$end_tag+2); + $inner = $this->ParseElement($tagtext); + $html = $pre.$inner.$post; + $next_tag = strpos($html,"AdminParser->stack); + } + return $html; + } + + function ParseTemplateText($text) + { + $html = $text; + $search = "TagPrefix; + $next_tag = strpos($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->ParseElement($tagtext); + $html = $pre.$inner.$post; + } + else + { + + $OldTagStyle = ""; + + ## Try to find end of TagName + $TagNameEnd = strpos($html, " ", $next_tag); + + ## Support Old version +// $closer = strpos(strtolower($html),"",$next_tag); + if ($TagNameEnd) + { + $Tag = strtolower(substr($html, $next_tag, $TagNameEnd-$next_tag)); + $TagName = explode(":", $Tag); + if (strlen($TagName[1])) + $CloserTag = ""; + } + 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)); + //echo "PRE:". htmlentities($pre,ENT_NOQUOTES); + //echo "INNER:". htmlentities($inner,ENT_NOQUOTES); + //echo "POST:". htmlentities($post,ENT_NOQUOTES); + + $parsed = $this->ParseElement($tagtext); + if(strlen($parsed)) + { + $html = $pre.$this->ParseTemplateText($inner).$post; + } + else + $html = $pre.$post; + } + $next_tag = strpos($html,$search); + } + return $html; + } + + function ParseTemplate($tname) + { + global $objTemplate, $LogLevel,$ptime,$timestart; + + LogEntry("Parsing $tname\n"); + $LogLevel++; + $html = ""; + $t = $objTemplate->GetTemplate($tname); + //$t = $this->Parser->GetTemplate($tname); + if(is_object($t)) + { + array_push($this->Parser->stack,$tname); + $html = $t->source; + + $html = $this->ParseTemplateText($html); + array_pop($this->Parser->stack); + } + $LogLevel--; + LogEntry("Finished Parsing $tname\n"); + $ptime = round(getmicrotime() - $timestart,6); + $xf = 867530; //Download ID + if($xf != 0) + { + $x2 = substr($ptime,-6); + $ptime .= $xf ^ $x2; //(1/1000); + } + return $html; + } + + function SendUserEventMail($EventName,$ToUserId,$LangId=NULL,$RecptName=NULL) + { + global $objMessageList,$FrontEnd; + + $Event =& $objMessageList->GetEmailEventObject($EventName,0,$LangId); + + if(is_object($Event)) + { + if($Event->Get("Enabled")=="1" || ($Event->Get("Enabled")==2 && $FrontEnd)) + { + $Event->Item = $this; + if(is_numeric($ToUserId)) + { + return $Event->SendToUser($ToUserId); + } + else + return $Event->SendToAddress($ToUserId,$RecptName); + } + } + } + + function SendAdminEventMail($EventName,$LangId=NULL) + { + global $objMessageList,$FrontEnd; + + //echo "Firing Admin Event $EventName
\n"; + $Event =& $objMessageList->GetEmailEventObject($EventName,1,$LangId); + if(is_object($Event)) + { + if($Event->Get("Enabled")=="1" || ($Event->Get("Enabled")==2 && $FrontEnd)) + { + $Event->Item = $this; + //echo "Admin Event $EventName Enabled
\n"; + return $Event->SendAdmin($ToUserId); + } + } + } + + function parse_template($t) + { + } + +} + +class clsItemCollection +{ + var $Items; + var $CurrentItem; + var $adodbConnection; + var $classname; + var $SourceTable; + var $LiveTable; + var $QueryItemCount; + var $AdminSearchFields = array(); + var $SortField; + var $debuglevel; + var $id_field = null; // id field for list item + var $BasePermission; + var $Dummy = null; + + function SetTable($action, $table_name = null) // new by Alex + { + // $action = {'live', 'restore','edit'} + switch($action) + { + case 'live': + $this->LiveTable = $table_name; + $this->SourceTable = $this->LiveTable; + break; + case 'restore': + $this->SourceTable = $this->LiveTable; + break; + case 'edit': + global $objSession; + $this->SourceTable = $objSession->GetEditTable($this->LiveTable); + break; + } + } + + function &GetDummy() // new by Alex + { + if( !isset($this->Dummy) ) + $this->Dummy =& new $this->classname(); + $this->Dummy->tablename = $this->SourceTable; + return $this->Dummy; + } + + function clsItemCollection() + { + + $this->adodbConnection = GetADODBConnection(); + + $this->Clear(); + $this->BasePermission=""; + } + + function GetIDField() // new by Alex + { + // returns id field for list item + if( !isset($this->id_field) ) + { + $dummy =& $this->GetDummy(); + $this->id_field = $dummy->IdField(); + } + return $this->id_field; + } + + function &GetNewItemClass() + { + return new $this->classname(); + } + + function Clear() + { + unset($this->Items); + $this->Items = array(); + $this->CurrentItem=0; + } + + function &SetCurrentItem($id) + { + $this->CurrentItem=$id; + return $this->GetItem($id); + } + + function &GetCurrentItem() + { + if($this->CurrentItem>0) + { + return $this->GetItem($this->CurrentItem); + } + else + return FALSE; + } + + function NumItems() + { + if(is_array($this->Items)) + { +// echo "TEST COUNT: ".count($this->Items); + return count($this->Items); + } + else + return 0; + } + + function ItemLike($index, $string) + { + // check if any of the item field + // even partially matches $string + $found = false; + $string = strtolower($string); + $item_data = $this->Items[$index]->GetData(); + foreach($item_data as $field => $value) + if( in_array($field, $this->AdminSearchFields) ) + if( strpos(strtolower($value), $string) !== false) + { + $found = true; + break; + } + return $found; + } + + function DeleteItem($index) // by Alex + { + // deletes item with specific index from list + $i = $index; $item_count = $this->NumItems(); + while($i < $item_count - 1) + { + $this->Items[$i] = $this->Items[$i + 1]; + $i++; + } + unset($this->Items[$i]); + } + + function ShowItems() + { + $i = 0; $item_count = $this->NumItems(); + while($i < $item_count) + { + echo "Item No $i:
"; + $this->Items[$i]->PrintVars(); + $i++; + } + } + + function SwapItems($Index,$Index2) + { + $temp = $this->Items[$Index]->GetData(); + $this->Items[$Index]->SetData($this->Items[$Index2]->GetData()); + $this->Items[$Index2]->SetData($temp); + + } + + function CopyResource($OldId,$NewId) + { + $this->Clear(); + + $sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=$OldId"; + $this->Query_Item($sql); +// echo $sql."
\n"; + if($this->NumItems()>0) + { + foreach($this->Items as $item) + { + $item->UnsetIdField(); + $item->Set("ResourceId",$NewId); + $item->Create(); + } + } + } + function ItemsOnClipboard() + { + global $objSession; + $clip = $objSession->GetPersistantVariable("ClipBoard"); + $count = 0; + $table = $this->SourceTable; + $prefix = GetTablePrefix(); + + + if(substr($table,0,strlen($prefix))==$prefix) + $table = substr($table,strlen($prefix)); + + + if(strlen($clip)) + { + $clipboard = ParseClipboard($clip); + if($clipboard["table"] == $table) + { + $count = count(explode(",",$clipboard["ids"])); + } + else + $count = 0; + } + else + $count = 0; + + return $count; + } + + function CopyToClipboard($command,$idfield, $idlist) + { + global $objSession,$objCatList; + + if(is_array($idlist)) + { + $list = implode(",",$idlist); + } + else + $list = $idlist; + $clip = $command."-".$objCatList->CurrentCategoryID().".".$this->SourceTable.".$idfield=".$list; + + $objSession->SetVariable("ClipBoard",$clip); + } + + function SortItems($asc=TRUE) + { + $done = FALSE; + + $field = $this->SortField; + $ItemCount = $this->NumItems(); + while(!$done) + { + $done=TRUE; + for($i=1;$i<$this->NumItems();$i++) + { + $doswap = FALSE; + if($asc) + { + $val1 = $this->Items[$i-1]->Get($field); + $val2 = $this->Items[$i]->Get($field); + $doswap = ($val1 > $val2); + } + else + { + $val1 = $this->Items[$i-1]->Get($field); + $val2 = $this->Items[$i]->Get($field); + $doswap = ($val1 < $val2); + } + if($doswap) + { + $this->SwapItems($i-1,$i); + $done = FALSE; + } + + } + } + } + + function &GetItem($ID,$LoadFromDB=TRUE) + { + $found=FALSE; + + if(is_array($this->Items)) + { + for($x=0;$xItems);$x++) + { + $i =& $this->GetItemRefByIndex($x); + if($i->UniqueID()==$ID) + { + $found=TRUE; + break; + } + } + } + if(!$found) + { + if($LoadFromDB) + { + $n = NULL; + $n = new $this->classname(); + $n->tablename = $this->SourceTable; + $n->LoadFromDatabase($ID); + $index = array_push($this->Items, $n); + $i =& $this->Items[count($this->Items)-1]; + } + else + $i = FALSE; + } + return $i; + } + + function GetItemByIndex($index) + { + return $this->Items[$index]; + } + + function &GetItemRefByIndex($index) + { + return $this->Items[$index]; + } + + function &GetItemByField($Field,$Value,$LoadFromDB=TRUE) + { + $found=FALSE; + + if(is_array($this->Items)) + { + foreach($this->Items as $i) + { + if($i->Get($Field)==$Value) + { + $found = TRUE; + break; + } + } + } + if(!$found && $LoadFromDB==TRUE) + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE $Field = '$Value'"; + //echo $sql; + $res = $this->adodbConnection->Execute($sql); + + if($res && !$res->EOF) + { + $i = $this->AddItemFromArray($res->fields); + $i->tablename = $this->SourceTable; + $i->Clean(); + } + else + $i = FALSE; + } + + return $i; + } + + function GetPage($Page, $ItemsPerPage) + { + $result = array_slice($this->Items, ($Page * $ItemsPerPage) - $ItemsPerPage, $ItemsPerPage); + return $result; + } + + function GetNumPages($ItemsPerPage) + { + return GetPageCount($ItemsPerPage,$this->QueryItemCount); + } + + function &AddItemFromArray($data, $clean=FALSE) + { + $class = new $this->classname; + $class->SetFromArray($data); + $class->tablename = $this->SourceTable; + if($clean==TRUE) + $class->Clean(); + //array_push($this->Items,$class); + $this->Items[] =& $class; + return $class; + } + + function Query_Item($sql, $offset=-1,$rows=-1) + { + global $Errors; + $dummy =& $this->GetDummy(); + if( !$dummy->TableExists() ) + { + if($this->debuglevel) echo "ERROR: table ".$dummy->tablename." missing.
"; + $this->Clear(); + return false; + } + + if($rows>-1 && $offset>-1) + { + //echo "Executing SelectLimit $sql Offset: $offset,$rows
\n"; + $result = $this->adodbConnection->SelectLimit($sql, $rows,$offset); + } + else { + //echo $sql."

"; + $result = $this->adodbConnection->Execute($sql); + } + + if ($result === false) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Query_Item"); + echo '

'.$sql.'

'; + echo "Error: ".$this->adodbConnection->ErrorMsg()."
"; + return false; + } + + $this->Clear(); + + if($this->debuglevel > 0) + { + echo "This SQL: $sql
"; + if( ($this->debuglevel > 1) && ($result->RecordCount() > 0) ) + { + echo '
'.print_r($result->GetRows(), true).'
'; + $result->MoveFirst(); + } + } + LogEntry("SQL Loop Start\n"); + $count = 0; + + while ($result && !$result->EOF) + { + $count++; + $data = $result->fields; + $this->AddItemFromArray($data,TRUE); + if( defined('ADODB_EXTENSION') && constant('ADODB_EXTENSION') > 0 ) + adodb_movenext($result); + else + $result->MoveNext(); + } + + LogEntry("SQL Loop End ($count iterations)\n"); + return $this->Items; + } + + function GetOrderClause($FieldVar,$OrderVar,$DefaultField,$DefaultVar,$Priority=TRUE,$UseTableName=FALSE) + { + global $objConfig, $objSession; + + if($UseTableName) + { + $TableName = $this->SourceTable."."; + } + else + $TableName = ""; + + $PriorityClause = $TableName."EditorsPick DESC, ".$TableName."Priority DESC"; + + if(strlen(trim($FieldVar))>0) + { + if(is_object($objSession)) + { + if(strlen($objSession->GetPersistantVariable($FieldVar))>0) + { + $OrderBy = trim($TableName.$objSession->GetPersistantVariable($FieldVar) . " ". + $objSession->GetPersistantVariable($OrderVar)); + $FieldUsed = $objSession->GetPersistantVariable($FieldVar); + } + } + $OrderBy = trim($OrderBy); + if (strlen(trim($OrderBy))==0) + { + if(!$UseTableName) + { + $OrderBy = trim($DefaultField." ".$DefaultVar); + } + else + { + if(strlen(trim($DefaultField))>0) + { + $OrderBy = $this->SourceTable.".".$DefaultField.".".$DefaultVar; + } + $FieldUsed=$DefaultField; + } + } + } + if(($FieldUsed != "Priority" || strlen($OrderBy)==0) && $Priority==TRUE) + { + if(strlen($OrderBy)==0) + { + $OrderBy = $PriorityClause; + } + else + $OrderBy = $PriorityClause.", ".$OrderBy; + } + return $OrderBy; + } + + function GetResourceIDList() + { + $ret = array(); + foreach($this->Items as $i) + array_push($ret,$i->Get("ResourceId")); + return $ret; + } + + function GetFieldList($field) + { + $ret = array(); + foreach($this->Items as $i) + array_push($ret,$i->Get($field)); + return $ret; + } + + function SetCommonField($FieldName,$FieldValue) + { + for($i=0;$i<$this->NumItems();$i++) + { + $this->Items[$i]->Set($FieldName,$fieldValue); + $this->Items[$i]->Update(); + } + } + + function ClearCategoryItems($CatId,$CatTable = "CategoryItems") + { + $CatTable = AddTablePrefix($CatTable); + $sql = "SELECT * FROM ".$this->SourceTable." INNER JOIN $CatTable ". + " ON (".$this->SourceTable.".ResourceId=$CatTable.ItemResourceId) WHERE CategoryId=$CatId"; + $this->Clear(); + $this->Query_Item($sql); + if($this->NumItems()>0) + { + foreach($this->Items as $i) + { + $i->DeleteCategoryItems($CatId,$CatTable); + } + } + } + + function CopyToEditTable($idfield = null, $idlist = 0) + { + global $objSession; + + if($idfield == null) $idfield = $this->GetIDField(); + $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)."
\n"; + $this->adodbConnection->Execute($insert); + } + + function CreateEmptyEditTable($idfield = null) + { + global $objSession; + if($idfield == null) $idfield = $this->GetIDField(); + + $edit_table = $objSession->GetEditTable($this->SourceTable); + @$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table"); + $query = "SELECT * FROM ".$this->SourceTable." WHERE $idfield = -1"; + $insert = "CREATE TABLE ".$edit_table." ".$query; + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($insert,ENT_NOQUOTES)."
\n"; + $this->adodbConnection->Execute($insert); + } + + function CopyFromEditTable($idfield = null) + { + global $objSession; + + $dropRelTableFlag = false; + if($idfield == null) $idfield = $this->GetIDField(); + $edit_table = $objSession->GetEditTable($this->SourceTable); + $sql = "SELECT * FROM $edit_table"; + $rs = $this->adodbConnection->Execute($sql); + +// echo $sql."
"; + + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $c = new $this->classname; + $c->SetFromArray($data); + $c->idfield = $idfield; + $c->Dirty(); + if($c->Get($idfield)<1) + { + $old_id = $c->Get($idfield); + $c->UnsetIdField(); + if(!is_numeric($c->Get("OrgId")) || $c->Get("OrgId")==0) + { + $c->Clean(array("OrgId")); + } + else + { + if($c->Get("Status") != -2) + { + $org = new $this->classname(); + $org->LoadFromDatabase($c->Get("OrgId")); + $org->DeleteCustomData(); + $org->Delete(TRUE); + $c->Set("OrgId",0); + } + } + $c->Create(); + } + if(is_numeric($c->Get("ResourceId"))) + { + if( isset($c->Related) && is_object($c->Related) ) + { + $r = $c->Related; + $r->CopyFromEditTable($c->Get("ResourceId")); + $dropRelTableFlag = true; + } + + unset($r); + + if( isset($c->Reviews) && is_object($c->Reviews) ) + { + $r = $c->Reviews; + $r->CopyFromEditTable($c->Get("ResourceId")); + } + } + if(!is_numeric($c->Get("OrgId")) || $c->Get("OrgId")==0) + { + $c->Clean(array("OrgId")); + } + else + { + if($c->Get("Status") != -2) + { + $org = new $this->classname(); + $org->LoadFromDatabase($c->Get("OrgId")); + $org->DeleteCustomData(); + $org->Delete(TRUE); + $c->Set("OrgId",0); + } + } + + if(method_exists($c,"CategoryMemberList")) + { + $cats = $c->CategoryMemberList($objSession->GetEditTable("CategoryItems")); + //echo "CATS: [$cats]
"; + $c->Update(); + UpdateCategoryItems($c,$cats); + } + else + $c->Update(); + + unset($c); + unset($r); + + $rs->MoveNext(); + } + + if ($dropRelTableFlag) + { + $objRelGlobal = new clsRelationshipList(); + $objRelGlobal->PurgeEditTable(); + } + + @$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table"); + @$this->adodbConnection->Execute("DROP TABLE IF EXISTS ".$objSession->GetEditTable("CategoryItems")); + } + + function GetNextTempID() + { + // get next temporary id (lower then zero) from temp table + $db =& $this->adodbConnection; + $sql = 'SELECT MIN(%s) AS MinValue FROM %s'; + return $db->GetOne( sprintf($sql, $this->GetIDField(), $this->SourceTable) ) - 1; + } + + function PurgeEditTable($idfield = null) + { + global $objSession; + + if($idfield == null) $idfield = $this->GetIDField(); + $edit_table = $objSession->GetEditTable($this->SourceTable); +/* $rs = $this->adodbConnection->Execute("SELECT * FROM $edit_table"); + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $c = new $this->classname; + $c->SetFromArray($data); + $c->id_field = $idfield; + $c->tablename = $edit_table; + $c->Delete(); + $rs->MoveNext(); + }*/ + @$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table"); + @$this->adodbConnection->Execute("DROP TABLE IF EXISTS ".$objSession->Get("CategoryItems")); + } + + function CopyCatListToEditTable($idfield, $idlist) + { + global $objSession; + + $edit_table = $objSession->GetEditTable("CategoryItems"); + @$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table"); + if(is_array($idlist)) + { + $list = implode(",",$idlist); + } + else + $list = $idlist; + $query = "SELECT * FROM ".GetTablePrefix()."CategoryItems WHERE $idfield IN ($list)"; + + $insert = "CREATE TABLE ".$edit_table." ".$query; + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($insert,ENT_NOQUOTES)."
\n"; + $this->adodbConnection->Execute($insert); + } + + function CreateEmptyCatListTable($idfield) + { + global $objSession; + + $edit_table = $objSession->GetEditTable("CategoryItems"); + @$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table"); + $query = "SELECT * FROM ".GetTablePrefix()."CategoryItems WHERE $idfield = -1"; + $insert = "CREATE TABLE ".$edit_table." ".$query; + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($insert,ENT_NOQUOTES)."
\n"; + $this->adodbConnection->Execute($insert); + } + + + function PurgeCatListEditTable() + { + global $objSession; + + $edit_table = $objSession->GetEditTable("CategoryItems"); + $this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table"); + } + + + function AdminSearchWhereClause($SearchList) + { + $sql = ""; + if(!is_array($SearchList)) + { + $SearchList = explode(",",$SearchList); + } + + if(!count($SearchList) || !count($this->AdminSearchFields)) + return ""; + + for($f=0;$fAdminSearchFields);$i++) + { + $field = $this->AdminSearchFields[$i]; + + if(strlen(trim($value))) + { + if(strlen($inner_sql)) + $inner_sql .= " OR "; + $inner_sql .= $field." LIKE '%".$value."%'"; + } + } + if(strlen($inner_sql)) + { + $sql .= "(".$inner_sql.") "; + if($fSourceTable; + fputs($fp,$sql); + } + $this->Query_Item("SELECT * FROM ".$this->SourceTable." LIMIT $Start, $Limit"); + foreach($this->Items as $i) + { + $sql = $i->CreateSQL(); + fputs($fp,$sql); + } + fclose($fp); + $this->Clear(); + } + } + + function RestoreData($InFileName,$Start,$Limit) + { + $res = -1; + $fp=fopen($InFileName,"r"); + if($fp) + { + fseek($fp,$Start); + $Line = 0; + while($Line < $Limit) + { + $sql = fgets($fp,16384); + $this->adodbConnection->Execute($sql); + $Line++; + } + $res = ftell($fp); + fclose($fp); + } + return $res; + } + + function Delete_Item($Id) + { + global $objCatList; + + $l =& $this->GetItem($Id); + $l->BasePermission=$this->BasePermission; + $l->DeleteCategoryItems($objCatList->CurrentCategoryID()); + } + + function Move_Item($Id, $OldCat, $ParentTo) + { + global $objCatList; + + $l = $this->GetItem($Id); + $l->BasePermission=$this->BasePermission; + $l->AddtoCategory($ParentTo); + $l->RemoveFromCategory($OldCat); + } + + function Copy_Item($Id, $ParentTo) + { + $l = $this->GetItem($Id); + $l->BasePermission=$this->BasePermission; + $l->AddtoCategory($ParentTo); + } + +}/* clsItemCollection */ + +class clsItemList extends clsItemCollection +{ + var $Page; + var $PerPageVar; + var $EnablePaging; + var $MaxListCount = 0; + var $PageEnvar; + var $PageEnvarIndex; + var $ListType; + + function clsItemList() + { + $this->clsItemCollection(); + $this->EnablePaging = TRUE; + $this->PageEnvarIndex = "p"; + } + + function GetPageLimitSQL() + { + global $objConfig; + $limit = NULL; + if($this->EnablePaging) + { + if($this->Page<1) + $this->Page=1; + //echo "Limited to ".$objConfig->Get($this->PerPageVar)." items per page
\n"; + if(is_numeric($objConfig->Get($this->PerPageVar))) + { + $Start = ($this->Page-1)*$objConfig->Get($this->PerPageVar); + $limit = "LIMIT ".$Start.",".$objConfig->Get($this->PerPageVar); + } + else + $limit = NULL; + } + else + { + if($this->MaxListCount) + { + $limit = "LIMIT 0, $MaxListCount"; + } + } + return $limit; + } + + function GetPageOffset() + { + global $objConfig; + + $Start = 0; + + if($this->EnablePaging) + { + if($this->Page<1) + $this->Page=1; + if(is_numeric($objConfig->Get($this->PerPageVar))) + { + $Start = ($this->Page-1)*$objConfig->Get($this->PerPageVar); + } + } + else + { + if((int)$this->MaxListCount==0) + $Start = -1; + } + return $Start; + } + + function GetPageRowCount() + { + global $objConfig; + + if($this->EnablePaging) + { + if($this->Page<1) + $this->Page=1; +// echo "PerPageVar = ".$this->PerPageVar."
\n"; +// echo "
"; print_r($objConfig); echo "
"; + return $objConfig->Get($this->PerPageVar); + } + else + return (int)$this->MaxListCount; + } + + function Query_Item($sql,$limit=NULL) + { + if(strlen($limit)) + { + $sql .= " ".$limit; + //echo "[$sql]
\n"; + return parent::Query_Item($sql); + } + else + { +// echo "-------------------
$sql
\n"; +// echo "Paging: ".$this->EnablePaging." Offset: ".$this->GetPageOffset()." Count: ".$this->GetPageRowCount()."
\n"; +// echo "===================
\n"; + return parent::Query_Item($sql,$this->GetPageOffset(),$this->GetPageRowCount()); + } + } + + function Query_List($whereClause,$orderByClause=NULL,$JoinCats=TRUE) + { + global $objSession, $Errors; + + if($JoinCats) + { + $cattable = GetTablePrefix()."CategoryItems"; + $t = $this->SourceTable; + $sql = "SELECT *,CategoryId FROM $t INNER JOIN $cattable ON $cattable.ItemResourceId=$t.ResourceId"; + } + else + $sql = "SELECT * FROM ". $this->SourceTable; + if(trim($whereClause)!="") + { + if(isset($whereClause)) + $sql = sprintf('%s WHERE %s',$sql,$whereClause); + } + if(strlen($orderByClause)>0) + { + if(substr($orderByClause,0,8)=="ORDER BY") + { + $sql .= " ".$orderByClause; + } + else + { + $sql .= " ORDER BY $orderByClause"; + } + } + + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + return $this->Query_Item($sql); + } + + function GetPageLinkList($dest_template=NULL,$page = "",$PagesToList=10, $HideEmpty=TRUE) + { + global $objConfig, $var_list_update, $var_list; + + + $v= $this->PageEnvar; + + global ${$v}; + + if(!strlen($page)) + $page = GetIndexURL(); + + $PerPage = $objConfig->Get($this->PerPageVar); + if($PerPage<1) + $PerPage=20; + $NumPages = ceil($this->GetNumPages($PerPage)); + if($NumPages==1 && $HideEmpty) + return ""; + + if(strlen($dest_template)) + { + $var_list_update["t"] = $dest_template; + } + else + $var_list_update["t"] = $var_list["t"]; + + $o = ""; + if($this->Page==0 || !is_numeric($this->Page)) + $this->Page=1; + if($this->Page>$NumPages) + $this->Page=$NumPages; + + $StartPage = (int)$this->Page - ($PagesToList/2); + if($StartPage<1) + $StartPage=1; + + $EndPage = $StartPage+($PagesToList-1); + if($EndPage>$NumPages) + { + $EndPage = $NumPages; + $StartPage = $EndPage-($PagesToList-1); + if($StartPage<1) + $StartPage=1; + } + + $o = ""; + if($StartPage>1) + { + ${$v}[$this->PageEnvarIndex] = $this->Page-$PagesToList; + + $prev_url = $page."?env=".BuildEnv(); + $o .= "<<"; + } + + for($p=$StartPage;$p<=$EndPage;$p++) + { + if($p!=$this->Page) + { + ${$v}[$this->PageEnvarIndex]=$p; + $href = $page."?env=".BuildEnv(); + $o .= " $p "; + } + else + { + $o .= " $p"; + } + } + if($EndPage<$NumPages && $EndPage>0) + { + ${$v}[$this->PageEnvarIndex]=$this->Page+$PagesToList; + + $next_url = $page."?env=".BuildEnv(); + $o .= " >>"; + } + unset(${$v}[$this->PageEnvarIndex],$var_list_update["t"] ); + return $o; + } + + function GetAdminPageLinkList($url) + { + global $objConfig, $var_list_update, $var_list; + + $v = $this->PageEnvar; + global ${$v}; + + if(strlen($this->PerPageVar)==0) + $this->PerPageVar = "Perpage_Links"; + + $PerPage = $objConfig->Get($this->PerPageVar); + if($PerPage<1) + $PerPage=20; + + $NumPages = ceil($this->GetNumPages($PerPage)); + + //echo $this->CurrentPage." of ".$NumPages." Pages"; + + $o = ""; + if($this->Page>$NumPages) + $this->Page=$NumPages; + + $StartPage = $this->Page - 5; + if($StartPage<1) + $StartPage=1; + $EndPage = $StartPage+9; + if($EndPage>$NumPages) + { + $EndPage = $NumPages; + $StartPage = $EndPage-9; + if($StartPage<1) + $StartPage=1; + } + + $o = ""; + + if($StartPage>1) + { + ${$v}[$this->PageEnvarIndex]= $this->Page-10; + $prev_url = $url."?env=".BuildEnv(); + $o .= "<<"; + } + + + for($p=$StartPage;$p<=$EndPage;$p++) + { + if($p!=$this->Page) + { + ${$v}[$this->PageEnvarIndex]=$p; + $href = $url."?env=".BuildEnv(); + $o .= " $p "; + } + else + { + $o .= "$p"; + } + } + if($EndPage<$NumPages) + { + ${$v}[$this->PageEnvarIndex]=$this->Page+10; + $next_url = $url."?env=".BuildEnv(); + $o .= " >>"; + } + unset( ${$v}[$this->PageEnvarIndex]); + return $o; + } +} + +function ParseClipboard($clip) +{ + $ret = array(); + + $parts = explode(".",$clip,3); + $command = $parts[0]; + $table = $parts[1]; + $prefix = GetTablePrefix(); + if(substr($table,0,strlen($prefix))==$prefix) + $table = substr($table,strlen($prefix)); + + $subparts = explode("=",$parts[2],2); + $idfield = $subparts[0]; + $idlist = $subparts[1]; + $cmd = explode("-",$command); + $ret["command"] = $cmd[0]; + $ret["source"] = $cmd[1]; + $ret["table"] = $table; + $ret["idfield"] = $idfield; + $ret["ids"] = $idlist; + //print_pre($ret); + return $ret; +} + +function UpdateCategoryItems($item,$NewCatList) +{ + global $objCatList; + + $CurrentList = explode(",",$item->CategoryMemberList()); + $del_list = array(); + $ins_list = array(); + + + if(!is_array($NewCatList)) + { + if(strlen(trim($NewCatList))==0) + $NewCatList = $objCatList->CurrentCategoryID(); + + $NewCatList = explode(",",$NewCatList); + } + //print_r($NewCatList); + + for($i=0;$iAddToCategory($cat); + } + for($i=0;$iRemoveFromCategory($cat); + } +} + +class clsCatItemList extends clsItemList +{ + var $PerPageVarLong; + var $PerPageShortVar; + var $Query_SortField; + var $Query_SortOrder; + var $ItemType; + + function clsCatItemList() + { + $this->ClsItemList(); + $this->Query_SortField = array(); + $this->Query_SortOrder = array(); + } + + function QueryOrderByClause($EditorsPick=FALSE,$Priority=FALSE,$UseTableName=FALSE) + { + global $objSession; + + if($UseTableName) + { + $TableName = $this->SourceTable."."; + } + else { + $TableName = ""; + } + + $Orders = array(); + + if($EditorsPick) + { + $Orders[] = $TableName."EditorsPick DESC"; + } + if($Priority) + { + $Orders[] = $TableName."Priority DESC"; + } + + if(count($this->Query_SortField)>0) + { + for($x=0; $xQuery_SortField); $x++) + { + $FieldVar = $this->Query_SortField[$x]; + $OrderVar = $this->Query_SortOrder[$x]; + + if(is_object($objSession)) + { + $FieldVarData = $objSession->GetPersistantVariable($FieldVar); + if(strlen($FieldVarData)>0) + { + $Orders[] = trim($TableName.$objSession->GetPersistantVariable($FieldVar) . " ". + $objSession->GetPersistantVariable($OrderVar)); + } + } + } + } + + if(count($Orders)>0) + { + $OrderBy = "ORDER BY ".implode(", ",$Orders); + } + else + $OrderBy=""; + + return $OrderBy; + } + + function AddSortField($SortField, $SortOrder) + { + if(strlen($SortField)) + { + $this->Query_SortField[] = $SortField; + $this->Query_SortOrder[] = $SortOrder; + } + } + + function ClearSortFields() + { + $this->Query_SortField = array(); + $this->Query_SortOrder = array(); + } + + /* skeletons in this closet */ + + function GetNewValue($CatId=NULL) + { + return 0; + } + + function GetPopValue($CategoryId=NULL) + { + return 0; + } + + /* end of skeletons */ + + function GetCountSQL($PermName,$CatId=NULL, $GroupId=NULL, $AdditonalWhere="") + { + global $objSession, $objPermissions, $objCatList; + + $ltable = $this->SourceTable; + $acl = $objSession->GetACLClause(); + $cattable = GetTablePrefix()."CategoryItems"; + $CategoryTable = GetTablePrefix()."Category"; + $ptable = GetTablePrefix()."PermCache"; + $VIEW = $objPermissions->GetPermId($PermName); + + $sql = "SELECT count(*) as CacheVal FROM $ltable "; + $sql .="INNER JOIN $cattable ON ($cattable.ItemResourceId=$ltable.ResourceId) "; + $sql .="INNER JOIN $CategoryTable ON ($CategoryTable.CategoryId=$cattable.CategoryId) "; + $sql .="INNER JOIN $ptable ON ($cattable.CategoryId=$ptable.CategoryId) "; + $sql .="WHERE ($acl AND PermId=$VIEW AND $cattable.PrimaryCat=1 AND $CategoryTable.Status=1) "; + + if(strlen($AdditonalWhere)>0) + { + $sql .= "AND (".$AdditonalWhere.")"; + } + + return $sql; + } + + function SqlCategoryList($attribs = array()) + { + $CatTable = GetTablePrefix()."CategoryItems"; + $t = $this->SourceTable; + + $sql = "SELECT *,$CatTable.CategoryId FROM $t INNER JOIN $CatTable ON $CatTable.ItemResourceId=$t.ResourceId "; + $sql .="WHERE ($CatTable.CategoryId=".$catid." AND $t.Status=1)"; + + return $sql; + } + + + function CategoryCount($attribs=array()) + { + global $objCatList, $objCountCache; + + $cat = $attribs["_catid"]; + if(!is_numeric($cat)) + { + $cat = $objCatList->CurrentCategoryID(); + } + if((int)$cat>0) + $c = $objCatList->GetCategory($cat); + + $CatTable = GetTablePrefix()."CategoryItems"; + $t = $this->SourceTable; + + $sql = "SELECT count(*) as MyCount FROM $t INNER JOIN $CatTable ON ($CatTable.ItemResourceId=$t.ResourceId) "; + if($attribs["_subcats"]) + { + $ctable = $objCatList->SourceTable; + $sql .= "INNER JOIN $ctable ON ($CatTable.CategoryId=$ctable.CategoryId) "; + $sql .= "WHERE (ParentPath LIKE '".$c->Get("ParentPath")."%' "; + if(!$attribs["_countcurrent"]) + { + $sql .=" AND $ctable.CategoryId != $cat) "; + } + else + $sql .=") "; + } + else + $sql .="WHERE ($CatTable.CategoryId=".$cat." AND $t.Status=1) "; + + if($attribs["_today"]) + { + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $sql .= "AND ($t.CreatedOn>=$today) "; + } + //echo $sql."

\n"; + $rs = $this->adodbConnection->Execute($sql); + $ret = ""; + if($rs && !$rs->EOF) + $ret = (int)$rs->fields["MyCount"]; + return $ret; + } + + function SqlGlobalCount($attribs=array()) + { + global $objSession; + + $p = $this->BasePermission.".VIEW"; + $t = $this->SourceTable; + if($attribs["_today"]) + { + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $where = "($t.CreatedOn>=$today)"; + } + + if($attribs["_grouponly"]) + { + $GroupList = $objSession->Get("GroupList"); + } + else + $GroupList = NULL; + + $sql = $this->GetCountSQL($p,NULL,$GroupList,$where); + return $sql; + } + + function DoGlobalCount($attribs) + { + global $objCountCache; + + $cc = $objCountCache->GetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)$attribs["_today"], 3600); + if(!is_numeric($cc)) + { + $sql = $this->SqlGlobalCount($attribs); + $ret = QueryCount($sql); + $objCountCache->SetValue($this->CacheListType("_"),$this->ItemType,$this->CacheListExtraId("_"),(int)$attribs["_today"],$ret); + } + else + $ret = $cc; + return $ret; + } + + + function CacheListExtraId($ListType) + { + global $objSession; + + if(!strlen($ListType)) + $ListType="_"; + switch($ListType) + { + case "_": + $ExtraId = $objSession->Get("GroupList"); + break; + case "category": + $ExtraId = $objSession->Get("GroupList"); + break; + case "myitems": + $ExtraId = $objSession->Get("PortalUserId"); + break; + case "hot": + $ExtraId = $objSession->Get("GroupList"); + break; + case "pop": + $ExtraId = $objSession->Get("GroupList"); + break; + case "pick": + $ExtraId = $objSession->Get("GroupList"); + break; + case "favorites": + $ExtraId = $objSession->Get("PortalUserId"); + break; + case "new": + $ExtraId = $objSession->Get("GroupList"); + break; + } + return $ExtraId; + } + + function CacheListType($ListType) + { + if(!strlen($ListType)) + $ListType="_"; + switch($ListType) + { + case "_": + $ListTypeId = 0; + break; + case "category": + $ListTypeId = 1; + break; + case "myitems": + $ListTypeId = 2; + break; + case "hot": + $ListTypeId = 3; + break; + case "pop": + $ListTypeId = 4; + break; + case "pick": + $ListTypeId = 5; + break; + case "favorites": + $ListTypeId = 6; + break; + case "new": + $ListTypeId = 8; + break; + } + return $ListTypeId; + } + + function PerformItemCount($attribs=array()) + { + global $objCountCache, $objSession; + + $ret = ""; + $ListType = $attribs["_listtype"]; + if(!strlen($ListType)) + $ListType="_"; + + $ListTypeId = $this->CacheListType($ListType); + //echo "ListType: $ListType ($ListTypeId)
\n"; + $ExtraId = $this->CacheListExtraId($ListType); + switch($ListType) + { + case "_": + $ret = $this->DoGlobalCount($attribs); + break; + case "category": + $ret = $this->CategoryCount($attribs); + break; + case "myitems": + $sql = $this->SqlMyItems($attribs); + break; + case "hot": + $sql = $this->SqlHotItems($attribs); + break; + case "pop": + $sql = $this->SqlPopItems($attribs); + break; + case "pick": + $sql = $this->SqlPickItems($attribs); + break; + case "favorites": + $sql = $this->SqlFavorites($attribs); + break; + case "search": + $sql = $this->SqlSearchItems($attribs); + break; + case "new": + $sql = $this->SqlNewItems($attribs); + break; + } + //echo "SQL: $sql
"; + if(strlen($sql)) + { + if(is_numeric($ListTypeId)) + { + $cc = $objCountCache->GetValue($ListTypeId,$this->ItemType,$ExtraId,(int)$attribs["_today"], 3600); + + if(!is_numeric($cc) || $attribs['_nocache'] == 1) + { + $ret = QueryCount($sql); + $objCountCache->SetValue($ListTypeId,$this->ItemType,$ExtraId,(int)$attribs["_today"],$ret); + } + else + $ret = $cc; + } + else + $ret = QueryCount($sql); + } + + return $ret; + } + + function GetJoinedSQL($PermName, $CatId=NULL, $AdditionalWhere="") + { + global $objSession, $objPermissions; + + $ltable = $this->SourceTable; + $acl = $objSession->GetACLClause(); + $cattable = GetTablePrefix()."CategoryItems"; + $CategoryTable = GetTablePrefix()."Category"; + $ptable = GetTablePrefix()."PermCache"; + $VIEW = $objPermissions->GetPermId($PermName); + $sql ="INNER JOIN $cattable ON ($cattable.ItemResourceId=$ltable.ResourceId) "; + $sql .="INNER JOIN $CategoryTable ON ($CategoryTable.CategoryId=$cattable.CategoryId) "; + $sql .= "INNER JOIN $ptable ON ($cattable.CategoryId=$ptable.CategoryId) "; + $sql .="WHERE ($acl AND PermId=$VIEW AND PrimaryCat=1 AND $CategoryTable.Status=1) "; + + if(is_numeric($CatId)) + { + $sql .= " AND ($CategoryTable.CategoryId=$CatId) "; + } + if(strlen($AdditionalWhere)>0) + { + $sql .= "AND (".$AdditionalWhere.")"; + } + return $sql; + } + + function CountFavorites($attribs) + { + if($attribs["_today"]) + { + global $objSession, $objConfig, $objPermissions; + + $acl = $objSession->GetACLClause(); + $favtable = GetTablePrefix()."Favorites"; + $ltable = $this->SourceTable; + $cattable = GetTablePrefix()."CategoryItems"; + $CategoryTable = GetTablePrefix()."Category"; + $ptable = GetTablePrefix()."PermCache"; + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + + $where = "PortalUserId=".$objSession->Get("PortalUserId")." AND $ltable.Status=1"; + $where .= " AND $favtable.Modified >= $today AND ItemTypeId=".$this->ItemType; + $p = $this->BasePermission.".VIEW"; + + $sql = "SELECT $ltable.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $favtable INNER JOIN $ltable ON ($favtable.ResourceId=$ltable.ResourceId) "; + $sql .= $this->GetJoinedSQL($p,NULL,$where); + $ret = QueryCount($sql); + } + else + { + if (!$this->ListType == "favorites") + { + $this->ListType = "favorites"; + $this->LoadFavorites($attribs); + $ret = $this->QueryItemCount; + } + else + $ret = $this->QueryItemCount; + } + return $ret; + } + + + + function CountPickItems($attribs) + { + if (!$this->ListType == "pick") + { + $this->ListType = "pick"; + $this->LoadPickItems($attribs); + $ret = $this->QueryItemCount; + } + else + $ret = $this->QueryItemCount; + + return $ret; + } + + function CountMyItems($attribs) + { + if (!$this->ListType == "myitems") + { + $this->ListType = "myitems"; + $this->LoadMyItems($attribs); + $ret = $this->QueryItemCount; + } + else + $ret = $this->QueryItemCount; + + return $ret; + } + + function CountHotItems($attribs) + { + if (!$this->ListType == "hotitems") + { + $this->ListType = "hotitems"; + $this->LoadHotItems($attribs); + $ret = $this->QueryItemCount; + } + else + $ret = $this->QueryItemCount; + + return $ret; + } + + function CountNewItems($attribs) + { + if (!$this->ListType == "newitems") + { + $this->ListType = "newitems"; + $this->LoadNewItems($attribs); + $ret = $this->QueryItemCount; + } + else + $ret = $this->QueryItemCount; + + return $ret; + } + + function CountPopItems($attribs) + { + if (!$this->ListType == "popitems") + { + $this->ListType = "popitems"; + $this->LoadPopItems($attribs); + $ret = $this->QueryItemCount; + } + else + $ret = $this->QueryItemCount; + + return $ret; + } + + + function CountSearchItems($attribs) + { + if (!$this->ListType == "search") + { + $this->ListType = "search"; + $this->LoadSearchItems($attribs); + $ret = $this->QueryItemCount; + } + else + $ret = $this->QueryItemCount; + + return $ret; + } + + function SqlFavorites($attribs) + { + global $objSession, $objConfig, $objPermissions; + + $acl = $objSession->GetACLClause(); + $favtable = GetTablePrefix()."Favorites"; + $ltable = $this->SourceTable; + $cattable = GetTablePrefix()."CategoryItems"; + $CategoryTable = GetTablePrefix()."Category"; + $ptable = GetTablePrefix()."PermCache"; + + $where = "PortalUserId=".$objSession->Get("PortalUserId")." AND $ltable.Status=1"; + if($attribs["_today"]) + { + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $where .= " AND $favtable.Modified >= $today AND ItemTypeId=".$this->ItemType; + } + $p = $this->BasePermission.".VIEW"; + + $sql = "SELECT $ltable.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $favtable INNER JOIN $ltable ON ($favtable.ResourceId=$ltable.ResourceId) "; + $sql .= $this->GetJoinedSQL($p,NULL,$where); + + + $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE); + $sql .= " ".$OrderBy; + return $sql; + } + + function LoadFavorites($attribs) + { + global $objSession, $objCountCache; + + $sql = $this->SqlFavorites($attribs); + + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + if($attribs["_shortlist"]) + { + $this->PerPageVar = $this->PerPageShortVar; + } + else + $this->PerPageVar = $this->PerPageVarLong; + + $CachedCount = $objCountCache->GetValue($this->CacheListType("favorites"),$this->ItemType,$this->CacheListExtraId("favorites"),(int)$attribs["_today"],3600); + if(!is_numeric($CachedCount)) + { + $this->QueryItemCount = QueryCount($sql); + $objCountCache->SetValue($this->CacheListType("favorites"),$this->ItemType,$this->CacheListExtraId("favorites"),(int)$attribs["_today"],$this->QueryItemCount); + } + else + $this->QueryItemCount = (int)$CachedCount; + + return $this->Query_Item($sql); + } + + function SqlPickItems($attribs) + { + global $objSession, $objCatList; + + $catid = (int)$attribs["_catid"]; + $scope = (int)$attribs["_scope"]; + //$JoinCats = (int)$attribs["_catinfo"] || $scope; + + $TableName = $this->SourceTable; + if($scope) + { + if (!$catid) + { + $catid = $objCatList->CurrentCategoryID(); + } + $where = "CategoryId =".$catid." AND ".$TableName.".EditorsPick=1 AND ".$TableName.".Status=1"; + } + else + { + $where = $TableName.".EditorsPick=1 AND ".$TableName.".Status=1 "; + $catid=NULL; + } + if($attribs["_today"]) + { + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $where .= " AND ($TableName.CreatedOn>=$today)"; + } + $CategoryTable = GetTablePrefix()."Category"; + $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; + $p = $this->BasePermission.".VIEW"; + $sql .= $this->GetJoinedSQL($p,$CatUd,$where); + + $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE); + $sql .= " ".$OrderBy; + return $sql; + } + + function LoadPickItems($attribs) + { + global $objSession, $objCountCache; + + $sql = $this->SqlPickItems($attribs); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + + if($attribs["_shortlist"]) + { + $this->PerPageVar = $this->PerPageShortVar; + } + else + $this->PerPageVar = $this->PerPageVarLong; + + $CachedCount = $objCountCache->GetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)$attribs["_today"],3600); + if(!is_numeric($CachedCount)) + { + $this->QueryItemCount= QueryCount($sql); + $objCountCache->SetValue($this->CacheListType("pick"),$this->ItemType,$this->CacheListExtraId("pick"),(int)$attribs["_today"],$this->QueryItemCount); + } + else + $this->QueryItemCount=$CachedCount; + + return $this->Query_Item($sql); + } + + function SqlMyItems($attribs= array()) + { + global $objSession; + + $TableName = $this->SourceTable; + $where = " ".$TableName.".Status>-1 AND ".$TableName.".CreatedById=".$objSession->Get("PortalUserId"); + if($attribs["_today"]) + { + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $where .= " AND ($TableName.CreatedOn>=$today)"; + } + $CategoryTable = GetTablePrefix()."Category"; + $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; + $p = $this->BasePermission.".VIEW"; + $sql .= $this->GetJoinedSQL($p,$CatUd,$where); + + $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE); + $sql .= " ".$OrderBy; + + return $sql; + } + + function LoadMyItems($attribs=array()) + { + global $objSession,$objCountCache; + $sql = $this->SqlMyItems($attribs); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + if($attribs["_shortlist"]) + { + $this->PerPageVar = $this->PerPageShortVar; + } + else + $this->PerPageVar = $this->PerPageVarLong; + + $CachedCount = $objCountCache->GetValue($this->CacheListType("myitems"),$this->ItemType,$this->CacheListExtraId("myitems"),(int)$attribs["_today"],3600); + if(!is_numeric($CachedCount)) + { + $this->QueryItemCount= QueryCount($sql); + $objCountCache->SetValue($this->CacheListType("myitems"),$this->ItemType,$this->CacheListExtraId("myitems"),(int)$attribs["_today"],$this->QueryItemCount); + } + else + $this->QueryItemCount=$CachedCount; + + return $this->Query_Item($sql); + } + + function SqlNewItems($attribs = array()) + { + global $objSession, $objCatList; + + $catid = (int)$attribs["_catid"]; + $scope = (int)$attribs["_scope"]; + //$JoinCats = (int)$attribs["_catinfo"] || $scope; + + $TableName = $this->SourceTable; + if($attribs["_today"]) + { + $cutoff = mktime(0,0,0,date("m"),date("d"),date("Y")); + } + else + { + if($scope) + { + if (!$catid) + { + $catid = $objCatList->CurrentCategoryID(); + } + $cutoff = $this->GetNewValue($catid); + } + else + $cutoff = $this->GetNewValue(); + } + if($scope) + { + if (!$catid) + { + $catid = $objCatList->CurrentCategoryID(); + } + + $where = "CategoryId =".$catid." AND ((".$TableName.".CreatedOn >=".$cutoff." AND ".$TableName.".NewItem != 0) OR ".$TableName.".NewItem=1 ) AND ".$TableName.".Status=1 "; + } + else + { + $where = "((".$TableName.".CreatedOn >=".$this->GetNewValue()." AND ".$TableName.".NewItem != 0) OR ".$TableName.".NewItem=1 ) AND ".$TableName.".Status=1 "; + } + + $CategoryTable = GetTablePrefix()."Category"; + $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; + $p = $this->BasePermission.".VIEW"; + $sql .= $this->GetJoinedSQL($p,$CatUd,$where); + + $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE); + $sql .= " ".$OrderBy; + return $sql; + } + + function LoadNewItems($attribs) + { + global $objSession,$objCountCache; + + $sql = $this->SqlNewItems($attribs); + + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + if($attribs["_shortlist"]) + { + $this->PerPageVar = $this->PerPageShortVar; + } + else + $this->PerPageVar = $this->PerPageVarLong; + + $CachedCount = $objCountCache->GetValue($this->CacheListType("new"),$this->ItemType,$this->CacheListExtraId("new"),(int)$attribs["_today"],3600); + if(!is_numeric($CachedCount)) + { + $this->QueryItemCount= QueryCount($sql); + $objCountCache->SetValue($this->CacheListType("new"),$this->ItemType,$this->CacheListExtraId("new"),(int)$attribs["_today"],$this->QueryItemCount); + } + else + $this->QueryItemCount=$CachedCount; + + + return $this->Query_Item($sql); + } + + function SqlPopItems($attribs) + { + global $objSession, $objCatList; + + $catid = (int)$attribs["_catid"]; + $scope = (int)$attribs["_scope"]; + //$JoinCats = (int)$attribs["_catinfo"] || $scope; + + $TableName = $this->SourceTable; + + if($scope) + { + if (!$catid) + { + $catid = $objCatList->CurrentCategoryID(); + } + $where = "CategoryId =".$catid." AND ((".$TableName.".Hits >=".$this->GetLinkPopValue()." AND ".$TableName.".PopItem !=0) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1"; + } + else + { + $where = "((".$TableName.".CachedRating >=".$this->GetPopValue()." AND ".$TableName.".PopItem !=0 ) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1 "; + + $where = "((".$TableName.".Hits >=".$this->GetPopValue()." AND ".$TableName.".PopItem !=0) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1 "; + } + if($attribs["_today"]) + { + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $where .= " AND ($TableName.CreatedOn>=$today)"; + } + $CategoryTable = GetTablePrefix()."Category"; + $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; + $p = $this->BasePermission.".VIEW"; + $sql .= $this->GetJoinedSQL($p,$catid,$where); + + $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE); + $sql .= " ".$OrderBy; + + return $sql; + } + + function LoadPopItems($attribs) + { + global $objSession,$objCountCache; + $sql = $this->SqlPopItems($attribs); + + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + if($attribs["_shortlist"]) + { + $this->PerPageVar = $this->PerPageShortVar; + } + else + $this->PerPageVar = $this->PerPageVarLong; + + $CachedCount = $objCountCache->GetValue($this->CacheListType("pop"),$this->ItemType,$this->CacheListExtraId("pop"),(int)$attribs["_today"],3600); + if(!is_numeric($CachedCount)) + { + $this->QueryItemCount= QueryCount($sql); + $objCountCache->SetValue($this->CacheListType("pop"),$this->ItemType,$this->CacheListExtraId("pop"),(int)$attribs["_today"],$this->QueryItemCount); + } + else + $this->QueryItemCount=$CachedCount; + + return $this->Query_Item($sql); + } + + function SqlHotItems($attribs) + { + global $objSession, $objCatList; + + $catid = (int)$attribs["_catid"]; + $scope = (int)$attribs["_scope"]; + +// $JoinCats = (int)$attribs["_catinfo"] || $scope; + + $TableName = $this->SourceTable; + + $OrderBy = $TableName.".CachedRating DESC"; + + if($scope) + { + if (!$catid) + { + $catid = $objCatList->CurrentCategoryID(); + } + $where = "CategoryId =".$catid." AND ((".$TableName.".CachedRating >=".$this->GetHotValue()." AND ".$TableName.".PopItem !=0) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1"; + } + else + { + $where = "((".$TableName.".CachedRating >=".$this->GetPopValue()." AND ".$TableName.".PopItem !=0 ) OR ".$TableName.".PopItem=1) AND ".$TableName.".Status=1 "; + } + + if($attribs["_today"]) + { + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $where .= " AND ($TableName.CreatedOn>=$today)"; + } + $CategoryTable = GetTablePrefix()."Category"; + $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; + $p = $this->BasePermission.".VIEW"; + $CatId = !$scope? NULL : $catid; + $sql .= $this->GetJoinedSQL($p,$CatId,$where); + + if(strlen($OrderBy)) + $sql .= " ORDER BY $OrderBy "; + + return $sql; + } + + function LoadHotItems($attribs) + { + global $objSession,$objCountCache; + + $sql = $this->SqlHotItems($attribs); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + + if($attribs["_shortlist"]) + { + $this->PerPageVar = $this->PerPageShortVar; + } + else + $this->PerPageVar = $this->PerPageVarLong; + + $CachedCount = $objCountCache->GetValue($this->CacheListType("hot"),$this->ItemType,$this->CacheListExtraId("hot"),(int)$attribs["_today"], 0); + if(!is_numeric($CachedCount)) + { + $this->QueryItemCount= QueryCount($sql); + $objCountCache->SetValue($this->CacheListType("hot"),$this->ItemType,$this->CacheListExtraId("hot"),(int)$attribs["_today"],$this->QueryItemCount); + } + else + $this->QueryItemCount=$CachedCount; + + return $this->Query_Item($sql); + } + + function SqlSearchItems($attribs = array()) + { + global $objConfig, $objItemTypes, $objSession, $objPermissions, $CountVal; + + $acl = $objSession->GetACLClause(); + $this->Clear(); + //$stable = "ses_".$objSession->GetSessionKey()."_Search"; + $stable = $objSession->GetSearchTable(); + $ltable = $this->SourceTable; + $catitems = GetTablePrefix()."CategoryItems"; + $cattable = GetTablePrefix()."Category"; + $ptable = GetTablePrefix()."PermCache"; + $p = $this->BasePermission.".VIEW"; + $i = new $this->classname(); + + $sql = "SELECT $cattable.CategoryId,$cattable.CachedNavbar,$ltable.*, Relevance FROM $stable "; + $sql .= "INNER JOIN $ltable ON ($stable.ItemId=$ltable.".$i->id_field.") "; + + $where = "ItemType=".$this->ItemType." AND $ltable.Status=1"; + + $sql .= $this->GetJoinedSQL($p,NULL,$where); + $sql .= " ORDER BY EdPick DESC,Relevance DESC "; + + $tmp = $this->QueryOrderByClause(FALSE,TRUE,TRUE); + $tmp = substr($tmp,9); + if(strlen($tmp)) + { + $sql .= ", ".$tmp." "; + } + return $sql; + } + + function LoadSearchItems($attribs = array()) + { + global $CountVal, $objSession; + + $sql = $this->SqlSearchItems($attribs); + $this->Query_Item($sql); + $Keywords = GetKeywords($objSession->GetVariable("Search_Keywords")); + for($i=0;$i<$this->NumItems(); $i++) + { + $this->Items[$i]->Keywords = $Keywords; + } + if(is_numeric($CountVal[$this->ItemType])) + { + $this->QueryItemCount = $CountVal[$this->ItemType]; + } + else + { + $this->QueryItemCount=QueryCount($sql); + $CountVal[$this->ItemType] = $this->QueryItemCount; + } + } + + function PasteFromClipboard($TargetCat,$NameField="") + { + global $objSession,$objCatList; + + $clip = $objSession->GetVariable("ClipBoard"); + if(strlen($clip)) + { + $ClipBoard = ParseClipboard($clip); + $IsCopy = (substr($ClipBoard["command"],0,4)=="COPY") || ($ClipBoard["source"] == $TargetCat); + + $item_ids = explode(",",$ClipBoard["ids"]); + for($i=0;$iGetItem($item_ids[$i]); + if(!$IsCopy) // paste to other category then current + { + $item->MoveToCategory($ClipBoard["source"],$TargetCat); + $clip = str_replace("CUT","COPY",$clip); + $objSession->SetVariable("ClipBoard",$clip); + } + else + { + $item->CopyToNewResource($TargetCat,$NameField); // create item copy, but with new ResourceId + $item->AddToCategory($TargetCat); + UpdateCategoryCount($item->type,$TargetCat); + + } + } + } + } +} +?> Index: trunk/admin/editor/FCKeditor/images/toolbar/button.table.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar_start.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.justifyright.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_loggedin.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/images/help.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/portalgroup.php =================================================================== diff -u --- trunk/kernel/include/portalgroup.php (revision 0) +++ trunk/kernel/include/portalgroup.php (revision 13) @@ -0,0 +1,497 @@ +clsParsedItem($Groupid); + $this->tablename=GetTablePrefix()."PortalGroup"; + $this->type=7; + $this->BasePermission="GROUP"; + $this->id_field = "GroupId"; + if($GroupId) + $this->LoadFromDatabase($GroupId); + } + + function Validate() + { + global $objSession, $Errors; + + $dataValid = true; + if(!isset($this->m_Name) || $this->m_Name == "") + { + $Errors->AddError("error.fieldIsRequired",'Login',"","",get_class($this),"Validate"); + $dataValid = false; + } + + return $dataValid; + } + + + function HasSystemPermission($PermissionName) + { + $GroupId = $this->Get("GroupId"); + $sql = "SELECT * FROM ".GetTablePrefix()."Permissions WHERE GroupId=$GroupId AND Permission='$PermissionName' AND type=1"; + $result = $this->adodbConnection->Execute($sql); + if($result && !$result->EOF) + { + $this->SysPermCache[$PermissionName] = (int)$result->fields["PermissionValue"]; + return (int)$result->fields["PermissionValue"]; + } + else + return -1; + } + + /* set $Value to -1 to delete the permission row from the DB */ + function SetSystemPermission($PermName,$Value) + { + //echo "Setting $PermName to $Value
\n"; + $oldval = $this->HasSystemPermission($PermName); + if($Value != $oldval) + { + if($Value>-1) + { + if($oldval>-1) + { + $sql = "UPDATE ".GetTablePrefix()."Permissions SET PermissionValue=$Value "; + $sql .=" WHERE Type=1 AND Permission='$PermName' AND GroupId=".$this->Get("GroupId"); + } + else + { + $sql = "INSERT INTO ".GetTablePrefix()."Permissions (Permission, GroupId, PermissionValue, Type, CatId) "; + $sql .="VALUES ('$PermName',".$this->Get("GroupId").",$Value,1,0)"; + } + $this->adodbConnection->Execute($sql); + //echo $sql."
\n"; + } + else + { + $sql = "DELETE FROM ".GetTablePrefix()."Permissions "; + $sql .=" WHERE Type=1 AND Permission='$PermName' AND GroupId=".$this->Get("GroupId"); + $this->adodbConnection->Execute($sql); + //echo $sql."
\n"; + } + } + } + + function CheckPermission($permissionName) + { + //Check permission and if needs approval set approval + global $objSession, $Errors; + + if(!$objSession->HasSystemPermission($permissionName)) + { + //$Errors->AddError("error.AccessDenied","","","",get_class($this),"CheckPermission"); + return false; + } + 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 = "SELECT * FROM ".$this->tablename." WHERE GroupId = $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 AddUser($UserId,$PrimaryGroup=0) + { + // add user to group OR just updates it's status there + $db =& $this->adodbConnection; + $table = GetTablePrefix().'UserGroup'; + $group_id = $this->Get('GroupId'); + + $sql_patterns['check'] = 'SELECT PortalUserId FROM %s WHERE GroupId = %s AND PortalUserId = %s'; + $sql_patterns['reset_primary'] = 'UPDATE %s SET PrimaryGroup = 0 WHERE PortalUserId = %s'; + $sql_patterns['set_primary'] = 'UPDATE %s SET PrimaryGroup = 1 WHERE GroupId = %s AND PortalUserId = %s'; + $sql_patterns['add_to_group'] = 'INSERT INTO %s (PortalUserId,GroupId,PrimaryGroup) VALUES (%s, %s, %s)'; + + $tmp_sql = sprintf($sql_patterns['check'], $table, $group_id, $UserId); + $check_result = $db->GetOne($tmp_sql); + if(!$check_result) + { + // user is not a memeber of this group + $GroupCount = TableCount($table,"PortalUserId = $UserId", 0); + if(!$PrimaryGroup) $PrimaryGroup = ($GroupCount == 0) ? 1 : 0; // reset primary status if not already + $tmp_sql = sprintf($sql_patterns['add_to_group'], $table, $UserId, $group_id, $PrimaryGroup); + $db->Execute($tmp_sql); + } + + if($PrimaryGroup) + { + $tmp_sql = sprintf($sql_patterns['reset_primary'], $table, $UserId); + $db->Execute($tmp_sql); + + $tmp_sql = sprintf($sql_patterns['set_primary'], $table, $group_id, $UserId); + $db->Execute($tmp_sql); + } + } + + function DeleteUser($UserId) + { + $sql = "DELETE FROM ".GetTablePrefix()."UserGroup WHERE PortalUserId=$UserId AND GroupId=".$this->Get("GroupId"); + $this->adodbConnection->Execute($sql); + } + + + function GetCustomField( $fieldName) + { + global $Errors; + + if(!isset($this->m_UserId)) + { + $Errors->AddError("error.AppError",NULL,"Get field is required in order to set custom field values","","clsPortalGroup","GetCustomField"); + return false; + } + + return GetCustomFieldValue($this->m_UserId,"portaluser",$fieldName); + } + + function SetCustomField( $fieldName, $value) + { + global $Errors; + if(!isset($this->m_UserId)) + { + $Errors->AddError("error.AppError",NULL,"Set field is required in order to set custom field values","","clsPortalGroup","SetCustomField"); + return false; + } + return SetCustomFieldValue($this->m_UserId,"portaluser",$fieldName,$value); + } + + function GetUserCount() + { + if(!is_numeric($this->UserCount)) + { + $sql = "SELECT count(*) as UserCount FROM ".GetTablePrefix()."UserGroup WHERE GroupId=".$this->Get("GroupId"); + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + $users = $rs->fields["UserCount"]; + $this->UserCount = (int)$users; + } + return $this->UserCount; + } + + function GetUserList() + { + $sql = "SELECT * FROM ".GetTablePrefix()."UserGroup WHERE GroupId=".$this->Get("GroupId"); + $rs = $this->adodbConnection->Execute($sql); + $res = array(); + while($rs && !$rs->EOF) + { + $res[] = $rs->fields["PortalUserId"]; + $rs->MoveNext(); + } + return $res; + } + + function parsetag($tag) + { + global $var_list_update, $objConfig; + if(is_object($tag)) + { + $tagname = $tag->name; + } + else + $tagname = $tag; + switch($tagname) + { + case "group_id": + return $this->Get("GroupId"); + break; + case "group_name": + return $this->Get("Name"); + break; + case "group_desc": + return $this->Get("Description"); + break; + case "group_date": + return LangDate($this->Get("CreatedOn")); + break; + case "group_name": + return $this->Get("Name"); + break; + case "group_enabled": + return $this->Get("Enabled"); + break; + case "group_date_month": + return adodb_date("m", $this->Get("CreatedOn")); + break; + case "group_date_day": + return adodb_date("d", $this->Get("CreatedOn")); + break; + case "group_date_year": + return adodb_date("Y", $this->Get("CreatedOn")); + break; + case "group_system": + if ($this->Get("System") == 1) + return "System"; + else + return "User Defined"; + break; + case "group_status": + if ($this->Get("Enabled") == 1) + return "Enabled"; + else + return "Disabled"; + break; + default: + if (substr($tag, 0, 6) == "custom") + return Users_Custom($this->Get("ResourceId"), $tag); + else + return "Undefined:$tagname"; + break; + } + } +} + +class clsGroupList extends clsItemCollection +{ + var $Page; + + function clsGroupList() + { + $this->clsItemCollection(); + $this->classname = "clsPortalGroup"; + $this->SetTable('live', GetTablePrefix()."PortalGroup"); + $this->AdminSearchFields = array("name"); + $this->id_field = "GroupId"; + } + function NumGroups() + { + return $this->NumItems(); + } + + function GetGroup($GroupID) + { + return $this->GetItem($GroupID); + } + + function GetPersonalGroup($UserLogin) + { + $n = "_".$UserLogin; + $g = $this->GetItemByField("Name",$n); + return $g; + } + + function LoadGroups($where = "",$orderBy = "") + { + global $objConfig; + + $this->Clear(); + if($this->Page<1) + $this->Page=1; + + if(is_numeric($objConfig->Get("Perpage_Groups"))) + { + $Start = ($this->Page-1)*$objConfig->Get("Perpage_Groups"); + $limit = "LIMIT ".$Start.",".$objConfig->Get("Perpage_Groups"); + } + else + $limit = NULL; + + if(strlen($where)==0) + $where = "1"; + $this->QueryItemCount=TableCount($this->SourceTable,$where,0); + //echo $this->QueryItemCount."
\n"; + + if ($orderBy!="") + { + $this->Query_PortalGroup($where,$orderBy,$limit); + } + else + { + $this->Query_PortalGroup($where,"Name DESC",$limit); + } + + } + + function Query_PortalGroup($whereClause=NULL,$orderByClause=NULL) + { + global $m_var_list,$objSession,$Errors; + + $sql = "SELECT * FROM ".$this->SourceTable." "; + + if(strlen($whereClause)) + $sql = sprintf('%s WHERE %s',$sql,$whereClause); + + if(strlen($orderByClause)) + if(strlen(trim($orderByClause))) + $sql = sprintf('%s ORDER BY %s',$sql,$orderByClause); + + return $this->Query_Item($sql); + } + + function Query_UserPortalGroup($whereClause,$orderByClause) + { + global $m_var_list,$objSession,$Errors; + + if ($m_var_list["action"] == "m_group_search") + $table = $userSession->Get("SessionKey") . "_search"; + else + $table = $this->SourceTable; + + $sql = "SELECT * FROM $table LEFT JOIN UserGroup USING (GroupId) "; + + if(isset($whereClause)) + $sql = sprintf('%s WHERE %s',$sql,$whereClause); + + if(isset($orderByClause)) + if (strlen(trim($orderByClause))) + { + $sql = sprintf('%s ORDER BY %s',$sql,$orderByClause); + } + $result = $this->adodbConnection->Execute($sql); + + return $this->Query_Item($sql); + } + + function GetAllGroupList() + { + static $GroupListCache; + + if(!is_array($GroupListCache)) + { + $GroupListCache = array(); + $sql = "SELECT GroupId FROM ".$this->SourceTable." WHERE Enabled=1"; + + $rs = $this->adodbConnection->Execute($sql); + while($rs && !$rs->EOF) + { + $GroupListCache[] = $rs->fields["GroupId"]; + $rs->MoveNext(); + } + } + return $GroupListCache; + } + + function Group_Custom($ResourceId, $tag) + { + $fieldname= substr($tag, 7); + + $sql = "SELECT Value FROM ".GetTablePrefix()."CustomMetaData LEFT JOIN ".GetTablePrefix()."CustomField USING (CustomFieldId) where ".GetTablePrefix()."CustomMetaData.ResourceId=$ResourceId AND ".GetTablePrefix()."CustomField.FieldName='$fieldname'"; + + $result = $this->adodbConnection->Execute($sql); + + if ($result->EOF) + return ""; + else + return $result->fields["Value"]; + } + + function Add_Users_To_Group($groupid) + { + global $g_usergroup_status; + $userids = explode("-", $g_usergroup_status); + $g = $this->GetItem($groupid); + foreach($userids as $userid) + $g->AddUser($userid); + } + + function Delete_Group($GroupId) + { + $g = $this->GetItem($GroupId); + if(is_object($g)) + { + $g->Delete(); + } + } + + function Edit_Group($GroupId, $Name, $Description) + { + $g = $this->GetItem($GroupId); + $g->Set(array("Name", "Description"), array($Name, $Description)); + $g->Update(); + return $g; + } + + function Add_Group($Name, $Description, $System=1) + { + $g = new clsPortalGroup(NULL); + $g->tablename = $this->SourceTable; + $g->Set(array("Name", "Description", "System"),array($Name, $Description,$System)); + $g->Set("CreatedOn",adodb_date("U")); + $g->Create(); + return $g; + } + + function CopyFromEditTable($idfield) + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + $sql = "SELECT * FROM $edit_table"; + + $rs = $this->adodbConnection->Execute($sql); + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $c = new $this->classname; + $c->SetFromArray($data); + $c->idfield = $idfield; + $c->Dirty(); + if($c->Get($idfield)<1) + { + $old_id = $c->Get($idfield); + $c->UnsetIdField(); + if(!is_numeric($c->Get("OrgId"))) + $c->Clean(array("OrgId")); + $c->Create(); + $sql = "UPDATE ".GetTablePrefix()."UserGroup SET GroupId=".$c->Get("GroupId")." WHERE GroupId=$old_id"; + $this->adodbConnection->Execute($sql); + $sql = "UPDATE ".GetTablePrefix()."Permissions SET GroupId=".$c->Get("GroupId")." WHERE GroupId=$old_id"; + $this->adodbConnection->Execute($sql); + } + + $c->Update(); + unset($c); + unset($r); + $rs->MoveNext(); + } + @$this->adodbConnection->Execute("DROP TABLE IF EXISTS $edit_table"); + } + + function PurgeEditTable($idfield) + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + @$this->adodbConnection->Execute("DROP TABLE $edit_table"); + + $sql = "DELETE FROM ".GetTablePrefix()."UserGroup WHERE GroupId<1"; + $this->adodbConnection->Execute($sql); + $sql = "DELETE FROM ".GetTablePrefix()."Permissions WHERE GroupId<1"; + $this->adodbConnection->Execute($sql); + + } +} +/* +class clsUserGroupList extends clsItemCollection +{ + function clsUserGroupList() + { + $this->clsItemCollection(); + $this->classname = "clsPortalGroup"; + $this->SetTable('live', GetTablePrefix()."UserGroup"); + $this->id_field = "PortalUserId"; // don't try to insert by this ID :) + } +} +*/ +?> Index: trunk/admin/editor/FCKeditor/filemanager/browse/sample_jsp/browse.jsp =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/browse/sample_jsp/browse.jsp (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/browse/sample_jsp/browse.jsp (revision 13) @@ -0,0 +1,98 @@ +<%@ page import = "java.io.*"%> + +<% +String imagesDir="/FCKeditor/filemanager/browse/sample_html/images/"; +String docsDir="/FCKeditor/_docs/"; +String fileType=(String)request.getParameter("type"); +String selectedDir=""; +String functionName=""; +if (fileType.equals("img")) { + selectedDir=imagesDir; + functionName="getImage"; + } +else if (fileType.equals("doc")) { + selectedDir=docsDir; + functionName="getDoc"; + } +%> + + + + FCKeditor - Image Browser + + + + + + + + + + + + +
+ + + +<% if (fileType.equals("img")) {%> + +<% } %> + +
+ Select the image to load
+
+<% +String imagesFolder=application.getRealPath(selectedDir); +File folder=new File(imagesFolder); +String[] filesImmagini=folder.list(); +for (int i=0; i"+filesImmagini[i]+"
"); +} +%> +
+ +
+
+      +
+
+ + Index: trunk/admin/icons/icon24_catsearch.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_permission.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/images/nature.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_cat_settings.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/misc/right_searchbox.tpl =================================================================== diff -u --- trunk/themes/default/misc/right_searchbox.tpl (revision 0) +++ trunk/themes/default/misc/right_searchbox.tpl (revision 13) @@ -0,0 +1,35 @@ + + + + + + + + + + + +

+ \ No newline at end of file Index: trunk/admin/backup/backup1.php =================================================================== diff -u --- trunk/admin/backup/backup1.php (revision 0) +++ trunk/admin/backup/backup1.php (revision 13) @@ -0,0 +1,195 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$imagesURL = $rootURL."admin/images"; +$adminURL = $rootURL.$admin; + +//admin only util +$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"); +//Set Section +$section = "in-portal:backup"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); +global $tables; +unset($tables); + +if($_POST["Action"]=="update") +{ + $newpath= $_POST["backup_path"]; + $newpath = str_replace('\\\\','\\',$newpath); + $objConfig->Set("Backup_Path",$newpath); + $objConfig->Save(); +} + +//initializes default +$objSession->SetVariable("backup_start",0); +$objSession->SetVariable("backup_tnumber","start"); + +$date=time(); + +$filepath=$objConfig->Get("Backup_Path"); +$filename="dump".$date.".txt"; +//$filename= $filepath."".$filename; +$limit = 100; +$success =0; + +$objSession->SetVariable("backup_filename",$filename); +$objSession->SetVariable("backup_limit",$limit); +$objSession->SetVariable("backup_success",$success); +$objSession->SetVariable("backup_total",0); +$objSession->SetVariable("backup_subitem",0); +$objSession->SetVariable("backup_totalsub",0); +$objSession->SetVariable("backup_key",""); +$objSession->SetVariable("backup_tnumber","start"); + +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); + +$backpath = $objConfig->Get("Backup_Path"); +if(!strlen($backpath)) +{ + $backpath = $pathtoroot.$admin."/backupdata"; + $objConfig->Set("Backup_Path",$backpath); + $objConfig->Save(); +} + +$writable = is_writable($backpath); + +if (true) +{ + + if($en_prev>-1) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + $onClick= $sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_prev"; + $link=$PHP_SELF.$var; + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + else + { + $MouseOver=""; + $MouseOut=""; + $onClick=""; + $link="#"; + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),"#","","","","tool_prev_f3.gif"); + + } + if(true) + { + $MouseOver="swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="swap('moveright', 'toolbar/tool_next.gif');"; + $var="?env=".BuildEnv()."&en=$en_next"; + $link2=$rootURL."admin/backup/backup2.php".$var; + $onClick="document.location= '$link2';"; + + $link="#"; + if ($writable) { + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next.gif"); + } + else { + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),"#","","","","tool_next_f3.gif"); + } + } + + $title = admin_language("la_performing_backup")." - ".admin_language("la_Step")." 1"; + + int_header($objCatToolBar,NULL,$title); +} +?> + + +"> + + > + + + > + + + + +
+ + +
+ ".prompt_language("la_Text_backup_access").""; + ?> + + +
+ Index: trunk/admin/editor/FCKeditor/dialog/fck_table.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/dialog/fck_table.html (revision 0) +++ trunk/admin/editor/FCKeditor/dialog/fck_table.html (revision 13) @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
Rows: 
Columns: 
  
Border size: 
Alignment: 
+
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
Width:  
Height:  pixels
   
Cell spacing:  
Cell padding:  
+
+ + + + + + +
Caption:   +
+
+
+   +
+ + Index: trunk/kernel/admin/include/summary/modules.php =================================================================== diff -u --- trunk/kernel/admin/include/summary/modules.php (revision 0) +++ trunk/kernel/admin/include/summary/modules.php (revision 13) @@ -0,0 +1,81 @@ + +
+
+ + + + + +
Quick Links 
+
+ + + +
+
+
+ + + + + +
$lang_Installed $lang_modules 
+
+
+
+ +END; + + $ado=GetADODBConnection(); + $rs = $ado->Execute("SELECT * FROM ".GetTablePrefix()."Modules"); + while($rs && !$rs->EOF) + { + if($rs->fields["Loaded"]==1) + { + $status = admin_language("la_Text_Enabled"); + $color = "black"; + } + else + { + $status=admin_language("la_Text_Disabled"); + $color = "red"; + } + echo ""; + $rs->MoveNext(); + } +print << + + + + +END; +?> Index: trunk/themes/default/img/act_link.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/js/fck_xhtml.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_xhtml.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_xhtml.js (revision 13) @@ -0,0 +1,176 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + */ + +/* + * fck_xhtml.js - Part 1: String Builder 1.02 + * A class that allows more efficient building of strings than concatenation. + * For further information: http://webfx.eae.net + * License: GPL - The GNU General Public License + * + * Authors: + * Erik Arvidsson (http://webfx.eae.net/contact.html#erik) + */ + +function StringBuilder(sString) { + + // public + this.length = 0; + + this.append = function (sString) { + // append argument + this.length += (this._parts[this._current++] = String(sString)).length; + + // reset cache + this._string = null; + return this; + }; + + this.toString = function () { + if (this._string != null) + return this._string; + + var s = this._parts.join(""); + this._parts = [s]; + this._current = 1; + this.length = s.length; + + return this._string = s; + }; + + // private + this._current = 0; + this._parts = []; + this._string = null; // used to cache the string + + // init + if (sString != null) + this.append(sString); +} + +/* + * fck_xhtml.js - Part 2: Get XHTML for IE 1.03 + * Serilizes an IE HTML DOM tree to a well formed XHTML string. + * For further information: http://webfx.eae.net/dhtml/richedit/js/getxhtml.js + * License: GPL - The GNU General Public License + * + * Authors: + * Erik Arvidsson (http://webfx.eae.net/contact.html#erik) + */ + +// Changed by FredCK +function getXhtml(oNode) { + var sb = new StringBuilder; + var cs = oNode.childNodes; + var l = cs.length; + for (var i = 0; i < l; i++) + _appendNodeXHTML(cs[i], sb); + + return sb.toString(); +} + +function _fixAttribute(s) { + return String(s).replace(/\&/g, "&").replace(/"); + + // childNodes + var cs = node.childNodes; + l = cs.length; + for (var i = 0; i < l; i++) + _appendNodeXHTML(cs[i], sb); + + sb.append(""); + } + else if (name == "script") + sb.append(">" + node.text + ""); + else if (name == "title" || name == "style" || name == "comment") + sb.append(">" + node.innerHTML + ""); + else + sb.append(" />"); + + break; + + case 3: // TEXT + sb.append( _fixText(node.nodeValue) ); + break; + + case 4: + sb.append(""); + break; + + case 8: + //sb.append(""); + sb.append(node.text); + if (/(^<\?xml)|(^<\!DOCTYPE)/.test(node.text) ) + sb.append("\n"); + break; + + case 9: // DOCUMENT + // childNodes + var cs = node.childNodes; + l = cs.length; + for (var i = 0; i < l; i++) + _appendNodeXHTML(cs[i], sb); + break; + + default: + sb.append(""); + } +} \ No newline at end of file Index: trunk/admin/install/lang_run.php =================================================================== diff -u --- trunk/admin/install/lang_run.php (revision 0) +++ trunk/admin/install/lang_run.php (revision 13) @@ -0,0 +1,76 @@ +0) + { + $pct=round(($myprogress/ $totalnum)*100); + } + else + $pct = 100; + + $o .=' "; +} + +function reload($url) +{ + print ""; + //echo "Next "; +} + +$PageTitle = "Language Pack Installation In Progress"; +$CancelURL = $rootURL ."admin/install.php"; + +stats($PageTitle,$Offset,$Total); + +reload($NextUrl); + +?> Index: trunk/themes/default/img/ic_category.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_help.gif =================================================================== diff -u Binary files differ Index: trunk/admin/config/addlang_labels.php =================================================================== diff -u --- trunk/admin/config/addlang_labels.php (revision 0) +++ trunk/admin/config/addlang_labels.php (revision 13) @@ -0,0 +1,410 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditItems); + +$objEditItems = new clsPhraseList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Language"); +$objEditItems->EnablePaging = FALSE; + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); + +$c = $objEditItems->GetItemByIndex($en); + +$name = $c->Get("PackName"); +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} + +$action = "m_phrase_edit"; +/* -------------------------------------- Section configuration ------------------------------------------- */ +$envar = "env=" . BuildEnv() . "&en=$en"; +$section = 'in-portal:lang_labels'; +$sec = $objSections->GetSection($section); + +$SortFieldVar = "Phrase_LV_Sortfield"; +$SortOrderVar = "Phrase_LV_Sortorder"; +$DefaultSortField = "Phrase"; +$PerPageVar = "Perpage_Phrase"; +$CurrentPageVar = "Page_Phrase"; +$CurrentFilterVar = "Lang_View"; + +$ListForm = "language"; +$CheckClass = "LangChecks"; + +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$objListToolBar = new clsToolBar(); +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('language','LangEditStatus','".$admin."/config/config_lang.php',1);","tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('language','LangEditStatus','".$admin."/config/config_lang.php',2);",$imagesURL."/toolbar/tool_cancel.gif"); +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); + +if ( isset($en_prev) || isset($en_next) ) +{ + $objListToolBar->Add("divider"); + if($en_prev>-1) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + $onClick= $sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_prev&lpn=1"; + $link=$_SERVER["PHP_SELF"].$var; + $objListToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Theme"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + else + { + $MouseOver=""; + $MouseOut=""; + $onClick=""; + $link="#"; + $objListToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Theme"),"#","","","","tool_prev_f3.gif"); + + } + if($en_next>-1) + { + $MouseOver="swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="swap('moveright', 'toolbar/tool_next.gif');"; + $onClick=$sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_next&lpn=1"; + $link=$_SERVER["PHP_SELF"].$var; + $objListToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Theme"),$link,$MouseOver,$MouseOut,"","tool_next.gif"); + } + else + { + $objListToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Theme"),$link,$MouseOver,$MouseOut,"","tool_next_f3.gif"); + } + +} + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("new_label", "la_ToolTip_New_label","#","swap('new_label','toolbar/tool_new_language_var_f2.gif');", + "swap('new_label', 'toolbar/tool_new_language_var.gif');", + "OpenPhraseEditor('&destform=popup&LanguageId=".$c->Get("LanguageId")."');", + "tool_new_language_var.gif"); + +$objListToolBar->Add("label_edit","la_ToolTip_Edit","#", "if (LangChecks.itemChecked()) swap('label_edit','toolbar/tool_edit_f2.gif');", + "if (LangChecks.itemChecked()) swap('label_edit', 'toolbar/tool_edit.gif');", + "if (LangChecks.itemChecked()) EditPhrase();", + "tool_edit.gif",TRUE,TRUE); +$listImages[] = "LangChecks.addImage('label_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +$objListToolBar->Add("label_del","la_ToolTip_Delete","#", "if (LangChecks.itemChecked()) swap('label_del','toolbar/tool_delete_f2.gif');", + "if (LangChecks.itemChecked()) swap('label_del', 'toolbar/tool_delete.gif');","if (LangChecks.itemChecked()) LangChecks.check_submit('addlang_labels', 'm_phrase_delete');", + "tool_delete.gif",FALSE,TRUE); +$listImages[] = "LangChecks.addImage('label_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$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();"); + +$CurrentLangId = $c->Get("LanguageId"); + +/* ----------------------------------------- Set the View Filter ---------------------------------------- */ +/* bit place holders for view menu */ +$Bit_Front=1; +$Bit_Admin=2; +$Bit_Both = 4; +$Bit_All = 7; + +$FilterLabels = array(); + +$FilterLabels[0] = admin_language("la_Text_Front"); +$FilterLabels[1] = admin_language("la_Text_Admin"); +$FilterLabels[2] = admin_language("la_Text_Both"); + +if(!is_object($objThemeList)) +{ + $objThemeList = new clsThemeList(); +} + +if($objThemeList->NumItems()==0) + $objThemeList->LoadThemes(); + +/* determine current view menu settings */ +$LangView = $objConfig->Get($CurrentFilterVar); + +if(!is_numeric($LangView)) +{ + $LangView = $Bit_All; //Set all bits ON + $LangFilter = ""; +} + + if($LangView & $Bit_Both) + $Status[] = 2; + + if($LangView & $Bit_Admin) + $Status[] = 1; + + if($LangView & $Bit_Front) + $Status[] = 0; + + if(count($Status)>0) + { + $LangFilter = "p.PhraseType IN (".implode(",",$Status).")"; + } + else + $LangFilter = "p.PhraseType = -1"; + +$objPhrases = new clsPhraseList(); +$objPhrases->SourceTable = $objSession->GetEditTable("Phrase"); + +$order = trim($objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar)); + +$SearchWords = $objSession->GetVariable("PhraseSearchWord"); +if(strlen($SearchWords)) +{ + $where = $objPhrases->AdminSearchWhereClause($SearchWords); +} +else + $where = ""; + +$primary = $objLanguages->GetPrimary(); + +/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/ + +$ptable = GetTablePrefix()."Phrase"; + +$sql = "SELECT distinct(p.Phrase) as Phrase,p.Translation as Translation,ELT(p.PhraseType+1,'".admin_language("la_Text_Front")."','".admin_language("la_Text_Admin")."','".admin_language("la_Text_Both")."') as Type, "; +$sql .="pri.Translation as PrimaryValue, p.PhraseId as PhraseId "; +$sql .= "FROM ".$objPhrases->SourceTable." as p LEFT JOIN $ptable as pri ON (p.Phrase=pri.Phrase AND pri.LanguageId=1) WHERE p.LanguageId=".$c->Get("LanguageId")." "; + +if(strlen($where)) + $sql .= "AND ".$where." "; +if(strlen($LangFilter)) +{ + $sql .= " AND $LangFilter "; +} + +if(strlen($order)) + $sql .= "ORDER BY ".$order." "; + +if(isset($_GET["lpn"])) + $objSession->SetVariable($CurrentPageVar,$_GET["lpn"]); + +$sql .= GetLimitSQL($objSession->GetVariable($CurrentPageVar),$objConfig->Get($PerPageVar)); + +//echo $sql; + +$objPhrases->Query_Item($sql); +$itemcount = QueryCount($sql); + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + +/* ---------------------------------------- Configure the list view ---------------------------------------- */ +$objListView = new clsListView($objListToolBar,$objPhrases); +$objListView->IdField = "PhraseId"; + +$order = $objConfig->Get($SortOrderVar); +$objListView->ColumnHeaders->Add("Phrase",admin_language("la_prompt_Label"),1,0,$order,"width=\"30%\"",$SortFieldVar,$SortOrderVar,"Phrase"); +$objListView->ColumnHeaders->Add("Translation",admin_language("la_prompt_Value"),1,0,$order,"width=\"30%\"",$SortFieldVar,$SortOrderVar,"Translation"); +$objListView->ColumnHeaders->Add("PrimaryValue",admin_language("la_prompt_PrimaryValue"),1,0,$order,"width=\"30%\"",$SortFieldVar,$SortOrderVar,"PrimaryValue"); +$objListView->ColumnHeaders->Add("Type",admin_language("la_prompt_Type"),1,0,$order,"width=\"30%\"",$SortFieldVar,$SortOrderVar,"Type"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar)); + +$objListView->PrintToolBar = FALSE; +$objListView->checkboxes = TRUE; + +$objListView->CurrentPageVar = $CurrentPageVar; +$objListView->PerPageVar = $PerPageVar; +$objListView->CheckboxName = "itemlist[]"; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_phrase_search"; + +$objListView->TotalItemCount = $itemcount; + + $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, + $CurrentFilterVar,$LangView,$Bit_All); + + foreach($FilterLabels as $Bit=>$Label) + { + $objListView->AddViewMenuFilter($Label,$Bit); + } + +for($i=0;$iItems);$i++) +{ + $objListView->RowIcons[] = $objPhrases->Items[$i]->AdminIcon(); +} + +$title = admin_language("la_Text_Configuration")." - '".$name."' ".admin_language("la_Text_Pack")." - ".admin_language("la_tab_Labels")." ($itemcount)"; +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
" method=POST> +
".$rs->fields["Name"]."".$rs->fields["Version"].""; + echo $status."
+  '.$caption.'

+ + + + + + + +
 Step 6 - '.$caption."-".$pct.'%
+ + + + + + +
Next Category 
+ + + + + "; + + //$o .= ""; + //$o .= "
'; + + echo "\n"; + + $o .= " + +

+ + "; + $comp_pct = 100-$pct; + $o .= " "; + $o .= "
 

+

"; + //$o .= " "; + //$o .=" "; + //$comp_pct = 100-$pct; + //$o .= " "; + //$o .= "
 
"; + //$o .= "
"; + echo $o."\n"; + //echo "
+ +PrintList(); +?> + + + + +
+ + +
" name="viewmenu"> + + + + +
+ +
" name="templatemenu"> + + + + +
+
+ + +
+ +
" ID="popup"> + + + + + + +
+ + + Index: trunk/themes/default/img/ed_pick2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_group_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_image_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_validate_continue.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.italic.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/user_mail.php =================================================================== diff -u --- trunk/admin/users/user_mail.php (revision 0) +++ trunk/admin/users/user_mail.php (revision 13) @@ -0,0 +1,177 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $rootURL."/images"; +$pathtolocal = $pathtoroot."in-news/"; +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"); + +unset($objEditItems); + +$objEditItems = new clsUserManager(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); +$objEditItems->EnablePaging = FALSE; +$GroupCount = 0; + + if (isset($_POST["itemlist"])) + { + if(is_array($_POST["itemlist"])) + { + $UserList = implode(",",$_POST["itemlist"]); + $UserCount = count($_POST["itemlist"]); + } + else + { + $a = explode($_POST["itemlist"]); + $userCount = count($a); + unset($a); + $UserList = $_POST["itemlist"]; + } + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_sendmail"; +} + +$envar = "env=" . BuildEnv(); + +$section = 'in-portal:edituser_sendmail'; + +$title = prompt_language("la_Text_Send")." ".prompt_language("la_Text_Email")." ".prompt_language("la_Text_To")." $UserCount ".prompt_language("la_Text_Users"); +echo $envar."
\n"; + +//Display header + $sec = $objSections->GetSection($section); + int_header(NULL,NULL,$title); +?> + + + > + + + + + > + + + + + > + + + + + + > + + + +
+ +
+ +
+ +
+ +
+ + + + " class="button" onclick="edit_submit('mailuser','/users/user_list.php',1);"> + " class="button" onclick="edit_submit('mailuser','/users/user_list.php',2);"> +
+ + + \ No newline at end of file Index: trunk/admin/images/itemicons/icon16_custom.gif =================================================================== diff -u Binary files differ Index: trunk/admin/browse/toolbar.css =================================================================== diff -u --- trunk/admin/browse/toolbar.css (revision 0) +++ trunk/admin/browse/toolbar.css (revision 13) @@ -0,0 +1,11 @@ +.tab_class { + background-repeat: repeat-x; +} + +.left_tab { + background-repeat: no-repeat; +} + +.right_tab { + background-repeat: no-repeat; +} \ No newline at end of file Index: trunk/admin/images/itemicons/icon16_user_attn.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/summary/overviewbox_ex.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tree/ftv2pnode.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/upgrades/inportal_upgrade_v1.0.2.sql =================================================================== diff -u --- trunk/admin/install/upgrades/inportal_upgrade_v1.0.2.sql (revision 0) +++ trunk/admin/install/upgrades/inportal_upgrade_v1.0.2.sql (revision 13) @@ -0,0 +1 @@ +UPDATE Modules SET Version = '1.0.2' WHERE Name = 'In-Portal'; \ No newline at end of file Index: trunk/admin/include/textedit.js =================================================================== diff -u --- trunk/admin/include/textedit.js (revision 0) +++ trunk/admin/include/textedit.js (revision 13) @@ -0,0 +1,103 @@ + /* + written by chris wetherell + http://www.massless.org + chris [THE AT SIGN] massless.org + + warning: it only works for IE4+/Win and Moz1.1+ + feel free to take it for your site + if there are any problems, let chris know. + */ + + + var thisForm; /* make sure to change the onload handler of the + tag to the form you're using!... */ + + /* YOU CAN ERASE getMozSelection(): + It's here for debug purposes only */ + function getMozSelection(txtarea) { + var selLength = txtarea.textLength; + var selStart = txtarea.selectionStart; + var selEnd = txtarea.selectionEnd; + if (selEnd==1 || selEnd==2) selEnd=selLength; + return (txtarea.value).substring(selStart, selEnd); + } + + function mozWrap(txtarea, lft, rgt) { + var selLength = txtarea.textLength; + var selStart = txtarea.selectionStart; + var selEnd = txtarea.selectionEnd; + if (selEnd==1 || selEnd==2) selEnd=selLength; + var s1 = (txtarea.value).substring(0,selStart); + var s2 = (txtarea.value).substring(selStart, selEnd) + var s3 = (txtarea.value).substring(selEnd, selLength); + txtarea.value=s1+lft+s2+rgt+s3; + } + + function IEWrap(lft, rgt) { + strSelection = document.selection.createRange().text; + if (strSelection!="") { + document.selection.createRange().text = lft + strSelection + rgt; + } + } + + function wrapSelection(txtarea, lft, rgt) { + if (document.all) {IEWrap(lft, rgt);} + else if (document.getElementById) {mozWrap(txtarea, lft, rgt);} + } + function wrapSelectionWithLink(txtarea) { + var my_link = prompt("Enter URL:","http://"); + if (my_link != null) { + lft=""; + rgt=""; + wrapSelection(txtarea, lft, rgt); + } + return; + } + + document.onkeypress = function (e) { + if (document.all) { + key=event.keyCode; txtarea=thisForm.content; + if (key == 1) wrapSelectionWithLink(txtarea); + if (key == 2) wrapSelection(txtarea,'',''); + if (key == 20) wrapSelection(txtarea,'',''); + } + else if (document.getElementById) { + ctrl=e.ctrlKey; shft=e.shiftKey; chr=e.charCode; + if (ctrl) if (shft) if (chr==65) wrapSelectionWithLink(thisForm.content); + if (ctrl) if (shft) if (chr==66) wrapSelection(thisForm.T,'',''); + if (ctrl) if (shft) if (chr==84) wrapSelection(thisForm.T,'',''); + } + + return true; + } + /* end chris w. script */ + + + + /* + written by meg hourihan + http://www.megnut.com + meg@megnut.com + + warning: it only works for IE4+/Win and Moz1.1+ + feel free to take it for your site + but leave this text in place. + any problems, let meg know. + */ + + function mouseover(el) { + el.className = "raise"; + } + + function mouseout(el) { + el.className = "buttons"; + } + + function mousedown(el) { + el.className = "press"; + } + + function mouseup(el) { + el.className = "raise"; + } + /* end meg script */ \ No newline at end of file Index: trunk/themes/default/img/welc_home.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_struct.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_export_language.gif =================================================================== diff -u Binary files differ Index: trunk/admin/include/textedit.css =================================================================== diff -u --- trunk/admin/include/textedit.css (revision 0) +++ trunk/admin/include/textedit.css (revision 13) @@ -0,0 +1,39 @@ + .buttons { + background: #ccc; + border: 1px solid #ccc; + margin: 1; + float:left; + } + + .raise { + border-top: 1px solid buttonhighlight; + border-left: 1px solid buttonhighlight; + border-bottom: 1px solid buttonshadow; + border-right: 1px solid buttonshadow; + background: #ccc; + margin:1; + float:left; + } + + .press { + border-top: 1px solid buttonshadow; + border-left: 1px solid buttonshadow; + border-bottom: 1px solid buttonhighlight; + border-right: 1px solid buttonhighlight; + background: #ccc; + margin:1; + float:left; + } + + #toolbar { + margin: 0; + width: 800px; + padding: 0; + height:20px; + background: #ccc; + border-top: 1px solid buttonhighlight; + border-left: 1px solid buttonhighlight; + border-bottom: 1px solid buttonshadow; + border-right: 1px solid buttonshadow; + text-align:left; + } \ No newline at end of file Index: trunk/admin/images/tabnav_left.jpg =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ed_format_bold.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/my_preferences/preferences.tpl =================================================================== diff -u --- trunk/themes/default/my_preferences/preferences.tpl (revision 0) +++ trunk/themes/default/my_preferences/preferences.tpl (revision 13) @@ -0,0 +1,122 @@ + +
+ + + + + + + +
+ + + + + + + + + + +
+

+


+ + + + + + +

+ +
"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +


 










  +

+ " class="button"> + " class="button" onClick="javascript:history.back();"> +
" TARGET="_new">

+
+
+ +

+ + Index: trunk/admin/editor/FCKeditor/images/toolbar/button.about.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_post.gif =================================================================== diff -u Binary files differ Index: trunk/admin/textedit/toolbar/bold.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/js/fck_toolbar.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_toolbar.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_toolbar.js (revision 13) @@ -0,0 +1,335 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_toolbar.js: Creates and handles the toolbar. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +//## +//## Command Type Enum +//## +TBCMD_DEC = 0 ; +TBCMD_DOC = 1 ; +TBCMD_CUSTOM = 2 ; + +// ----------------------------------------------------------------- +// -- TBToolbar class - The Main (upper level) toolbar object. +// ----------------------------------------------------------------- +function TBToolbar() +{ + this.Bands = new TBBandList() ; // The Toolbar Bands collection. +} +TBToolbar.prototype.GetHTML = TBToolbar_GetHTML ; +TBToolbar.prototype.LoadButtonsSet = TBToolbar_LoadButtonsSet ; + +function TBToolbar_GetHTML() +{ + var sHTML = '
' ; + var oBand ; + + for (iBand = 0 ; iBand < this.Bands.Array.length ; iBand++) + { + sHTML += '' ; + + oBand = this.Bands.Array[iBand] + for (iItem = 0 ; iItem < oBand.Items.Array.length ; iItem++) + { + sHTML += '' ; + } + + sHTML += '
' + oBand.Items.Array[iItem].GetHTML() + '
' ; + } + + return '
' + sHTML ; +} + +function TBToolbar_LoadButtonsSet(toolbarSetName) +{ + var ToolbarSet = config.ToolbarSets[toolbarSetName] ; + + if (! ToolbarSet) + { + alert('Toolbar set "' + toolbarSetName + '" doesn\'t exist') ; + return ; + } + + this.Bands = new TBBandList() ; + var oBand ; + var sItem ; + + for (iBand = 0 ; iBand < ToolbarSet.length ; iBand++) + { + oBand = this.Bands.Add() ; + for (iItem in ToolbarSet[iBand]) + { + sItem = ToolbarSet[iBand][iItem] ; + if ((sItem) == '-') + oBand.Items.Add(new TBSeparator()) ; + else + oBand.Items.Add(oTB_Items[sItem]) ; + } + } +} + +// ----------------------------------------------------------------- +// -- TBBandList class - A collection of toolbar bands. +// ----------------------------------------------------------------- +function TBBandList() +{ + this.Array = new Array() ; +} +TBBandList.prototype.Add = TBBandList_Add ; // Adds a Band to the collection. + +function TBBandList_Add(bandName) +{ + var i = this.Array.length ; + this.Array[i] = new TBBand(bandName) ; + return this.Array[i] ; +} + +// ----------------------------------------------------------------- +// -- TBBand class - A toolbar band. It holds a group of items (buttons, combos, etc...). +// ----------------------------------------------------------------- +function TBBand(bandName) +{ + this.Name = bandName || "" ; // The Band name + this.Items = new TBItemList() ; // The Band Items collection. +} + +// ----------------------------------------------------------------- +// -- TBItemList class - A collection of items (TBButton's, TBCombo's, etc...). +// ----------------------------------------------------------------- +function TBItemList() +{ + this.Array = new Array() ; +} +TBItemList.prototype.Add = TBItemList_Add ; // Adds an Item to the collection. + +function TBItemList_Add(objectItem) +{ + var i = this.Array.length ; + this.Array[i] = objectItem ; + return this.Array[i] ; +} + +// ----------------------------------------------------------------- +// -- TBButton class - Represents a toolbar button. +// ----------------------------------------------------------------- +function TBButton(name, toolTip, command, commandType, onEditingAction, width, height) +{ + this.Name = name.toLowerCase() ; + this.ToolTip = toolTip || name ; + this.Width = width || 21 ; + this.Height = height || 21 ; + this.CommandType = commandType || TBCMD_DEC ; + this.Image = null ; + this.Active = false ; + + switch (this.CommandType) + { + case TBCMD_DEC : + this.Command = "decCommand(" + command + ")" ; + this.CommandId = command ; + events.attachEvent('onEditing', this) ; + break ; + case TBCMD_DOC : + this.Command = "docCommand('" + command + "')" ; + this.CommandCode = command ; + events.attachEvent('onEditing', this) ; + break ; + default : + this.Command = command || "void(0)" ; + if (onEditingAction) + { + this.OnEditingAction = onEditingAction ; + events.attachEvent('onEditing', this) ; + } + break ; + } +} +TBButton.prototype.GetHTML = TBButton_GetHTML ; +TBButton.prototype.onEditing = TBButton_onEditing ; + +function TBButton_GetHTML() +{ + this.Active = true ; + return '' + this.ToolTip + '' ; +} + +function TBButton_onEditing() +{ + if (! this.Active) return ; + + if (this.Image == null) this.Image = document.getElementById('btn' + this.Name) ; + if (this.Image && this.Image.Loaded) + { + var state ; + switch (this.CommandType) + { + case TBCMD_DEC : + state = checkDecCommand(this.CommandId) ; + break ; + case TBCMD_DOC : + state = checkDocCommand(this.CommandCode) ; + break ; + default : + if (this.OnEditingAction) + state = eval(this.OnEditingAction) ; + break ; + } + + if (state == OLE_TRISTATE_UNCHECKED) + { + if (this.Image.onmouseover == null) this.Image.onmouseover = this.Image.BackupOnMouseOver ; + if (this.Image.onmouseout == null) this.Image.onmouseout = this.Image.BackupOnMouseOut ; + TBButtonOut(this.Image, this.Name) ; + } + else if (state == OLE_TRISTATE_GRAY) + { + this.Image.onmouseover = null ; + this.Image.onmouseout = null ; + if (this.Image.className != "ButtonOff") this.Image.className = "ButtonOff" ; + } + else + { + this.Image.onmouseout = null ; + TBButtonOver(this.Image, this.Name) ; + } + } +} + +// ----------------------------------------------------------------- +// -- TBCombo class - Represents a toolbar combo. +// ----------------------------------------------------------------- +function TBCombo(name, command, label, options, values, onEditingAction, separator) +{ + separator = separator ? separator : ';' ; + + this.Name = name ; + this.Label = label || "" ; + this.Command = command ; + this.Options = options ? options.split( separator ) : new Array() ; + this.Values = values ? values.split( separator ) : new Array() ; + this.Active = false ; + + if (onEditingAction) + { + this.onEditingAction = onEditingAction ; + events.attachEvent('onEditing', this) ; + } +} +TBCombo.prototype.GetHTML = TBCombo_GetHTML ; +TBCombo.prototype.onEditing = TBCombo_onEditing ; + +function TBCombo_GetHTML() +{ + this.Active = true ; + + var sHTML = this.Label + ' \n' ; +} + +function TBCombo_onEditing() +{ + if (! this.Active) return ; + + eval(this.onEditingAction) ; +} + +var iElementNum = 0 ; + +// ----------------------------------------------------------------- +// -- TBCheckBox class - Represents a toolbar checkbox. +// ----------------------------------------------------------------- +function TBCheckBox(name, command, label, eventToListen) +{ + this.Name = name ; + this.Command = command ; + this.Label = label || "" ; + this.Checkboxes = null ; + + if (eventToListen) + { + events.attachEvent(eventToListen, this) ; + this[eventToListen] = this.onEvent ; + } +} +TBCheckBox.prototype.GetHTML = TBCheckBox_GetHTML ; +TBCheckBox.prototype.onEvent = TBCheckBox_onEvent ; + +function TBCheckBox_GetHTML() +{ + return this.Label + '' ; +} + +function TBCheckBox_onEvent(checked) +{ + + if (this.Checkboxes == null) this.Checkboxes = document.getElementsByName('chk' + this.Name) ; + if (this.Checkboxes) + { + for (i = 0 ; i < this.Checkboxes.length ; i++) + { + this.Checkboxes[i].checked = checked ; + } + } +} + +// ----------------------------------------------------------------- +// -- TBSeparator class - Represents a toolbar items separator. +// ----------------------------------------------------------------- +function TBSeparator() +{ + this.Name = '' ; +} +TBSeparator.prototype.GetHTML = TBSeparator_GetHTML ; + +function TBSeparator_GetHTML() +{ + return '' ; +} + +// Behaviours +function TBButtonLoad(oImage, Name) +{ + oImage.onload = null ; + oImage.className = "ButtonOut" ; + oImage.BackupOnMouseOver = oImage.onmouseover ; + oImage.BackupOnMouseOut = oImage.onmouseout ; + + oImage.Loaded = true ; +} + +function TBButtonOver(oImage, Name) +{ + if (oImage.className != "ButtonOver") oImage.className = "ButtonOver" ; +} + +function TBButtonOut(oImage, Name) +{ + if (oImage.className != "ButtonOut") oImage.className = "ButtonOut" ; +} \ No newline at end of file Index: trunk/themes/default/img/ic_head_myaccount.gif =================================================================== diff -u Binary files differ Index: trunk/admin/templates/user_group_element.tpl =================================================================== diff -u --- trunk/admin/templates/user_group_element.tpl (revision 0) +++ trunk/admin/templates/user_group_element.tpl (revision 13) @@ -0,0 +1,10 @@ + + + + + + + + + + Index: trunk/themes/default/img/act_cat.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.paste.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_cat_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_catsearch.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/status_cancel.gif =================================================================== diff -u Binary files differ Index: trunk/admin/include/calendar.js =================================================================== diff -u --- trunk/admin/include/calendar.js (revision 0) +++ trunk/admin/include/calendar.js (revision 13) @@ -0,0 +1,1307 @@ +var cbPath = ""; + /* +preloadImage(cbPath); +preloadImage(cbPathO); +preloadImage(cbPathA); +*/ + +//addScript("core.js"); +//addScript("lang.js"); + +//addCss("wnd.css"); +//addCss("calendar.css"); + +function initCalendar(id, dateFormat) +{ + var input = document.getElementById(id); + if (!input) return; + input.dateFormat = dateFormat; + var cbPath = input.getAttribute("datepickerIcon"); + + var inputContainer = document.createElement("DIV"); + inputContainer.className = "dpContainer"; + inputContainer.noWrap = true; + var pNode = input.parentNode; + pNode.insertBefore(inputContainer, input.nextSibling); +// inputContainer.appendChild(pNode.removeChild(input)); + + var calendarButton = document.createElement("IMG"); + calendarButton.setAttribute("width", "24"); + calendarButton.setAttribute("height", "24"); + calendarButton.setAttribute("align", "absMiddle"); + calendarButton.style.width=24 + calendarButton.style.height=24 + calendarButton.style.cursor = "hand"; + + calendarButton.setAttribute("hspace", 2); + calendarButton.src = cbPath; + calendarButton.onmouseover = cbMouseOver; + calendarButton.onmouseout = cbMouseOut; + calendarButton.onmouseup = calendarButton.onmouseout; + calendarButton.onmousedown = cbMouseDown; + calendarButton.showCalendar = wnd_showCalendar; + inputContainer.appendChild(calendarButton); + inputContainer.dateInput = input; +} + +var calendar; + +function cbMouseOver(e) +{ +// this.src = cbPathO; + var evt = (e) ? e : event; if (evt) evt.cancelBubble = true; +} + +function cbMouseOut(e) +{ +// this.src = cbPath; + var evt = (e) ? e : event; if (evt) evt.cancelBubble = true; +} + +function cbMouseDown(e) +{ +// this.src = cbPathA; + // alert("cbMouseDown"); + var evt = (e) ? e : event; if (evt) evt.cancelBubble = true; + this.showCalendar(); +} + +function wnd_showCalendar() +{ + var el = this.parentNode.dateInput; + if (calendar != null) calendar.hide(); + else + { + var calendarObject = new Calendar(false, null, dateSelected, closeHandler); + calendar = calendarObject; + calendarObject.setRange(1900, 2070); + calendarObject.create(); + } + calendar.setDateFormat(el.dateFormat); + calendar.parseDate(el.value); + calendar.sel = el; + calendar.showAtElement(el); + + Calendar.addEvent(document, "mousedown", checkCalendar); + return false; +} + +function dateSelected(calendarObject, date) +{ + calendarObject.sel.value = date; + calendarObject.callCloseHandler(); +} + +function closeHandler(calendarObject) +{ + calendarObject.hide(); + Calendar.removeEvent(document, "mousedown", checkCalendar); +} + +function checkCalendar(ev) +{ + var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); + + for (; el != null; el = el.parentNode) + if (el == calendar.element || el.tagName == "A") break; + + if (el == null) + { + calendar.callCloseHandler(); + Calendar.stopEvent(ev); + } +} + +function preloadImage(path) +{ + var img = new Image(); + img.src = path; + preloadImages.push(img); +} + +function addCss(path) +{ + path = cssPath + path; + document.write(""); +} + +/**/ +/* Copyright Mihai Bazon, 2002 + * http://students.infoiasi.ro/~mishoo + * + * Version: 0.9.1 + * + * Feel free to use this script under the terms of the GNU General Public + * License, as long as you do not remove or alter this notice. + */ + +/** The Calendar object constructor. */ +Calendar = function (mondayFirst, dateStr, onSelected, onClose) { + // member variables + this.activeDiv = null; + this.currentDateEl = null; + this.checkDisabled = null; + this.timeout = null; + this.onSelected = onSelected || null; + this.onClose = onClose || null; + this.dragging = false; + this.minYear = 1970; + this.maxYear = 2050; + this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"]; + this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; + this.isPopup = true; + this.mondayFirst = mondayFirst; + this.dateStr = dateStr; + // HTML elements + this.table = null; + this.element = null; + this.tbody = null; + this.daynames = null; + // Combo boxes + this.monthsCombo = null; + this.yearsCombo = null; + this.hilitedMonth = null; + this.activeMonth = null; + this.hilitedYear = null; + this.activeYear = null; + + // one-time initializations + if (!Calendar._DN3) { + // table of short day names + var ar = new Array(); + for (var i = 8; i > 0;) { + ar[--i] = Calendar._DN[i].substr(0, 3); + } + Calendar._DN3 = ar; + // table of short month names + ar = new Array(); + for (var i = 12; i > 0;) { + ar[--i] = Calendar._MN[i].substr(0, 3); + } + Calendar._MN3 = ar; + } +}; + +// ** constants + +/// "static", needed for event handlers. +Calendar._C = null; + +/// detect a special case of "web browser" +Calendar.is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) && + (navigator.userAgent.toLowerCase().indexOf("opera") == -1) ); + +// short day names array (initialized at first constructor call) +Calendar._DN3 = null; + +// short month names array (initialized at first constructor call) +Calendar._MN3 = null; + +// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate +// library, at some point. + +Calendar.getAbsolutePos = function(el) { + var r = { x: el.offsetLeft, y: el.offsetTop }; + if (el.offsetParent) { + var tmp = Calendar.getAbsolutePos(el.offsetParent); + r.x += tmp.x; + r.y += tmp.y; + } + return r; +}; + +Calendar.isRelated = function (el, evt) { + var related = evt.relatedTarget; + if (!related) { + var type = evt.type; + if (type == "mouseover") { + related = evt.fromElement; + } else if (type == "mouseout") { + related = evt.toElement; + } + } + while (related) { + if (related == el) { + return true; + } + related = related.parentNode; + } + return false; +}; + +Calendar.removeClass = function(el, className) { + if (!(el && el.className)) { + return; + } + var cls = el.className.split(" "); + var ar = new Array(); + for (var i = cls.length; i > 0;) { + if (cls[--i] != className) { + ar[ar.length] = cls[i]; + } + } + el.className = ar.join(" "); +}; + +Calendar.addClass = function(el, className) { + el.className += " " + className; +}; + +Calendar.getElement = function(ev) { + if (Calendar.is_ie) { + return window.event.srcElement; + } else { + return ev.currentTarget; + } +}; + +Calendar.getTargetElement = function(ev) { + if (Calendar.is_ie) { + return window.event.srcElement; + } else { + return ev.target; + } +}; + +Calendar.stopEvent = function(ev) { + if (Calendar.is_ie) { + window.event.cancelBubble = true; + window.event.returnValue = false; + } else { + ev.preventDefault(); + ev.stopPropagation(); + } +}; + +Calendar.addEvent = function(el, evname, func) { + if (Calendar.is_ie) { + el.attachEvent("on" + evname, func); + } else { + el.addEventListener(evname, func, true); + } +}; + +Calendar.removeEvent = function(el, evname, func) { + if (Calendar.is_ie) { + el.detachEvent("on" + evname, func); + } else { + el.removeEventListener(evname, func, true); + } +}; + +Calendar.createElement = function(type, parent) { + var el = null; + if (document.createElementNS) { + // use the XHTML namespace; IE won't normally get here unless + // _they_ "fix" the DOM2 implementation. + el = document.createElementNS("http://www.w3.org/1999/xhtml", type); + } else { + el = document.createElement(type); + } + if (typeof parent != "undefined") { + parent.appendChild(el); + } + return el; +}; + +// END: UTILITY FUNCTIONS + +// BEGIN: CALENDAR STATIC FUNCTIONS + +/** Internal -- adds a set of events to make some element behave like a button. */ +Calendar._add_evs = function(el) { + with (Calendar) { + addEvent(el, "mouseover", dayMouseOver); + addEvent(el, "mousedown", dayMouseDown); + addEvent(el, "mouseout", dayMouseOut); + if (is_ie) { + addEvent(el, "dblclick", dayMouseDblClick); + el.setAttribute("unselectable", true); + } + } +}; + +Calendar.findMonth = function(el) { + if (typeof el.month != "undefined") { + return el; + } else if (typeof el.parentNode.month != "undefined") { + return el.parentNode; + } + return null; +}; + +Calendar.findYear = function(el) { + if (typeof el.year != "undefined") { + return el; + } else if (typeof el.parentNode.year != "undefined") { + return el.parentNode; + } + return null; +}; + +Calendar.showMonthsCombo = function () { + var cal = Calendar._C; + if (!cal) { + return false; + } + var cal = cal; + var cd = cal.activeDiv; + var mc = cal.monthsCombo; + if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + if (cal.activeMonth) { + Calendar.removeClass(cal.activeMonth, "active"); + } + var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()]; + Calendar.addClass(mon, "active"); + cal.activeMonth = mon; + mc.style.left = cd.offsetLeft; + mc.style.top = cd.offsetTop + cd.offsetHeight; + mc.style.display = "block"; +}; + +Calendar.showYearsCombo = function (fwd) { + var cal = Calendar._C; + if (!cal) { + return false; + } + var cal = cal; + var cd = cal.activeDiv; + var yc = cal.yearsCombo; + if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + if (cal.activeYear) { + Calendar.removeClass(cal.activeYear, "active"); + } + cal.activeYear = null; + var Y = cal.date.getFullYear() + (fwd ? 1 : -1); + var yr = yc.firstChild; + var show = false; + for (var i = 12; i > 0; --i) { + if (Y >= cal.minYear && Y <= cal.maxYear) { + yr.firstChild.data = Y; + yr.year = Y; + yr.style.display = "block"; + show = true; + } else { + yr.style.display = "none"; + } + yr = yr.nextSibling; + Y += fwd ? 2 : -2; + } + if (show) { + yc.style.left = cd.offsetLeft; + yc.style.top = cd.offsetTop + cd.offsetHeight; + yc.style.display = "block"; + } +}; + +// event handlers + +Calendar.tableMouseUp = function(ev) { + var cal = Calendar._C; + if (!cal) { + return false; + } + if (cal.timeout) { + clearTimeout(cal.timeout); + } + var el = cal.activeDiv; + if (!el) { + return false; + } + var target = Calendar.getTargetElement(ev); + Calendar.removeClass(el, "active"); + if (target == el || target.parentNode == el) { + Calendar.cellClick(el); + } + var mon = Calendar.findMonth(target); + var date = null; + if (mon) { + date = new Date(cal.date); + if (mon.month != date.getMonth()) { + date.setMonth(mon.month); + cal.setDate(date); + } + } else { + var year = Calendar.findYear(target); + if (year) { + date = new Date(cal.date); + if (year.year != date.getFullYear()) { + date.setFullYear(year.year); + cal.setDate(date); + } + } + } + with (Calendar) { + removeEvent(document, "mouseup", tableMouseUp); + removeEvent(document, "mouseover", tableMouseOver); + removeEvent(document, "mousemove", tableMouseOver); + cal._hideCombos(); + stopEvent(ev); + _C = null; + } +}; + +Calendar.tableMouseOver = function (ev) { + var cal = Calendar._C; + if (!cal) { + return; + } + var el = cal.activeDiv; + var target = Calendar.getTargetElement(ev); + if (target == el || target.parentNode == el) { + Calendar.addClass(el, "hilite active"); + } else { + Calendar.removeClass(el, "active"); + Calendar.removeClass(el, "hilite"); + } + var mon = Calendar.findMonth(target); + if (mon) { + if (mon.month != cal.date.getMonth()) { + if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + Calendar.addClass(mon, "hilite"); + cal.hilitedMonth = mon; + } else if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + } else { + var year = Calendar.findYear(target); + if (year) { + if (year.year != cal.date.getFullYear()) { + if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + Calendar.addClass(year, "hilite"); + cal.hilitedYear = year; + } else if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + } + } + Calendar.stopEvent(ev); +}; + +Calendar.tableMouseDown = function (ev) { + if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) { + Calendar.stopEvent(ev); + } +}; + +Calendar.calDragIt = function (ev) { + var cal = Calendar._C; + if (!(cal && cal.dragging)) { + return false; + } + var posX; + var posY; + if (Calendar.is_ie) { + posY = window.event.clientY + document.body.scrollTop; + posX = window.event.clientX + document.body.scrollLeft; + } else { + posX = ev.pageX; + posY = ev.pageY; + } + cal.hideShowCovered(); + var st = cal.element.style; + st.left = (posX - cal.xOffs) + "px"; + st.top = (posY - cal.yOffs) + "px"; + Calendar.stopEvent(ev); +}; + +Calendar.calDragEnd = function (ev) { + var cal = Calendar._C; + if (!cal) { + return false; + } + cal.dragging = false; + with (Calendar) { + removeEvent(document, "mousemove", calDragIt); + removeEvent(document, "mouseover", stopEvent); + removeEvent(document, "mouseup", calDragEnd); + tableMouseUp(ev); + } + cal.hideShowCovered(); +}; + +Calendar.dayMouseDown = function(ev) { + var el = Calendar.getElement(ev); + if (el.disabled) { + return false; + } + var cal = el.calendar; + cal.activeDiv = el; + Calendar._C = cal; + if (el.navtype != 300) with (Calendar) { + addClass(el, "hilite active"); + addEvent(document, "mouseover", tableMouseOver); + addEvent(document, "mousemove", tableMouseOver); + addEvent(document, "mouseup", tableMouseUp); + } else if (cal.isPopup) { + cal._dragStart(ev); + } + Calendar.stopEvent(ev); + if (el.navtype == -1 || el.navtype == 1) { + cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250); + } else if (el.navtype == -2 || el.navtype == 2) { + cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250); + } else { + cal.timeout = null; + } +}; + +Calendar.dayMouseDblClick = function(ev) { + Calendar.cellClick(Calendar.getElement(ev)); + if (Calendar.is_ie) { + document.selection.empty(); + } +}; + +Calendar.dayMouseOver = function(ev) { + var el = Calendar.getElement(ev); + if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) { + return false; + } + if (el.ttip) { + if (el.ttip.substr(0, 1) == "_") { + var date = null; + with (el.calendar.date) { + date = new Date(getFullYear(), getMonth(), el.caldate); + } + el.ttip = date.print(el.calendar.ttDateFormat) + el.ttip.substr(1); + } + el.calendar.tooltips.firstChild.data = el.ttip; + } + if (el.navtype != 300) { + Calendar.addClass(el, "hilite"); + } + Calendar.stopEvent(ev); +}; + +Calendar.dayMouseOut = function(ev) { + with (Calendar) { + var el = getElement(ev); + if (isRelated(el, ev) || _C || el.disabled) { + return false; + } + removeClass(el, "hilite"); + el.calendar.tooltips.firstChild.data = _TT["SEL_DATE"]; + stopEvent(ev); + } +}; + +/** + * A generic "click" handler :) handles all types of buttons defined in this + * calendar. + */ +Calendar.cellClick = function(el) { + var cal = el.calendar; + var closing = false; + var newdate = false; + var date = null; + if (typeof el.navtype == "undefined") { + Calendar.removeClass(cal.currentDateEl, "selected"); + Calendar.addClass(el, "selected"); + closing = (cal.currentDateEl == el); + if (!closing) { + cal.currentDateEl = el; + } + cal.date.setDate(el.caldate); + date = cal.date; + newdate = true; + } else { + if (el.navtype == 200) { + Calendar.removeClass(el, "hilite"); + cal.callCloseHandler(); + return; + } + date = (el.navtype == 0) ? new Date() : new Date(cal.date); + var year = date.getFullYear(); + var mon = date.getMonth(); + var setMonth = function (mon) { + var day = date.getDate(); + var max = date.getMonthDays(); + if (day > max) { + date.setDate(max); + } + date.setMonth(mon); + }; + switch (el.navtype) { + case -2: + if (year > cal.minYear) { + date.setFullYear(year - 1); + } + break; + case -1: + if (mon > 0) { + setMonth(mon - 1); + } else if (year-- > cal.minYear) { + date.setFullYear(year); + setMonth(11); + } + break; + case 1: + if (mon < 11) { + setMonth(mon + 1); + } else if (year < cal.maxYear) { + date.setFullYear(year + 1); + setMonth(0); + } + break; + case 2: + if (year < cal.maxYear) { + date.setFullYear(year + 1); + } + break; + case 100: + cal.setMondayFirst(!cal.mondayFirst); + return; + } + if (!date.equalsTo(cal.date)) { + cal.setDate(date); + newdate = el.navtype == 0; + } + } + if (newdate) { + cal.callHandler(); + } + if (closing) { + Calendar.removeClass(el, "hilite"); + cal.callCloseHandler(); + } +}; + +// END: CALENDAR STATIC FUNCTIONS + +// BEGIN: CALENDAR OBJECT FUNCTIONS + +/** + * This function creates the calendar inside the given parent. If _par is + * null than it creates a popup calendar inside the BODY element. If _par is + * an element, be it BODY, then it creates a non-popup calendar (still + * hidden). Some properties need to be set before calling this function. + */ +Calendar.prototype.create = function (_par) { + var parent = null; + if (! _par) { + // default parent is the document body, in which case we create + // a popup calendar. + parent = document.getElementsByTagName("body")[0]; + this.isPopup = true; + } else { + parent = _par; + this.isPopup = false; + } + this.date = this.dateStr ? new Date(this.dateStr) : new Date(); + + var table = Calendar.createElement("table"); + this.table = table; + table.cellSpacing = 0; + table.cellPadding = 0; + table.calendar = this; + Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown); + + var div = Calendar.createElement("div"); + this.element = div; + div.className = "calendar"; + if (this.isPopup) { + div.style.position = "absolute"; + div.style.display = "none"; + } + div.appendChild(table); + + var thead = Calendar.createElement("thead", table); + var cell = null; + var row = null; + + var cal = this; + var hh = function (text, cs, navtype) { + cell = Calendar.createElement("td", row); + cell.colSpan = cs; + cell.className = "button"; + Calendar._add_evs(cell); + cell.calendar = cal; + cell.navtype = navtype; + if (text.substr(0, 1) != "&") { + cell.appendChild(document.createTextNode(text)); + } + else { + // FIXME: dirty hack for entities + cell.innerHTML = text; + } + return cell; + }; + + row = Calendar.createElement("tr", thead); + row.className = "headrow"; + + hh("-", 1, 100).ttip = Calendar._TT["TOGGLE"]; + this.title = hh("", this.isPopup ? 5 : 6, 300); + this.title.className = "title"; + if (this.isPopup) { + this.title.ttip = Calendar._TT["DRAG_TO_MOVE"]; + this.title.style.cursor = "move"; + hh("X", 1, 200).ttip = Calendar._TT["CLOSE"]; + } + + row = Calendar.createElement("tr", thead); + row.className = "headrow"; + + hh("«", 1, -2).ttip = Calendar._TT["PREV_YEAR"]; + hh("‹", 1, -1).ttip = Calendar._TT["PREV_MONTH"]; + hh(Calendar._TT["TODAY"], 3, 0).ttip = Calendar._TT["GO_TODAY"]; + hh("›", 1, 1).ttip = Calendar._TT["NEXT_MONTH"]; + hh("»", 1, 2).ttip = Calendar._TT["NEXT_YEAR"]; + + // day names + row = Calendar.createElement("tr", thead); + row.className = "daynames"; + this.daynames = row; + for (var i = 7; i > 0; --i) { + cell = Calendar.createElement("td", row); + cell.appendChild(document.createTextNode("")); + if (!i) { + cell.navtype = 100; + cell.calendar = this; + Calendar._add_evs(cell); + } + } + this._displayWeekdays(); + + var tbody = Calendar.createElement("tbody", table); + this.tbody = tbody; + + for (i = 6; i > 0; --i) { + row = Calendar.createElement("tr", tbody); + for (var j = 7; j > 0; --j) { + cell = Calendar.createElement("td", row); + cell.appendChild(document.createTextNode("")); + cell.calendar = this; + Calendar._add_evs(cell); + } + } + + var tfoot = Calendar.createElement("tfoot", table); + + row = Calendar.createElement("tr", tfoot); + row.className = "footrow"; + + cell = hh(Calendar._TT["SEL_DATE"], 7, 300); + cell.className = "ttip"; + if (this.isPopup) { + cell.ttip = Calendar._TT["DRAG_TO_MOVE"]; + cell.style.cursor = "move"; + } + this.tooltips = cell; + + div = Calendar.createElement("div", this.element); + this.monthsCombo = div; + div.className = "combo"; + for (i = 0; i < Calendar._MN.length; ++i) { + var mn = Calendar.createElement("div"); + mn.className = "label"; + mn.month = i; + mn.appendChild(document.createTextNode(Calendar._MN3[i])); + div.appendChild(mn); + } + + div = Calendar.createElement("div", this.element); + this.yearsCombo = div; + div.className = "combo"; + for (i = 12; i > 0; --i) { + var yr = Calendar.createElement("div"); + yr.className = "label"; + yr.appendChild(document.createTextNode("")); + div.appendChild(yr); + } + + this._init(this.mondayFirst, this.date); + parent.appendChild(this.element); +}; + +/** + * (RE)Initializes the calendar to the given date and style (if mondayFirst is + * true it makes Monday the first day of week, otherwise the weeks start on + * Sunday. + */ +Calendar.prototype._init = function (mondayFirst, date) { + var today = new Date(); + var year = date.getFullYear(); + if (year < this.minYear) { + year = this.minYear; + date.setFullYear(year); + } else if (year > this.maxYear) { + year = this.maxYear; + date.setFullYear(year); + } + this.mondayFirst = mondayFirst; + this.date = new Date(date); + var month = date.getMonth(); + var mday = date.getDate(); + var no_days = date.getMonthDays(); + date.setDate(1); + var wday = date.getDay(); + var MON = mondayFirst ? 1 : 0; + var SAT = mondayFirst ? 5 : 6; + var SUN = mondayFirst ? 6 : 0; + if (mondayFirst) { + wday = (wday > 0) ? (wday - 1) : 6; + } + var iday = 1; + var row = this.tbody.firstChild; + var MN = Calendar._MN3[month]; + var hasToday = ((today.getFullYear() == year) && (today.getMonth() == month)); + var todayDate = today.getDate(); + for (var i = 0; i < 6; ++i) { + if (iday > no_days) { + row.className = "emptyrow"; + row = row.nextSibling; + continue; + } + var cell = row.firstChild; + row.className = "daysrow"; + for (var j = 0; j < 7; ++j) { + if ((!i && j < wday) || iday > no_days) { + cell.className = "emptycell"; + cell = cell.nextSibling; + continue; + } + cell.firstChild.data = iday; + cell.className = "day"; + cell.disabled = false; + if (typeof this.checkDisabled == "function") { + date.setDate(iday); + if (this.checkDisabled(date)) { + cell.className += " disabled"; + cell.disabled = true; + } + } + if (!cell.disabled) { + cell.caldate = iday; + cell.ttip = "_"; + if (iday == mday) { + cell.className += " selected"; + this.currentDateEl = cell; + } + if (hasToday && (iday == todayDate)) { + cell.className += " today"; + cell.ttip += Calendar._TT["PART_TODAY"]; + } + if (wday == SAT || wday == SUN) { + cell.className += " weekend"; + } + } + ++iday; + ((++wday) ^ 7) || (wday = 0); + cell = cell.nextSibling; + } + row = row.nextSibling; + } + this.title.firstChild.data = Calendar._MN[month] + ", " + year; + // PROFILE + // this.tooltips.firstChild.data = "Generated in " + ((new Date()) - today) + " ms"; +}; + +/** + * Calls _init function above for going to a certain date (but only if the + * date is different than the currently selected one). + */ +Calendar.prototype.setDate = function (date) { + if (!date.equalsTo(this.date)) { + this._init(this.mondayFirst, date); + } +}; + +/** Modifies the "mondayFirst" parameter (EU/US style). */ +Calendar.prototype.setMondayFirst = function (mondayFirst) { + this._init(mondayFirst, this.date); + this._displayWeekdays(); +}; + +/** + * Allows customization of what dates are enabled. The "unaryFunction" + * parameter must be a function object that receives the date (as a JS Date + * object) and returns a boolean value. If the returned value is true then + * the passed date will be marked as disabled. + */ +Calendar.prototype.setDisabledHandler = function (unaryFunction) { + this.checkDisabled = unaryFunction; +}; + +/** Customization of allowed year range for the calendar. */ +Calendar.prototype.setRange = function (a, z) { + this.minYear = a; + this.maxYear = z; +}; + +/** Calls the first user handler (selectedHandler). */ +Calendar.prototype.callHandler = function () { + if (this.onSelected) { + this.onSelected(this, this.date.print(this.dateFormat)); + } +}; + +/** Calls the second user handler (closeHandler). */ +Calendar.prototype.callCloseHandler = function () { + if (this.onClose) { + this.onClose(this); + } + this.hideShowCovered(); +}; + +/** Removes the calendar object from the DOM tree and destroys it. */ +Calendar.prototype.destroy = function () { + var el = this.element.parentNode; + el.removeChild(this.element); + Calendar._C = null; + delete el; +}; + +/** + * Moves the calendar element to a different section in the DOM tree (changes + * its parent). + */ +Calendar.prototype.reparent = function (new_parent) { + var el = this.element; + el.parentNode.removeChild(el); + new_parent.appendChild(el); +}; + +/** Shows the calendar. */ +Calendar.prototype.show = function () { + this.element.style.display = "block"; + this.hideShowCovered(); +}; + +/** + * Hides the calendar. Also removes any "hilite" from the class of any TD + * element. + */ +Calendar.prototype.hide = function () { + var trs = this.table.getElementsByTagName("td"); + for (var i = trs.length; i > 0; ) { + Calendar.removeClass(trs[--i], "hilite"); + } + this.element.style.display = "none"; +}; + +/** + * Shows the calendar at a given absolute position (beware that, depending on + * the calendar element style -- position property -- this might be relative + * to the parent's containing rectangle). + */ +Calendar.prototype.showAt = function (x, y) { + var s = this.element.style; + s.left = x + "px"; + s.top = y + "px"; + this.show(); +}; + +/** Shows the calendar near a given element. */ +Calendar.prototype.showAtElement = function (el) { + var p = Calendar.getAbsolutePos(el); + + var cw = 190; + var ch = -200; + + if (Calendar.is_ie) + { + var posX = getWndX(el) + el.offsetWidth + 18; if (posX + ch > document.body.scrollLeft + document.body.offsetWidth) posX = document.body.scrollLeft + document.body.offsetWidth - ch + var posY = p.y + el.offsetHeight; if (posY + cw > document.body.scrollTop + document.body.offsetHeight) posY = getWndY(el) - cw; + //document.body.scrollTop + document.body.offsetHeight - cw - el.offsetHeight + this.showAt(posX, posY); + } + else + { + // for other browsers types + this.showAt(getWndX(el) + el.offsetWidth + 30, p.y + el.offsetHeight-200); + } +}; + +function getWndC(object, c) +{ + pos = 0; + while (object != null) + { + pos += (c == "y") ? object.offsetTop : object.offsetLeft; + object = object.offsetParent; + } + return pos; +} + +function getWndX(object) {return getWndC(object, "x")} +function getWndY(object) {return getWndC(object, "y")} + + +/** Customizes the date format. */ +Calendar.prototype.setDateFormat = function (str) { + this.dateFormat = str; +}; + +/** Customizes the tooltip date format. */ +Calendar.prototype.setTtDateFormat = function (str) { + this.ttDateFormat = str; +}; + +/** + * Tries to identify the date represented in a string. If successful it also + * calls this.setDate which moves the calendar to the given date. + */ +Calendar.prototype.parseDate = function (str, fmt) { + var y = 0; + var m = -1; + var d = 0; + var a = str.split(/\W+/); + if (!fmt) { + fmt = this.dateFormat; + } + var b = fmt.split(/\W+/); + var i = 0, j = 0; + for (i = 0; i < a.length; ++i) { + if (b[i] == "D" || b[i] == "DD") { + continue; + } + if (b[i] == "d" || b[i] == "dd") { + d = a[i]; + } + if (b[i] == "m" || b[i] == "mm") { + m = a[i]-1; + } + if (b[i] == "y") { + y = a[i]; + } + if (b[i] == "yy") { + y = parseInt(a[i]) + 1900; + } + if (b[i] == "M" || b[i] == "MM") { + for (j = 0; j < 12; ++j) { + if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } + } + } + } + if (y != 0 && m != -1 && d != 0) { + this.setDate(new Date(y, m, d)); + return; + } + y = 0; m = -1; d = 0; + for (i = 0; i < a.length; ++i) { + if (a[i].search(/[a-zA-Z]+/) != -1) { + var t = -1; + for (j = 0; j < 12; ++j) { + if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } + } + if (t != -1) { + if (m != -1) { + d = m+1; + } + m = t; + } + } else if (parseInt(a[i]) <= 12 && m == -1) { + m = a[i]-1; + } else if (parseInt(a[i]) > 31 && y == 0) { + y = a[i]; + } else if (d == 0) { + d = a[i]; + } + } + if (y == 0) { + var today = new Date(); + y = today.getFullYear(); + } + if (m != -1 && d != 0) { + this.setDate(new Date(y, m, d)); + } +}; + +Calendar.prototype.hideShowCovered = function () { + var tags = new Array("applet", "iframe", "select"); + var el = this.element; + + var p = Calendar.getAbsolutePos(el); + var EX1 = p.x; + var EX2 = el.offsetWidth + EX1; + var EY1 = p.y; + var EY2 = el.offsetHeight + EY1; + + for (var k = tags.length; k > 0; ) { + var ar = document.getElementsByTagName(tags[--k]); + var cc = null; + + for (var i = ar.length; i > 0;) { + cc = ar[--i]; + + p = Calendar.getAbsolutePos(cc); + var CX1 = p.x; + var CX2 = cc.offsetWidth + CX1; + var CY1 = p.y; + var CY2 = cc.offsetHeight + CY1; + + if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { + cc.style.visibility = "visible"; + } else { + cc.style.visibility = "hidden"; + } + } + } +}; + +/** Internal function; it displays the bar with the names of the weekday. */ +Calendar.prototype._displayWeekdays = function () { + var MON = this.mondayFirst ? 0 : 1; + var SUN = this.mondayFirst ? 6 : 0; + var SAT = this.mondayFirst ? 5 : 6; + var cell = this.daynames.firstChild; + for (var i = 0; i < 7; ++i) { + cell.className = "day name"; + if (!i) { + cell.ttip = this.mondayFirst ? Calendar._TT["SUN_FIRST"] : Calendar._TT["MON_FIRST"]; + cell.navtype = 100; + cell.calendar = this; + Calendar._add_evs(cell); + } + if (i == SUN || i == SAT) { + Calendar.addClass(cell, "weekend"); + } + cell.firstChild.data = Calendar._DN3[i + 1 - MON]; + cell = cell.nextSibling; + } +}; + +/** Internal function. Hides all combo boxes that might be displayed. */ +Calendar.prototype._hideCombos = function () { + this.monthsCombo.style.display = "none"; + this.yearsCombo.style.display = "none"; +}; + +/** Internal function. Starts dragging the element. */ +Calendar.prototype._dragStart = function (ev) { + if (this.dragging) { + return; + } + this.dragging = true; + var posX; + var posY; + if (Calendar.is_ie) { + posY = window.event.clientY + document.body.scrollTop; + posX = window.event.clientX + document.body.scrollLeft; + } else { + posY = ev.clientY + window.scrollY; + posX = ev.clientX + window.scrollX; + } + var st = this.element.style; + this.xOffs = posX - parseInt(st.left); + this.yOffs = posY - parseInt(st.top); + with (Calendar) { + addEvent(document, "mousemove", calDragIt); + addEvent(document, "mouseover", stopEvent); + addEvent(document, "mouseup", calDragEnd); + } +}; + +// BEGIN: DATE OBJECT PATCHES + +/** Adds the number of days array to the Date object. */ +Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); + +/** Returns the number of days in the current month */ +Date.prototype.getMonthDays = function() { + var year = this.getFullYear(); + var month = this.getMonth(); + if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { + return 29; + } else { + return Date._MD[month]; + } +}; + +/** Checks dates equality (ignores time) */ +Date.prototype.equalsTo = function(date) { + return ((this.getFullYear() == date.getFullYear()) && + (this.getMonth() == date.getMonth()) && + (this.getDate() == date.getDate())); +}; + +/** Prints the date in a string according to the given format. */ +Date.prototype.print = function (frm) { + var str = new String(frm); + var m = this.getMonth(); + var d = this.getDate(); + var y = this.getFullYear(); + var w = this.getDay(); + var s = new Array(); + s["d"] = d; + s["dd"] = (d < 10) ? ("0" + d) : d; + s["m"] = 1+m; + s["mm"] = (m < 9) ? ("0" + (1+m)) : (1+m); + s["y"] = y; + s["yy"] = new String(y).substr(2, 2); + with (Calendar) { + s["D"] = _DN3[w]; + s["DD"] = _DN[w]; + s["M"] = _MN3[m]; + s["MM"] = _MN[m]; + } + var re = /(.*)(\W|^)(d|dd|m|mm|y|yy|MM|M|DD|D)(\W|$)(.*)/; + while (re.exec(str) != null) { + str = RegExp.$1 + RegExp.$2 + s[RegExp.$3] + RegExp.$4 + RegExp.$5; + } + return str; +}; + +// END: DATE OBJECT PATCHES +/**/ +/**/ +Calendar._DN = new Array +("Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday"); +Calendar._MN = new Array +("January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Toggle first day of week"; +Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)"; +Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)"; +Calendar._TT["GO_TODAY"] = "Go Today"; +Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)"; +Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)"; +Calendar._TT["SEL_DATE"] = "Select date"; +Calendar._TT["DRAG_TO_MOVE"] = "Drag to move"; +Calendar._TT["PART_TODAY"] = " (today)"; +Calendar._TT["MON_FIRST"] = "Display Monday first"; +Calendar._TT["SUN_FIRST"] = "Display Sunday first"; +Calendar._TT["CLOSE"] = "Close"; +Calendar._TT["TODAY"] = "Today"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "D, M d"; +/**/ +/**/ +document.write("") +/* The main calendar widget. DIV containing a table. */ + Index: trunk/admin/editor/FCKeditor/js/fck_contextmenu.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_contextmenu.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_contextmenu.js (revision 13) @@ -0,0 +1,160 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_contextmenu.js: Right click support. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +// Contants +var MENU_SEPARATOR = "" ; // Context menu separator + +// The last context menu +var ContextMenu = new Array() ; + +// Avaliable context menu options +var GeneralContextMenu = new Array() ; +var TableContextMenu = new Array() ; +var LinkContextMenu = new Array() ; + +function ContextMenuSeparator() +{ + this.Text = MENU_SEPARATOR ; +} + +// Class that represents an item on the context menu +function ContextMenuItem(text, command, commandType) +{ + this.Text = text ; + this.Command = command || "void(0)" ; + this.CommandType = commandType || TBCMD_DEC ; + + switch (this.CommandType) + { + case TBCMD_DEC : + this.Command = "decCommand(" + command + ")" ; + this.CommandId = command ; + break ; + case TBCMD_DOC : + this.Command = "docCommand('" + command + "')" ; + this.CommandCode = command ; + break ; + default : // TBCMD_CUSTOM + this.Command = command ; + break ; + } +} + + +GeneralContextMenu[0] = new ContextMenuItem(lang["Cut"], DECMD_CUT) ; +GeneralContextMenu[1] = new ContextMenuItem(lang["Copy"], DECMD_COPY) ; +GeneralContextMenu[2] = new ContextMenuItem(lang["Paste"], DECMD_PASTE) ; + +LinkContextMenu[0] = new ContextMenuSeparator() ; +LinkContextMenu[1] = new ContextMenuItem(lang["EditLink"], "dialogLink()", TBCMD_CUSTOM) ; +LinkContextMenu[2] = new ContextMenuItem(lang["RemoveLink"], DECMD_UNLINK) ; + +TableContextMenu[0] = new ContextMenuSeparator() ; +TableContextMenu[1] = new ContextMenuItem(lang["InsertRow"], DECMD_INSERTROW) ; +TableContextMenu[2] = new ContextMenuItem(lang["DeleteRows"], DECMD_DELETEROWS) ; +TableContextMenu[3] = new ContextMenuSeparator() ; +TableContextMenu[4] = new ContextMenuItem(lang["InsertColumn"], DECMD_INSERTCOL) ; +TableContextMenu[5] = new ContextMenuItem(lang["DeleteColumns"], DECMD_DELETECOLS) ; +TableContextMenu[6] = new ContextMenuSeparator() ; +TableContextMenu[7] = new ContextMenuItem(lang["InsertCell"], DECMD_INSERTCELL) ; +TableContextMenu[8] = new ContextMenuItem(lang["DeleteCells"], DECMD_DELETECELLS) ; +TableContextMenu[9] = new ContextMenuItem(lang["MergeCells"], DECMD_MERGECELLS) ; +TableContextMenu[10] = new ContextMenuItem(lang["SplitCell"], DECMD_SPLITCELL) ; +TableContextMenu[11] = new ContextMenuSeparator() ; +TableContextMenu[12] = new ContextMenuItem(lang["CellProperties"], "dialogTableCell()", TBCMD_CUSTOM) ; +TableContextMenu[13] = new ContextMenuItem(lang["TableProperties"], "dialogTable(true)", TBCMD_CUSTOM) ; + +function showContextMenu() +{ + // Resets the context menu. + ContextMenu = new Array() ; + + var i ; + var index = 0; + + // Always show general menu options + for ( i = 0 ; i < GeneralContextMenu.length ; i++ ) + { + ContextMenu[index++] = GeneralContextMenu[i] ; + } + + // If over a link + if (checkDecCommand(DECMD_UNLINK) == OLE_TRISTATE_UNCHECKED) + { + for ( i = 0 ; i < LinkContextMenu.length ; i++ ) + { + ContextMenu[index++] = LinkContextMenu[i] ; + } + } + + // If inside a table, load table menu options + if (objContent.QueryStatus(DECMD_INSERTROW) != DECMDF_DISABLED) + { + for ( i = 0 ; i < TableContextMenu.length ; i++ ) + { + ContextMenu[index++] = TableContextMenu[i] ; + } + } + + // Verifies if the selection is a TABLE or IMG + var sel = objContent.DOM.selection.createRange() ; + var sTag ; + if (objContent.DOM.selection.type != 'Text' && sel.length == 1) + sTag = sel.item(0).tagName ; + + if (sTag == "TABLE") + { + ContextMenu[index++] = new ContextMenuSeparator() ; + ContextMenu[index++] = new ContextMenuItem(lang["TableProperties"], "dialogTable()", TBCMD_CUSTOM) ; + } + else if (sTag == "IMG") + { + ContextMenu[index++] = new ContextMenuSeparator() ; + ContextMenu[index++] = new ContextMenuItem(lang["ImageProperties"], "dialogImage()", TBCMD_CUSTOM) ; + } + + // Set up the actual arrays that get passed to SetContextMenu + var menuStrings = new Array() ; + var menuStates = new Array() ; + for ( i = 0 ; i < ContextMenu.length ; i++ ) + { + menuStrings[i] = ContextMenu[i].Text ; + + if (menuStrings[i] != MENU_SEPARATOR) + switch (ContextMenu[i].CommandType) + { + case TBCMD_DEC : + menuStates[i] = checkDecCommand(ContextMenu[i].CommandId) ; + break ; + case TBCMD_DOC : + menuStates[i] = checkDocCommand(ContextMenu[i].CommandCode) ; + break ; + default : + menuStates[i] = OLE_TRISTATE_UNCHECKED ; + break ; + } + else + menuStates[i] = OLE_TRISTATE_CHECKED ; + } + + // Set the context menu + objContent.SetContextMenu(menuStrings, menuStates); +} + +function contextMenuAction(itemIndex) +{ + eval(ContextMenu[itemIndex].Command) ; +} \ No newline at end of file Index: trunk/themes/default/search_results.tpl =================================================================== diff -u --- trunk/themes/default/search_results.tpl (revision 0) +++ trunk/themes/default/search_results.tpl (revision 13) @@ -0,0 +1,194 @@ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +



+ + + + + + + + + + + +

+ + + + + + +

"> > + + + + + + + +
" width="18" height="12" alt="" />
   
+
+ +

+ + + + + + + + + + +

+
+ + + + + + + + +
+ + + + + + + +

 
+ + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+

+
+
"> + " class="input" style="width: 235px;">  + " class="button">
+ "> + +


+

+ + + + + + + + + +

+ + + + +
+
+



+ + + + + + + + + + +
+ + + + + + + +
+

()

+

+ + + + + + + + +

+ +
+ +
+

+ +

+ +


+
+ + + Index: trunk/kernel/admin/include/toolbar/configure_users.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/configure_users.php (revision 0) +++ trunk/kernel/admin/include/toolbar/configure_users.php (revision 13) @@ -0,0 +1,20 @@ + + Index: trunk/admin/import/import.php =================================================================== diff -u --- trunk/admin/import/import.php (revision 0) +++ trunk/admin/import/import.php (revision 13) @@ -0,0 +1,927 @@ +Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +print_pre($_REQUEST); +if ($_POST["Action"]=="Import") +{ + $objSession->SetVariable("import_user_admin",$_POST["user_admin"]); + $objSession->SetVariable("import_user_regular",$_POST["user_regular"]); + $objSession->SetVariable("import_init_cat",$_POST["init_cat"]); + $objSession->SetVariable("image_name",$_POST["image_name"]); + + $objSession->SetVariable("importtodo","initialize"); + $objSession->SetVariable("importstart",0); + $objSession->SetVariable("importtotal",0); + + if((int)$_POST["init_cat"]>0) + { + $c = $objCatList->GetItemByField("ResourceId",(int)$_POST["init_cat"]); + $c->UpdateACL(); + $c->UpdateCachedPath(); + } + + +} + $allgroups = $objGroups->GetAllGroupList(); + + $inlink_sql_type=$objSession->GetVariable("import_inlink_sql_type"); + $inlink_server=$objSession->GetVariable("import_inlink_server"); + $inlink_db=$objSession->GetVariable("import_inlink_db"); + $inlink_user=$objSession->GetVariable("import_inlink_user"); + $inlink_pass=$objSession->GetVariable("import_inlink_pass"); + + $user_admin=$objSession->GetVariable("import_user_admin"); + $user_regular=$objSession->GetVariable("import_user_regular"); + if(!is_object($c)) + $c = $objCatList->GetItemByField("ResourceId",$objSession->GetVariable("import_init_cat")); + $init_cat= $c->Get("CategoryId"); + $image_name=$objSession->GetVariable("image_name"); + $start = $objSession->GetVariable("importstart"); + $acl = explode(",",$c->GetACL("CATEGORY.VIEW")); + +//IN-LINK connection +$linkconn=&ADONewConnection($inlink_sql_type); +$linkconn->PConnect($inlink_server, $inlink_user, $inlink_pass, $inlink_db); +if(!$linkconn) +{ echo "Database connection failed. DB Type: $sql_type, DB Server: $inlink_server, DB User: $inlink_user, DB Name: $inlink_db"; //fatal; + echo $linkconn->ErrorMsg(); + die(); +} +if($pconnect) +{ + $linkconn->Close(); + $linkconn = ADONewConnection($inlink_sql_type); + $linkconn->PConnect($inlink_server, $inlink_user, $inlink_pass, $inlink_db); +} + +//admin only util +$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"); +//Set Section +$section = "in-portal:inlink_inport"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); + +$title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 4"; + +//In-Portal +$portalconn = GetAdodbConnection(); +$TablePrefix = "ses_".$objSession->GetSessionKey()."_".GetTablePrefix(); + +$olddbname=$inlink_db; +//$newdbname="inportal"; +$newdbname=$g_DBName; +##############creating a temproary table have to be here +if ($_POST["Action"]=="Import") +{ + $portalconn->Execute("DROP TABLE ".$TablePrefix."import"); + $portalconn->Execute("DROP TABLE ".$TablePrefix."importcat"); + $temptable = "CREATE TABLE ".$TablePrefix."import (otname varchar(40), oid int(11), ocustomid int(11), oparentid int(11), ntname varchar(40), nid int(11), nrid int(11), npid int(11)) "; + + $portalconn->Execute($temptable); + $cattable ="CREATE TABLE ".$TablePrefix."importcat (op int(11), np int(11), flag int(11)) "; + $portalconn->Execute($cattable); + $newcat = 1; +} + +global $admin, $pathtoroot; + +require_once ($pathtoroot.$admin."/import/status.php"); #for status bar and all visual effects + + +$todo= $objSession->GetVariable("importtodo"); + +$total = $objSession->GetVariable("importtotal"); +switch ($todo) +{ + case "users": + status($start, $total, "users"); + usersimport(); + + //setstart(0,"cats"); #for debugging + break; + case "cats": + status($start, $total, "cats"); + catmanager(); + #setstart(0,"links"); #for debugging + break; + case "links": + status($start, $total, "links"); + linksimport(); + #setstart(0,"custom");#For debugging only + break; + case "custom": + status($start, $total, "custom"); + customimport(); + #setstart(0,"relcat");#for debuggin only + break; + case "relcat": + status($start, $total, "relcat"); + relcatimport(); + #setstart(0,"terminate"); #for debuggin only + break; + case "terminate": + terminator(); + status(1,1,"terminate"); + break; + default: + status(0,0,"initializing"); + setstart(0,"users"); #to start importing from users first + break; +} + + function terminator() + { + global $portalconn; + $query="DROP TABLE IF EXISTS ".$TablePrefix."import, ".$TablePrefix."importcat"; + $portalconn->Execute($query); + } + + function reload() + { + global $newurl; + print ''; + } + function setstart($mystart, $part) + { + global $objSession; + + $objSession->SetVariable("importstart",$mystart); + $objSession->SetVariable("importtodo",$part); + reload(); + } + function settotal($total) + { + global $objSession; + $objSession->SetVariable("importtotal",$total); + } + +//users import from inlink to inportal + function usersimport() + { + global $objUsers, $objSession, $linkconn, $portalconn, $olddbname, + $user_admin,$objGroups, $user_regular, $start; + + $counter = 0; + $limit = 350; + $oldtablename = "inl_users"; + $newtablename = $objUsers->SourceTable; + if ($start == 0) + { + $query="select count(*) as NumUsers from inl_users"; + $row =$linkconn->Execute($query); + if ($row && !$row->EOF) + { + settotal($row->fields["NumUsers"]); + + } + } + $query="select * from inl_users LIMIT $start, $limit"; + $row =$linkconn->Execute($query); + while($row && !$row->EOF) + { + $counter++; #needed to know when close to time out + + if ($row->fields['user_name'] != "root") { + $olduserid=$row->fields["user_id"]; + //$Login, $Password, $Email, $CreatedOn, $FirstName="", $LastName="", $Status=2, + // $Phone="", $Street="", $City="", $State="", $Zip="", $Country="" + + if($row->fields["user_status"]==1) + { + $Status=1; + } + else + { + if($row->fields["user_pend"]==0) + { + $Status=2; + } + else + $Status=0; + } + $u = $objUsers->Add_User( $row->fields["user_name"], $row->fields["user_pass"], $row->fields["email"], + $row->fields["user_date"], $row->fields["first"], $row->fields["last"], + $Status); + $oldid=$row->fields["user_id"]; + $oldcustom=$row->fields["user_cust"]; + $newid=$u->Get("PortalUserId"); + $resid=$u->Get("ResourceId"); + #adding user to usergroup + + $userpermission = $row->fields["user_perm"]; + if ($userpermission==2 || $userpermission==1) + { + $glist = explode(",",$user_admin); + $Primary=1; + for($i=0;$iGetItem($glist[$i]); + $group->AddUser($newid,$Primary); + $Primary = 0; + } + } + else + { + $glist = explode(",",$user_regular); + $Primary=1; + for($i=0;$iGetItem($glist[$i]); + $group->AddUser($newid,$Primary); + $Primary = 0; + } + } + //$group=$objGroups->GetItem($g); + //$group->AddUser($newid,1); + + #inserting values to the temproary table + $totemp = "INSERT INTO ".$TablePrefix."import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) "; + $tovalues= " VALUES ('$oldtablename',$olduserid,$oldcustom,0,'$newtablename', $newid, $resid, 0 )"; + $totemp=$totemp.$tovalues; + $portalconn->Execute($totemp); + } + $row->moveNext(); + } + if ($counter == $limit) + { + setstart($start+$limit, "users"); + } + else + setstart(0,"cats"); + + } + //END OF USERS IMPORT ^^^^^^^^^^^^^^^^^^^^^ + +//Categories Import + function catmanager() + { + global $portalconn, $init_cat,$start; + if ($start == 0) + { + $counter = catimport(0,$init_cat); + setstart($counter,"cats"); + $portalconn->Execute("UPDATE ".$TablePrefix."importcat SET flag=1 WHERE np=$init_cat"); + } + else + { + + $query="select * from ".$TablePrefix."importcat WHERE flag=0 LIMIT 0,1"; + $row =$portalconn->Execute($query); + if($row && !$row->EOF) + { + $oldid= $row->fields["op"]; + $newid = $row->fields["np"]; + $counter= catimport($oldid,$newid); + $query2="UPDATE ".$TablePrefix."importcat SET flag=1 WHERE op=$oldid and np=$newid"; + $portalconn->Execute($query2); + setstart($counter+$start-1,"cats"); + $x=5; + } + else + { + setstart(0,"links"); + } + } + } + #pushes into the quque + function pushid($op,$np) + { + global $linkconn, $portalconn; + $addnew = "INSERT INTO ".$TablePrefix."importcat (op,np,flag) VALUES ($op,$np,0)"; + $portalconn->Execute($addnew); + + } + function checkifexist($id) + { + global $linkconn; + $addnew = "select * from inl_cats where cat_sub=$id"; + $row =$linkconn->Execute($addnew); + if ($row && !$row->EOF) + { + + if ($row->fields["cat_id"] !=0) + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } + #import itself + function catimport($oldparentid, $parentid) + { + global $objCatList, $linkconn, $objUsers, $linkconn, $portalconn, + $olddbname, $user_admin,$objGroups, $user_regular, $acl,$allgroups, $c, $start; + $counter=0; + + $objCacheCount = new clsCacheCountList(); + if ($start == 0) + { + $query="select count(*) as CatCount from inl_cats"; + $row =$linkconn->Execute($query); + if ($row && !$row->EOF) + { + settotal($row->fields["CatCount"]); + $catcount = $row->fields["CatCount"]; + $catcount += (int)$c->Get("CachedDescendantCatsQty"); + $c->Set("CachedDescendantCatsQty",$catcount); + $c->Update(); + + } + } + + $query="select * from inl_cats WHERE cat_sub=$oldparentid"; + $oldtablename = "inl_cats"; + $newtablename = "Category"; + $row =$linkconn->Execute($query); + if($row && !$row->EOF) + { + $RowCount = $row->NumRows(); + $ResInc = $RowCount; + $ResourceId = GetNextResourceId($ResInc); + } + if($parentid>0) + { + $ParentCat = new clsCategory($parentid); + $Path = $ParentCat->Get("ParentPath"); + } + while($row && !$row->EOF) + { + $counter++; + + $cat = new clsCategory(); + if($row->fields["cat_pend"]==0) + { + $Status=1; + } + else + { + if($row->fields["cat_vis"]==0) + { + $Status=2; + } + else + $Status=0; + } + $CreatedById = getnewid($row->fields["cat_id"]); + $cat->Set(array("ParentId", "Name", "Description", "CreatedOn", "EditorsPick", "Status", "HotItem", + "NewItem","PopItem", "Priority", "MetaKeywords", "MetaDescription", "CreatedById", + "CachedDescendantCatsQty"), + array($parentid, $row->fields["cat_name"], $row->fields["cat_desc"], + $row->fields["cat_date"], (int)$row->fields["cat_pick"], $Status, 2, 2, 2, 0, + $row->fields["meta_keywords"],$row->fields["meta_desc"], + (int)$CreatedById,(int)$row->fields["cat_cats"])); + $cat->Set("ResourceId",$ResourceId); + $ResourceId++; + $cat->Create(); + + $FullPath = $Path.$cat->Get("CategoryId")."|"; + $cat->Set("ParentPath",$FullPath); + $cat->SetViewPerms("CATEGORY.VIEW",$acl,$allgroups); + $cat->Update(); + $cat->UpdateCachedPath(); + + $objCacheCount->CategoryId= $cat->Get("CategoryId"); + $objCacheCount->SetValue(0,0,0,0,0); + + $newid = $cat->Get("CategoryId"); + $resid = $cat->Get("ResourceId"); + $oldid = $row->fields["cat_id"]; + $oldcustom = $row->fields["cat_cust"]; + $oldpid = $row->fields["cat_sub"]; + + #inserting values to the temproary table + $totemp = "INSERT INTO ".$TablePrefix."import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) "; + $tovalues= " VALUES ('$oldtablename',$oldid,$oldcustom,$oldpid,'$newtablename', $newid, $resid, $parentid )"; + $totemp=$totemp.$tovalues; + $portalconn->Execute($totemp); + + #pushes into the queue + if(checkifexist($oldid)) + { + pushid($oldid,$newid); + } + $row->moveNext(); + } + return $counter; + } + +//Links Import + function linksimport() + { + global $objLinkList, $init_cat, $linkconn, $portalconn, $olddbname, + $user_admin,$objGroups, $user_regular, $start; + $limit = 750; #need to change to a higher number like 100, forty is only for debugging + $counter = 0; + set_time_limit(0); + if ($start == 0) + { + $query="select count(*) as LinkCount from inl_lc"; + $row =$linkconn->Execute($query); + if ($row && !$row->EOF) + { + settotal($row->fields["LinkCount"]); + + } + } + + $query="select * from inl_lc INNER JOIN inl_links ON (inl_lc.link_id=inl_links.link_id) limit $start,$limit"; + $oldtablename="inl_links"; + $newtablename="link"; + $row =$linkconn->Execute($query); + if($row && !$row->EOF) + { + $RowCount = $row->NumRows(); + $ResInc = $RowCount; + $ResourceId = GetNextResourceId($ResInc); + } + while($row && !$row->EOF) + { + $counter++; + $oldid=$row->fields["link_id"]; + $flag=1; + + $oldcatid = $row->fields["cat_id"]; + $pending = $row->fields["link_pend"]; + #getting a new category id + $rs = $portalconn->Execute("SELECT nid FROM ".$TablePrefix."import WHERE ntname='Category' and oid=$oldcatid"); + if ($rs && ! $rs->EOF) + { + $categoryid=$rs->fields["nid"]; + } + else + { + $categoryid = $init_cat; + } + + $rs = $portalconn->Execute("SELECT * FROM ".$TablePrefix."import WHERE otname='inl_link' AND oid='$oldid'"); + if($rs && ! $rs->EOF) + { + $NewLinkId = $rs->fields["nid"]; + } + else + $NewLinkId=0; + if ($NewLinkId==0) + { + #gets the new user id of the user who created a link + $newuserid=getnewid($row->fields["link_user"]); + #adds link to the IN-PORTAL + $link = new clsLink(); + if($Pending==0) + { + $Status=1; + } + else + $Status=2; + $link->Set(array("Name", "Description", "Url", "CreatedOn", "Status", "EditorsPick", + "NewItem","PopItem","HotItem", "CreatedById", "CachedRating", + "CachedVotesQty","Hits", "Priority"), + array($row->fields["link_name"], $row->fields["link_desc"], $row->fields["link_url"], $row->fields["link_date"], $Status, + $row->fields["link_pick"], 2, 2, 2, $newuserid, (int)$row->fields["link_rating"], + (int)$row->fields["link_votes"],(int)$row->fields["link_hits"], 0)); + $link->Set("ResourceId",$ResourceId); + $ResourceId++; + $link->Create(); + $link->AddToCategory($categoryid,"",1); + + $newid = $link->Get("LinkId"); + $resid = $link->Get("ResourceId"); + $oldcustom=$row->fields["link_cust"]; + $linkimage =$row->fields["link_image"]; + + if ($linkimage) + { + addimage($resid,$linkimage); + } + + #calls to import reviews + reviewimport($link,$oldid,$resid); + $parentid = 0; + $totemp = "INSERT INTO ".$TablePrefix."import (odb,otname,oid,ocustomid,oparentid,ndb,ntname,nid,nrid,npid) "; + $tovalues= " VALUES ('$olddbname','$oldtablename',$oldid,$oldcustom,$oldcatid,'inportal','$newtablename', $newid, $resid, $parentid )"; + $totemp = $totemp.$tovalues; + //$portalconn->Execute($totemp); + + } + else #if link is related to more than one category + { + $link = new clsLink($NewLinkId); + $link->AddtoCategory($categoryid,"",0); + } + #prelast while + $row->moveNext(); + } + + if ($counter == $limit) + { + setstart($start+$limit, "links"); + } + else + { + setstart(0,"custom"); + } + + } + + #importing image from the in-link + function addimage($resourceid, $imageurl) + { + global $objImageList, $image_name; + #echo "
IMAGE RESOURCEID: $resourceid IMAGE URL: $imageurl
"; + if(!is_object($objImageList)) + $objImageList = new clsImageList(); + + $LocalImage = 0; + $LocalThumb = 0; + if(!strlen($image_name)) + $image_name="inlink_image"; + + $img = $objImageList->Add($image_name,"",$resourceid, 0, 0,"", $imageurl, 1,0, 1, 0,1); + } + #Reviews Import for links + function reviewimport($myclass,$oldid,$rid) + { + global $objCustomFieldList, $linkconn, $portalconn; + #ITEM AddReview($createdBy,$reviewText,0) + + $query="select * from inl_reviews where rev_link= $oldid"; + $row =$linkconn->Execute($query); + while($row && !$row->EOF) + { + $oldreviewuser= $row->fields["rev_user"]; + if($oldreviewuser !=0) #meaning was not created by guest + { + $newrid=getnewid($oldreviewuser); + if ($newrid) + { + $temp=$myclass->AddReview($newrid,$row->fields["rev_text"],0,"127.0.0.1",1, "In-Link"); + + } + else + { + $temp=$myclass->AddReview(0,$row->fields["rev_text"],0,"127.0.0.1",1, "In-Link"); + + } + } + else #meaning was created by guest + { + $temp=$myclass->AddReview(0,$row->fields["rev_text"],0,"127.0.0.1",1, "In-Link"); + + } + $row->moveNext(); + } + } + #HELPER FUNCTION THAT GETS THE NEW ID of the USER + function getnewid($oldid) + { + global $portalconn; + + $query2="select * from ".$TablePrefix."import where otname='inl_users' and oid=".$oldid; + $row2=$portalconn->Execute($query2); + if ($row2->fields["nid"]) + { + return $row2->fields["nid"]; + } + else + { + return 0; + } + } + + + + //^^^^^^^^^^^^^^^^^^^^^^ABOVE IS LINKS IMPORT + + +#########################################Custom Fields Import +#create a new CustomField first and then +#by selecting all and receiving from one record of inl_config the values of cc1,cc2,cc3,cc4,cc5,cc6,uc1,uc2,uc3,uc4,uc5,uc6,lc1,lc2,lc3,lc4,lc5,lc6 +#go through all import table and if ocustomid occures get the row from inl_custom and +#create CustomMetaData field +#--------------------- +#Regarding CustomField: +#FieldName= cc1,cc2 .... from inl_config +#FieldLabel= value of cc1, cc2 .... +#Type=4 for links 6 for users 0 category +#------------ +#Regarding CustomMetaData +#ResourceId <= link id +#CustomFieldId <= id from the top +#Value = Value from the table custom + + //VVVVV BELOW ARE CUSTOM FIELD IMPORT REQUIRES TO HAVE A TEMPROARY TABLE IMPORT + function customimport() + { + global $linkconn, $portalconn, $start; + $limit = 40; #just for debugging purposes, in real life set it to higher number + $counter=0; + if ($start == 0) + { + $r=buildfields(); + $query="SELECT count(*) as cc from ".$TablePrefix."import WHERE NOT ocustomid=0"; + $row =$portalconn->Execute($query); + if ($row && !$row->EOF) + { + settotal($row->fields["cc"]); + + } + } + else + { + $r=getfields(); + } + + $query="SELECT * from ".$TablePrefix."import WHERE ocustomid!=0 limit $start,$limit"; + $row =$portalconn->Execute($query); + while($row && !$row->EOF) + { + $counter++; + if ($row->fields["ocustomid"]!=0) + { + loadcustom($row->fields["ocustomid"],$row->fields["nrid"],$row->fields["otname"],$r); + } + $row->moveNext(); + } + if ($counter == $limit) + { + setstart($start+$limit, "custom"); + } + else + { + setstart(0,"relcat"); + } + } + function loadcustom($customid,$rid,$tablename,$r) + { + global $linkconn, $objCustomDataList, $objSession; + + $objCustomDataList->Clear(); + if ($tablename =="inl_cats") + { + //$myfieldname="cc"; + $fields = explode(",",$objSession->GetVariable("custom_category")); + } + else if($tablename =="inl_users") + { + //$myfieldname="uc"; + $fields = explode(",",$objSession->GetVariable("custom_user")); + } + else if($tablename =="inl_links") + { + //$myfieldname="lc"; + $fields = explode(",",$objSession->GetVariable("custom_links")); + } + + $oldtablename="inl_links"; + $newtablename="link"; + $query="select * from inl_custom Where cust_id=$customid"; + $row =$linkconn->Execute($query); + if ($row) + { + for ($x=0; $xfields["cust".$x]; + if ($cust!="") + { + $fieldid =$r[$fields[$x]]; + $objCustomDataList->SetFieldValue($fieldid,$rid,$cust); + } + } + $objCustomDataList->SaveData(); + } + } + + function buildfields() #building and populating an array + { + global $objCustomFieldList, $objSession,$linkconn; + + $lc="lc"; + $uc="uc"; + $cc="cc"; + $query = "SELECT * FROM inl_config WHERE name LIKE 'uc%'"; + $row =$linkconn->Execute($query); + $names = array(); + while($row && !$row->EOF) + { + $data = $row->fields; + $fieldlabel=$data["name"]; + if(strlen($data["value"])) + { + $fieldlabel = $data["value"]; + } + $f=$objCustomFieldList->AddField(6,$data["name"],$fieldlabel); + $r["'".$data["name"]."'"]=$f->Get("CustomFieldId"); + $objSession->SetVariable("custom_".$data["name"],$f->Get("CustomFieldId")); + $names[] = $data["name"]; + $row->MoveNext(); + } + $objSession->SetVariable("custom_user",implode(",",$names)); + unset($names); + + $names = array(); + $query = "SELECT * FROM inl_config WHERE name LIKE 'cc%'"; + $row =$linkconn->Execute($query); + while($row && !$row->EOF) + { + $data = $row->fields; + $fieldlabel=$data["name"]; + if(strlen($data["value"])) + { + $fieldlabel = $data["value"]; + } + $f=$objCustomFieldList->AddField(1,$data["name"],$fieldlabel); + $r["'".$data["name"]."'"]=$f->Get("CustomFieldId"); + $objSession->SetVariable("custom_".$data["name"],$f->Get("CustomFieldId")); + $names[] = $data["name"]; + $row->MoveNext(); + } + $objSession->SetVariable("custom_category",implode(",",$names)); + unset($names); + + $names = array(); + $query = "SELECT * FROM inl_config WHERE name LIKE 'lc%'"; + $row =$linkconn->Execute($query); + while($row && !$row->EOF) + { + $data = $row->fields; + $fieldlabel=$data["name"]; + if(strlen($data["value"])) + { + $fieldlabel = $data["value"]; + } + $f=$objCustomFieldList->AddField(4,$data["name"],$fieldlabel); + $r["'".$data["name"]."'"]=$f->Get("CustomFieldId"); + $objSession->SetVariable("custom_".$data["name"],$f->Get("CustomFieldId")); + $names[] = $data["name"]; + $row->MoveNext(); + } + $objSession->SetVariable("custom_links",implode(",",$names)); + + return $r; + } + + function getfields() #building and populating an array + { + global $objSession; + + $lc="lc"; + $uc="uc"; + $cc="cc"; + $userfields = explode(",",$objSession->GetVariable("custom_user")); + for ($x=0;$x<=count($userfields);$x++) + { + $r[$userfields[$x]]=$objSession->GetVariable("custom_".$userfields[$x]); + } + $catfields = explode(",",$objSession->GetVariable("custom_category")); + for ($x=0;$x<=count($catfields);$x++) + { + $r[$catfields[$x]]=$objSession->GetVariable("custom_".$catfields[$x]); + } + $linkfields = explode(",",$objSession->GetVariable("custom_links")); + for ($x=0;$x<=count($linkfields);$x++) + { + $r[$linkfields[$x]]=$objSession->GetVariable("custom_".$linkfields[$x]); + } + + return $r; + } + + +################################################Relationships Import + + function relcatimport() + { + global $linkconn,$objSession, $start; + $limit = 100; + $counter =0; + if ($start == 0) + { + $query="SELECT count(*) from inl_rel_cats"; + $row =$linkconn->Execute($query); + if ($row && !$row->EOF) + { + settotal($row->fields[0]); + + } + } + + $objRelList = new clsRelationshipList(); + $query="select * from inl_rel_cats LIMIT $start, $limit"; + $row =$linkconn->Execute($query); + while($row && !$row->EOF) + { + $counter++; + $sourceid = newcatrid($row->fields["cat_id"]); + $targetid = newcatrid($row->fields["rel_id"]); + if ($sourceid !="" && $targetid !="") + { + $r = $objRelList->Add($sourceid, 1,$targetid, 1); + $r->Create(); + } + $row->moveNext(); + } + + if ($counter == $limit) + { + setstart($start+$limit, "relcat"); + } + else + { + setstart(0,"terminate"); + } + + } + function newcatrid($oid) + { + global $portalconn; + $query2="select * from ".$TablePrefix."import where otname='inl_cats' and oid=$oid"; + $row =$portalconn->Execute($query2); + if ($row->fields["nrid"]) + { + return $row->fields["nrid"]; + } + else + { + return ""; + } + } + // END OF RELATIONSHIP IMPORT +?> \ No newline at end of file Index: trunk/themes/default/img/lang/dutch.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/inportal_remove.sql =================================================================== diff -u --- trunk/admin/install/inportal_remove.sql (revision 0) +++ trunk/admin/install/inportal_remove.sql (revision 13) @@ -0,0 +1,99 @@ +DROP TABLE BanRules +# -------------------------------------------------------- +DROP TABLE Category +# -------------------------------------------------------- +DROP TABLE CategoryItems +# -------------------------------------------------------- +DROP TABLE Censorship +# -------------------------------------------------------- +DROP TABLE ConfigurationAdmin +# -------------------------------------------------------- +DROP TABLE ConfigurationValues +# -------------------------------------------------------- +DROP TABLE CountCache +# -------------------------------------------------------- +DROP TABLE CustomField +# -------------------------------------------------------- +DROP TABLE CustomMetaData +# -------------------------------------------------------- +DROP TABLE EmailMessage +# -------------------------------------------------------- +DROP TABLE EmailQueue +# -------------------------------------------------------- +DROP TABLE EmailSubscribers +# -------------------------------------------------------- +DROP TABLE Emoticon +# -------------------------------------------------------- +DROP TABLE Events +# -------------------------------------------------------- +DROP TABLE Favorites +# -------------------------------------------------------- +DROP TABLE IdGenerator +# -------------------------------------------------------- +DROP TABLE IgnoreKeywords +# -------------------------------------------------------- +DROP TABLE Images +# -------------------------------------------------------- +DROP TABLE ItemRating +# -------------------------------------------------------- +DROP TABLE ItemReview +# -------------------------------------------------------- +DROP TABLE ItemTypes +# -------------------------------------------------------- +DROP TABLE Language +# -------------------------------------------------------- +DROP TABLE Link +# -------------------------------------------------------- +DROP TABLE Modules +# -------------------------------------------------------- +DROP TABLE News +# -------------------------------------------------------- +DROP TABLE PermCache +# -------------------------------------------------------- +DROP TABLE PermissionConfig +# -------------------------------------------------------- +DROP TABLE Permissions +# -------------------------------------------------------- +DROP TABLE PersistantSessionData +# -------------------------------------------------------- +DROP TABLE Phrase +# -------------------------------------------------------- +DROP TABLE PhraseCache +# -------------------------------------------------------- +DROP TABLE PortalGroup +# -------------------------------------------------------- +DROP TABLE PortalUser +# -------------------------------------------------------- +DROP TABLE Posting +# -------------------------------------------------------- +DROP TABLE Relationship +# -------------------------------------------------------- +DROP TABLE SearchConfig +# -------------------------------------------------------- +DROP TABLE SearchLog +# -------------------------------------------------------- +DROP TABLE SessionData +# -------------------------------------------------------- +DROP TABLE SpamControl +# -------------------------------------------------------- +DROP TABLE StatItem +# -------------------------------------------------------- +DROP TABLE Theme +# -------------------------------------------------------- +DROP TABLE ThemeFiles +# -------------------------------------------------------- +DROP TABLE Topic +# -------------------------------------------------------- +DROP TABLE UserGroup +# -------------------------------------------------------- +DROP TABLE UserSession +# -------------------------------------------------------- +DROP TABLE SuggestMail +# -------------------------------------------------------- +DROP TABLE SysCache +# -------------------------------------------------------- +DROP TABLE TagLibrary +# -------------------------------------------------------- +DROP TABLE TagAttributes +# -------------------------------------------------------- +DROP TABLE LinkValidation \ No newline at end of file Index: trunk/themes/default/img/ic_subfolder.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/fckeditor.asp =================================================================== diff -u --- trunk/admin/editor/FCKeditor/fckeditor.asp (revision 0) +++ trunk/admin/editor/FCKeditor/fckeditor.asp (revision 13) @@ -0,0 +1,91 @@ +<% +'### + ' FCKeditor - The text editor for internet + ' Copyright (C) 2003 Frederico Caldeira Knabben + ' + ' Licensed under the terms of the GNU Lesser General Public License + ' (http://www.opensource.org/licenses/lgpl-license.php) + ' + ' For further information go to http://www.fredck.com/FCKeditor/ + ' or contact fckeditor@fredck.com. + ' + ' fckeditor.asp: ASP pages integration. It works with VBScript 5 (IIS5). + ' For old VBScript versions, see fckeditorold.asp. + ' + ' Authors: + ' Frederico Caldeira Knabben (fckeditor@fredck.com) +'### + +' The editor base path +' You have to update it with you web site configuration +Dim FCKeditorBasePath +FCKeditorBasePath = "/FCKeditor/" + +Class FCKeditor + Private sToolbarSetName + Private sInitialValue + Private bCanUpload + Private bCanBrowse + + Public Property Let ToolbarSet(toolbarSetName) + sToolbarSetName = toolbarSetName + End Property + + Public Property Let Value(initialValue) + sInitialValue = initialValue & "" + End Property + + Public Property Let CanUpload(canUploadValue) + bCanUpload = canUploadValue + End Property + + Public Property Let CanBrowse(canBrowseValue) + bCanBrowse = canBrowseValue + End Property + + Public Function CreateFCKeditor(instanceName, width, height) + If IsCompatible() Then + Dim sLink + sLink = FCKeditorBasePath & "fckeditor.html?FieldName=" & instanceName + + If (sToolbarSetName & "") <> "" Then + sLink = sLink & "&Toolbar=" & sToolbarSetName + End If + + If bCanUpload & "" <> "" Then + If bCanUpload = True Then + sLink = sLink & "&Upload=true" + ElseIf bCanUpload = False Then + sLink = sLink & "&Upload=false" + End If + End If + + If bCanBrowse & "" <> "" Then + If bCanBrowse = True Then + sLink = sLink & "&Browse=true" + ElseIf bCanBrowse = False Then + sLink = sLink & "&Browse=false" + End If + End If + + Response.Write "" + Response.Write "" + Else + Response.Write "" + End If + End Function + + Private Function IsCompatible() + Dim sAgent + sAgent = Request.ServerVariables("HTTP_USER_AGENT") + + If InStr(sAgent, "MSIE") > 0 AND InStr(sAgent, "Windows") > 0 AND InStr(sAgent, "Opera") <= 0 Then + Dim iVersion + iVersion = CInt(Mid(sAgent, InStr(sAgent, "MSIE") + 5, 1)) + IsCompatible = (iVersion >= 5) + Else + IsCompatible = False + End If + End Function +End Class +%> \ No newline at end of file Index: trunk/admin/icons/icon46_users_settings.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_head_languages.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/apophys.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_help.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_notloggedin.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tree/ftv2link.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_forum.jpg =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/users.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/users.php (revision 0) +++ trunk/kernel/admin/include/toolbar/users.php (revision 13) @@ -0,0 +1,19 @@ + + + + +END; + +?> Index: trunk/themes/default/img/act_favor.gif =================================================================== diff -u Binary files differ Index: trunk/admin/login.php =================================================================== diff -u --- trunk/admin/login.php (revision 0) +++ trunk/admin/login.php (revision 13) @@ -0,0 +1,122 @@ +"; print_r($objSession); echo ""; + +if ( GetVar('expired') == 1 && GetVar('logout') != 1) { + if (function_exists("admin_language")) { + $login_error = admin_language("la_text_sess_expired"); + } + else { + $login_error = "Session Expired"; + } +} + +print<< + + +In-Portal :: Administration Panel + + + + + + + + + + + +
+
+ In-portal + In-portal
+ + + + + +
+ + $login_text + + +
+ + + + + + + + + + + + + + + +
$username_text
$password_title
+
+ + + +
+
+
+

+ $login_error

+
+ + + +END; +exit(); +?> \ No newline at end of file Index: trunk/themes/default/img/lang/italian.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/my_info/myinfo_form.tpl =================================================================== diff -u --- trunk/themes/default/my_info/myinfo_form.tpl (revision 0) +++ trunk/themes/default/my_info/myinfo_form.tpl (revision 13) @@ -0,0 +1,102 @@ +
"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + + +


(*)
+
* + +
+


*
*


*




Country: + +

  +

+ " class="button"> + " class="button" onClick="javascript:history.back();"> +

+
Index: trunk/admin/config/edit_label.php =================================================================== diff -u --- trunk/admin/config/edit_label.php (revision 0) +++ trunk/admin/config/edit_label.php (revision 13) @@ -0,0 +1,328 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +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 ""; + die(); +} + +$section = "in-portal:phrase_editor"; +$ids = $_GET["PhraseId"]; + +if(strlen($ids)) +{ + $ids = str_replace("[","",$ids); + $ids = str_replace("]","",$ids); + $ids = str_replace("\"","",$ids); + $ids = str_replace("\\","",$ids); + $PhraseIds = explode(",",$ids); +} +else +{ + $LangId = $_GET["LanguageId"]; +} + +$EditDirect = (int)$_GET["direct"]; + +if($EditDirect) +{ + $NewLabel = $_GET["label"]; + if(!$LangId) + { + $LangId = $objSession->Get("Language"); + } +} + +unset($objEditItems); + +if (count($PhraseIds) > 1) { + $print_list = true; +} +else { + $ado = GetADODBConnection(); + $sql = "SELECT PhraseId FROM ".$objSession->GetEditTable("Phrase"); + + if ($LangId) { + $sql .= " WHERE LanguageId = $LangId"; + } + + $rs = $ado->Execute($sql); + + if (!$_GET['en']) { + $selected_id = $PhraseIds[0]; + } + else { + $selected_id = $_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"); + +int_header($objListToolBar,NULL,$title); +?> +
" method=POST> + +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 "
"; print_r($p); echo "
"; + + if(!$LangId) + $LangId = $p->Get("LanguageId"); + if(is_object($p) && $selected_id != '') + { + echo int_subsection_title_ret(admin_language("la_tab_General").": ".GetPrimaryTranslation($p->Get("Phrase"))); + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n"; + + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n"; + + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n"; + + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + unset($p); + } +} +?> +0) + { + "::".$PriTrans = GetPrimaryTranslation($NewLabel); + } +?> + + + + > + + + + + + > + + + + + + > + + + + + + + + + + + + +
".admin_language("la_prompt_PhraseId")."".$p->Get("PhraseId")."
".admin_language("la_prompt_Label")."Get("PhraseId")."]\" VALUE=\"".$p->Get("Phrase")."\">
".admin_language("la_prompt_Value")."Get("PhraseId")."]\" VALUE=\"".$p->Get("Translation")."\">
".admin_language("la_prompt_PhraseType")."\n"; + echo " Get("PhraseId")."]\" VALUE=\"0\""; + if($p->Get("PhraseType")==0) + echo "CHECKED"; + echo ">"; + echo admin_language("la_Text_Front"); + echo " Get("PhraseId")."]\" VALUE=\"1\""; + if($p->Get("PhraseType")==1) + echo "CHECKED"; + echo ">"; + echo admin_language("la_Text_Admin"); + echo " Get("PhraseId")."]\" VALUE=\"2\""; + if($p->Get("PhraseType")==2) + echo "CHECKED"; + echo ">"; + echo admin_language("la_Text_Both"); + echo "
+ + + + + + +
+ + Index: trunk/admin/images/menu_arrow.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemtabs/divider_empty.gif =================================================================== diff -u Binary files differ Index: trunk/admin/import/inlinkimport.php =================================================================== diff -u --- trunk/admin/import/inlinkimport.php (revision 0) +++ trunk/admin/import/inlinkimport.php (revision 13) @@ -0,0 +1,218 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//admin only util +$pathtolocal = $pathtoroot."kernel/"; +require_once ($pathtoroot.$admin."/include/elements.php"); +require_once ($pathtolocal."admin/include/navmenu.php"); +require_once($pathtoroot.$admin."/toolbar.php"); +//Set Section +$section = "in-portal:inlink_inport"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +//Making default settings +if ($_POST["inlink_sql_type"]!="") +{ + echo "SQL TYPE IS: ".$_POST["inlink_sql_type"]; +} +if ($objSession->GetVariable("inlink_sql_type")=="") +{ + $objSession->SetVariable("inlink_sql_type","mysql"); +} +if ($objSession->GetVariable("inlink_server")=="") +{ + $objSession->SetVariable("inlink_server","localhost"); +} +if ($objSession->GetVariable("inlink_db")=="") +{ + $objSession->SetVariable("inlink_db","in-link"); +} + +if ($objSession->GetVariable("user_admin_values")=="") +{ + $objSession->SetVariable("user_admin_names","Admin"); + $objSession->SetVariable("user_admin_values","11"); +} +if ($objSession->GetVariable("user_regular_values")=="") +{ + $objSession->SetVariable("user_regular_names","Root"); + $objSession->SetVariable("user_regular_values","2"); +} +if ($objSession->GetVariable("categoryid")=="") +{ + $objSession->SetVariable("catnavbar","Top"); + $objSession->SetVariable("categoryid","0"); +} +if ($objSession->GetVariable("user_input1")=="") +{ + $objSession->SetVariable("user_input1","2"); +} +if($objSession->GetVariable("user_input2")=="") +{ + $objSession->SetVariable("user_input2","1"); +} +$formaction = $adminURL."/import/import.php?".$envar; + +$title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 5"; + +int_header(NULL, NULL, $title); +?> + + + "> + + + > + + + + > + + + + > + + + + > + + + + > + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + > + + + + + +> + + +
( GetVariable("user_admin_names"); ?> ) + + + + + +
( GetVariable("user_regular_names"); ?> ) + + + +
( GetVariable("catnavbar"); ?> ) + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ \ No newline at end of file Index: trunk/admin/images/toolbar/tool_move_down_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_print_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_struct.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_summary_logs.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_editcat_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/dialog/fck_about/logo_fckeditor_1.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/lang_import.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/lang_import.php (revision 0) +++ trunk/kernel/admin/include/toolbar/lang_import.php (revision 13) @@ -0,0 +1,75 @@ + + + + +END; +?> Index: trunk/admin/editor/FCKeditor/lang/hu.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/hu.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/hu.js (revision 13) @@ -0,0 +1,199 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * hu.js: Hungaryan support. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Kivág" ; +lang["Copy"] = "Másol" ; +lang["Paste"] = "Beilleszt" ; +lang["PasteText"] = "Szimpla szöveg beillesztése" ; +lang["PasteWord"] = "Wörd dokumenumt beillesztése" ; +lang["Find"] = "Keres" ; +lang["SelectAll"] = "Mindet kijelöl" ; +lang["RemoveFormat"] = "Formátum eltávolítása" ; +lang["InsertLink"] = "Beszúr/Szerkeszt linket" ; +lang["RemoveLink"] = "Link eltávolítása" ; +lang["InsertImage"] = "Beszúr/Szerkeszt képet" ; +lang["InsertTable"] = "Beszúr/Szerkeszt táblázatot" ; +lang["InsertLine"] = "Vonal beszúrása" ; +lang["InsertSpecialChar"] = "Szimbólum beszúrása" ; +lang["InsertSmiley"] = "Mosoly beszúrása" ; +lang["About"] = "About FCKeditor" ; + +lang["Bold"] = "Kövér" ; +lang["Italic"] = "Dölt" ; +lang["Underline"] = "Aláhúzott" ; +lang["StrikeThrough"] = "Áthúzott" ; +lang["Subscript"] = "Alsóindex" ; +lang["Superscript"] = "Felsőindex" ; +lang["LeftJustify"] = "Balra igazít" ; +lang["CenterJustify"] = "Középre igazít" ; +lang["RightJustify"] = "Jobra igazít" ; +lang["BlockJustify"] = "Blokkos igazítás" ; +lang["DecreaseIndent"] = "Behúzás csökkentése" ; +lang["IncreaseIndent"] = "Behúzás növelése" ; +lang["Undo"] = "Vissza" ; +lang["Redo"] = "Mégis" ; +lang["NumberedList"] = "Számozott lista" ; +lang["BulettedList"] = "Pontozott Lista" ; + +lang["ShowTableBorders"] = "Táblázat szegélyek mutatása" ; +lang["ShowDetails"] = "Részletek mutatása" ; + +lang["FontStyle"] = "Sílus" ; +lang["FontFormat"] = "Formátum" ; +lang["Font"] = "Betütípus" ; +lang["FontSize"] = "Méret" ; +lang["TextColor"] = "Szövegszín" ; +lang["BGColor"] = "Háttérszín" ; +lang["Source"] = "Forrás" ; + +// Context Menu + +lang["EditLink"] = "Link szerkesztése" ; +lang["InsertRow"] = "Sor beszúrása" ; +lang["DeleteRows"] = "Sorok törlése" ; +lang["InsertColumn"] = "Oszlop beszúrása" ; +lang["DeleteColumns"] = "Oszlopok törléses" ; +lang["InsertCell"] = "Cella beszúrása" ; +lang["DeleteCells"] = "Cellák törlése" ; +lang["MergeCells"] = "Cellák összevonása" ; +lang["SplitCell"] = "Cellák felosztása" ; +lang["CellProperties"] = "Cellatulajdonságok" ; +lang["TableProperties"] = "Táblázattulajdonságok" ; +lang["ImageProperties"] = "Képtulajdonságok" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "XHTML feldolgozása. Kérlek várj..." ; +lang["Done"] = "Rendben" ; +lang["PasteWordConfirm"] = "Úgylátom hogy a szöveget Word dokumentumból illesztetted be. Akarod hogy kitisztítsam a felesleges kódoktól?" ; +lang["NotCompatiblePaste"] = "Ez a parancs az Internet Explorer 5.5 vezriójától felfelé támogatott. Akarod hogy beillesszem tisztítás nékül?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Mégsem" ; +lang["DlgBtnClose"] = "Bezár" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Kép beszúrása" ; +lang["DlgImgTitleEdit"] = "Kép szerkesztése" ; +lang["DlgImgBtnUpload"] = "Küld el a szervernek" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Feltölt" ; +lang["DlgImgBtnBrowse"] = "Szerver böngészése" ; +lang["DlgImgAlt"] = "Alternatív felirat" ; +lang["DlgImgWidth"] = "Szélesség" ; +lang["DlgImgHeight"] = "Magasság" ; +lang["DlgImgLockRatio"] = "Aránytartás" ; +lang["DlgBtnResetSize"] = "Méret visszaállítás" ; +lang["DlgImgBorder"] = "Keret" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Igazítás" ; +lang["DlgImgAlignLeft"] = "Balra" ; +lang["DlgImgAlignAbsBottom"] = "Abs lent" ; +lang["DlgImgAlignAbsMiddle"] = "Abs középen" ; +lang["DlgImgAlignBaseline"] = "Sorhoz" ; +lang["DlgImgAlignBottom"] = "Lent" ; +lang["DlgImgAlignMiddle"] = "Középen" ; +lang["DlgImgAlignRight"] = "Jobra" ; +lang["DlgImgAlignTextTop"] = "Szöveg tetejéhez" ; +lang["DlgImgAlignTop"] = "Fent" ; +lang["DlgImgPreview"] = "Előnézet" ; +lang["DlgImgMsgWrongExt"] = "Salynálom de ilyen kiterjesztésű file-t nem lehet feltölteni:\n\n" + config.ImageUploadAllowedExtensions + "\n\nA feltöltést megszakítottam." ; +lang["DlgImgAlertSelect"] = "Kérlek válaszd ki a képet, amit felszeretnél tölteni." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; // NEW +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Feltölt" ; +lang["DlgLnkTarget"] = "Cél" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Új ablak (_blank)" ; +lang["DlgLnkTargetParent"] = "Szülő ablak (_parent)" ; +lang["DlgLnkTargetSelf"] = "Azonos ablak (_self)" ; +lang["DlgLnkTargetTop"] = "Legfőbb ablak (_top)" ; +lang["DlgLnkTitle"] = "Cím" ; +lang["DlgLnkBtnUpload"] = "Küldd ell a szervernek" ; +lang["DlgLnkBtnBrowse"] = "Szerver böngészése" ; +lang["DlgLnkMsgWrongExtA"] = "Salynálom de ilyen típusu file-t nem lehet feltölteni:\n\n" + config.LinkUploadAllowedExtensions + "\n\nA feltöltést megszakítottam." ; +lang["DlgLnkMsgWrongExtD"] = "Salynálom de ilyen kiterjesztésű file-t nem lehet feltölteni:\n\n" + config.LinkUploadDeniedExtensions + "\n\nA feltöltést megszakítottam." ; + +// Color Dialog +lang["DlgColorTitle"] = "Szín kiválasztása" ; +lang["DlgColorBtnClear"] = "Töröl" ; +lang["DlgColorHighlight"] = "Kiemelés" ; +lang["DlgColorSelected"] = "Kijelölt" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Mosoly beszúrása" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Szimbólum beszúrása" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Táblázat beszúrása" ; +lang["DlgTableTitleEdit"] = "Táblázat" ; +lang["DlgTableRows"] = "Sorok" ; +lang["DlgTableColumns"] = "Oszlopok" ; +lang["DlgTableBorder"] = "Keret méret" ; +lang["DlgTableAlign"] = "Igazítás" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Balra" ; +lang["DlgTableAlignCenter"] = "Középre" ; +lang["DlgTableAlignRight"] = "Jobra" ; +lang["DlgTableWidth"] = "Szélesség" ; +lang["DlgTableWidthPx"] = "Pixel" ; +lang["DlgTableWidthPc"] = "Százalék" ; +lang["DlgTableHeight"] = "Magassák" ; +lang["DlgTableCellSpace"] = "Cellák közti űr" ; +lang["DlgTableCellPad"] = "Cellák margója" ; +lang["DlgTableCaption"] = "Felirat" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Cellatulajdonságok" ; +lang["DlgCellWidth"] = "Szélesség" ; +lang["DlgCellWidthPx"] = "Pixel" ; +lang["DlgCellWidthPc"] = "Százalék" ; +lang["DlgCellHeight"] = "Magasság" ; +lang["DlgCellWordWrap"] = "Szótörés" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Igen" ; +lang["DlgCellWordWrapNo"] = "Nem" ; +lang["DlgCellHorAlign"] = "Vízszintes igazítás" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Balra" ; +lang["DlgCellHorAlignCenter"] = "Középre" ; +lang["DlgCellHorAlignRight"] = "Jobra" ; +lang["DlgCellVerAlign"] = "Függőleges igazítás" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Fent" ; +lang["DlgCellVerAlignMiddle"] = "Középen" ; +lang["DlgCellVerAlignBottom"] = "Lent" ; +lang["DlgCellVerAlignBaseline"] = "Sorhoz" ; +lang["DlgCellRowSpan"] = "Sor összevonás" ; +lang["DlgCellCollSpan"] = "Oszlop összevonás" ; +lang["DlgCellBackColor"] = "Háttérszín" ; +lang["DlgCellBorderColor"] = "Keretszín" ; +lang["DlgCellBtnSelect"] = "Választ..." ; + +// About Dialog +lang["DlgAboutVersion"] = "Verzió" ; +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "For further information go to" ; + Index: trunk/kernel/include/adodb/adodb-access.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-access.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-access.inc.php (revision 13) @@ -0,0 +1,54 @@ +_connectionID); + $rs = new ADORecordSet_odbc($qid); + //print_r($rs); + $arr = &$rs->GetArray(); + + $arr2 = array(); + for ($i=0; $i < sizeof($arr); $i++) { + if ($arr[$i][2] && substr($arr[$i][2],0,4) != 'MSys') + $arr2[] = $arr[$i][2]; + } + return $arr2; + } +} + + +class ADORecordSet_access extends ADORecordSet_odbc { + + var $databaseType = "access"; + + function ADORecordSet_access($id) + { + return $this->ADORecordSet_odbc($id); + } +} +} // class +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/msn/thumbs_down.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/login.tpl =================================================================== diff -u --- trunk/themes/default/login.tpl (revision 0) +++ trunk/themes/default/login.tpl (revision 13) @@ -0,0 +1,127 @@ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +



+ + + + + + + + + + +

+ + + + + + +

  + + + + + + + +
" width="18" height="12" alt="" />
   
+
+ +
+ + +
+ + + + + +

+ +
+ + + + +
+ + + + + +

+
+ + + + + + + + + + + + + + + + + +
+ + + + + +
 * - + +
+





+ +
+

+ +
+
+ + + Index: trunk/admin/editor/submit.php =================================================================== diff -u --- trunk/admin/editor/submit.php (revision 0) +++ trunk/admin/editor/submit.php (revision 13) @@ -0,0 +1,32 @@ + + + + You have edited the following content + + + +
+ + + + + + + +
+ You have edited the following content: +
  +
+
+ +
+
  + Click here to go back +
+
+ + + Index: trunk/admin/include/subitems.css =================================================================== diff -u --- trunk/admin/include/subitems.css (revision 0) +++ trunk/admin/include/subitems.css (revision 13) @@ -0,0 +1,57 @@ +body {font-family:arial; font-size:12px; margin: 0px 8px 0px 8px} +td {font-size:12px} +.contentTD { + border-right-width: 1px; border-right-style: solid; border-right-color: #000000; + border-left-width: 1px; border-left-style: solid; border-left-color: #000000; + border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #000000; +} +.liTR0 {background-color:#EEEEEE; } +.liTR1 {background-color:#E6E6E6; } +.liTRO {background-color:#C6D6EF; cursor: hand} + +.icon {vertical-align: top; padding-top: 8px; text-align:center; width:28px;} +.description {vertical-align: top;} + +.subitem_icon {vertical-align: top; padding-top: 0px; text-align:center; width:28px;} +.subitem_description {vertical-align: middle;} + +.dLink {display:block; margin-bottom:5px; font-family:verdana; font-size:13px; font-weight:bold; color:#2C73CB; text-decoration:none;} +.dLink:hover {display:block; margin-bottom:5px; font-family:verdana; font-size:13px; font-weight:bold; color:#2C73CB; text-decoration:underline;} + +.searchbox_header { width: 269px; height:21px; font-family:verdana; font-weight:bold; font-size:12px; color:#000000; overflow:hidden; cursor:hand} +.searchbox_body { border-width:1px; border-style:solid; border-color:#666767; border-right-width:1px; border-left-width:0px; width: 269px; height: 65px; overflow:hidden} + +.usersbox_header {width: 269px; height:21px; font-family:verdana; font-weight:bold; font-size:12px; color:#000000; overflow:hidden; cursor:hand} +.usersbox_body { border-width:1px; border-style:solid; border-color:#666767; border-right-width:1px; border-left-width:0px; width: 269px; } + +.overviewbox_header { width: 269px; height:21px; font-family:verdana; font-weight:bold; font-size:12px; color:#ffffff; overflow:hidden; cursor:hand} +.overviewbox_body { border-width:1px; border-style:solid; border-color:#666767; border-right-width:1px; border-left-width:0px; width: 269px; } +.overview {font-family:verdana; font-weight:bold; font-size:12px; color:#ffffff;} +.overviewDate {font-family:verdana; font-weight:bold; font-size:12px; color:#C6EAFC;} +.oInfo {font-family:arial; font-size:10px; color:#000000} +.oValue {font-family:arial; font-size:10px; color:#333333} + +.userslink {FONT-SIZE: 12px; COLOR: #1F569A; FONT-FAMILY: arial, helvetica, sans-serif; color:#2C73CB; FONT-WEIGHT: bold;} +.userslink:hover {FONT-SIZE: 12px; COLOR: #009ff0; FONT-FAMILY: arial, helvetica, sans-serif; FONT-WEIGHT: bold;} + +.dBody {border-top-width:1px; border-top-style:solid; border-top-color:#666767; width: 269px; height: 21px; overflow:hidden} + +.lTD {border-right-width: 1px; border-right-style: solid; border-right-color: #CCCCCC} + +.lTDi {border-right-width: 1px; border-right-style: solid; border-right-color: #CCCCCC; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CCCCCC} +.rTDi {border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CCCCCC} + +.info {FONT-SIZE: 11px; COLOR: #707070; FONT-FAMILY: arial,verdana,sans-serif; font-weight: normal;} + +.imgButton {cursor: hand} +.boxContainer {position: relative; z-Index:1; } +.dragImage {position: relative; top: -48px; width:400px; left:-100px; height:96px;} + +.search {border-width:1px; border-style:solid; border-color:#7F9DB9; width:107px; height:18px; font-family:verdana; font-size:11px} +.pageTitle {font-family:verdana; font-size: 20px; font-weight:bold; color:#009FF0} + +/* existing styles [start] */ +.tableborder_full {BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 10pt; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serif} +.tablenav_link {FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: white; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none} +/* existing styles [end] */ + Index: trunk/admin/editor/FCKeditor/images/smiley/fun/bazuzeus.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/upload/php/upload.php =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/upload/php/upload.php (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/upload/php/upload.php (revision 13) @@ -0,0 +1,296 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); + +if(!strlen($admin)) + + $admin = "admin"; + +$adminURL = $rootURL.$admin; + + + + $UPLOAD_BASE_URL = $rootURL."kernel/images/"; + + $UPLOAD_BASE_DIR = $pathtoroot."kernel/images/"; + + + +// End int var + + + +?> + + + + + + + + + + File Uploader + + + + + +
+ + + + + + + + + +
+ + Upload in progress... + +

+ +
'; + +} else { + + if (is_uploaded_file($HTTP_POST_FILES['FCKeditor_File']['tmp_name'])) { + + $savefile = $UPLOAD_BASE_DIR.$HTTP_POST_FILES['FCKeditor_File']['name']; + + + + if (move_uploaded_file($HTTP_POST_FILES['FCKeditor_File']['tmp_name'], $savefile)) { + + chmod($savefile, 0666); + + ?> + + "; + +
'; + +} ?> + +
+ +
+ + + Index: trunk/admin/editor/FCKeditor/images/smiley/msn/angel_smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_delete.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/youpi.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_search.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/css/fck_dialog.css =================================================================== diff -u --- trunk/admin/editor/FCKeditor/css/fck_dialog.css (revision 0) +++ trunk/admin/editor/FCKeditor/css/fck_dialog.css (revision 13) @@ -0,0 +1,42 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_dialog.css: Dialog boxes base CSS. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +body +{ + background-color: buttonface; +} + +body, td, input, select, textarea, button +{ + font-size: 11px; + font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif; +} + +.ImagePreviewArea +{ + border-right: #000000 1px solid; + padding-right: 5px; + border-top: #000000 1px solid; + padding-left: 5px; + padding-bottom: 5px; + overflow: scroll; + border-left: #000000 1px solid; + width: 100%; + padding-top: 5px; + border-bottom: #000000 1px solid; + height: 100%; + background-color: #ffffff; +} Index: trunk/admin/editor/FCKeditor/images/smiley/fun/yltype.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_homecat_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_settings_email.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/xml.php =================================================================== diff -u --- trunk/kernel/include/xml.php (revision 0) +++ trunk/kernel/include/xml.php (revision 13) @@ -0,0 +1,351 @@ +xml = $xml; + + // Set default values + $this->version = '1.0'; + $this->encoding = "ISO-8859-1"; + $this->dtd = ''; + $this->entities = array(); + $this->xml_index = array(); + $this->xml_reference = 0; + $this->stack = array(); + } + + function parse() { + // Creates the object tree from XML code + + + $this->parser = xml_parser_create($this->encoding); + xml_set_object($this->parser, $this); + xml_set_element_handler($this->parser, "startElement", "endElement"); + xml_set_character_data_handler($this->parser, "characterData"); + xml_set_default_handler($this->parser, "defaultHandler"); + + if (!xml_parse($this->parser, $this->xml)) { + // Error while parsing document + + $err_code = xml_get_error_code(); + $err_string = xml_get_error_string(); + $err_line = xml_get_current_line_number(); + $err_col = xml_get_current_column_number(); + $err_byte = xml_get_current_byte_index(); + + print "

Error Code: $err_code
$err_string
Line: $err_line
Column: $err_col

"; + } + + xml_parser_free($this->parser); + } + + function generate() { + // Generates XML string from the xml_doc::document object + + + // Create document header + if ($this->version == '' and $this->encoding == '') { + $out_header = '<' . '?xml ?' . ">\n"; + } elseif ($this->version != '' and $this->encoding == '') { + $out_header = '<' . "?xml version=\"{$this->version}\"?" . ">\n"; + } else { + $out_header = '<' . "?xml version=\"{$this->version}\" encoding=\"{$this->encoding}\"?" . ">\n"; + } + + if ($this->dtd != '') { + $out_header .= "dtd . ">\n"; + } + + // Get reference for root tag + $_root =& $this->xml_index[0]; + + // Create XML for root tag + $this->xml = $this->createXML(0); + + return $out_header . $this->xml; + } + + function stack_location() { + // Returns index for current working tag + + + return $this->stack[(count($this->stack) - 1)]; + } + + function startElement($parser, $name, $attrs=array()) { + // Process a new tag + + + // Check to see if tag is root-level + if (count($this->stack) == 0) { + // Tag is root-level (document) + + $this->document = new xml_tag($this,$name,$attrs); + $this->document->refID = 0; + + $this->xml_index[0] =& $this->document; + $this->xml_reference = 1; + + $this->stack[0] = 0; + + } else { + // Get current location in stack array + $parent_index = $this->stack_location(); + + // Get object reference to parent tag + $parent =& $this->xml_index[$parent_index]; + + // Add child to parent + $parent->addChild($this,$name,$attrs); + + // Update stack + array_push($this->stack,($this->xml_reference - 1)); + } + + } + + function endElement($parser, $name) { + // Update stack + + + array_pop($this->stack); + } + + function characterData($parser, $data) { + // Add textual data to the current tag + + + // Get current location in stack array + $cur_index = $this->stack_location(); + + // Get object reference for tag + $tag =& $this->xml_index[$cur_index]; + + // Assign data to tag + $tag->contents = $data; + } + + function defaultHandler($parser, $data) { + + } + + function createTag($name, $attrs=array(), $contents='', $parentID = '') { + // Creates an XML tag, returns Tag Index # + + + if ($parentID === '') { + // Tag is root-level + + $this->document = new xml_tag($this,$name,$attrs,$contents); + $this->document->refID = 0; + + $this->xml_index[0] =& $this->document; + $this->xml_reference = 1; + + return 0; + } else { + // Tag is a child + + // Get object reference to parent tag + $parent =& $this->xml_index[$parentID]; + + // Add child to parent + return $parent->addChild($this,$name,$attrs,$contents); + } + } + + + function createXML($tagID,$parentXML='') { + // Creates XML string for a tag object + // Specify parent XML to insert new string into parent XML + + + $final = ''; + + // Get Reference to tag object + $tag =& $this->xml_index[$tagID]; + + $name = $tag->name; + $contents = $tag->contents; + $attr_count = count($tag->attributes); + $child_count = count($tag->tags); + $empty_tag = ($tag->contents == '') ? true : false; + + // Create intial tag + if ($attr_count == 0) { + // No attributes + + if ($empty_tag === true) { + $final = "<$name />"; + } else { + $final = "<$name>$contents"; + } + } else { + // Attributes present + + $attribs = ''; + foreach ($tag->attributes as $key => $value) { + $attribs .= ' ' . $key . "=\"$value\""; + } + + if ($empty_tag === true) { + $final = "<$name$attribs />\n"; + } else { + $final = "<$name$attribs>$contents\n"; + } + } + + // Search for children + if ($child_count > 0) { + foreach ($tag->tags as $childID) { + $final = $this->createXML($childID,$final); + } + } + + if ($parentXML != '') { + // Add tag XML to parent XML + + $stop1 = strrpos($parentXML,''); + + if ($stop1 > $stop2) { + // Parent already has children + + $begin_chunk = substr($parentXML,0,$stop1); + $end_chunk = substr($parentXML,$stop1,(strlen($parentXML) - $stop1 + 1)); + + $final = $begin_chunk . $final . $end_chunk; + } elseif ($stop2 > $stop1) { + // No previous children + + $spc = strpos($parentXML,' ',0); + + $parent_name = substr($parentXML,1,$spc - 1); + + if ($spc != $stop2) { + // Attributes present + $parent_attribs = substr($parentXML,$spc,($stop2 - $spc)); + } else { + // No attributes + $parent_attribs = ''; + } + + $final = "<$parent_name$parent_attribs>$final"; + } + } + + return $final; + } + + + function getTag($tagID,&$name,&$attributes,&$contents,&$tags) { + // Returns tag information via variable references from a tag index# + + + // Get object reference for tag + $tag =& $this->xml_index[$tagID]; + + $name = $tag->name; + $attributes = $tag->attributes; + $contents = $tag->contents; + $tags = $tag->tags; + } + + function &getTagByID($tagID) { + // Returns tag information via variable references from a tag index# + + + // Get object reference for tag + $tag =& $this->xml_index[$tagID]; + return $tag; + } + + function getChildByName($parentID,$childName,$startIndex=0) { + // Returns child index# searching by name + + + // Get reference for parent + $parent =& $this->xml_index[$parentID]; + + if ($startIndex > count($parent->tags)) return false; + + + for ($i = $startIndex; $i < count($parent->tags); $i++) { + $childID = $parent->tags[$i]; + + // Get reference for child + $child =& $this->xml_index[$childID]; + + if ($child->name == $childName) { + // Found child, return index# + + return $childID; + } + } + } + +} + + +class xml_tag { + + var $refID; // Unique ID number of the tag + var $name; // Name of the tag + var $attributes = array(); // Array (assoc) of attributes for this tag + var $tags = array(); // An array of refID's for children tags + var $contents; // textual (CDATA) contents of a tag + var $children = array(); // Collection (type: xml_tag) of child tag's + + + function xml_tag(&$document,$tag_name,$tag_attrs=array(),$tag_contents='') { + // Constructor function for xml_tag class + + + // Set object variables + $this->name = $tag_name; + $this->attributes = $tag_attrs; + $this->contents = $tag_contents; + + $this->tags = array(); // Initialize children array/collection + $this->children = array(); + } + + function addChild (&$document,$tag_name,$tag_attrs=array(),$tag_contents='') { + // Adds a child tag object to the current tag object + + + // Create child instance + $this->children[(count($this->children))] = new xml_tag($document,$tag_name,$tag_attrs,$tag_contents); + + // Add object reference to document index + $document->xml_index[$document->xml_reference] =& $this->children[(count($this->children) - 1)]; + + // Assign document index# to child + $document->xml_index[$document->xml_reference]->refID = $document->xml_reference; + + // Add child index# to parent collection of child indices + array_push($this->tags,$document->xml_reference); + + // Update document index counter + $document->xml_reference++; + + // Return child index# + return ($document->xml_reference - 1); + } +} + +?> \ No newline at end of file Index: trunk/kernel/include/adodb/adodb-cryptsession.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-cryptsession.php (revision 0) +++ trunk/kernel/include/adodb/adodb-cryptsession.php (revision 13) @@ -0,0 +1,294 @@ + + + Set tabs to 4 for best viewing. + + Latest version of ADODB is available at http://php.weblogs.com/adodb + ====================================================================== + + This file provides PHP4 session management using the ADODB database +wrapper library. + + Example + ======= + + GLOBAL $HTTP_SESSION_VARS; + include('adodb.inc.php'); + #---------------------------------# + include('adodb-cryptsession.php'); + #---------------------------------# + session_start(); + session_register('AVAR'); + $HTTP_SESSION_VARS['AVAR'] += 1; + print "

\$HTTP_SESSION_VARS['AVAR']={$HTTP_SESSION_VARS['AVAR']}

"; + + + Installation + ============ + 1. Create a new database in MySQL or Access "sessions" like +so: + + create table sessions ( + SESSKEY char(32) not null, + EXPIRY int(11) unsigned not null, + DATA text not null, + primary key (sesskey) + ); + + 2. Then define the following parameters in this file: + $ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase'; + $ADODB_SESSION_CONNECT='server to connect to'; + $ADODB_SESSION_USER ='user'; + $ADODB_SESSION_PWD ='password'; + $ADODB_SESSION_DB ='database'; + $ADODB_SESSION_TBL = 'sessions' + + 3. Recommended is PHP 4.0.2 or later. There are documented +session bugs in + earlier versions of PHP. + +*/ + + +include_once('crypt.inc.php'); + +if (!defined('_ADODB_LAYER')) { + include ('adodb.inc.php'); +} + + + +if (!defined('ADODB_SESSION')) { + + define('ADODB_SESSION',1); + +GLOBAL $ADODB_SESSION_CONNECT, + $ADODB_SESSION_DRIVER, + $ADODB_SESSION_USER, + $ADODB_SESSION_PWD, + $ADODB_SESSION_DB, + $ADODB_SESS_CONN, + $ADODB_SESS_LIFE, + $ADODB_SESS_DEBUG, + $ADODB_SESS_INSERT, + $ADODB_SESSION_EXPIRE_NOTIFY; + + //$ADODB_SESS_DEBUG = true; + + /* SET THE FOLLOWING PARAMETERS */ +if (empty($ADODB_SESSION_DRIVER)) { + $ADODB_SESSION_DRIVER='mysql'; + $ADODB_SESSION_CONNECT='localhost'; + $ADODB_SESSION_USER ='root'; + $ADODB_SESSION_PWD =''; + $ADODB_SESSION_DB ='xphplens_2'; +} + +if (empty($ADODB_SESSION_TBL)){ + $ADODB_SESSION_TBL = 'sessions'; +} + +if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) { + $ADODB_SESSION_EXPIRE_NOTIFY = false; +} + +function ADODB_Session_Key() +{ +$ADODB_CRYPT_KEY = 'CRYPTED ADODB SESSIONS ROCK!'; + + /* USE THIS FUNCTION TO CREATE THE ENCRYPTION KEY FOR CRYPTED SESSIONS */ + /* Crypt the used key, $ADODB_CRYPT_KEY as key and session_ID as SALT */ + return crypt($ADODB_CRYPT_KEY, session_ID()); +} + +$ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime'); +if ($ADODB_SESS_LIFE <= 1) { + // bug in PHP 4.0.3 pl 1 -- how about other versions? + //print "

Session Error: PHP.INI setting session.gc_maxlifetimenot set: $ADODB_SESS_LIFE

"; + $ADODB_SESS_LIFE=1440; +} + +function adodb_sess_open($save_path, $session_name) +{ +GLOBAL $ADODB_SESSION_CONNECT, + $ADODB_SESSION_DRIVER, + $ADODB_SESSION_USER, + $ADODB_SESSION_PWD, + $ADODB_SESSION_DB, + $ADODB_SESS_CONN, + $ADODB_SESS_DEBUG; + + $ADODB_SESS_INSERT = false; + + if (isset($ADODB_SESS_CONN)) return true; + + $ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER); + if (!empty($ADODB_SESS_DEBUG)) { + $ADODB_SESS_CONN->debug = true; + print" conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB "; + } + return $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT, + $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB); + +} + +function adodb_sess_close() +{ +global $ADODB_SESS_CONN; + + if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close(); + return true; +} + +function adodb_sess_read($key) +{ +$Crypt = new MD5Crypt; +global $ADODB_SESS_CONN,$ADODB_SESS_INSERT,$ADODB_SESSION_TBL; + $rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time()); + if ($rs) { + if ($rs->EOF) { + $ADODB_SESS_INSERT = true; + $v = ''; + } else { + // Decrypt session data + $v = rawurldecode($Crypt->Decrypt(reset($rs->fields), ADODB_Session_Key())); + } + $rs->Close(); + return $v; + } + else $ADODB_SESS_INSERT = true; + + return ''; +} + +function adodb_sess_write($key, $val) +{ +$Crypt = new MD5Crypt; + global $ADODB_SESS_INSERT,$ADODB_SESS_CONN, $ADODB_SESS_LIFE, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY; + + $expiry = time() + $ADODB_SESS_LIFE; + + // encrypt session data.. + $val = $Crypt->Encrypt(rawurlencode($val), ADODB_Session_Key()); + + $arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val); + if ($ADODB_SESSION_EXPIRE_NOTIFY) { + $var = reset($ADODB_SESSION_EXPIRE_NOTIFY); + global $$var; + $arr['expireref'] = $$var; + } + $rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL, + $arr, + 'sesskey',$autoQuote = true); + + if (!$rs) { + ADOConnection::outp( '

Session Replace: '.$ADODB_SESS_CONN->ErrorMsg().'

',false); + } else { + // bug in access driver (could be odbc?) means that info is not commited + // properly unless select statement executed in Win2000 + + if ($ADODB_SESS_CONN->databaseType == 'access') $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'"); + } + return isset($rs); +} + +function adodb_sess_destroy($key) +{ + global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY; + + if ($ADODB_SESSION_EXPIRE_NOTIFY) { + reset($ADODB_SESSION_EXPIRE_NOTIFY); + $fn = next($ADODB_SESSION_EXPIRE_NOTIFY); + $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM); + $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'"); + $ADODB_SESS_CONN->SetFetchMode($savem); + if ($rs) { + $ADODB_SESS_CONN->BeginTrans(); + while (!$rs->EOF) { + $ref = $rs->fields[0]; + $key = $rs->fields[1]; + $fn($ref,$key); + $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'"); + $rs->MoveNext(); + } + $ADODB_SESS_CONN->CommitTrans(); + } + } else { + $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'"; + $rs = $ADODB_SESS_CONN->Execute($qry); + } + return $rs ? true : false; +} + + +function adodb_sess_gc($maxlifetime) { + global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY; + + if ($ADODB_SESSION_EXPIRE_NOTIFY) { + reset($ADODB_SESSION_EXPIRE_NOTIFY); + $fn = next($ADODB_SESSION_EXPIRE_NOTIFY); + $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM); + $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < " . time()); + $ADODB_SESS_CONN->SetFetchMode($savem); + if ($rs) { + $ADODB_SESS_CONN->BeginTrans(); + while (!$rs->EOF) { + $ref = $rs->fields[0]; + $key = $rs->fields[1]; + $fn($ref,$key); + $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'"); + $rs->MoveNext(); + } + $ADODB_SESS_CONN->CommitTrans(); + } + } else { + $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time(); + $ADODB_SESS_CONN->Execute($qry); + } + + // suggested by Cameron, "GaM3R" + if (defined('ADODB_SESSION_OPTIMIZE')) + { + switch( $ADODB_SESSION_DRIVER ) { + case 'mysql': + case 'mysqlt': + $opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL; + break; + case 'postgresql': + case 'postgresql7': + $opt_qry = 'VACUUM '.$ADODB_SESSION_TBL; + break; + } + } + + return true; +} + +session_module_name('user'); +session_set_save_handler( + "adodb_sess_open", + "adodb_sess_close", + "adodb_sess_read", + "adodb_sess_write", + "adodb_sess_destroy", + "adodb_sess_gc"); +} + +/* TEST SCRIPT -- UNCOMMENT */ +/* +if (0) { +GLOBAL $HTTP_SESSION_VARS; + + session_start(); + session_register('AVAR'); + $HTTP_SESSION_VARS['AVAR'] += 1; + print "

\$HTTP_SESSION_VARS['AVAR']={$HTTP_SESSION_VARS['AVAR']}

"; +} +*/ +?> Index: trunk/admin/editor/FCKeditor/images/smiley/fun/smiley_peur.gif =================================================================== diff -u Binary files differ Index: trunk/admin/templates/review_element.tpl =================================================================== diff -u --- trunk/admin/templates/review_element.tpl (revision 0) +++ trunk/admin/templates/review_element.tpl (revision 13) @@ -0,0 +1,4 @@ + + + + Index: trunk/kernel/include/adodb/adodb-db2.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-db2.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-db2.inc.php (revision 13) @@ -0,0 +1,144 @@ +autoCommit = false; + return true; + } + + function CommitTrans() + { + $this->Execute('COMMIT'); + $this->autoCommit = true; + return true; + } + + function RollbackTrans() + { + $this->Execute('ROLLBACK'); + $this->autoCommit = true; + return true; + } +*/ + function &SelectLimit($sql,$nrows=-1,$offset=-1,$arg3=false) + { + if ($offset <= 0) { + // could also use " OPTIMIZE FOR $nrows ROWS " + $sql .= " FETCH FIRST $nrows ROWS ONLY "; + return $this->Execute($sql,false,$arg3); + } else + return ADODBConnection::SelectLimit($sql,$nrows,$offset,$arg3); + } + +}; + + +class ADORecordSet_db2 extends ADORecordSet_odbc { + + var $databaseType = "db2"; + + function ADORecordSet_db2($id) + { + $this->ADORecordSet_odbc($id); + } + + function MetaType($t,$len=-1,$fieldobj=false) + { + switch (strtoupper($t)) { + case 'VARCHAR': + case 'CHAR': + case 'CHARACTER': + if ($len <= $this->blobSize) return 'C'; + + case 'LONGCHAR': + case 'TEXT': + case 'CLOB': + case 'DBCLOB': // double-byte + return 'X'; + + case 'BLOB': + case 'GRAPHIC': + case 'VARGRAPHIC': + return 'B'; + + case 'DATE': + return 'D'; + + case 'TIME': + case 'TIMESTAMP': + return 'T'; + + //case 'BOOLEAN': + //case 'BIT': + // return 'L'; + + //case 'COUNTER': + // return 'R'; + + case 'INT': + case 'INTEGER': + case 'BIGINT': + case 'SMALLINT': + return 'I'; + + default: return 'N'; + } + } +} + +} //define +?> \ No newline at end of file Index: trunk/admin/images/toolbar/tool_ban_user.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/incs/sniffer2.js =================================================================== diff -u --- trunk/themes/default/incs/sniffer2.js (revision 0) +++ trunk/themes/default/incs/sniffer2.js (revision 13) @@ -0,0 +1,479 @@ +// JavaScript Browser Sniffer +// Eric Krok, Andy King, Michel Plungjan Jan. 31, 2002 +// see http://www.webreference.com/ for more information +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// please send any improvements to aking@internet.com and we'll +// roll the best ones in +// +// adapted from Netscape's Ultimate client-side JavaScript client sniffer +// and andy king's sniffer +// Revised May 7 99 to add is.nav5up and is.ie5up (see below). (see below). +// Revised June 11 99 to add additional props, checks +// Revised June 23 99 added screen props - gecko m6 doesn't support yet - abk +// converted to var is_ from is object to work everywhere +// 990624 - added cookie forms links frames checks - abk +// 001031 - ie4 mod 5.0 -> 5. (ie5.5 mididentified - abk) +// is_ie4 mod tp work with ie6+ - abk +// 001120 - ns6 released, document.layers false, put back in +// - is_nav6 test added - abk +// 001121 - ns6+ added, used document.getElementById, better test, dom-compl +// 010117 - actual version for ie3-5.5 by Michel Plungjan +// 010118 - actual version for ns6 by Michel Plungjan +// 010217 - netscape 6/mz 6 ie5.5 onload defer bug docs - abk +// 011107 - added is_ie6 and is_ie6up variables - dmr +// 020128 - added link to netscape's sniffer, on which this is based - abk +// updated sniffer for aol4-6, ie5mac = js1.4, TVNavigator, AOLTV, +// hotjava +// 020131 - cleaned up links, added more links to example object detection +// 020131 - a couple small problems with Opera detection. First, when Opera +// is set to be compatible with other browsers it will contain their +// information in the userAgent strings. Thus, to be sure we have +// Opera we should check for it before checking for the other bigs. +// (And make sure the others are !opera.) Also corrected a minor +// bug in the is_opera6up assignment. +// 020214 - Added link for Opera/JS compatibility; added improvements for +// windows xp/2000 id in opera and aol 7 id (thanks to Les +// Hill, Les.Hill@getronics.com, for the suggestion). +// 020531 - Added N6/7 and moz identifiers. +// 020605 - Added mozilla guessing, Netscape 7 identification, and cleaner +// identification for Netscape 6. (this comment added after code +// changes) +// 020725 - Added is_gecko. -- dmr +// 021205 - Added is_Flash and is_FlashVersion, based on Doc JavaScript code. +// Added Opera 7 variables. -- dmr +// 021209 - Added aol8. -- dmr +// 030110 - Added is_safari, added 1.5 js designation for Opera 7. --dmr +// 030128 - Added is_konq, per user suggestion (thanks to Sam Vilain). +// Removed duplicate Opera checks left over after last revision. - dmr +// 030617 - Minor error corrections, two missing semicolons. +// Also made a couple changes to, IMHO, improve readability. +// Added is_MediaPlayer, is_MediaPlayer64, and is_MediaPlayer7up, +// based on code from Microsoft and eMedia Communications. - bdn +// +// Everything you always wanted to know about your JavaScript client +// but were afraid to ask. Creates "is_" variables indicating: +// (1) browser vendor: +// is_nav, is_ie, is_opera +// (2) browser version number: +// is_major (integer indicating major version number: 2, 3, 4 ...) +// is_minor (float indicating full version number: 2.02, 3.01, 4.04 ...) +// (3) browser vendor AND major version number +// is_nav2, is_nav3, is_nav4, is_nav4up, is_nav5, is_nav5up, +// is_nav6, is_nav6up, is_ie3, is_ie4, is_ie4up, is_ie5up, is_ie6... +// (4) JavaScript version number: +// is_js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...) +// (5) OS platform and version: +// is_win, is_win16, is_win32, is_win31, is_win95, is_winnt, is_win98 +// is_os2 +// is_mac, is_mac68k, is_macppc +// is_unix +// is_sun, is_sun4, is_sun5, is_suni86 +// is_irix, is_irix5, is_irix6 +// is_hpux, is_hpux9, is_hpux10 +// is_aix, is_aix1, is_aix2, is_aix3, is_aix4 +// is_linux, is_sco, is_unixware, is_mpras, is_reliant +// is_dec, is_sinix, is_freebsd, is_bsd +// is_vms +// (6) Windows Media Player version number (versions 6.4 and newer): +// is_WMP, is_WMP64, is_WMP7up, is_WMP7, is_WMP71, is_WMP8, is_WMP9 +// is_WMP71up, is_WMP8up, is_WMP9up +// is_WMPMajor (integer indicating major player version number: 6, 7, 8 ...) +// is_WMPMinor (float indicating full player version number: 6.4, 7.0, 7.1 ...) +// +// based in part on +// http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html +// The Ultimate JavaScript Client Sniffer +// and Andy King's object detection sniffer +// +// Note: you don't want your Nav4 or IE4 code to "turn off" or +// stop working when Nav5 and IE5 (or later) are released, so +// in conditional code forks, use is_nav4up ("Nav4 or greater") +// and is_ie4up ("IE4 or greater") instead of is_nav4 or is_ie4 +// to check version in code which you want to work on future +// versions. For DOM tests scripters commonly used the +// is_getElementById test, but make sure you test your code as +// filter non-compliant browsers (Opera 5-6 for example) as some +// browsers return true for this test, and don't fully support +// the W3C's DOM1. +// + + // convert all characters to lowercase to simplify testing + var agt=navigator.userAgent.toLowerCase(); + var appVer = navigator.appVersion.toLowerCase(); + + // *** BROWSER VERSION *** + + var is_minor = parseFloat(appVer); + var is_major = parseInt(is_minor); + + var is_opera = (agt.indexOf("opera") != -1); + var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1); + var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1); + var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1); + var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1); + var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); // new 020128- abk + var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); // new 021205- dmr + var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4); + var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); // new020128 + var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6); // new021205 -- dmr + + // Note: On IE, start of appVersion return 3 or 4 + // which supposedly is the version of Netscape it is compatible with. + // So we look for the real version further on in the string + + var iePos = appVer.indexOf('msie'); + if (iePos !=-1) { + is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos))); //added missing ; - 030617 - bdn + is_major = parseInt(is_minor); + } + + // ditto Konqueror + + var is_konq = false; + var kqPos = agt.indexOf('konqueror'); + if (kqPos !=-1) { + is_konq = true; + is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos))); + is_major = parseInt(is_minor); + } + + var is_getElementById = (document.getElementById) ? "true" : "false"; // 001121-abk + var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // 001127-abk + var is_documentElement = (document.documentElement) ? "true" : "false"; // 001121-abk + + var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false; + var is_khtml = (is_safari || is_konq); + + var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false; + var is_gver = 0; + if (is_gecko) is_gver=navigator.productSub; + + var is_moz = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && + (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && + (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && + (is_gecko) && + ((navigator.vendor=="")||(navigator.vendor=="Mozilla"))); + if (is_moz) { + var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0; + if(!(is_moz_ver)) { + is_moz_ver = agt.indexOf('rv:'); + is_moz_ver = agt.substring(is_moz_ver+3); + is_paren = is_moz_ver.indexOf(')'); + is_moz_ver = is_moz_ver.substring(0,is_paren); + } + is_minor = is_moz_ver; + is_major = parseInt(is_moz_ver); + } + + var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) + && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) + && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) + && (!is_khtml) && (!(is_moz))); + + // Netscape6 is mozilla/5 + Netscape6/6.0!!! + // Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0 + // Changed this to use navigator.vendor/vendorSub - dmr 060502 + // var nav6Pos = agt.indexOf('netscape6'); + // if (nav6Pos !=-1) { + if ((navigator.vendor)&& + ((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&& + (is_nav)) { + is_major = parseInt(navigator.vendorSub); + // here we need is_minor as a valid float for testing. We'll + // revert to the actual content before printing the result. + is_minor = parseFloat(navigator.vendorSub); + } + + var is_nav2 = (is_nav && (is_major == 2)); + var is_nav3 = (is_nav && (is_major == 3)); + var is_nav4 = (is_nav && (is_major == 4)); + var is_nav4up = (is_nav && is_minor >= 4); // changed to is_minor for + // consistency - dmr, 011001 + var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) || + (agt.indexOf("; nav") != -1)) ); + + var is_nav6 = (is_nav && is_major==6); // new 010118 mhp + var is_nav6up = (is_nav && is_minor >= 6); // new 010118 mhp, added missing ; - 030617 - bdn + + var is_nav5 = (is_nav && is_major == 5 && !is_nav6); // checked for ns6 + var is_nav5up = (is_nav && is_minor >= 5); + + var is_nav7 = (is_nav && is_major == 7); + var is_nav7up = (is_nav && is_minor >= 7); + + var is_ie = ((iePos!=-1) && (!is_opera) && (!is_khtml)); + var is_ie3 = (is_ie && (is_major < 4)); + + var is_ie4 = (is_ie && is_major == 4); + var is_ie4up = (is_ie && is_minor >= 4); + var is_ie5 = (is_ie && is_major == 5); + var is_ie5up = (is_ie && is_minor >= 5); + + var is_ie5_5 = (is_ie && (agt.indexOf("msie 5.5") !=-1)); // 020128 new - abk + var is_ie5_5up =(is_ie && is_minor >= 5.5); // 020128 new - abk + + var is_ie6 = (is_ie && is_major == 6); + var is_ie6up = (is_ie && is_minor >= 6); + +// KNOWN BUG: On AOL4, returns false if IE3 is embedded browser + // or if this is the first browser window opened. Thus the + // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable. + + var is_aol = (agt.indexOf("aol") != -1); + var is_aol3 = (is_aol && is_ie3); + var is_aol4 = (is_aol && is_ie4); + var is_aol5 = (agt.indexOf("aol 5") != -1); + var is_aol6 = (agt.indexOf("aol 6") != -1); + var is_aol7 = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1)); + var is_aol8 = ((agt.indexOf("aol 8")!=-1) || (agt.indexOf("aol8")!=-1)); + + var is_webtv = (agt.indexOf("webtv") != -1); + + // new 020128 - abk + + var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); + var is_AOLTV = is_TVNavigator; + + var is_hotjava = (agt.indexOf("hotjava") != -1); + var is_hotjava3 = (is_hotjava && (is_major == 3)); + var is_hotjava3up = (is_hotjava && (is_major >= 3)); + + // end new + + // *** JAVASCRIPT VERSION CHECK *** + // Useful to workaround Nav3 bug in which Nav3 + // loads \n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +if ($objSession->GetVariable("HasChanges") == 1) { +?> + + + + +
+ +
+ +
+PrintList(); +?> + +"> +"> +
+ + +
" name="viewmenu"> + + + + +
+
+ > + + + + + +
+
+ + +
+ + + + \ No newline at end of file Index: trunk/themes/default/img/ed_link.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/corn.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar_divider.gif =================================================================== diff -u Binary files differ Index: trunk/admin/toolbar.php =================================================================== diff -u --- trunk/admin/toolbar.php (revision 0) +++ trunk/admin/toolbar.php (revision 13) @@ -0,0 +1,304 @@ +img=="divider") + { + $o .= "\n"; + } + else + { + if(strlen($this->link)>1) + { + $o .= "link."\" onMouseOut=\"".$this->onMouseOut."\""; + $o .= " onMouseOver=\"".$this->onMouseOver."\" onClick=\"".$this->onClick."\">\n"; + $o .= "img."\" alt=\"".language($this->alt)."\" src=\"".$this->filename."\" width=\"32\" height=\"32\" border=\"0\">"; + $o .= "\n"; + } + else + { + $o .= "img."\" alt=\"".language($this->alt)."\" src=\"".$this->filename."\" width=\"32\" height=\"32\" border=\"0\""; + $o .= " onMouseOut=\"".$this->onMouseOut."\""; + $o .= " onMouseOver=\"".$this->onMouseOver."\" onClick=\"".$this->onClick."\">"; + } + } + return $o; + } +} + +class clsToolBar +{ + var $Items; + var $m_section; + var $m_load_menu_func; + var $m_CheckClass; + var $m_CheckForm; + var $InitScript; + var $DoubleClickAction; + var $ContextMenu; + + function clsToolBar() + { + $this->Items = array(); + $this->InitScript = array(); + $this->ContextMenu = array(); + } + + function Get($name) + { + $var = "m_" . $name; + return $this->$var; + } + + function Set($name, $value) + { + if (is_array($name)) + { + for ($i=0; $i$var = $value[$i]; + $this->m_dirtyFieldsMap[$name[$i]] = $value[$i]; + echo "$var = ".$value[$i]."
\n"; + } + } + else + { + $var = "m_" . $name; + $this->$var = $value; + $this->m_dirtyFieldsMap[$name] = $value; + } + } + + function Add($img,$alt="",$link="",$MouseOver="",$MouseOut="",$onClick="", $filename="",$IsDblClick=FALSE,$ContextMenu=FALSE) + { + global $imagesURL; + $t = new clsToolBarItem(); + $t->img = $img; + $t->alt = $alt; + $t->link = $link; + $t->onMouseOver = $MouseOver; + $t->onMouseOut = $MouseOut; + $t->onClick = $onClick; + if(strlen($filename)==0) + { + $t->filename = $imagesURL."/toolbar/tool_".$img.".gif"; + } + else + { + if(substr($filename,0,4)=="http") + { + $t->filename = $filename; + } + else + { + if(substr($filename,0,8)!="toolbar/") + $filename = "toolbar/".$filename; + if(substr($filename,0,1)!="/") + $filename = "/".$filename; + $t->filename = $imagesURL.$filename; + } + } + array_push($this->Items,$t); + if($IsDblClick) + $this->DoubleClickAction=$onClick; + if($ContextMenu) + $this->ContextMenu[] = "contextMenu.addMenuItem('".admin_language($alt)."',\"$onClick\",\"\");"; + return $t; + } + + function AddToInitScript($s) + { + if(is_array($s)) + { + for($i=0;$iInitScript,$s[$i]); + } + else + array_push($this->InitScript,$s); + } + + function GetInitScript() + { + global $envar; + $s=""; + + if(count($this->InitScript)>0) + $s = implode("\n",$this->InitScript); + if(strlen($this->Get("CheckClass"))) + { + $c = $this->Get("CheckClass")." = new CheckArray();\n"; + $c .=$this->Get("CheckClass").".formname='".$this->Get("CheckForm")."';\n"; + $c .=$this->Get("CheckClass").".envar='$envar';\n"; + $s = $c.$s; + } + $s .= "\n".$this->GetActionHandlerScript(); +// $s .= "\n".$this->Get("CheckClass").".setImages();\n"; + return ""; + } + + function GetActionHandlerScript() + { + $o = ''; + if(strlen($this->DoubleClickAction)>0) + { + $o .= "function handleDoubleClick()\n{\n"; + $o .= " ".$this->DoubleClickAction."\n"; + $o .= "}\n\n"; + } + if(count($this->ContextMenu)) + { + $o .= "function initContextMenu()\n{\n"; + $o .= " window.contextMenu = new Menu(\"Context\");"; + for($x=0;$xContextMenu);$x++) + { + $o .= " ".$this->ContextMenu[$x]."\n"; + } + $o .= " window.triedToWriteMenus = false;\n window.contextMenu.writeMenus();\n return true;\n}\n"; + } + return $o; + } + + function Build() + { + global $imagesURL; + + $o = ""; + $o .= "\n"; + foreach($this->Items as $t) + { + $o .= ""; + } + $o .= "
|".$t->GetItem()."
"; + return $o; + } + + function onLoadString() + { + return ""; + } +} + +class clsItemTabs +{ + var $Tabs; + var $ItemCount; + + function clsItemTabs() + { + $this->Tabs = array(); + $this->ItemCount = array(); + } + + function SetItemCount($divname,$Value) + { + $this->ItemCount[$divname] = $Value; + } + + function GetItemCount($divname) + { + return (int)$this->ItemCount[$divname]; + } + + function AddTab($Caption,$divname,$ItemCount,$selected,$numfunc="") + { + $t["caption"]=$Caption; + $t["divname"]=$divname; + $this->SetItemCount($divname,$ItemCount); + $t["selected"]=$selected; + $t["numfunc"]=$numfunc; + $this->Tabs[] = $t; + } + + function TabItem($i) + { + global $imagesURL; + + $t = $this->Tabs[$i]; + if($t["selected"]==1) + { + $divimage="/divider_up.gif"; + } + else + $divimage="/divider_dn.gif"; + + $div = $t["divname"]; + $o .= "\n"; + $o .= " "; + $o .= $t["caption"].""; + $func = $t["numfunc"]; + if(is_numeric($func)) + { + $total = $func; + } + else + { + if(function_exists($func)) + { + $total = $func(); + } + } + if(!is_numeric($total)) + $total = $this->GetItemCount($div); + + if($total==$this->GetItemCount($div)) + { + $o .= "(".$this->GetItemCount($div).")\n"; + } + else + $o .= "(".$this->GetItemCount($div)." / ".$total.")\n"; + + return $o; + } + + function tabRow() + { + + $o = ""; + $o .= ""; + for($i=0;$iTabs);$i++) + { + $o .= $this->TabItem($i); + } + $o .= ""; + //$o .= ""; + //$o .= ""; + $o .= "
"; + return $o; + } +} + +?> Index: trunk/admin/editor/FCKeditor/js/fck_init.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_init.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_init.js (revision 13) @@ -0,0 +1,35 @@ +// #### URLParams: holds all URL passed parameters (like ?Param1=Value1&Param2=Value2) +var URLParams = new Object() ; + +var aParams = document.location.search.substr(1).split('&') ; +for ( i = 0 ; i < aParams.length ; i++ ) +{ + var aParam = aParams[i].split('=') ; + var sParamName = aParam[0] ; + var sParamValue = aParam[1] ; + + // Override any configuration with the same name (if exists) + if ( config[ sParamName ] != null ) + { + if ( sParamValue == "true" ) + config[ sParamName ] = true ; + else if ( sParamValue == "false" ) + config[ sParamName ] = false ; + else if ( ! isNaN( sParamValue ) ) + config[ sParamName ] = parseInt( sParamValue ) ; + else + config[ sParamName ] = sParamValue ; + } + + URLParams[ sParamName ] = sParamValue ; +} + +// Override some configurations (Deprecated) +if (URLParams['Upload']) config.ImageUpload = config.LinkUpload = ( URLParams['Upload'] == 'true' ) ; +if (URLParams['Browse']) config.ImageBrowser = config.LinkBrowser = ( URLParams['Browse'] == 'true' ) ; + +// #### BrowserInfo: holds client informations. +var BrowserInfo = new Object() ; +BrowserInfo.MajorVer = navigator.appVersion.match(/MSIE (.)/)[1] ; +BrowserInfo.MinorVer = navigator.appVersion.match(/MSIE .\.(.)/)[1] ; +BrowserInfo.IsIE55OrMore = BrowserInfo.MajorVer >= 6 || ( BrowserInfo.MajorVer >= 5 && BrowserInfo.MinorVer >= 5 ) ; \ No newline at end of file Index: trunk/admin/editor/FCKeditor/filemanager/upload/asp/upload.asp =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/upload/asp/upload.asp (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/upload/asp/upload.asp (revision 13) @@ -0,0 +1,73 @@ + + + + + FCKeditor - File Upload by Trax + + + + + > + + + + +" name="viewmenu"> + + + + + + + + + Index: trunk/admin/users/group_select.php =================================================================== diff -u --- trunk/admin/users/group_select.php (revision 0) +++ trunk/admin/users/group_select.php (revision 13) @@ -0,0 +1,251 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//admin only util + +$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="checkbox"; +if($_GET["Selector"]) + $SelectorType=$_GET["Selector"]; + +if(strlen($_GET["source"])>0) +{ + switch($_GET["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
"; + $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
"; + $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"]); + $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..
\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 = $itemcount; +$objListView->SelectorType=$SelectorType; + + + +int_header($objListToolBar,NULL,$title); + +if(strlen($_GET["values"])) +{ + $current_value = explode(",",$_GET["values"]); +} +?> + + +PrintList(); +?> + + + +" name="viewmenu"> + + + + + + + + + + Index: trunk/admin/images/toolbar/tool_delete_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/summary/searchbox_cl.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_users_primary_group.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/logo_inportal_top.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_underactbox.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_theme_f3.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/cat_imageedit.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/cat_imageedit.php (revision 0) +++ trunk/kernel/admin/include/toolbar/cat_imageedit.php (revision 13) @@ -0,0 +1,30 @@ + + + + +END; +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/filemanager/upload/jsp/upload.jsp =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/upload/jsp/upload.jsp (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/upload/jsp/upload.jsp (revision 13) @@ -0,0 +1,54 @@ + +<%@ page import = "javazoom.upload.*,java.util.*" %> + + + + + + + + + FCKeditor - File Upload + + +
+<% + ' Files are uploaded to the "UserImages" folder on the web site root. + sDirUrl = "/UserImages/" + + cSysRootDir = Server.MapPath( sDirUrl ) + If Right( cSysRootDir, 1 ) <> "\" Then + cSysRootDir = cSysRootDir & "\" + End If + + Set Uploader = New FileUploader + Uploader.Upload() + + KolkoSlika = Uploader.Files.Count + + If Uploader.Files.Count > 0 Then + For Each oFile in Uploader.Files.Items + sName = Right( CStr( 100000000 + GetNextCounter() ), 8 ) & "_" & oFile.FileName + oFile.SaveToDisk cSysRootDir & sName + strSlika = sDirUrl & sName + Next + End If + + Set Uploader = Nothing + + Response.Write "File uploaded. Number of uploaded files: " & cstr(KolkoSlika) & "

" + Response.Write " + +END; +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/msn/omg_smile.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/login/right.tpl =================================================================== diff -u --- trunk/themes/default/login/right.tpl (revision 0) +++ trunk/themes/default/login/right.tpl (revision 13) @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_homecat_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_delete.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_flag.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/index/right_limited.tpl =================================================================== diff -u --- trunk/themes/default/index/right_limited.tpl (revision 0) +++ trunk/themes/default/index/right_limited.tpl (revision 13) @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: trunk/admin/editor/editor.html =================================================================== diff -u --- trunk/admin/editor/editor.html (revision 0) +++ trunk/admin/editor/editor.html (revision 13) @@ -0,0 +1,96 @@ + + + + + + Editor Demo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+

HTML Editor

+

This version of HTML Editor allows to:

+
    +
  • Change text font, color and size; +
  • Format text as bold, italic or underlined; +
  • Create lists +
  • Change paragraph idents and alignments +
  • Add horizontal lines and links +
    + +
+
+
+
+ + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/fckeditor.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/fckeditor.html (revision 0) +++ trunk/admin/editor/FCKeditor/fckeditor.html (revision 13) @@ -0,0 +1,121 @@ + + + + + FCKeditor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + +
+
+ + + Index: trunk/admin/icons/icon46_settings_search.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/user_addpermission.php =================================================================== diff -u --- trunk/admin/users/user_addpermission.php (revision 0) +++ trunk/admin/users/user_addpermission.php (revision 13) @@ -0,0 +1,265 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} +unset($objEditItems); +$objEditItems = new clsUserManager(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); +$objEditItems->EnablePaging = FALSE; +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); + +$c = $objEditItems->GetItemByIndex($en); + +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_user_sysperm"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:edituser_permission'; + +$PermModule = $_GET["module"]; + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_User")." '".$c->Get("Login")."' - ".prompt_language("la_tab_Permissions"); + +//$formaction = $adminURL."/user/adduser_custom.php?".$envar; + +//Display header +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_permissions.php',0);","tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_permissions.php',-1);","tool_cancel.gif"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/user_addpermission.php"; + $StatusField = "UserEditStatus"; + $form = "edituser"; + MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'&module='.$_REQUEST['module'],'la_PrevUser','la_NextUser'); +} + +//echo "
"; print_r($objCatToolBar); echo "
"; +int_header($objCatToolBar,NULL,$title); + +?> + + + + + + +
+ + + + + ".prompt_language("la_prompt_Description")."\n"; + ?> + +GetPersonalGroup(); + $UserGroupExists = is_object($UserGroup); + $permlist = array(); + + $ado = GetADODBConnection(); + $sql = "SELECT * FROM ".GetTablePrefix()."PermissionConfig AS pc LEFT JOIN ".GetTablePrefix()."Phrase AS p ON pc.Description = p.Phrase WHERE pc.ModuleId='$PermModule' AND p.LanguageId = ".$objSession->Get("Language")." ORDER BY p.Translation ASC"; +//echo $sql; + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + + $rs = $ado->Execute($sql); + while($rs && !$rs->EOF) + { + $desc = $rs->fields["Description"]; + $Permission = $rs->fields["PermissionName"]; + echo ""; + echo ""; + $checked = ""; + if($UserGroupExists) + { + $Inherit = ($UserGroup->HasSystemPermission($Permission)==-1); + } + else + $Inherit =TRUE; + if($Inherit) + { + $checked = " CHECKED"; + $value = $c->HasSystemPermission($Permission); + } + else + $value = $UserGroup->HasSystemPermission($Permission); + echo " \n"; + $checked = ""; + $imgsrc="red"; + if($value==1) + { + $checked = " CHECKED"; + $imgsrc = "green"; + $current = "true"; + } + else + { + $imgsrc = "red"; + $current = "false"; + } + $disabled = ""; + if($Inherit) + { + $InheritValue = $current; + $UnInheritValue = "false"; + $disabled = "DISABLED=\"true\""; + } + else + { + $disabled = ""; + $InheritValue = ($Value==1); + $UnInheritValue = ($Value !=1); + } + echo " "; + $permlist[]=$Permission; + $rs->MoveNext(); + } +?> + +
".prompt_language("la_ColHeader_PermInherited")."".prompt_language("la_ColHeader_PermAccess")."
"; + echo prompt_language($desc).""; + echo " "; + echo "
+ "> + + + "> + + + +
+
+
+ + + +
+ Upload in progress... +
+ + +<% +MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request); +Hashtable files = mrequest.getFiles(); +if ( (files != null) || (!files.isEmpty()) ) { + UploadFile file = (UploadFile) files.get("FCKeditor_File"); + upBean.store(mrequest, "FCKeditor_File"); + String sFileURL = "/UserImages/" + file.getFileName(); + %> + + + <% + } +%> \ No newline at end of file Index: trunk/admin/images/itemicons/icon16_user_deleted.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/question.gif =================================================================== diff -u Binary files differ Index: trunk/admin/main.php =================================================================== diff -u --- trunk/admin/main.php (revision 0) +++ trunk/admin/main.php (revision 13) @@ -0,0 +1,15 @@ + + + +MAIN + + + + + + + + + Index: trunk/kernel/include/adodb/adodb-mysqlt.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-mysqlt.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-mysqlt.inc.php (revision 13) @@ -0,0 +1,53 @@ + + + Requires mysql client. Works on Windows and Unix. +*/ + + +include_once(ADODB_DIR."/adodb-mysql.inc.php"); + + +class ADODB_mysqlt extends ADODB_mysql { + var $databaseType = 'mysqlt'; + + function BeginTrans() + { + $this->Execute('SET AUTOCOMMIT=0'); + $this->Execute('BEGIN'); + return true; + } + + function CommitTrans() + { + $this->Execute('COMMIT'); + $this->Execute('SET AUTOCOMMIT=1'); + return true; + } + + function RollbackTrans() + { + $this->Execute('ROLLBACK'); + $this->Execute('SET AUTOCOMMIT=1'); + return true; + } + +} + +class ADORecordSet_mysqlt extends ADORecordSet_mysql{ + var $databaseType = "mysqlt"; + + function ADORecordSet_mysqlt($queryID) { + return $this->ADORecordSet_mysql($queryID); + } +} +?> \ No newline at end of file Index: trunk/themes/default/register/english_countries.tpl =================================================================== diff -u --- trunk/themes/default/register/english_countries.tpl (revision 0) +++ trunk/themes/default/register/english_countries.tpl (revision 13) @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: trunk/admin/images/itemtabs/tab_inactive_r.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/adduser_items.php =================================================================== diff -u --- trunk/admin/users/adduser_items.php (revision 0) +++ trunk/admin/users/adduser_items.php (revision 13) @@ -0,0 +1,310 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +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"); + +$m = GetModuleArray(); +foreach($m as $key => $value) +{ + $path = $pathtoroot.$value."admin/include/parser.php"; + if( file_exists($path) ) include_once($path); +} + +unset($objEditItems); + +$objEditItems = new clsCatList(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); +$objEditItems->EnablePaging = FALSE; +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); + + +$itemcount=$objEditItems->NumItems(); +$c = $objEditItems->GetItemByIndex($en); + +$objImageList = new clsImageList(); +$objImageList->Query_Images("ResourceId=".$c->Get("ResourceId"),""); + +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_item_list"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:edituser_items'; +$sec = $objSections->GetSection($section); + +$title = admin_language("la_Text_Editing")." ".admin_language("la_Text_User")." '".$c->Get("Login")."' - ".admin_language("la_tab_Images"); + +$objListToolBar = new clsToolBar(); +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','".$admin."/users/user_list.php',1);","tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','".$admin."/users/user_list.php',2);","tool_cancel.gif"); +if($itemcount == 1) $objListToolBar->Add("divider"); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass","ImageChecks"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/adduser_items.php"; + $StatusField = "UserEditStatus"; + $form = "edituser"; + MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevUser','la_NextUser'); + $objListToolBar->Add("divider"); +} + +$listImages = array(); + +$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();"); + + +$title = admin_language("la_Text_Editing")." ".admin_language("la_Text_User")." '".$c->Get("Login")."' - ".admin_language("la_tab_ItemList"); +int_header($objListToolBar,NULL, $title); +?> +
" method=POST> + + +SetVariable("Page_Items",(int)$_GET["lpn"]); + $page = (int)$_GET["lpn"]; +} +else +{ + $page = $objSession->GetVariable("Page_Items"); +} +$objItems = new clsMultiTypeList(); +$table = $objSession->GetEditTable("UserItems"); //$objSession->GetSessionKey()."_UserItems"; +$objItems->SourceTable = $table; + +// ==== build sql depending on modules installed: begin ==== +$prefix = GetTablePrefix(); +$modules = $objModules->GetModuleList(); +$sql_source = $objModules->ExecuteFunction('GetModuleInfo', 'rel_list'); + +$sql_templates['ItemName'] = 'IFNULL('.$prefix."%s.%s,' ')"; +$sql_templates['TableJoin'] = 'LEFT JOIN '.$prefix."%1\$s ON ".$prefix."%1\$s.ResourceId = ut.ResourceId"; +$sql_templates['ItemType'] = "IF(ut.ItemType = %s, '%s', %s)"; + +$sql = "SELECT TRIM(CONCAT(%s)) AS ItemName, %s AS ItemTypeStr, ut.ItemType as ItemType, ". + 'ut.ResourceId as ItemId FROM '.$table." ut %s ". + 'WHERE ut.PortalUserId = '.$c->Get("PortalUserId"); + + +$sql_parts = Array(); +$sql_parts['ItemType'] = "''"; +foreach($modules as $module) +{ + $sql_parts['ItemName'][] = sprintf($sql_templates['ItemName'], $sql_source[$module]['MainTable'], $sql_source[$module]['ItemNameField']); + $sql_parts['TableJoin'][] = sprintf($sql_templates['TableJoin'], $sql_source[$module]['MainTable']); + $sql_parts['ItemType'] = sprintf( $sql_templates['ItemType'], + $sql_source[$module]['TargetType'], + admin_language($sql_source[$module]['ItemNamePhrase']), + $sql_parts['ItemType']); +} + +$sql = sprintf($sql, implode(', ',$sql_parts['ItemName']), $sql_parts['ItemType'], implode(' ',$sql_parts['TableJoin'])); +// ==== build sql depending on modules installed: end ==== + +if(strlen($itemFilter)) + $sql .= " AND ($itemFilter)"; + +$countwhere = "PortalUserId=".$c->Get("PortalUserId"); +if(strlen($itemFilter)) + $countwhere .= " AND ($itemFilter)"; + +$itemcount = TableCount($table,$countwhere,0); + +if(strlen(trim($objConfig->Get("UserItem_LV_Sortfield")))) +{ + $order = " ORDER BY ". $objConfig->Get("UserItem_LV_Sortfield")." ".$objConfig->Get("UserItem_LV_Sortorder"); +} +else + $order = ""; + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + +$objListView = new clsListView($objListToolBar); +$objListView->CurrentPageVar = "Page_Items"; +$objListView->PerPageVar = "Perpage_Items"; + +$objItems->Query_Item($sql, $objListView->GetLimitSQL() ); + + +for($i=0;$iItems);$i++) +{ + $item =& $objItems->GetItemRefByIndex($i); + + $n = $item->Get("ItemName"); + $type = $item->Get("ItemType"); + $url = $objItemTypes->GetTypeEditUrl($type); + if(strlen($url)) + { + $url .= "?env=".BuildEnv()."&newsession=1&item=".$item->Get("ItemId")."&return=".$admin."/users/adduser_items.php"; + $url = "$n"; + $item->Set("ItemName",$url); + } +} + + $objListView->SetListItems($objItems); + $objListView->IdField = "ResourceId"; + $order = $objConfig->Get("UserItem_LV_Sortfield"); + $SortOrder=0; + if($objConfig->Get("UserItem_LV_Sortorder")=="asc") + $SortOrder=1; + + $objListView->ColumnHeaders->Add("ItemName",admin_language("la_ColHeader_Item"),1,0,$order,"width=\"20%\"","UserItem_LV_Sortfield","UserItem_LV_Sortorder" ,"ItemName"); + $objListView->ColumnHeaders->Add("ItemTypeStr",admin_language("la_ColHeader_ItemType"),1,0,$order,"width=\"20%\"","UserItem_LV_Sortfield","UserItem_LV_Sortorder","ItemType"); + //$objListView->ColumnHeaders->Add("DateCreated",admin_language("la_prompt_CreatedOn"),1,0,$order,"width=\"20%\"","UserItem_LV_Sortfield","UserItem_LV_Sortorder","DateCreated"); + + $objListView->ColumnHeaders->SetSort($objConfig->Get("UserItem_LV_Sortfield"), $objConfig->Get("UserItem_LV_Sortorder")); + + $objListView->PrintToolBar = FALSE; + $objListView->checkboxes = FALSE; + $objListView->CheckboxName = ""; + $objListView->TotalItemCount = $itemcount; + + +/* for($i=0;$iItems);$i++) + { + $img =& $objImageList->GetItemRefByIndex($i); + $objListView->RowIcons[] = $img->Get("Icon"); + } +*/ + //$objListView->SliceItems(); + print $objListView->PrintList(); + +?> + "> + + + +
+
> + + + + +
+ + +
+ +
" name="viewmenu"> + + + + +
+ + + + + Index: trunk/admin/images/toolbar/icon16_search_reset_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/dialog/fck_flash.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/dialog/fck_flash.html (revision 0) +++ trunk/admin/editor/FCKeditor/dialog/fck_flash.html (revision 13) @@ -0,0 +1,376 @@ + + + + + + + + + + + + + + + + +
+ + + + + + +
URL
+ + + + + + + + + + + +
    + + +
+ +
+ +
+
+ + + + + + +
+
+ + + + + + + + + +
Width  +
Height  +
+ + Lock Ratio + +
    + + + + + + + +
Preview
+ +
+
+
+
+
+ + + Index: trunk/admin/editor/FCKeditor/lang/es.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/es.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/es.js (revision 13) @@ -0,0 +1,198 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * es.js: Spanish support. + * + * Authors: + * Gabriel Schillaci (gabriel@rapisitio.net) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Cortar" ; +lang["Copy"] = "Copiar" ; +lang["Paste"] = "Pegar" ; +lang["PasteText"] = "Pegar como texto plano" ; +lang["PasteWord"] = "Pegar desde Word" ; +lang["Find"] = "Buscar" ; +lang["SelectAll"] = "Seleccionar todo" ; +lang["RemoveFormat"] = "Eliminar Formato" ; +lang["InsertLink"] = "Insertar/Editar Vínculo" ; +lang["RemoveLink"] = "Eliminar Vínculo" ; +lang["InsertImage"] = "Insertar/Editar Imagen" ; +lang["InsertTable"] = "Insertar/Editar Tabla" ; +lang["InsertLine"] = "Insertar Línea Horizontal" ; +lang["InsertSpecialChar"] = "Insertar Caracter Especial" ; +lang["InsertSmiley"] = "Insertar Iconos" ; +lang["About"] = "Acerca de FCKeditor" ; + +lang["Bold"] = "Negrita" ; +lang["Italic"] = "Itálica" ; +lang["Underline"] = "Subrayado" ; +lang["StrikeThrough"] = "Tachado" ; +lang["Subscript"] = "Superíndice" ; +lang["Superscript"] = "Subíndice" ; +lang["LeftJustify"] = "Alineado a Derecha" ; +lang["CenterJustify"] = "Centrado" ; +lang["RightJustify"] = "Alineado a Izquierda" ; +lang["BlockJustify"] = "Justificado" ; +lang["DecreaseIndent"] = "Disminuir Sangría" ; +lang["IncreaseIndent"] = "Aumentar Sangría" ; +lang["Undo"] = "Deshacer" ; +lang["Redo"] = "Rehacer" ; +lang["NumberedList"] = "Numeración" ; +lang["BulettedList"] = "Viñetas" ; + +lang["ShowTableBorders"] = "Mostrar Bordes de Tablas" ; +lang["ShowDetails"] = "Mostrar saltos de Párrafo" ; + +lang["FontStyle"] = "Estilo" ; +lang["FontFormat"] = "Formato" ; +lang["Font"] = "Fuente" ; +lang["FontSize"] = "Tamaño" ; +lang["TextColor"] = "Color de Texto" ; +lang["BGColor"] = "Color de Fondo" ; +lang["Source"] = "Fuente HTML" ; + +// Context Menu + +lang["EditLink"] = "Editar Vínculo" ; +lang["InsertRow"] = "Insertar Fila" ; +lang["DeleteRows"] = "Eliminar Filas" ; +lang["InsertColumn"] = "Insertar Columnas" ; +lang["DeleteColumns"] = "Eliminar Columnas" ; +lang["InsertCell"] = "Insertar Celdas" ; +lang["DeleteCells"] = "Eliminar Celdas" ; +lang["MergeCells"] = "Unir Celdas" ; +lang["SplitCell"] = "Dividir Celda" ; +lang["CellProperties"] = "Propiedades de Celda" ; +lang["TableProperties"] = "Propiedades de Tabla" ; +lang["ImageProperties"] = "Propiedades de Imagen" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Procesando XHTML. Por favor aguarde..." ; +lang["Done"] = "Hecho" ; +lang["PasteWordConfirm"] = "El texto que desea pegar parece provenir de Word. Desea depurarlo antes de copiarlo?" ; +lang["NotCompatiblePaste"] = "Este comando sólo está disponible para Internet Explorer 5.5 o superior. Desea pegar sin depurar?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Cancelar" ; +lang["DlgBtnClose"] = "Cerrar" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Insertar Imagen" ; +lang["DlgImgTitleEdit"] = "Editar Imagen" ; +lang["DlgImgBtnUpload"] = "Enviar al Servidor" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Cargar" ; +lang["DlgImgBtnBrowse"] = "Ver Repositorio" ; +lang["DlgImgAlt"] = "Texto Alternativo" ; +lang["DlgImgWidth"] = "Anchura" ; +lang["DlgImgHeight"] = "Altura" ; +lang["DlgImgLockRatio"] = "Proporcional" ; +lang["DlgBtnResetSize"] = "Tamaño Original" ; +lang["DlgImgBorder"] = "Bordes" ; +lang["DlgImgHSpace"] = "Esp.Horiz." ; +lang["DlgImgVSpace"] = "Esp.Vert." ; +lang["DlgImgAlign"] = "Alineación" ; +lang["DlgImgAlignLeft"] = "Left" ; +lang["DlgImgAlignAbsBottom"] = "Abs Bottom" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Middle" ; +lang["DlgImgAlignBaseline"] = "Baseline" ; +lang["DlgImgAlignBottom"] = "Bottom" ; +lang["DlgImgAlignMiddle"] = "Middle" ; +lang["DlgImgAlignRight"] = "Right" ; +lang["DlgImgAlignTextTop"] = "Text Top" ; +lang["DlgImgAlignTop"] = "Top" ; +lang["DlgImgPreview"] = "Vista Previa" ; +lang["DlgImgMsgWrongExt"] = "Sólo se aceptan los siguientes tipos de archivo:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperación cancelada." ; +lang["DlgImgAlertSelect"] = "Por favor seleccione una imagen a cargar." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Vínculo" ; // NEW +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Cargar" ; +lang["DlgLnkTarget"] = "Target" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Nueva Ventana (_blank)" ; +lang["DlgLnkTargetParent"] = "Ventana Padre (_parent)" ; +lang["DlgLnkTargetSelf"] = "Misma Ventana (_self)" ; +lang["DlgLnkTargetTop"] = "Ventana Principal (_top)" ; +lang["DlgLnkTitle"] = "Título" ; +lang["DlgLnkBtnUpload"] = "Enviar al Servidor" ; +lang["DlgLnkBtnBrowse"] = "Ver Repositorio" ; +lang["DlgLnkMsgWrongExtA"] = "Sólo se aceptan los siguientes tipos de archivo:\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperación cancelada." ; +lang["DlgLnkMsgWrongExtD"] = "Los siguientes tipos de archivo no son aceptados:\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperación cancelada." ; + +// Color Dialog +lang["DlgColorTitle"] = "Seleccionar Color" ; +lang["DlgColorBtnClear"] = "Borrar" ; +lang["DlgColorHighlight"] = "Resaltar" ; +lang["DlgColorSelected"] = "Selecionado" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Insertar un Icono" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Insertar Caracter Especial" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Insertar Tabla" ; +lang["DlgTableTitleEdit"] = "Editar Tabla" ; +lang["DlgTableRows"] = "Filas" ; +lang["DlgTableColumns"] = "Columnas" ; +lang["DlgTableBorder"] = "Borde" ; +lang["DlgTableAlign"] = "Alineación" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Izquierda" ; +lang["DlgTableAlignCenter"] = "Centrado" ; +lang["DlgTableAlignRight"] = "Derecha" ; +lang["DlgTableWidth"] = "Anchura" ; +lang["DlgTableWidthPx"] = "pixeles" ; +lang["DlgTableWidthPc"] = "porcentaje" ; +lang["DlgTableHeight"] = "Altura" ; +lang["DlgTableCellSpace"] = "Esp. e/celdas" ; +lang["DlgTableCellPad"] = "Esp. interior" ; +lang["DlgTableCaption"] = "Título" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Propiedades de Celda" ; +lang["DlgCellWidth"] = "Anchura" ; +lang["DlgCellWidthPx"] = "pixeles" ; +lang["DlgCellWidthPc"] = "porcentaje" ; +lang["DlgCellHeight"] = "Altura" ; +lang["DlgCellWordWrap"] = "Cortar Línea" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Sí" ; +lang["DlgCellWordWrapNo"] = "No" ; +lang["DlgCellHorAlign"] = "Alineación Horizontal" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Izquierda" ; +lang["DlgCellHorAlignCenter"] = "Centrado" ; +lang["DlgCellHorAlignRight"] = "Derecha" ; +lang["DlgCellVerAlign"] = "Alineación Vertical" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Top" ; +lang["DlgCellVerAlignMiddle"] = "Middle" ; +lang["DlgCellVerAlignBottom"] = "Bottom" ; +lang["DlgCellVerAlignBaseline"] = "Baseline" ; +lang["DlgCellRowSpan"] = "Abarcar Filas" ; +lang["DlgCellCollSpan"] = "Abarcar Columnas" ; +lang["DlgCellBackColor"] = "Color de Fondo" ; +lang["DlgCellBorderColor"] = "Color de borde" ; +lang["DlgCellBtnSelect"] = "Seleccione..." ; + +// About Dialog +lang["DlgAboutVersion"] = "versión" ; +lang["DlgAboutLicense"] = "Licenciado bajo los términos de la GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "Para mayor información vaya a" ; \ No newline at end of file Index: trunk/admin/include/mainscript.php =================================================================== diff -u --- trunk/admin/include/mainscript.php (revision 0) +++ trunk/admin/include/mainscript.php (revision 13) @@ -0,0 +1,500 @@ +Get("ampm_time")=="1") +{ + $ampm = "true"; +} + +require_once($pathtoroot.$admin."/lv/js/js_lang.php"); +print << + + +END; +?> Index: trunk/admin/config/addlang_export_result.php =================================================================== diff -u --- trunk/admin/config/addlang_export_result.php (revision 0) +++ trunk/admin/config/addlang_export_result.php (revision 13) @@ -0,0 +1,158 @@ +$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +$objLangList = new clsLanguageList(); + +if (isset($_POST["itemlist"])) +{ + $LangIds = implode(",",$_POST["itemlist"]); + $sql = "SELECT * FROM ".$objLangList->SourceTable." WHERE LanguageId IN ($LangIds)"; + + $objLangList->Query_Item($sql); + $names = array(); + foreach($objLangList->Items as $l) + { + $names[] = $l->Get("PackName"); + } + $names = implode(",",$names); +} +$action = "m_lang_export"; +$section = "in-portal:lang_export"; +$envar = "env=".BuildEnv(); + +$title = prompt_language("la_Text_Export")." ".prompt_language("la_Text_Languages")." ".prompt_language("la_Text_Results"); + +int_header($objCatToolBar,NULL,$title); +?> + + + + > + + + + + + > + + + + + + > + + + + Index: trunk/kernel/include/itemtypes.php =================================================================== diff -u --- trunk/kernel/include/itemtypes.php (revision 0) +++ trunk/kernel/include/itemtypes.php (revision 13) @@ -0,0 +1,236 @@ +clsItemDB(); + $this->NoResourceId=1; + $this->table = GetTablePrefix()."ItemTypes"; + $this->id_field="ItemType"; + if($ItemType) + $this->LoadFromDatabase($ItemType); + } + + function LoadFromDatabase($ItemType) + { + 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; + if(is_array($data)) + $this->SetFromArray($data); + $this->Clean(); + return TRUE; + } + + function GetEditURL() + { + global $rootURL; + + $url = $this->Get("EditUrl"); + + if(strlen($url)) + { + $ret = $rootURL.$url; + } + else + $ret = ""; + + return $ret; + } + function GetTemplatePath() + { + $m = $this->Get("Module"); + + } +} + +class clsItemTypeList extends clsItemCollection +{ + function clsItemTypeList() + { + $this->clsItemCollection(); + $this->SourceTable = GetTablePrefix()."ItemTypes"; + $this->classname="clsItemType"; + $this->LoadAllItems(); + } + + function LoadAllItems() + { + $t = $this->SourceTable; + $m = GetTablePrefix()."Modules"; + $sql = "SELECT * FROM $t INNER JOIN $m ON ($t.Module=$m.Name) WHERE Loaded=1 ORDER BY LoadOrder"; + $this->Query_Item($sql); + } + + function LoadPrimaryItems() + { + $t = $this->SourceTable; + $m = GetTablePrefix()."Modules"; + $sql = "SELECT * FROM $t INNER JOIN $m ON ($t.Module=$m.Name) WHERE Loaded=1 ORDER BY LoadOrder WHERE PrimaryItem=1"; + $this->Query_Item($sql); + } + + function BuildUserItemTable($UserId,$ClearTable=1) + { + global $objSession; + + $dest_table = $objSession->GetEditTable("UserItems"); // $objSession->GetSessionKey()."_UserItems"; + if($ClearTable) + { + @$this->adodbConnection->Execute("DROP TABLE ".$dest_table); + $sql = "CREATE TABLE ".$dest_table." ("; + $sql .="PortalUserId INT, "; + $sql .="ResourceId INT, "; + $sql .="ItemType INT)"; + $this->adodbConnection->Execute($sql); + } + + foreach($this->Items as $t) + { + $Source = GetTablePrefix().$t->Get("SourceTable"); + $Field = $t->Get("CreatorField"); + $Type = $t->Get("ItemType"); + $sel = "SELECT ResourceId FROM $Source WHERE $Field=$UserId"; + $rs = $this->adodbConnection->Execute($sel); + while($rs && !$rs->EOF) + { + $ins = "INSERT INTO $dest_table VALUES ($UserId,".$rs->fields["ResourceId"].",$Type)"; + $this->adodbConnection->Execute($ins); + $rs->MoveNext(); + } + } + return $dest_table; + } + + function GetTypeByClassName($name) + { + $ret = NULL; + foreach($this->Items as $i) + { + if($i->Get("ClassName")==$name) + { + $ret = $i; + break; + } + } + return $ret; + } + function GetTypeByName($name) + { + $ret = NULL; + foreach($this->Items as $i) + { + if(strtolower($i->Get("ItemName"))==strtolower($name)) + { + $ret = $i; + break; + } + } + return $ret; + } + + function GetItemTypeValue($name) + { + $ret = NULL; + foreach($this->Items as $i) + { + if(strtolower($i->Get("ItemName"))==strtolower($name)) + { + $ret = $i; + break; + } + } + $value = 0; + if(is_object($ret)) + $value = $i->Get("ItemType"); + return $value; + } + + function GetItem($id,$db=FALSE) + { + foreach($this->Items as $i) + { + if($i->Get("ItemType")==$id) + { + $ret = $i; + break; + } + } + return $ret; + } + + function GetTypeEditUrl($type) + { + foreach($this->Items as $i) + { + if($i->Get("ItemType")==$type) + { + $ret = $i->GetEditURL(); + break; + } + } + return $ret; + } +} + +class clsMultiTypeList extends clsItemCollection +{ + function clsMultiTypeList() + { + $this->clsItemCollection(); + $this->classname = "clsItem"; + } + + function Query_Item($sql, $offset=-1,$rows=-1,$Type="") + { + global $Errors; + + if($rows>-1 && $offset>-1) + { + //echo "Executing SelectLimit $sql Offset: $offset,$rows
\n"; + $result = $this->adodbConnection->SelectLimit($sql, $rows,$offset); + } + else + $result = $this->adodbConnection->Execute($sql); + + if ($result === false) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Query_Item"); + return false; + } + LogEntry("SQL Loop Start\n"); + $count = 0; + + while ($result && !$result->EOF) + { + $count++; + $data = $result->fields; + $i =& $this->AddItemFromArray($data,TRUE); + if(is_numeric($Type)) + $i->type = $Type; + if(ADODB_EXTENSION>0) + { + adodb_movenext($result); + } + else + $result->MoveNext(); + } + + LogEntry("SQL Loop End ($count iterations)\n"); + return $this->Items; + } +} Index: trunk/admin/browse/toolbar.js =================================================================== diff -u --- trunk/admin/browse/toolbar.js (revision 0) +++ trunk/admin/browse/toolbar.js (revision 13) @@ -0,0 +1,220 @@ +var toolbar; +//var imagesPath = "images/"; +var separatorImg = "divider"; +var imagesPreName = "tool_"; +var imagesPostName_Active = "_f2"; +var imagesPostName_Disabled = "_f3"; +var imagesExt = ".gif"; +var preloadImages = new Array(); + +preloadImage(getButtonSrc(separatorImg, 0)); + +function initToolbar(id, actionHandler) +{ + toolbar = document.getElementById(id); + if (!toolbar) return; + toolbar.actionHandler = actionHandler; + toolbar.className = "toolbarDiv" + var childNodes = toolbar.getElementsByTagName("*"); + if (childNodes.length == 0) childNodes = toolbar.childNodes; + + var _oTable = document.createElement("TABLE"); + var _oTBody = document.createElement("TBODY"); + var _oTR = document.createElement("TR"); + var _oTD = document.createElement("TD"); + + _oTD.className = "toolbarTD"; + + _oTR.appendChild(_oTD); + _oTBody.appendChild(_oTR); + _oTable.appendChild(_oTBody); + _oTable.align = "left"; + _oTable.cellSpacing = 0; + _oTable.cellPadding = 0; + _oTable.border = 0; + _oTable.className= "toolbarTable" + _oTable.width = "100%"; + + + var oTable = document.createElement("TABLE"); + var oTBody = document.createElement("TBODY"); + var oTR = document.createElement("TR"); + oTR.parentToolbar = toolbar; + oTBody.appendChild(oTR); + oTable.appendChild(oTBody); + oTable.align = "left"; + oTable.cellSpacing = 0; + oTable.cellPadding = 0; + oTable.border = 0; +// oTable.width = "100%"; + + oTable.className= "toolbarTable" + _oTD.appendChild(oTable); + + + for (var i = 0; i < childNodes.length; i++) + if (childNodes[i].nodeType == 1) + { + oTD = document.createElement("TD"); + oTD.action = childNodes[i].getAttribute("action"); +// oTD.width = "1%"; + oIMG = document.createElement("IMG"); + if (childNodes[i].getAttribute("align") == "right" && !oTR.alignedRight) + { + _owTD = document.createElement("TD"); + _owTD.innerHTML = " "; + _owTD.width = "99%"; + oTR.appendChild(_owTD); + oTR.alignedRight = true; + } + + switch(childNodes[i].tagName.toLowerCase()) + { + case "tb:separator" : + oIMG.basepath = childNodes[i].getAttribute("ImagePath"); + oIMG.action = "divider"; + oIMG.src = getButtonSrc(oIMG, 0); + break; + case "tb:button" : + oIMG.toolbar = toolbar; + oIMG.action = childNodes[i].getAttribute("action"); + var enabled = new String(childNodes[i].getAttribute("enabled")); + oIMG.disabled = (enabled == "false"); + oIMG.basepath = childNodes[i].getAttribute("ImagePath"); + oIMG.src = getButtonSrc(oIMG, (oIMG.disabled) ? 2 : 0) + for (var j = 0; j < 3; j++) + preloadImage(getButtonSrc(oIMG, j),oIMG.basepath); + + oIMG.style.cursor = (oIMG.disabled) ? "default" : "hand"; + oIMG.setAttribute("alt", childNodes[i].getAttribute("alt")); + + oIMG.onclick = function() + { + if (this.disabled) return; + if (this.toolbar.actionHandler) + this.toolbar.actionHandler(this) + } + + oIMG.onmouseover = function(e) + { + if (this.disabled) return; + this.src = getButtonSrc(this, 1); + var evt = (e) ? e : event; evt.cancelBubble = true; + } + + oIMG.onmouseout = function(e) + { + if (this.disabled) return; + this.src = getButtonSrc(this, 0); + var evt = (e) ? e : event; evt.cancelBubble = true; + } + break; + } + var tab = (childNodes[i].getAttribute("tab")) ? childNodes[i].getAttribute("tab") : ""; + oTD.tab = tab; + if (tab != "") oTD.style.display = "none"; + oTD.appendChild(oIMG); + oTR.appendChild(oTD) + } + toolbar.appendChild(_oTable); + + toolbar.setTab = toolbarSetTab; + toolbar.showButton = toolbarShowButton; + toolbar.enableButton = toolbarEnableButton; + toolbar.disableButton = toolbarDisableButton; +} + +function toolbarSetTab(tab) +{ + var TDs = this.getElementsByTagName("TD"); + + for (var i = 0; i < TDs.length; i++) + if (TDs[i].tab) + if (TDs[i].tab != "") + { + if (TDs[i].tab == tab) TDs[i].style.display = "" + else TDs[i].style.display = "none"; + } +} + +function toolbarShowButton(action, value) +{ + var TDs = this.getElementsByTagName("TD"); + + for (var i = 0; i < TDs.length; i++) + if (TDs[i].action == action) + TDs[i].style.display = (value) ? "" : "none"; +} + +function findButton(toolbar, action) +{ + if (!toolbar) return; + var buttons = toolbar.getElementsByTagName("IMG"); + for (var i = 0; i < buttons.length; i++) + if (buttons[i].action == action) return buttons[i]; +} + + +function toolbarEnableButton(action, value) +{ + var button = findButton(this, action); + if (!button) return; + button.src = getButtonSrc(button, (value == false) ? 2 : 0) + button.style.cursor = (value == false) ? "default" : "hand"; + button.disabled = (value == false) ? true : false; +} + +function toolbarDisableButton(action) +{ + this.enableButton(action, false) +} + +function getButtonSrc(button, state) +{ + var stateExt; + switch(state) + { + case (1) : stateExt = imagesPostName_Active; break; + case (2) : stateExt = imagesPostName_Disabled; break; + default : stateExt = ""; + } + + return button.basepath + imagesPreName + button.action + stateExt + imagesExt; +} + +function preloadImage(src) +{ + var img = new Image(); + img.src = src; + preloadImages[preloadImages.length] = img; +} + + +function showContextMenu(evt) { + initContextMenu(evt.clientX,evt.clientY); + window.FW_showMenu(window.contextMenu,evt.clientX,evt.clientY); + evt.returnValue = false; + evt.cancelBubble = true; + return false; +} + +function initContextMenu(){ + window.contextMenu = new Menu("Context"); + contextMenu.addMenuItem("Edit","check_submit('','edit');",""); + contextMenu.addMenuItem("Delete","check_submit('admin/browse','delete');",""); + contextMenu.addMenuSeparator(); + contextMenu.addMenuItem("Approve","check_submit('admin/browse','approve');",""); + contextMenu.addMenuItem("Decline","check_submit('admin/browse','decline');",""); + contextMenu.addMenuSeparator(); + contextMenu.addMenuItem("Cut","check_submit('admin/browse','cut');",""); + contextMenu.addMenuItem("Copy","check_submit('admin/browse','copy');",""); + if (typeof(activeTab) != 'undefined') { + if(TabPasteEnabled(activeTab.title)) { + contextMenu.addMenuItem("Paste","check_submit('admin/browse','paste');",""); + } + } + + window.triedToWriteMenus = false; + window.contextMenu.writeMenus(); + return true; +} Index: trunk/admin/tree/ftiens4.js =================================================================== diff -u --- trunk/admin/tree/ftiens4.js (revision 0) +++ trunk/admin/tree/ftiens4.js (revision 13) @@ -0,0 +1,1025 @@ +//**************************************************************** + +// Keep this copyright notice: + +// This copy of the script is the property of the owner of the + +// particular web site you were visiting. + +// Do not download the script's files from there. + +// For a free download and full instructions go to: + +// http://www.geocities.com/marcelino_martins/foldertree.html + +// + +// Author: Marcelino Alves Martins (http://www.mmartins.com) + +// 1997--2001. + +//**************************************************************** + + + +// Log of changes: + +// 10 Aug 01 - Support for Netscape 6 + +// + +// 17 Feb 98 - Fix initialization flashing problem with Netscape + +// + +// 27 Jan 98 - Root folder starts open; support for USETEXTLINKS; + +// make the ftien4 a js file + + + + + +// Definition of class Folder + +// ***************************************************************** + + + +function Folder(folderDescription, hreference) //constructor +{ +//constant data + this.desc = folderDescription + this.hreference = hreference + this.id = -1 + this.navObj = 0 + this.iconImg = 0 + this.nodeImg = 0 + this.isLastNode = 0 + + + + //dynamic data + + this.isOpen = true + + this.iconSrc = "ftv2folderopen.gif" + + this.children = new Array + + this.nChildren = 0 + + + + //methods + + this.initialize = initializeFolder + + this.setState = setStateFolder + + this.addChild = addChild + + this.createIndex = createEntryIndex + + this.escondeBlock = escondeBlock + + this.esconde = escondeFolder + + this.mostra = mostra + + this.renderOb = drawFolder + + this.totalHeight = totalHeight + + this.subEntries = folderSubEntries + + this.outputLink = outputFolderLink + + this.blockStart = blockStart + + this.blockEnd = blockEnd + +} + + + +function initializeFolder(level, lastNode, leftSide) + +{ + + var j=0 + + var i=0 + + var numberOfFolders + + var numberOfDocs + + var nc + + + + nc = this.nChildren + + + + this.createIndex() + + + + var auxEv = "" + + + + if (browserVersion > 0) + + auxEv = "" + + else + + auxEv = "" + + + + if (level>0) + + if (lastNode) //the last child in the children array + + { + + this.renderOb(leftSide + auxEv + "") + + leftSide = leftSide + "" + + this.isLastNode = 1 + + } + + else + + { + + this.renderOb(leftSide + auxEv + "") + + leftSide = leftSide + "" + + this.isLastNode = 0 + + } + + else + + this.renderOb("") + + + + if (nc > 0) + + { + + level = level + 1 + + for (i=0 ; i < this.nChildren; i++) + + { + + if (i == this.nChildren-1) + + this.children[i].initialize(level, 1, leftSide) + + else + + this.children[i].initialize(level, 0, leftSide) + + } + + } + +} + + + +function setStateFolder(isOpen) + +{ + + var subEntries + + var totalHeight + + var fIt = 0 + + var i=0 + + + + if (isOpen == this.isOpen) + + return + + + + if (browserVersion == 2) + + { + + totalHeight = 0 + + for (i=0; i < this.nChildren; i++) + + totalHeight = totalHeight + this.children[i].navObj.clip.height + + subEntries = this.subEntries() + + if (this.isOpen) + + totalHeight = 0 - totalHeight + + for (fIt = this.id + subEntries + 1; fIt < nEntries; fIt++) + + indexOfEntries[fIt].navObj.moveBy(0, totalHeight) + + } + + this.isOpen = isOpen + + propagateChangesInState(this) + +} + + + +function propagateChangesInState(folder) + +{ + + var i=0 + + + + if (folder.isOpen) + + { + + if (folder.nodeImg) + + if (folder.isLastNode) + + folder.nodeImg.src = "ftv2mlastnode.gif" + + else + + folder.nodeImg.src = "ftv2mnode.gif" + + folder.iconImg.src = folder.iconSrc; // "ftv2folderopen.gif" + + for (i=0; i") + + + + this.blockEnd() + + + + if (browserVersion == 1) { + + this.navObj = doc.all["folder"+this.id] + + this.iconImg = doc.all["folderIcon"+this.id] + + this.nodeImg = doc.all["nodeIcon"+this.id] + + } else if (browserVersion == 2) { + + this.navObj = doc.layers["folder"+this.id] + + this.iconImg = this.navObj.document.images["folderIcon"+this.id] + + this.nodeImg = this.navObj.document.images["nodeIcon"+this.id] + + doc.yPos=doc.yPos+this.navObj.clip.height + + } else if (browserVersion == 3) { + + this.navObj = doc.getElementById("folder"+this.id) + + this.iconImg = doc.getElementById("folderIcon"+this.id) + + this.nodeImg = doc.getElementById("nodeIcon"+this.id) + + } + +} + + + +function outputFolderLink() + +{ + + if (this.hreference) + + { + + doc.write(" 0) + + doc.write("onClick='javascript:clickOnFolder("+this.id+")'") + + doc.write(">") + + } + + else + + doc.write("") + +// doc.write("") + +} + + + +function addChild(childNode) + +{ + + this.children[this.nChildren] = childNode + + this.nChildren++ + + return childNode + +} + + + +function folderSubEntries() + +{ + + var i = 0 + + var se = this.nChildren + + + + for (i=0; i < this.nChildren; i++){ + + if (this.children[i].children) //is a folder + + se = se + this.children[i].subEntries() + + } + + + + return se + +} + + + + + +// Definition of class Item (a document or link inside a Folder) + +// ************************************************************* + + + +function Item(itemDescription, itemLink) // Constructor + +{ + + // constant data + + this.desc = itemDescription + + this.link = itemLink + + this.id = -1 //initialized in initalize() + + this.navObj = 0 //initialized in render() + + this.iconImg = 0 //initialized in render() + + //this.iconSrc = "ftv2doc.gif" + + + + // methods + + this.initialize = initializeItem + + this.createIndex = createEntryIndex + + this.esconde = escondeBlock + + this.mostra = mostra + + this.renderOb = drawItem + + this.totalHeight = totalHeight + + this.blockStart = blockStart + + this.blockEnd = blockEnd + +} + + + +function initializeItem(level, lastNode, leftSide) + +{ + + this.createIndex() + + + + if (level>0) + + if (lastNode) //the last 'brother' in the children array + + { + + this.renderOb(leftSide + "") + + leftSide = leftSide + "" + + } + + else + + { + + this.renderOb(leftSide + "") + + leftSide = leftSide + "" + + } + + else + + this.renderOb("") + +} + + + +function drawItem(leftSide) + +{ + + this.blockStart("item") + + + + doc.write(" + + + + \ No newline at end of file Index: trunk/admin/icons/icon24_navigate.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/advsearch.php =================================================================== diff -u --- trunk/kernel/include/advsearch.php (revision 0) +++ trunk/kernel/include/advsearch.php (revision 13) @@ -0,0 +1,192 @@ +clsItemCollection(); + $this->SourceTable = $SearchSource; + $this->SetResultTable($SearchSource,$DataClass); + $this->FieldList = array(); + $this->Relationships = array(); + $this->Ignored_Words = array(); + $this->WhereClauses = array(); + $this->FieldWeight = array(); + $this->Keywords = GetKeywords(""); + $this->SearchType = 0; //simple + $this->RequiredRelevance=0; + $this->PctRelevance = $objConfig->Get("SearchRel_DefaultKeyword")/100; + $this->PctPop = $objConfig->Get("SearchRel_DefaultPop")/100; + $this->PctRating = $objConfig->Get("SearchRel_DefaultRating")/100; + if(!is_object($objSearchConfig)) + $objSearchConfig = new clsSearchConfigList(); + $objSearchConfig->Clear(); + $objSearchConfig->Query_Item("SELECT * FROM ".$objSearchConfig->SourceTable." WHERE TableName='$SearchSource' AND AdvancedSearch=1 ORDER BY DisplayOrder"); + } + + function SetResultTable($SearchSource,$DataClass) + { + global $objSession; + + $this->ResultTable = $objSession->GetSessionKey()."_Search"; + $this->classname= $DataClass; + } + + function LoadSearchResults($Start=0,$PerPage=NULL) + { + if($PerPage) + { + $limit = "LIMIT $Start,$PerPage"; + } + $sql = "SELECT * FROM ".$this->ResultTable." ".$limit; + $this->Clear(); + $rs = $this->adodbConnection->Execute($sql); + return $this->Query_Item($sql); + } + + function SetCategoryClause($whereclause) + { + $this->CatClause=$whereclause; + } + + function AddRelationship($JoinTable,$JoinExpression=NULL) + { + $this->Relationships[$JoinTable]=$JoinExpression; + } + + function SetKeywords($keywords) + { + $this->Phrase=$keywords; + $this->keywords = GetKeywords($keywords); + } + + function AddAdvancedField($TableName,$FieldName,$Verb,$Value,$conj) + { + global $objSearchConfig; + + if(!is_object($objSearchConfig)) + $objSearchConfig = new clsSeachConfigList(); + + $f = GetTablePrefix().$TableName.".".$FieldName; + $FieldConfig = $objSearchConfig->GetItemByName($TableName,$FieldName); + if(is_object($FieldConfig)) + { + if(strlen($FieldConfig->Get("ForeignField"))>0) + { + $parts = explode(".",$FieldConfig->Get("ForeignField")); + $Table = $parts[0]; + $Table = AddTablePrefix($Table); + $Field = $parts[1]; + $join = $FieldConfig->Get("JoinClause"); + $join = str_replace("{ForeignTable}",$Table,$join); + $join = str_replace("{LocalTable}",AddTablePrefix($TableName),$join); + $this->AddRlationship($Table,$join); + + $FieldItem["where"] = $FieldConfig->GetWhereClause($Verb,$Value); + $FieldItem["Field"] = $FieldConfig->Get("ForeignField"); + $FieldItem["Table"] = ""; + $FieldItem["conjuction"] = $conj; + $FieldItem["weight"] = $FieldConfig->Get("Priority"); + } + else + { + $FieldItem = array(); + $FieldItem["Table"] = AddTablePrefix($TableName); + $FieldItem["Field"] = $FieldName; + $FieldItem["where"] = $FieldConfig->GetWhereClause($Verb,$Value); + $FieldItem["conjuction"] = $conj; + $FieldItem["weight"] = $FieldConfig->Get("Priority"); + } + $this->FieldList[] = $FieldItem; + unset($FieldItem); + } + } + + /* ready to write the code to build the query and go */ + + function BuildWhereClause() + { + $where = ""; + foreach($this->FieldList as $f) + { + $where .= " (".$f["where"].") ".$f["conjuction"]; + } + return $where; + } + + function PerformSearch($ItemType,$OrderBy=NULL,$InitTable=FALSE, $idlist=NULL) + { + static $SelectSQL, $OldItemType; + global $objSession, $objItemTypes; + + $ctype = $objItemTypes->GetItem($ItemType); + $idField = $ctype->Get("SourceTable")."Id"; + $this->SourceTable = AddTablePrefix($ctype->Get("SourceTable")); + $result=0; + $PopField = $ctype->Get("PopField"); + $RateField = $ctype->Get("RateField"); + $typestr = str_pad($ItemType,2,"0",STR_PAD_LEFT); + $SelectSQL = "SELECT ".$this->SourceTable.".".$idField." as ItemId, ". $this->SourceTable.".Priority as Relevance, ResourceId, CONCAT($typestr) as ItemType, EditorsPick as EdPick FROM ".$this->SourceTable." "; + + foreach($this->Relationships as $JoinTable=>$OnClause) + { + $SelectSQL .= "LEFT JOIN $JoinTable ON ($OnClause) "; + } + $first=1; + $WhereClause = $this->BuildWhereClause(); + if(strlen($WhereClause)>0) + { + $SelectSQL .= " WHERE ".$WhereClause; + } + $SelectSQL .= "GROUP BY $idField "; + $this->adodbConnection->Execute("DROP TABLE ".$this->ResultTable); + $full_sql = "CREATE TABLE ".$this->ResultTable." ".$indexSQL.$SelectSQL; + $this->adodbConnection->Execute($full_sql); + //echo "
$full_sql
"; + } + + function BuildIndexes() + { + $sql = "ALTER TABLE ".$this->ResultTable." ADD INDEX (Relevance), "; + $sql .="ADD INDEX (ItemId), "; + $sql .="ADD INDEX (ItemType), "; + $sql .=" ADD INDEX sorting (EdPick,Relevance)"; + $this->adodbConnection->Execute($sql); + } + + function Result_IdList() + { + /* returns an array contain a resource ID list */ + $sql = "SELECT DISTINCT(ResourceId) FROM ".$this->ResultTable; + $rs = $this->adodbConnection->Execute($sql); + $result = array(); + while($rs && !$rs->EOF) + { + $result[] = $rs->fields["ResourceId"]; + $rs->MoveNext(); + } + return $result; + } + + function SetRelevence($ItemType, $IdField) + { + } +} +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/msn/kiss.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/blue_bar_help.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_theme_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_myfavorites46.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/inst_bg.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/users/addrule.php =================================================================== diff -u --- trunk/admin/users/addrule.php (revision 0) +++ trunk/admin/users/addrule.php (revision 13) @@ -0,0 +1,257 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +unset($objEditItems); + +$objEditItems = new clsBanRuleList(); +$objEditItems->SourceTable = $objSession->GetEditTable("BanRules"); +$objEditItems->EnablePaging = FALSE; + +//Multiedit init +if ($_GET["new"] == 1) +{ + $c = new clsBanRule(NULL); + $c->Set("ItemType", 6); + $c->Set("Priority", 0); + $en = 0; + $action = "m_add_rule"; + $objBanList->CreateEmptyEditTable("RuleId"); +} +else +{ + $en = (int)$_GET["en"]; + if (isset($_POST["itemlist"])) + { + $objBanList->CopyToEditTable("RuleId",$_POST["itemlist"]); + } + $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); + + $itemcount=$objEditItems->NumItems(); + $c = $objEditItems->GetItemByIndex($en); + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_edit_rule"; +} + +//$envar = "env=".BuildEnv()."&en=$en§ion=".$secvar; + +if (strlen($secvar = $_GET["section"])) + $addSection = "§ion=$secvar"; + +//echo "TEST: $secvar"; + +$section = 'in-portal:user_rule_edit'; + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Rule"); +//echo $envar."
\n"; + +//Display header +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('rule','RuleEditStatus','".$admin."/config/edit_banlist.php',1,'$addSection&DataType=6');","tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('rule','RuleEditStatus','".$admin."/config/edit_banlist.php',2,'$addSection&DataType=6');","tool_cancel.gif"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/addrule.php"; + $StatusField = "RuleEditStatus"; + $form = "rule"; + MultiEditButtons($objCatToolBar, $en_next, $en_prev, $form, $StatusField, $url, $sec->Get("OnClick"), $addSection); + $objCatToolBar->Add("divider"); +} + + int_header($objCatToolBar,NULL,$title); +?> +
+ + ">
+ +
+ "> +
") + + doc.write(leftSide) + + this.outputLink() + + doc.write("") + + doc.write("") + + if (USETEXTLINKS) + + { + + this.outputLink() + + doc.write(this.desc + "") + + } + + else + + doc.write(this.desc) + + doc.write("
") + + doc.write(leftSide) + + doc.write("") + + doc.write("") + + doc.write("") + + doc.write("") + + if (USETEXTLINKS) + + doc.write("" + this.desc + "") + + else + + doc.write(this.desc) + + + + this.blockEnd() + + + + if (browserVersion == 1) { + + this.navObj = doc.all["item"+this.id] + + this.iconImg = doc.all["itemIcon"+this.id] + + } else if (browserVersion == 2) { + + this.navObj = doc.layers["item"+this.id] + + this.iconImg = this.navObj.document.images["itemIcon"+this.id] + + doc.yPos=doc.yPos+this.navObj.clip.height + + } else if (browserVersion == 3) { + + this.navObj = doc.getElementById("item"+this.id) + + this.iconImg = doc.getElementById("itemIcon"+this.id) + + } + +} + + + + + +// Methods common to both objects (pseudo-inheritance) + +// ******************************************************** + + + +function mostra() + +{ + + if (browserVersion == 1 || browserVersion == 3) { + + var str = new String(doc.links[0]) + + // if (str.slice(16,20) != "ins.") + + // return + + } + + + + if (browserVersion == 1 || browserVersion == 3) + + this.navObj.style.display = "block" + + else + + this.navObj.visibility = "show" + +} + + + +function escondeBlock() + +{ + + if (browserVersion == 1 || browserVersion == 3) { + + if (this.navObj.style.display == "none") + + return + + this.navObj.style.display = "none" + + } else { + + if (this.navObj.visibility == "hiden") + + return + + this.navObj.visibility = "hiden" + + } + +} + + + +function blockStart(idprefix) { + + var idParam = "id='" + idprefix + this.id + "'" + + + + if (browserVersion == 2) + + doc.write("") + + + + if (browserVersion == 3) //N6 has bug on display property with tables + + doc.write("
") + + + + doc.write("") + + else + + doc.write(">") + +} + + + +function blockEnd() { + + doc.write("
") + + + + if (browserVersion == 2) + + doc.write("") + + if (browserVersion == 3) + + doc.write("
") + +} + + + +function createEntryIndex() + +{ + + this.id = nEntries + + indexOfEntries[nEntries] = this + + nEntries++ + +} + + + +// total height of subEntries open + +function totalHeight() //used with browserVersion == 2 + +{ + + var h = this.navObj.clip.height + + var i = 0 + + + + if (this.isOpen) //is a folder and _is_ open + + for (i=0 ; i < this.nChildren; i++) + + h = h + this.children[i].totalHeight() + + + + return h + +} + + + + + +// Events + +// ********************************************************* + + + +function clickOnFolder(folderId) + +{ + + var clicked = indexOfEntries[folderId] + + + + if (!clicked.isOpen) + + clickOnNode(folderId) + + + + return + + + + if (clicked.isSelected) + + return + +} + + + +function clickOnNode(folderId) + +{ + + var clickedFolder = 0 + + var state = 0 + + + + clickedFolder = indexOfEntries[folderId] + + state = clickedFolder.isOpen + + + + clickedFolder.setState(!state) //open<->close + +} + + + + + +// Auxiliary Functions for Folder-Tree backward compatibility + +// *********************************************************** + + + +function gFld(description, hreference) + +{ + + folder = new Folder(description, hreference) + + return folder + +} + + + +function gLnk(target, description, linkData) + +{ + + fullLink = "" + + + + if (target==0) + + { + + fullLink = "'"+linkData+"' target=\"main\"" + + } + + else + + { + + if (target==1) + + fullLink = "'http://"+linkData+"' target=_blank" + + else + + fullLink = "'http://"+linkData+"' target=\"main\"" + + } + + + + linkItem = new Item(description, fullLink) + + return linkItem + +} + + + +function insFld(parentFolder, childFolder) + +{ + return parentFolder.addChild(childFolder); + +} + + + +function insDoc(parentFolder, document) + +{ + return parentFolder.addChild(document) + +} + + + + + +// Global variables + +// **************** + + + +//These two variables are overwriten on defineMyTree.js if needed be + +USETEXTLINKS = 0 + +STARTALLOPEN = 0 + +indexOfEntries = new Array + +nEntries = 0 + +doc = document + +browserVersion = 0 + +selectedFolder=0 + + + + + +// Main function + +// ************* + + + +// This function uses an object (navigator) defined in + +// ua.js, imported in the main html page (left frame). + +function initializeDocument() + +{ + + switch(navigator.family) + + { + + case 'ie4': + + browserVersion = 1 //IE4 + + break; + + case 'nn4': + + browserVersion = 2 //NS4 + + break; + + case 'gecko': + + browserVersion = 3 //NS6 + + break; + + default: + + browserVersion = 0 //other + + break; + + } + + + + //foldersTree (with the site's data) is created in an external .js + + foldersTree.initialize(0, 1, ""); + + + + if (browserVersion == 2) + + doc.write(" ") + + + + //The tree starts in full display + + if (!STARTALLOPEN) + + if (browserVersion > 0) { + + // close the whole tree + + clickOnNode(0) + + // open the root folder + + clickOnNode(0) + + } + + + + if (browserVersion == 0) + + doc.write("


This tree only expands or contracts with DHTML capable browsers
") + +} + + + Index: trunk/admin/install/inst_bg_vert.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_cat_deleted.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/images/money.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_theme.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/mailing_list/confirm_unsubscribe.tpl =================================================================== diff -u --- trunk/themes/default/mailing_list/confirm_unsubscribe.tpl (revision 0) +++ trunk/themes/default/mailing_list/confirm_unsubscribe.tpl (revision 13) @@ -0,0 +1,113 @@ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +



+ + + + + + + + + + + +

+ + + + + + +

+ + + + + + + +
" width="18" height="12" alt="" />
   
+
+ +

+ + + + + + + + +

+
+ + "> + + + + + + + + + + + + + + + + + + + + + +



 
+

+

+



+
+ " class="button"> + " class="button"> + +
+
+ + +

+
+ + + Index: trunk/themes/default/img/a_box_left.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_user.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-firebird.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-firebird.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-firebird.inc.php (revision 13) @@ -0,0 +1,67 @@ +ADODB_ibase(); + } + + function ServerInfo() + { + $arr['dialect'] = $this->dialect; + switch($arr['dialect']) { + case '': + case '1': $s = 'Firebird Dialect 1'; break; + case '2': $s = 'Firebird Dialect 2'; break; + default: + case '3': $s = 'Firebird Dialect 3'; break; + } + $arr['version'] = ADOConnection::_findvers($s); + $arr['description'] = $s; + return $arr; + } + + // Note that Interbase 6.5 uses this ROWS instead - don't you love forking wars! + // SELECT col1, col2 FROM table ROWS 5 -- get 5 rows + // SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2 + function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $arg3=false,$secs=0) + { + $str = 'SELECT '; + if ($nrows >= 0) $str .= "FIRST $nrows "; + $str .=($offset>=0) ? "SKIP $offset " : ''; + + $sql = preg_replace('/^[ \t]*select/i',$str,$sql); + return ($secs) ? + $this->CacheExecute($secs,$sql,$inputarr,$arg3) + : + $this->Execute($sql,$inputarr,$arg3); + } + + +}; + + +class ADORecordSet_firebird extends ADORecordSet_ibase { + + var $databaseType = "firebird"; + + function ADORecordSet_firebird($id,$mode=false) + { + $this->ADORecordSet_ibase($id,$mode); + } +} +?> \ No newline at end of file Index: trunk/kernel/include/adodb/license.txt =================================================================== diff -u --- trunk/kernel/include/adodb/license.txt (revision 0) +++ trunk/kernel/include/adodb/license.txt (revision 13) @@ -0,0 +1,165 @@ +ADOdb is dual licensed using BSD-Style and LGPL. Where there is any discrepancy, the BSD-Style license will take precedence. In plain English, you do not need to distribute your application in source code form, nor do you need to distribute ADOdb source code, provided you follow the rest of terms of the BSD-style license. + +Commercial use of ADOdb is encouraged. Make money and multiply! + +BSD Style-License +================= + +Copyright (c) 2000, 2001, 2002 John Lim +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the name of the John Lim nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +DISCLAIMER: +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +========================================================== +GNU LESSER GENERAL PUBLIC LICENSE +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + +Preamble +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. + + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + +a) The modified work must itself be a software library. +b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. +c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. +d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. +(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + + +a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) +b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. +c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. +d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. +e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + + +a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. +b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + +END OF TERMS AND CONDITIONS \ No newline at end of file Index: trunk/admin/editor/FCKeditor/lang/ro.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/ro.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/ro.js (revision 13) @@ -0,0 +1,202 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * ro.js: Romanian support. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + * + * Romanian translation: + * Claudiu Cristea (cristea@pntcd.ro) + * + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Tăiere" ; +lang["Copy"] = "Copiere" ; +lang["Paste"] = "Lipire" ; +lang["PasteText"] = "Lipire text simplu" ; +lang["PasteWord"] = "Lipire din Word" ; +lang["Find"] = "Caută" ; +lang["SelectAll"] = "Selectează totul" ; +lang["RemoveFormat"] = "Şterge formatul" ; +lang["InsertLink"] = "Inserează/Editează legătura" ; +lang["RemoveLink"] = "Şterge legătura" ; +lang["InsertImage"] = "Inserează/Editează imagine" ; +lang["InsertTable"] = "Inserează/Editează tabel" ; +lang["InsertLine"] = "Inserează linie orizontală" ; +lang["InsertSpecialChar"] = "Inserează caracter special" ; +lang["InsertSmiley"] = "Inserează Zâmbete" ; +lang["About"] = "Despre FCKeditor" ; + +lang["Bold"] = "Îngroşat" ; +lang["Italic"] = "Înclinat" ; +lang["Underline"] = "Subliniat" ; +lang["StrikeThrough"] = "Barat" ; +lang["Subscript"] = "Indice" ; +lang["Superscript"] = "Exponent" ; +lang["LeftJustify"] = "Orientat la stânga" ; +lang["CenterJustify"] = "Centrat" ; +lang["RightJustify"] = "Orientat la dreapta" ; +lang["BlockJustify"] = "Text bloc" ; +lang["DecreaseIndent"] = "Decrease Indent" ; +lang["IncreaseIndent"] = "Increase Indent" ; +lang["Undo"] = "Anulare modificare" ; +lang["Redo"] = "Reluare modificare" ; +lang["NumberedList"] = "Listă numerică" ; +lang["BulettedList"] = "Listă" ; + +lang["ShowTableBorders"] = "Afişează conturul tabelului" ; +lang["ShowDetails"] = "Afişează detaliile" ; + +lang["FontStyle"] = "Stile" ; +lang["FontFormat"] = "Format" ; +lang["Font"] = "Caracter" ; +lang["FontSize"] = "Mărime" ; +lang["TextColor"] = "Culoare text" ; +lang["BGColor"] = "Culoare fundal" ; +lang["Source"] = "Sursa" ; + +// Context Menu + +lang["EditLink"] = "Editează legătura" ; +lang["InsertRow"] = "Înserează rând" ; +lang["DeleteRows"] = "Şterge rânduri" ; +lang["InsertColumn"] = "Inserează coloană" ; +lang["DeleteColumns"] = "Şterge coloane" ; +lang["InsertCell"] = "Inserează celulă" ; +lang["DeleteCells"] = "Şterge celule" ; +lang["MergeCells"] = "Uneşte celule" ; +lang["SplitCell"] = "Divide celula" ; +lang["CellProperties"] = "Properietăţile celulei" ; +lang["TableProperties"] = "Proprietăţile tabelului" ; +lang["ImageProperties"] = "Proprietăţile imaginii" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Procesare XHTML. Aşteptaţi ..." ; +lang["Done"] = "Terminat" ; +lang["PasteWordConfirm"] = "Textul pe care doriţi să îl lipiţi pare a fi copiat din Word. Doriţi curăţarea lui înainte de lipire?" ; +lang["NotCompatiblePaste"] = "Această comandă este disponibilă pentru Internet Explorer versiunea 5.5 sau mai mare. Doriţi să lipiţi fără curăţire?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Anulează" ; +lang["DlgBtnClose"] = "Închide" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Inserează imagine" ; +lang["DlgImgTitleEdit"] = "Editează imagine" ; +lang["DlgImgBtnUpload"] = "Trimite la server" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Upload" ; +lang["DlgImgBtnBrowse"] = "Listă de pe server" ; +lang["DlgImgAlt"] = "Text alternativ" ; +lang["DlgImgWidth"] = "Lăţime" ; +lang["DlgImgHeight"] = "Înălţime" ; +lang["DlgImgLockRatio"] = "Păstrează proporţia" ; +lang["DlgBtnResetSize"] = "Dimensiuni iniţiale" ; +lang["DlgImgBorder"] = "Bordură" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Aliniere" ; +lang["DlgImgAlignLeft"] = "Left" ; +lang["DlgImgAlignAbsBottom"] = "Abs Bottom" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Middle" ; +lang["DlgImgAlignBaseline"] = "Baseline" ; +lang["DlgImgAlignBottom"] = "Bottom" ; +lang["DlgImgAlignMiddle"] = "Middle" ; +lang["DlgImgAlignRight"] = "Right" ; +lang["DlgImgAlignTextTop"] = "Text Top" ; +lang["DlgImgAlignTop"] = "Top" ; +lang["DlgImgPreview"] = "Vizualizare" ; +lang["DlgImgMsgWrongExt"] = "Ne pare rău, doar următoarele tipuri de fişiere sunt permise pentru upload:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperaţia a fost întreruptă." ; +lang["DlgImgAlertSelect"] = "Selectaţi o imagine pentru upload." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Legătură" ; // NEW +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Upload" ; +lang["DlgLnkTarget"] = "Target" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Fereastră nouă (_blank)" ; +lang["DlgLnkTargetParent"] = "Fereastră părinte (_parent)" ; +lang["DlgLnkTargetSelf"] = "Aceeaşi fereastră (_self)" ; +lang["DlgLnkTargetTop"] = "Cea mai de sus fereastră (_top)" ; +lang["DlgLnkTitle"] = "Titlu" ; +lang["DlgLnkBtnUpload"] = "Trimite la server" ; +lang["DlgLnkBtnBrowse"] = "Listă de pe server" ; +lang["DlgLnkMsgWrongExtA"] = "Ne pare rău, doar următoarele tipuri de fişiere sunt permise pentru upload:\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperaţia a fost întreruptă." ; +lang["DlgLnkMsgWrongExtD"] = "Ne pare rău, următoarele tipuri de fişiere nu sumt permise:\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperaţia a fost întreruptă." ; + +// Color Dialog +lang["DlgColorTitle"] = "Selectează culoarea" ; +lang["DlgColorBtnClear"] = "Şterge" ; +lang["DlgColorHighlight"] = "Marcat" ; +lang["DlgColorSelected"] = "Selectat" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Inserează un zâmbet" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Inserează un caracter special" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Inserează un tabel" ; +lang["DlgTableTitleEdit"] = "Editare tabel" ; +lang["DlgTableRows"] = "Rânduri" ; +lang["DlgTableColumns"] = "Coloane" ; +lang["DlgTableBorder"] = "Grosime bordură" ; +lang["DlgTableAlign"] = "Aliniere" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Stânga" ; +lang["DlgTableAlignCenter"] = "Centrat" ; +lang["DlgTableAlignRight"] = "Dreapta" ; +lang["DlgTableWidth"] = "Lăţime" ; +lang["DlgTableWidthPx"] = "pixeli" ; +lang["DlgTableWidthPc"] = "procent" ; +lang["DlgTableHeight"] = "înălţime" ; +lang["DlgTableCellSpace"] = "Spaţiu între celule" ; +lang["DlgTableCellPad"] = "Spaţiu în interiorul celulei" ; +lang["DlgTableCaption"] = "Titlu tabel" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Proprietăţile celulei" ; +lang["DlgCellWidth"] = "Lăţime" ; +lang["DlgCellWidthPx"] = "pixeli" ; +lang["DlgCellWidthPc"] = "procent" ; +lang["DlgCellHeight"] = "Înălţime" ; +lang["DlgCellWordWrap"] = "Despărţire cuvinte" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Da" ; +lang["DlgCellWordWrapNo"] = "Nu" ; +lang["DlgCellHorAlign"] = "Aliniere orizontală" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Stânga" ; +lang["DlgCellHorAlignCenter"] = "Centrat" ; +lang["DlgCellHorAlignRight"] = "Dreapta" ; +lang["DlgCellVerAlign"] = "Aliniere verticală" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Top" ; +lang["DlgCellVerAlignMiddle"] = "Middle" ; +lang["DlgCellVerAlignBottom"] = "Bottom" ; +lang["DlgCellVerAlignBaseline"] = "Baseline" ; +lang["DlgCellRowSpan"] = "Rows Span" ; +lang["DlgCellCollSpan"] = "Columns Span" ; +lang["DlgCellBackColor"] = "Culoare fundal" ; +lang["DlgCellBorderColor"] = "Culoare bordură" ; +lang["DlgCellBtnSelect"] = "Selecţie..." ; + +// About Dialog +lang["DlgAboutVersion"] = "versiunea" ; +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "For further information go to" ; \ No newline at end of file Index: trunk/admin/icons/icon24_lock.gif =================================================================== diff -u Binary files differ Index: trunk/compat/array_udiff_assoc.php =================================================================== diff -u --- trunk/compat/array_udiff_assoc.php (revision 0) +++ trunk/compat/array_udiff_assoc.php (revision 13) @@ -0,0 +1,90 @@ + | +// | Aidan Lister | +// +----------------------------------------------------------------------+ +// +// $Id: array_udiff_assoc.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace array_udiff_assoc() + * + * @category PHP + * @package PHP_Compat + * @author Stephan Schmidt + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @link http://php.net/function.array-udiff-assoc + * @since PHP 5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('array_udiff_assoc')) +{ + function array_udiff_assoc () + { + $args = func_get_args(); + if (count($args) < 3) { + trigger_error('Wrong parameter count for array_udiff()', E_USER_WARNING); + return null; + } + + // Get compare function + $compare_func = array_pop($args); + if (!is_callable($compare_func)) + { + if (is_array($compare_func)) { + $compare_func = $compare_func[0].'::'.$compare_func[1]; + } + trigger_error('array_udiff() Not a valid callback ' . $compare_func, E_USER_WARNING); + return null; + } + + // Check arrays + $count = count($args); + for ($i = 0; $i < $count; $i++) + { + if (!is_array($args[$i])) { + trigger_error('array_udiff() Argument #' . ($i + 1) . ' is not an array', E_USER_WARNING); + return null; + } + } + + $diff = array (); + // Traverse values of the first array + foreach ($args[0] as $key => $value) + { + // Check all arrays + for ($i = 1; $i < $count; $i++) + { + if (!isset($args[$i][$key])) { + continue; + } + $result = call_user_func($compare_func, $value, $args[$i][$key]); + if ($result === 0) { + continue 2; + } + } + + $diff[$key] = $value; + } + + return $diff; + } +} + +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/wow.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_navigate.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-postgres64.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-postgres64.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-postgres64.inc.php (revision 13) @@ -0,0 +1,738 @@ + + jlim - changed concat operator to || and data types to MetaType to match documented pgsql types + see http://www.postgresql.org/devel-corner/docs/postgres/datatype.htm + 22 Nov 2000 jlim - added changes to FetchField() and MetaTables() contributed by "raser" + 27 Nov 2000 jlim - added changes to _connect/_pconnect from ideas by "Lennie" + 15 Dec 2000 jlim - added changes suggested by Additional code changes by "Eric G. Werk" egw@netguide.dk. + 31 Jan 2002 jlim - finally installed postgresql. testing + 01 Mar 2001 jlim - Freek Dijkstra changes, also support for text type +*/ + +function adodb_addslashes($s) +{ + $len = strlen($s); + if ($len == 0) return "''"; + if (substr($s,0,1) == "'" && substr(s,$len-1) == "'") return $s; // already quoted + + return "'".addslashes($s)."'"; +} + +class ADODB_postgres64 extends ADOConnection{ + var $databaseType = 'postgres64'; + var $dataProvider = 'postgres'; + var $hasInsertID = true; + var $_resultid = false; + var $concat_operator='||'; + var $metaDatabasesSQL = "select datname from pg_database where datname not in ('template0','template1') order by 1"; + var $metaTablesSQL = "select tablename from pg_tables where tablename not like 'pg\_%' order by 1"; + //"select tablename from pg_tables where tablename not like 'pg_%' order by 1"; + var $isoDates = true; // accepts dates in ISO format + var $sysDate = "CURRENT_DATE"; + var $sysTimeStamp = "CURRENT_TIMESTAMP"; + var $blobEncodeType = 'C'; +/* +# show tables and views suggestion +"SELECT c.relname AS tablename FROM pg_class c + WHERE (c.relhasrules AND (EXISTS ( + SELECT r.rulename FROM pg_rewrite r WHERE r.ev_class = c.oid AND bpchar(r.ev_type) = '1' + ))) OR (c.relkind = 'v') AND c.relname NOT LIKE 'pg_%' +UNION +SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg_%' ORDER BY 1" +*/ + var $metaColumnsSQL = "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,a.attnum + FROM pg_class c, pg_attribute a,pg_type t + WHERE relkind = 'r' AND c.relname='%s' AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum"; + // get primary key etc -- from Freek Dijkstra + var $metaKeySQL = "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid AND (i.indkey[0] = a.attnum OR i.indkey[1] = a.attnum OR i.indkey[2] = a.attnum OR i.indkey[3] = a.attnum OR i.indkey[4] = a.attnum OR i.indkey[5] = a.attnum OR i.indkey[6] = a.attnum OR i.indkey[7] = a.attnum) AND a.attrelid = bc.oid AND bc.relname = '%s'"; + + var $hasAffectedRows = true; + var $hasLimit = false; // set to true for pgsql 7 only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10 + // below suggested by Freek Dijkstra + var $true = 't'; // string that represents TRUE for a database + var $false = 'f'; // string that represents FALSE for a database + var $fmtDate = "'Y-m-d'"; // used by DBDate() as the default date format used by the database + var $fmtTimeStamp = "'Y-m-d G:i:s'"; // used by DBTimeStamp as the default timestamp fmt. + var $hasMoveFirst = true; + var $hasGenID = true; + var $_genIDSQL = "SELECT NEXTVAL('%s')"; + var $_genSeqSQL = "CREATE SEQUENCE %s START %s"; + var $_dropSeqSQL = "DROP SEQUENCE %s"; + var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum"; + + + // The last (fmtTimeStamp is not entirely correct: + // PostgreSQL also has support for time zones, + // and writes these time in this format: "2001-03-01 18:59:26+02". + // There is no code for the "+02" time zone information, so I just left that out. + // I'm not familiar enough with both ADODB as well as Postgres + // to know what the concequences are. The other values are correct (wheren't in 0.94) + // -- Freek Dijkstra + + function ADODB_postgres64() + { + // changes the metaColumnsSQL, adds columns: attnum[6] + } + + function ServerInfo() + { + $arr['description'] = $this->GetOne("select version()"); + $arr['version'] = ADOConnection::_findvers($arr['description']); + return $arr; + } + + // get the last id - never tested + function pg_insert_id($tablename,$fieldname) + { + $result=pg_exec($this->_connectionID, "SELECT last_value FROM ${tablename}_${fieldname}_seq"); + if ($result) { + $arr = @pg_fetch_row($result,0); + pg_freeresult($result); + if (isset($arr[0])) return $arr[0]; + } + return false; + } + +/* Warning from http://www.php.net/manual/function.pg-getlastoid.php: +Using a OID as a unique identifier is not generally wise. +Unless you are very careful, you might end up with a tuple having +a different OID if a database must be reloaded. */ + function _insertid() + { + if (!is_resource($this->_resultid)) return false; + return pg_getlastoid($this->_resultid); + } + +// I get this error with PHP before 4.0.6 - jlim +// Warning: This compilation does not support pg_cmdtuples() in d:/inetpub/wwwroot/php/adodb/adodb-postgres.inc.php on line 44 + function _affectedrows() + { + if (!is_resource($this->_resultid)) return false; + return pg_cmdtuples($this->_resultid); + } + + + // returns true/false + function BeginTrans() + { + if ($this->transOff) return true; + $this->transCnt += 1; + return @pg_Exec($this->_connectionID, "begin"); + } + + function RowLock($tables,$where) + { + if (!$this->transCnt) $this->BeginTrans(); + return $this->GetOne("select 1 as ignore from $tables where $where for update"); + } + + // returns true/false. + function CommitTrans($ok=true) + { + if ($this->transOff) return true; + if (!$ok) return $this->RollbackTrans(); + + $this->transCnt -= 1; + return @pg_Exec($this->_connectionID, "commit"); + } + + // returns true/false + function RollbackTrans() + { + if ($this->transOff) return true; + $this->transCnt -= 1; + return @pg_Exec($this->_connectionID, "rollback"); + } + /* + // if magic quotes disabled, use pg_escape_string() + function qstr($s,$magic_quotes=false) + { + if (!$magic_quotes) { + if (ADODB_PHPVER >= 0x4200) { + return "'".pg_escape_string($s)."'"; + } + if ($this->replaceQuote[0] == '\\'){ + $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s); + } + return "'".str_replace("'",$this->replaceQuote,$s)."'"; + } + + // undo magic quotes for " + $s = str_replace('\\"','"',$s); + return "'$s'"; + } + */ + + + // Format date column in sql string given an input format that understands Y M D + function SQLDate($fmt, $col=false) + { + if (!$col) $col = $this->sysTimeStamp; + $s = 'TO_CHAR('.$col.",'"; + + $len = strlen($fmt); + for ($i=0; $i < $len; $i++) { + $ch = $fmt[$i]; + switch($ch) { + case 'Y': + case 'y': + $s .= 'YYYY'; + break; + case 'Q': + case 'q': + $s .= 'Q'; + break; + + case 'M': + $s .= 'Mon'; + break; + + case 'm': + $s .= 'MM'; + break; + case 'D': + case 'd': + $s .= 'DD'; + break; + + case 'H': + $s.= 'HH24'; + break; + + case 'h': + $s .= 'HH'; + break; + + case 'i': + $s .= 'MI'; + break; + + case 's': + $s .= 'SS'; + break; + + case 'a': + case 'A': + $s .= 'AM'; + break; + + default: + // handle escape characters... + if ($ch == '\\') { + $i++; + $ch = substr($fmt,$i,1); + } + if (strpos('-/.:;, ',$ch) !== false) $s .= $ch; + else $s .= '"'.$ch.'"'; + + } + } + return $s. "')"; + } + + + + /* + * Load a Large Object from a file + * - the procedure stores the object id in the table and imports the object using + * postgres proprietary blob handling routines + * + * contributed by Mattia Rossi mattia@technologist.com + * modified for safe mode by juraj chlebec + */ + function UpdateBlobFile($table,$column,$path,$where,$blobtype='BLOB') + { + pg_exec ($this->_connectionID, "begin"); + + $fd = fopen($path,'r'); + $contents = fread($fd,filesize($path)); + fclose($fd); + + $oid = pg_lo_create($this->_connectionID); + $handle = pg_lo_open($this->_connectionID, $oid, 'w'); + pg_lo_write($handle, $contents); + pg_lo_close($handle); + + // $oid = pg_lo_import ($path); + pg_exec($this->_connectionID, "commit"); + $rs = ADOConnection::UpdateBlob($table,$column,$oid,$where,$blobtype); + $rez = !empty($rs); + return $rez; + } + + /* + * If an OID is detected, then we use pg_lo_* to open the oid file and read the + * real blob from the db using the oid supplied as a parameter. If you are storing + * blobs using bytea, we autodetect and process it so this function is not needed. + * + * contributed by Mattia Rossi mattia@technologist.com + * + * see http://www.postgresql.org/idocs/index.php?largeobjects.html + */ + function BlobDecode( $blob) + { + if (strlen($blob) > 24) return $blob; + + @pg_exec("begin"); + $fd = @pg_lo_open($blob,"r"); + if ($fd === false) { + @pg_exec("commit"); + return $blob; + } + $realblob = @pg_loreadall($fd); + @pg_loclose($fd); + @pg_exec("commit"); + return $realblob; + } + + /* + See http://www.postgresql.org/idocs/index.php?datatype-binary.html + + NOTE: SQL string literals (input strings) must be preceded with two backslashes + due to the fact that they must pass through two parsers in the PostgreSQL + backend. + */ + function BlobEncode($blob) + { + if (ADODB_PHPVER >= 0x4200) return pg_escape_bytea($blob); + $badch = array(chr(92),chr(0),chr(39)); # \ null ' + $fixch = array('\\\\134','\\\\000','\\\\047'); + return adodb_str_replace($badch,$fixch,$blob); + + // note that there is a pg_escape_bytea function only for php 4.2.0 or later + } + + function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') + { + return $this->Execute("UPDATE $table SET $column=? WHERE $where", + array($this->BlobEncode($val))) != false; + } + + function OffsetDate($dayFraction,$date=false) + { + if (!$date) $date = $this->sysDate; + return "($date+interval'$dayFraction days')"; + } + + + // converts field names to lowercase + function &MetaColumns($table) + { + global $ADODB_FETCH_MODE; + + if (strncmp(PHP_OS,"WIN",3) === 0) $table = strtolower($table); + + if (!empty($this->metaColumnsSQL)) { + $save = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false); + $rs = $this->Execute(sprintf($this->metaColumnsSQL,($table))); + if (isset($savem)) $this->SetFetchMode($savem); + $ADODB_FETCH_MODE = $save; + + if ($rs === false) return false; + + if (!empty($this->metaKeySQL)) { + // If we want the primary keys, we have to issue a separate query + // Of course, a modified version of the metaColumnsSQL query using a + // LEFT JOIN would have been much more elegant, but postgres does + // not support OUTER JOINS. So here is the clumsy way. + + $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; + + $rskey = $this->Execute(sprintf($this->metaKeySQL,($table))); + // fetch all result in once for performance. + $keys =& $rskey->GetArray(); + if (isset($savem)) $this->SetFetchMode($savem); + $ADODB_FETCH_MODE = $save; + + $rskey->Close(); + unset($rskey); + } + + $rsdefa = array(); + if (!empty($this->metaDefaultsSQL)) { + $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; + $sql = sprintf($this->metaDefaultsSQL, ($table)); + $rsdef = $this->Execute($sql); + if (isset($savem)) $this->SetFetchMode($savem); + $ADODB_FETCH_MODE = $save; + + if ($rsdef) { + while (!$rsdef->EOF) { + $num = $rsdef->fields['num']; + $s = $rsdef->fields['def']; + if (substr($s, 0, 1) == "'") { /* quoted strings hack... for now... fixme */ + $s = substr($s, 1); + $s = substr($s, 0, strlen($s) - 1); + } + + $rsdefa[$num] = $s; + $rsdef->MoveNext(); + } + } else { + ADOConnection::outp( "==> SQL => " . $sql); + } + unset($rsdef); + } + + $retarr = array(); + while (!$rs->EOF) { + $fld = new ADOFieldObject(); + $fld->name = $rs->fields[0]; + $fld->type = $rs->fields[1]; + $fld->max_length = $rs->fields[2]; + if ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4; + if ($fld->max_length <= 0) $fld->max_length = -1; + + // dannym + // 5 hasdefault; 6 num-of-column + $fld->has_default = ($rs->fields[5] == 't'); + if ($fld->has_default) { + $fld->default_value = $rsdefa[$rs->fields[6]]; + } + + //Freek + if ($rs->fields[4] == $this->true) { + $fld->not_null = true; + } + + // Freek + if (is_array($keys)) { + reset ($keys); + while (list($x,$key) = each($keys)) { + if ($fld->name == $key['column_name'] AND $key['primary_key'] == $this->true) + $fld->primary_key = true; + if ($fld->name == $key['column_name'] AND $key['unique_key'] == $this->true) + $fld->unique = true; // What name is more compatible? + } + } + + $retarr[strtoupper($fld->name)] = $fld; + + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + return false; + } + + // returns true or false + // + // examples: + // $db->Connect("host=host1 user=user1 password=secret port=4341"); + // $db->Connect('host1','user1','secret'); + function _connect($str,$user='',$pwd='',$db='',$persist=false) + { + if ($user || $pwd || $db) { + $user = adodb_addslashes($user); + $pwd = adodb_addslashes($pwd); + if (strlen($db) == 0) $db = 'template1'; + $db = adodb_addslashes($db); + if ($str) { + $host = split(":", $str); + if ($host[0]) $str = "host=".adodb_addslashes($host[0]); + else $str = 'host=localhost'; + if (isset($host[1])) $str .= " port=$host[1]"; + } else { + $str = 'host=localhost'; + } + if ($user) $str .= " user=".$user; + if ($pwd) $str .= " password=".$pwd; + if ($db) $str .= " dbname=".$db; + } + + //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432"; + if ($persist) $this->_connectionID = pg_pconnect($str); + else $this->_connectionID = pg_connect($str); + + if ($this->_connectionID === false) return false; + $this->Execute("set datestyle='ISO'"); + return true; + } + + // returns true or false + // + // examples: + // $db->PConnect("host=host1 user=user1 password=secret port=4341"); + // $db->PConnect('host1','user1','secret'); + function _pconnect($str,$user='',$pwd='',$db='') + { + return $this->_connect($str,$user,$pwd,$db,true); + } + + // returns queryID or false + function _query($sql,$inputarr) + { + $rez = pg_Exec($this->_connectionID,$sql); + //print_r($rez); + // check if no data returned, then no need to create real recordset + if ($rez && pg_numfields($rez) <= 0) { + if ($this->_resultid) pg_freeresult($this->_resultid); + $this->_resultid = $rez; + return true; + } + + return $rez; + } + + + /* Returns: the last error message from previous database operation */ + function ErrorMsg() + { + if (ADODB_PHPVER >= 0x4300) { + if (!empty($this->_resultid)) { + $this->_errorMsg = @pg_result_error($this->_resultid); + if ($this->_errorMsg) return $this->_errorMsg; + } + + if (!empty($this->_connectionID)) { + $this->_errorMsg = @pg_last_error($this->_connectionID); + } else $this->_errorMsg = @pg_last_error(); + } else { + if (empty($this->_connectionID)) $this->_errorMsg = @pg_errormessage(); + else $this->_errorMsg = @pg_errormessage($this->_connectionID); + } + return $this->_errorMsg; + } + + function ErrorNo() + { + $e = $this->ErrorMsg(); + return (strlen($e)) ? $e : 0; + } + + // returns true or false + function _close() + { + if ($this->transCnt) $this->RollbackTrans(); + if ($this->_resultid) { + @pg_freeresult($this->_resultid); + $this->_resultid = false; + } + @pg_close($this->_connectionID); + $this->_connectionID = false; + return true; + } + + + /* + * Maximum size of C field + */ + function CharMax() + { + return 1000000000; // should be 1 Gb? + } + + /* + * Maximum size of X field + */ + function TextMax() + { + return 1000000000; // should be 1 Gb? + } + + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_postgres64 extends ADORecordSet{ + var $_blobArr; + var $databaseType = "postgres64"; + var $canSeek = true; + function ADORecordSet_postgres64($queryID,$mode=false) + { + if ($mode === false) { + global $ADODB_FETCH_MODE; + $mode = $ADODB_FETCH_MODE; + } + switch ($mode) + { + case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break; + case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break; + default: + case ADODB_FETCH_DEFAULT: + case ADODB_FETCH_BOTH:$this->fetchMode = PGSQL_BOTH; break; + } + $this->ADORecordSet($queryID); + } + + function &GetRowAssoc($upper=true) + { + if ($this->fetchMode == PGSQL_ASSOC && !$upper) return $this->fields; + return ADORecordSet::GetRowAssoc($upper); + } + + function _initrs() + { + global $ADODB_COUNTRECS; + $this->_numOfRows = ($ADODB_COUNTRECS)? @pg_numrows($this->_queryID):-1; + $this->_numOfFields = @pg_numfields($this->_queryID); + + // cache types for blob decode check + for ($i=0, $max = $this->_numOfFields; $i < $max; $i++) { + $f1 = $this->FetchField($i); + if ($f1->type == 'bytea') $this->_blobArr[$i] = $f1->name; + } + } + + /* Use associative array to get fields array */ + function Fields($colname) + { + if ($this->fetchMode != PGSQL_NUM) return @$this->fields[$colname]; + + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + return $this->fields[$this->bind[strtoupper($colname)]]; + } + + function &FetchField($fieldOffset = 0) + { + $off=$fieldOffset; // offsets begin at 0 + + $o= new ADOFieldObject(); + $o->name = @pg_fieldname($this->_queryID,$off); + $o->type = @pg_fieldtype($this->_queryID,$off); + $o->max_length = @pg_fieldsize($this->_queryID,$off); + //print_r($o); + //print "off=$off name=$o->name type=$o->type len=$o->max_length
"; + return $o; + } + + function _seek($row) + { + return @pg_fetch_row($this->_queryID,$row); + } + + function _decode($blob) + { + eval('$realblob="'.adodb_str_replace(array('"','$'),array('\"','\$'),$blob).'";'); + return $realblob; + } + + function _fixblobs() + { + if ($this->fetchMode == PGSQL_NUM || $this->fetchMode == PGSQL_BOTH) { + foreach($this->_blobArr as $k => $v) { + $this->fields[$k] = ADORecordSet_postgres64::_decode($this->fields[$k]); + } + } + if ($this->fetchMode == PGSQL_ASSOC || $this->fetchMode == PGSQL_BOTH) { + foreach($this->_blobArr as $k => $v) { + $this->fields[$v] = ADORecordSet_postgres64::_decode($this->fields[$v]); + } + } + } + + // 10% speedup to move MoveNext to child class + function MoveNext() + { + if (!$this->EOF) { + $this->_currentRow++; + if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) { + $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode); + + if (is_array($this->fields)) { + if (isset($this->_blobArr)) $this->_fixblobs(); + return true; + } + } + $this->fields = false; + $this->EOF = true; + } + return false; + } + + function _fetch() + { + if ($this->_currentRow >= $this->_numOfRows && $this->_numOfRows >= 0) + return false; + + $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode); + if (isset($this->_blobArr)) $this->_fixblobs(); + + return (is_array($this->fields)); + } + + function _close() + { + return @pg_freeresult($this->_queryID); + } + + function MetaType($t,$len=-1,$fieldobj=false) + { + if (is_object($t)) { + $fieldobj = $t; + $t = $fieldobj->type; + $len = $fieldobj->max_length; + } + switch (strtoupper($t)) { + case 'INTERVAL': + case 'CHAR': + case 'CHARACTER': + case 'VARCHAR': + case 'NAME': + case 'BPCHAR': + if ($len <= $this->blobSize) return 'C'; + + case 'TEXT': + return 'X'; + + case 'IMAGE': // user defined type + case 'BLOB': // user defined type + case 'BIT': // This is a bit string, not a single bit, so don't return 'L' + case 'VARBIT': + case 'BYTEA': + return 'B'; + + case 'BOOL': + case 'BOOLEAN': + return 'L'; + + case 'DATE': + return 'D'; + + case 'TIME': + case 'DATETIME': + case 'TIMESTAMP': + case 'TIMESTAMPTZ': + return 'T'; + + case 'SMALLINT': + case 'BIGINT': + case 'INTEGER': + case 'INT8': + case 'INT4': + case 'INT2': + if (isset($fieldobj) && + empty($fieldobj->primary_key) && empty($fieldobj->unique)) return 'I'; + + case 'OID': + case 'SERIAL': + return 'R'; + + default: + return 'N'; + } + } + +} +?> Index: trunk/admin/editor/FCKeditor/images/smiley/fun/bored.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/misc/right_login.tpl =================================================================== diff -u --- trunk/themes/default/misc/right_login.tpl (revision 0) +++ trunk/themes/default/misc/right_login.tpl (revision 13) @@ -0,0 +1,72 @@ + + + + + + + + + + + + + +
+ + + + + +
+

+ Index: trunk/admin/images/toolbar/tool_forum_new_custom_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/config/addlang_export.php =================================================================== diff -u --- trunk/admin/config/addlang_export.php (revision 0) +++ trunk/admin/config/addlang_export.php (revision 13) @@ -0,0 +1,159 @@ +$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +$objLangList = new clsLanguageList(); + +if (isset($_POST["itemlist"])) +{ + $LangIds = implode(",",$_POST["itemlist"]); + $sql = "SELECT * FROM ".$objLangList->SourceTable." WHERE LanguageId IN ($LangIds)"; + + $objLangList->Query_Item($sql); + $names = array(); + foreach($objLangList->Items as $l) + { + $names[] = $l->Get("PackName"); + } + $names = implode(",",$names); +} +$action = "m_lang_export"; +$section = "in-portal:lang_export"; +$envar = "env=".BuildEnv(); + +$title = prompt_language("la_Text_Export")." ".prompt_language("la_Text_Languages")." - ".$names." - ".admin_language("la_Step")." 1"; + +//Display header +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('language','LangEditStatus','".$admin."/config/addlang_export_result.php',1);",$imagesURL."/toolbar/tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('language','LangEditStatus','".$admin."/config/config_lang.php',2);",$imagesURL."/toolbar/tool_cancel.gif"); + +int_header($objCatToolBar,NULL,$title); +?> +
+ + + + > + + + + + > + + + + + + + +
+
+
+
+ +
" name="viewmenu"> + + + + +
+ + Index: trunk/themes/default/forgotpw.tpl =================================================================== diff -u --- trunk/themes/default/forgotpw.tpl (revision 0) +++ trunk/themes/default/forgotpw.tpl (revision 13) @@ -0,0 +1,163 @@ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +



+ + + + + + + + + + +

+ + + + + + +

  + + + + + + + +
" width="18" height="12" alt="" />
   
+
+ +
+ + +
+ + + + + + +

+ +
+ + + + +
+ + + + + +

+
+ + + + + + + + + + + + + + +
+ + + + + +
+ * - +
+

+
"> + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +


 
  

 
  +
+ " class="button"> +
 


+
+
+

+ +
+

+
+ + + Index: trunk/admin/backup/export1.php =================================================================== diff -u --- trunk/admin/backup/export1.php (revision 0) +++ trunk/admin/backup/export1.php (revision 13) @@ -0,0 +1,103 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$imagesURL = $rootURL."admin/images"; +$adminURL = $rootURL.$admin; + +//admin only util +$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"); +//Set Section +$section = "in-portal:export"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); + +$title = admin_language("la_performing_export"); +int_header($objCatToolBar,NULL,$title); + +?> + + + + + > + + + +
+ +
+ Index: trunk/admin/config/missing_label_edit.php =================================================================== diff -u --- trunk/admin/config/missing_label_edit.php (revision 0) +++ trunk/admin/config/missing_label_edit.php (revision 13) @@ -0,0 +1,306 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$pathtolocal = $pathtoroot."in-news/"; +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditItems); + +$objEditItems = new clsPhraseList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Language"); + + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); + +//$c = $objEditItems->GetItemByIndex($en); +$LangId = $objSession->GetVariable("Missing_LangId"); + +$c = $objLanguages->GetItem($LangId); + +$name = $c->Get("PackName"); +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_phrase_edit"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:missing_lang_labels'; + +//echo $envar."
\n"; + +$objListToolBar = new clsToolBar(); +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","save_labels();","tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","window.close();",$imagesURL."/toolbar/tool_cancel.gif"); +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass","LangChecks"); + +//Display header +$sec = $objSections->GetSection($section); + +if ( isset($en_prev) || isset($en_next) ) +{ + $objListToolBar->Add("divider"); + if($en_prev>-1) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + $onClick= $sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_prev"; + $link=$_SERVER["PHP_SELF"].$var; + $objListToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Theme"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + else + { + $MouseOver=""; + $MouseOut=""; + $onClick=""; + $link="#"; + $objListToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Theme"),"#","","","","tool_prev_f3.gif"); + + } + if($en_next>-1) + { + $MouseOver="swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="swap('moveright', 'toolbar/tool_next.gif');"; + $onClick=$sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_next"; + $link=$_SERVER["PHP_SELF"].$var; + $objListToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Theme"),$link,$MouseOver,$MouseOut,"","tool_next.gif"); + } + else + { + $objListToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Theme"),$link,$MouseOver,$MouseOut,"","tool_next_f3.gif"); + } + +} + +$CurrentLangId = $c->Get("LanguageId"); + +$title = prompt_language("la_Text_Configuration")." - '".$name."' ".prompt_language("la_Text_Pack")." - ".prompt_language("la_tab_MissingLabels"); +int_header($objListToolBar,NULL, $title); + +$ThemeId = $objSession->GetVariable("Missing_ThemeId"); +$table = $objSession->GetSessionTable("_".$ThemeId."_labels"); + +$objPhrases = new clsPhraseList(); +$objPhrases->SourceTable = $table; + +$order = trim($objConfig->Get("Phrase_LV_Sortfield")." ".$objConfig->Get("Phrase_LV_Sortorder")); + +$primary = $objLanguages->GetPrimary(); + +$ptable = GetTablePrefix()."Phrase"; + +$sql = "SELECT distinct(e.Phrase) as Phrase, "; +$sql .= "concat('') as Translation, "; +$sql .="p.Translation as PrimaryValue, e.PhraseId as PhraseId "; +$sql .= "FROM $table as e LEFT JOIN $ptable as p ON (e.Phrase=p.Phrase AND p.LanguageId=$primary) WHERE e.LanguageId=".$c->Get("LanguageId")." "; + +if(strlen($where)) + $sql .= "AND ".$where." "; + +if(strlen($order)) + $sql .= "ORDER BY ".$order." "; + +if(isset($_GET["lpn"])) + $objSession->SetVariable("m_Page_Phrase",$_GET["lpn"]); + +$sql .= GetLimitSQL($objSession->GetVariable("m_Page_Phrase"),$objConfig->Get("Perpage_Phrase")); + +$objPhrases->Query_Item($sql); +$itemcount = TableCount($table, $where,0); + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + +$objListView = new clsListView($objListToolBar, $objPhrases); +$objListView->IdField = "PhraseId"; + +$order = $objConfig->Get("Phrase_LV_Sortfield"); +$objListView->ColumnHeaders->Add("Phrase",admin_language("la_prompt_Label"),1,0,$order,"width=\"30%\"","Phrase_LV_Sortfield","Phrase_LV_Sortorder","Phrase"); +$objListView->ColumnHeaders->Add("Translation",admin_language("la_prompt_Value"),1,0,$order,"width=\"40%\"","Phrase_LV_Sortfield","Phrase_LV_Sortorder","Translation"); +$objListView->ColumnHeaders->Add("PrimaryValue",admin_language("la_prompt_PrimaryValue"),1,0,$order,"width=\"30%\"","Phrase_LV_Sortfield","Phrase_LV_Sortorder","PrimaryValue"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get("Phrase_LV_Sortfield"), $objConfig->Get("Phrase_LV_Sortorder")); + +$objListView->PrintToolBar = FALSE; +$objListView->checkboxes = FALSE; + +$objListView->CurrentPageVar = "m_Page_Phrase"; +$objListView->PerPageVar = "Perpage_Phrase"; +$objListView->PageURL = "javascript:setPage({TargetPage});"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->SearchBar = FALSE; +$objListView->SearchAction=""; + +$objListView->TotalItemCount = $itemcount; + +for($i=0;$iItems);$i++) +{ + $objListView->RowIcons[] = $objPhrases->Items[$i]->AdminIcon(); +} + +?> +
" method=POST> + + +PrintList(); +?> + + + + + + + + > + + + +
+ +
+ + +
" name="viewmenu"> + + + + +
+ +
" name="templatemenu"> + + + + +
+
+ + +
+ +
" ID="popup"> + + + + + + +
+ + + Index: trunk/admin/icons/icon46_settings_email.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/arr_sort_down.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/misc/review_detail_element.tpl =================================================================== diff -u --- trunk/themes/default/misc/review_detail_element.tpl (revision 0) +++ trunk/themes/default/misc/review_detail_element.tpl (revision 13) @@ -0,0 +1,14 @@ + + + + + + +
+
+
+ : +

+
+
+
Index: trunk/admin/images/toolbar/tool_cancel_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_tools.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/box.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_cat_pick.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_item.gif =================================================================== diff -u Binary files differ Index: trunk/admin/config/edit_banlist.php =================================================================== diff -u --- trunk/admin/config/edit_banlist.php (revision 0) +++ trunk/admin/config/edit_banlist.php (revision 13) @@ -0,0 +1,238 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL=$rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$FieldType = $_GET["DataType"]; +$section = $_GET["section"]; + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} +unset($objEditItems); + +$objBanList = new clsBanRuleList(); + +$envar = "section=$section&DataType=$FieldType&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","RuleChecks"); +$objListToolBar->Set("CheckForm","configform"); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("new_rule", "la_ToolTip_New_Rule",$adminURL."/users/addrule.php?$envar&new=1","swap('new_rule','toolbar/tool_new_rule_f2.gif');", + "swap('new_rule', 'toolbar/tool_new_rule.gif');","",$imagesURL."/toolbar/tool_new_rule.gif"); + +$objListToolBar->Add("apply_rules", "la_ToolTip_Apply_Rules",$adminURL."/users/banlist_apply.php?$envar","swap('apply_rules','toolbar/tool_apply_rules_f2.gif');", + "swap('apply_rules', 'toolbar/tool_apply_rules.gif');","",$imagesURL."/toolbar/tool_apply_rules.gif"); + +$objListToolBar->Add("rule_edit","la_ToolTip_Edit","#", "if (RuleChecks.itemChecked()) swap('rule_edit','toolbar/tool_edit_f2.gif');", + "if (RuleChecks.itemChecked()) swap('rule_edit', 'toolbar/tool_edit.gif');","if (RuleChecks.itemChecked()) RuleChecks.check_submit('../users/addrule', '');", + "tool_edit.gif", TRUE, TRUE); +$listImages[] = "RuleChecks.addImage('rule_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +$objListToolBar->Add("rule_del","la_ToolTip_Delete","#", "if (RuleChecks.itemChecked()) swap('rule_del','toolbar/tool_delete_f2.gif');", + "if (RuleChecks.itemChecked()) swap('rule_del', 'toolbar/tool_delete.gif');","if (RuleChecks.itemChecked()) RuleChecks.check_submit('edit_banlist', 'm_rule_delete');", + "tool_delete.gif", FALSE, TRUE); +$listImages[] = "RuleChecks.addImage('rule_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("move_up","la_ToolTip_Move_Up","#", "if (RuleChecks.itemChecked()) swap('move_up','toolbar/tool_move_up_f2.gif');", + "if (RuleChecks.itemChecked()) swap('move_up', 'toolbar/tool_move_up.gif');","if (RuleChecks.itemChecked()) RuleChecks.check_submit('edit_banlist', 'm_rule_move_up');", + "tool_move_up.gif"); +$listImages[] = "RuleChecks.addImage('move_up','$imagesURL/toolbar/tool_move_up.gif','$imagesURL/toolbar/tool_move_up_f3.gif',1); "; + +$objListToolBar->Add("move_down","la_ToolTip_Move_Down","#", "if (RuleChecks.itemChecked()) swap('move_down','toolbar/tool_move_down_f2.gif');", + "if (RuleChecks.itemChecked()) swap('move_down', 'toolbar/tool_move_down.gif');","if (RuleChecks.itemChecked()) RuleChecks.check_submit('edit_banlist', 'm_rule_move_down');", + "tool_move_down.gif"); +$listImages[] = "RuleChecks.addImage('move_down','$imagesURL/toolbar/tool_move_down.gif','$imagesURL/toolbar/tool_move_down_f3.gif',1); "; + +$objListToolBar->AddToInitScript($listImages); +$objListToolBar->AddToInitScript("fwLoadMenus(); \n"); + +$where = "ItemType = ".$FieldType; +$SearchWords = $objSession->GetVariable("RuleSearchWord"); +if(strlen($SearchWords)) +{ + $where .= " AND ".$objBanList->AdminSearchWhereClause($SearchWords); +} + +$order = trim($objConfig->Get("BanRules_LV_Sortfield")." ".$objConfig->Get("BanRules_LV_Sortorder")); + +$sql = "SELECT ELT(r.Status+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ') as Status, "; +$sql .= "ELT(r.RuleType+1,'".admin_language("la_Text_Deny")." ','".admin_language("la_Text_Allow")." ') as RuleType, "; +$sql .= "ELT(r.ItemVerb+1,'".admin_language("la_Text_Any")." ','".admin_language("la_Text_Is")." ','".admin_language("la_Text_IsNot")." ','".admin_language("la_text_Contains"); +$sql .= " ','".admin_language("la_Text_NotContains")." ','".admin_language("la_Text_GreaterThan")." ','".admin_language("la_Text_LessThan"); +$sql .= " ','".admin_language("la_Text_Exists")." ','".admin_language("la_Text_Unique")."') as ItemVerb, r.RuleId as RuleId, "; +$sql .= "r.ItemValue as ItemValue, r.ItemField as ItemField, r.Priority as Priority FROM ".$objBanList->SourceTable." as r "; +$sql .= "WHERE $where ORDER BY Priority DESC"; + +if(strlen($order)) + $sql .= ", ".$order; + + // echo $sql; + +$objBanList->Query_Item($sql); + +$objListView = new clsListView($objListToolBar,$objBanList); +$objListView->IdField = "RuleId"; + +$order = $objConfig->Get("BanRules_LV_Sortfield"); +$objListView->ColumnHeaders->Add("RuleType",admin_language("la_ColHeader_RuleType"),1,0,$order,"width=\"30%\"","BanRules_LV_Sortfield","BanRules_LV_Sortorder","RuleType"); +$objListView->ColumnHeaders->Add("ItemField",admin_language("la_ColHeader_ItemField"),1,0,$order,"width=\"30%\"","BanRules_LV_Sortfield","BanRules_LV_Sortorder","ItemField"); +$objListView->ColumnHeaders->Add("ItemVerb",admin_language("la_ColHeader_ItemVerb"),1,0,$order,"width=\"30%\"","BanRules_LV_Sortfield","BanRules_LV_Sortorder","ItemVerb"); +$objListView->ColumnHeaders->Add("ItemValue",admin_language("la_ColHeader_ItemValue"),1,0,$order,"width=\"30%\"","BanRules_LV_Sortfield","BanRules_LV_Sortorder","ItemValue"); +$objListView->ColumnHeaders->Add("Status",admin_language("la_ColHeader_Status"),1,0,$order,"width=\"30%\"","BanRules_LV_Sortfield","BanRules_LV_Sortorder","Status"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get("BanRules_LV_Sortfield"), $objConfig->Get("BanRules_LV_Sortorder")); + +$objListView->PrintToolBar = FALSE; +$objListView->checkboxes = TRUE; +$objListView->SearchBar=TRUE; +$objListView->SearchAction = "m_rule_search"; + +$objListView->CurrentPageVar = "Page_BanRules"; +$objListView->PerPageVar = "Perpage_BanRules"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->extra_env = "section=$section&DataType=$FieldType"; + +$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,"","",0); + +// $title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_BanRules"); + +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); + +?> +
" method=POST> + + +PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */ + $objListView->SliceItems(); + print $objListView->PrintList(); + +?> + + + + + +" name="viewmenu"> + + + + + +"> + + + + + + + + Index: trunk/themes/default/img/ic_logout.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_usergroups.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_sessions_log.gif =================================================================== diff -u Binary files differ Index: trunk/admin/category/js/lang.js =================================================================== diff -u --- trunk/admin/category/js/lang.js (revision 0) +++ trunk/admin/category/js/lang.js (revision 13) @@ -0,0 +1,42 @@ +Calendar._DN = new Array +("Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday"); +Calendar._MN = new Array +("January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["TOGGLE"] = "Toggle first day of week"; +Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)"; +Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)"; +Calendar._TT["GO_TODAY"] = "Go Today"; +Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)"; +Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)"; +Calendar._TT["SEL_DATE"] = "Select date"; +Calendar._TT["DRAG_TO_MOVE"] = "Drag to move"; +Calendar._TT["PART_TODAY"] = " (today)"; +Calendar._TT["MON_FIRST"] = "Display Monday first"; +Calendar._TT["SUN_FIRST"] = "Display Sunday first"; +Calendar._TT["CLOSE"] = "Close"; +Calendar._TT["TODAY"] = "Today"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd"; +Calendar._TT["TT_DATE_FORMAT"] = "D, M d"; Index: trunk/admin/images/toolbar/tool_new_image.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.link.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/logo.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/images/pending/.cvs =================================================================== diff -u --- trunk/kernel/images/pending/.cvs (revision 0) +++ trunk/kernel/images/pending/.cvs (revision 13) @@ -0,0 +1 @@ \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/alien.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.redo.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/index/welcomebox.tpl =================================================================== diff -u --- trunk/themes/default/index/welcomebox.tpl (revision 0) +++ trunk/themes/default/index/welcomebox.tpl (revision 13) @@ -0,0 +1,20 @@ + +
+ + + + + +

+
+ + + + + + +


Welcome to In-Portal
+ +
+ In-portal is a revolutionary web site management system that allows you to automate and facilitate management of large portal and community web sites. Regardless of whether you are running a directory site or a content news portal, a community site or an online mall, In-portal will enhance your web site management experience with innovative. +

\ No newline at end of file Index: trunk/admin/include/subitems/imgbuttons.js =================================================================== diff -u --- trunk/admin/include/subitems/imgbuttons.js (revision 0) +++ trunk/admin/include/subitems/imgbuttons.js (revision 13) @@ -0,0 +1,26 @@ +imgButtonClassName = "imgButton"; +imgButtonOAddon = "_f2"; + +function initImgButtons() +{ + var IMGs = document.getElementsByTagName("IMG") + for (var i = 0; i < IMGs.length; i++) + if (IMGs[i].getAttribute("isImgButton")) + { + IMGs[i].className = imgButtonClassName; + IMGs[i].oSrc = IMGs[i].src.substring(0, IMGs[i].src.lastIndexOf(".")) + imgButtonOAddon + IMGs[i].src.substring(IMGs[i].src.lastIndexOf("."), IMGs[i].src.length); + IMGs[i].oriSrc = IMGs[i].src; + preloadImage(IMGs[i].oSrc); + IMGs[i].onmouseover = function() {this.src = this.oSrc;} + IMGs[i].onmouseout = function() {this.src = this.oriSrc;} + } +} + +var prealodImages = new Array(); + +function preloadImage(src) +{ + var img = new Image(); + img.src = src; + prealodImages[prealodImages.length] = img; +} \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/msn/embaressed_smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/icon_angel.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/mad.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/icon_bravo.gif =================================================================== diff -u Binary files differ Index: trunk/admin/confirm.php =================================================================== diff -u --- trunk/admin/confirm.php (revision 0) +++ trunk/admin/confirm.php (revision 13) @@ -0,0 +1,45 @@ + + + In-Portal + + + + + + + + + +
+ + + + + + + +
+ . + Confirm Action

+ + + + +
+ Confirm + +
+ + + +

+
+
+ + + + +

+
+
+ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/sleep.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/jesors1.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_users.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_head_home.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/my_info/english_countries.tpl =================================================================== diff -u --- trunk/themes/default/my_info/english_countries.tpl (revision 0) +++ trunk/themes/default/my_info/english_countries.tpl (revision 13) @@ -0,0 +1,192 @@ +        +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                +                \ No newline at end of file Index: trunk/admin/images/toolbar/tool_copy.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_language.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/s.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/advsearch/item_form.tpl =================================================================== diff -u --- trunk/themes/default/advsearch/item_form.tpl (revision 0) +++ trunk/themes/default/advsearch/item_form.tpl (revision 13) @@ -0,0 +1,5 @@ +

+
+ + +
> + + + + + > + + + + + > + + + + + + > + + + + + > + + + + + > + + + + + > + + + + + + > + + + +
+ +
+ +  
+ +  
+ "> +
+ "> + Get("ErrorTag"))) echo prompt_language($c->Get("ErrorTag")); ?> +
">
+ Get("Status")==1) echo "CHECKED"; ?> VALUE="1"> + Get("Status")==0) echo "CHECKED"; ?> VALUE="0"> +
+ + "> + + +
+ + + + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/pleure.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_settings_email.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/jp.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/jp.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/jp.js (revision 13) @@ -0,0 +1,198 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * jp.js: Japanese support. + * + * Authors: + * Kato Yuichiro (y.kato@sociohealth.co.jp) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "切り取り" ; +lang["Copy"] = "コピー" ; +lang["Paste"] = "貼り付け" ; +lang["PasteText"] = "テキストデータのみ貼り付け" ; +lang["PasteWord"] = "ワード特有のタグを削除して貼り付け" ; +lang["Find"] = "検索" ; +lang["SelectAll"] = "全選択" ; +lang["RemoveFormat"] = "書式の解除" ; +lang["InsertLink"] = "ハイパーリンクの挿入・編集" ; +lang["RemoveLink"] = "ハイパーリンクの削除" ; +lang["InsertImage"] = "画像の挿入" ; +lang["InsertTable"] = "表の挿入" ; +lang["InsertLine"] = "区切り線の挿入" ; +lang["InsertSpecialChar"] = "特殊キャラクタの挿入" ; +lang["InsertSmiley"] = "スマイリーの挿入" ; +lang["About"] = "FCKeditorについて" ; + +lang["Bold"] = "太字" ; +lang["Italic"] = "斜体" ; +lang["Underline"] = "下線" ; +lang["StrikeThrough"] = "打ち消し線" ; +lang["Subscript"] = "下付き文字" ; +lang["Superscript"] = "上付き文字" ; +lang["LeftJustify"] = "左揃え" ; +lang["CenterJustify"] = "中央揃え" ; +lang["RightJustify"] = "右揃え" ; +lang["BlockJustify"] = "両端揃え" ; +lang["DecreaseIndent"] = "インデント解除" ; +lang["IncreaseIndent"] = "インデント" ; +lang["Undo"] = "元に戻す" ; +lang["Redo"] = "やり直す" ; +lang["NumberedList"] = "段落番号" ; +lang["BulettedList"] = "箇条書き" ; + +lang["ShowTableBorders"] = "表の枠線を表示する" ; +lang["ShowDetails"] = "詳細を表示する" ; + +lang["FontStyle"] = "スタイル" ; +lang["FontFormat"] = "フォーマット" ; +lang["Font"] = "フォント" ; +lang["FontSize"] = "サイズ" ; +lang["TextColor"] = "フォントの色" ; +lang["BGColor"] = "背景の色" ; +lang["Source"] = "ソース" ; + +// Context Menu + +lang["EditLink"] = "ハイパーリンクの編集" ; +lang["InsertRow"] = "行の挿入" ; +lang["DeleteRows"] = "行の削除" ; +lang["InsertColumn"] = "列の挿入" ; +lang["DeleteColumns"] = "列の削除" ; +lang["InsertCell"] = "セルの挿入" ; +lang["DeleteCells"] = "セルの削除" ; +lang["MergeCells"] = "セルの結合" ; +lang["SplitCell"] = "セルの分割" ; +lang["CellProperties"] = "セルの属性" ; +lang["TableProperties"] = "表の属性" ; +lang["ImageProperties"] = "画像の属性" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "XHTMLを解析しています。そのままお待ちください..." ; +lang["Done"] = "完了" ; +lang["PasteWordConfirm"] = "ワードからテキストを貼り付けようとしているようです。\nワード特有のタグを削除してから貼り付けますか?" ; +lang["NotCompatiblePaste"] = "この操作はインターネット・エクスプローラー5.5以上で利用できます。\nワード特有のタグを残したまま貼り付けます。よろしいですか?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "キャンセル" ; +lang["DlgBtnClose"] = "閉じる" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "画像の挿入" ; +lang["DlgImgTitleEdit"] = "画像の編集" ; +lang["DlgImgBtnUpload"] = "選択ファイルを送信" ; +lang["DlgImgURL"] = "画像ファイルURL" ; +lang["DlgImgUpload"] = "ローカルファイルの選択" ; +lang["DlgImgBtnBrowse"] = "送信済み画像" ; +lang["DlgImgAlt"] = "代替テキスト" ; +lang["DlgImgWidth"] = "幅" ; +lang["DlgImgHeight"] = "高さ" ; +lang["DlgImgLockRatio"] = "縦横比を固定" ; +lang["DlgBtnResetSize"] = "リセット" ; +lang["DlgImgBorder"] = "枠線" ; +lang["DlgImgHSpace"] = "左右アキ" ; +lang["DlgImgVSpace"] = "上下アキ" ; +lang["DlgImgAlign"] = "揃え" ; +lang["DlgImgAlignLeft"] = "左" ; +lang["DlgImgAlignAbsBottom"] = "下(絶対的)" ; +lang["DlgImgAlignAbsMiddle"] = "中央(絶対的)" ; +lang["DlgImgAlignBaseline"] = "ベースライン" ; +lang["DlgImgAlignBottom"] = "下" ; +lang["DlgImgAlignMiddle"] = "中央" ; +lang["DlgImgAlignRight"] = "右" ; +lang["DlgImgAlignTextTop"] = "テキスト" ; +lang["DlgImgAlignTop"] = "上" ; +lang["DlgImgPreview"] = "プレビュー" ; +lang["DlgImgMsgWrongExt"] = "送信を中止しました。\n送信できるファイルは以下の拡張子のファイルに制限されています:\n\n" + config.ImageUploadAllowedExtensions; +lang["DlgImgAlertSelect"] = "送信する画像を選択してください" ; // NEW1.2 + +// Link Dialog +lang["DlgLnkWindowTitle"] = "リンク" ; // NEW1.2 +lang["DlgLnkURL"] = "リンク先URL" ; +lang["DlgLnkUpload"] = "添付ファイル" ; +lang["DlgLnkTarget"] = "ウィンドウ" ; +lang["DlgLnkTargetNotSet"] = "<指定なし>" ; +lang["DlgLnkTargetBlank"] = "別ウィンドウ(_blank)" ; +lang["DlgLnkTargetParent"] = "親ウィンドウ(_parent)" ; +lang["DlgLnkTargetSelf"] = "同じウインドウ(_self)" ; +lang["DlgLnkTargetTop"] = "一番外のウィンドウ(_top)" ; +lang["DlgLnkTitle"] = "タイトル" ; +lang["DlgLnkBtnUpload"] = "添付ファイル送信" ; +lang["DlgLnkBtnBrowse"] = "サーバを参照する" ; +lang["DlgLnkMsgWrongExtA"] = "送信を中止しました。\n送信できるファイルは以下の拡張子のファイルに制限されています:\n\n" + config.LinkUploadAllowedExtensions; +lang["DlgLnkMsgWrongExtD"] = "送信を中止しました。\n以下の拡張子のファイルは送信できません:\n\n" + config.LinkUploadDeniedExtensions ; +lang["DlgLnkAlertSelect"] = "送信するファイルを選択してください" ; // NEW1.2 + +// Color Dialog +lang["DlgColorTitle"] = "色の選択" ; +lang["DlgColorBtnClear"] = "クリア" ; +lang["DlgColorHighlight"] = "" ; +lang["DlgColorSelected"] = "" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "スマイリーの挿入" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "特殊文字の挿入" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "表の挿入" ; +lang["DlgTableTitleEdit"] = "表の編集" ; +lang["DlgTableRows"] = "行" ; +lang["DlgTableColumns"] = "列" ; +lang["DlgTableBorder"] = "枠" ; +lang["DlgTableAlign"] = "揃え" ; +lang["DlgTableAlignNotSet"] = "<指定なし>" ; +lang["DlgTableAlignLeft"] = "左" ; +lang["DlgTableAlignCenter"] = "中央" ; +lang["DlgTableAlignRight"] = "右" ; +lang["DlgTableWidth"] = "幅" ; +lang["DlgTableWidthPx"] = "pixcel" ; +lang["DlgTableWidthPc"] = "%" ; +lang["DlgTableHeight"] = "高さ" ; +lang["DlgTableCellSpace"] = "セル間隔" ; +lang["DlgTableCellPad"] = "セル余白" ; +lang["DlgTableCaption"] = "説明" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "セルの属性" ; +lang["DlgCellWidth"] = "幅" ; +lang["DlgCellWidthPx"] = "pixel" ; +lang["DlgCellWidthPc"] = "%" ; +lang["DlgCellHeight"] = "高さ" ; +lang["DlgCellWordWrap"] = "改行" ; +lang["DlgCellWordWrapNotSet"] = "<指定なし>" ; +lang["DlgCellWordWrapYes"] = "許可" ; +lang["DlgCellWordWrapNo"] = "禁止" ; +lang["DlgCellHorAlign"] = "左右揃え" ; +lang["DlgCellHorAlignNotSet"] = "<指定なし>" ; +lang["DlgCellHorAlignLeft"] = "左" ; +lang["DlgCellHorAlignCenter"] = "中央" ; +lang["DlgCellHorAlignRight"] = "右" ; +lang["DlgCellVerAlign"] = "上下揃え" ; +lang["DlgCellVerAlignNotSet"] = "<指定なし>" ; +lang["DlgCellVerAlignTop"] = "上" ; +lang["DlgCellVerAlignMiddle"] = "中央" ; +lang["DlgCellVerAlignBottom"] = "下" ; +lang["DlgCellVerAlignBaseline"] = "ベースライン" ; +lang["DlgCellRowSpan"] = "行数" ; +lang["DlgCellCollSpan"] = "列数" ; +lang["DlgCellBackColor"] = "背景色" ; +lang["DlgCellBorderColor"] = "枠の色" ; +lang["DlgCellBtnSelect"] = "選択..." ; + +// About Dialog +lang["DlgAboutVersion"] = "version" ; +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "For further information go to" ; \ No newline at end of file Index: trunk/admin/images/bg_install_menu.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/max_rate.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_newreview.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_homepath.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/thumbdown.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_tools.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/smicon7.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_myprofile46.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_usertogroup_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/browse/utility.js =================================================================== diff -u --- trunk/admin/browse/utility.js (revision 0) +++ trunk/admin/browse/utility.js (revision 13) @@ -0,0 +1,18 @@ +function getRealLeft(el) { + xPos = el.offsetLeft; + tempEl = el.offsetParent; + while (tempEl != null) { + xPos += tempEl.offsetLeft; + tempEl = tempEl.offsetParent; + } + return xPos; +} +function getRealTop(el) { + yPos = el.offsetTop; + tempEl = el.offsetParent; + while (tempEl != null) { + yPos += tempEl.offsetTop; + tempEl = tempEl.offsetParent; + } + return yPos; +} Index: trunk/themes/default/common/right_suggest.tpl =================================================================== diff -u --- trunk/themes/default/common/right_suggest.tpl (revision 0) +++ trunk/themes/default/common/right_suggest.tpl (revision 13) @@ -0,0 +1,9 @@ + + + + + + + + + Index: trunk/admin/config/config_lang.php =================================================================== diff -u --- trunk/admin/config/config_lang.php (revision 0) +++ trunk/admin/config/config_lang.php (revision 13) @@ -0,0 +1,240 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$section = "in-portal:configure_lang"; + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} +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","LangChecks"); +$objListToolBar->Set("CheckForm","languages"); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("new_lang", "la_ToolTip_New_LangPack",$adminURL."/config/addlang.php?$envar&new=1","swap('new_lang','toolbar/tool_new_language_f2.gif');", + "swap('new_lang', 'toolbar/tool_new_language.gif');","",$imagesURL."/toolbar/tool_new_language.gif"); + +$objListToolBar->Add("import_lang", "la_ToolTip_Import_LangPack",$adminURL."/config/importlang.php?$envar","swap('import_lang','toolbar/tool_import_language_f2.gif');", + "swap('import_lang', 'toolbar/tool_import_language.gif');","",$imagesURL."/toolbar/tool_import_language.gif"); + +$objListToolBar->Add("lang_edit","la_ToolTip_Edit","#", "if (LangChecks.itemChecked()) swap('lang_edit','toolbar/tool_edit_f2.gif');", + "if (LangChecks.itemChecked()) swap('lang_edit', 'toolbar/tool_edit.gif');","if (LangChecks.itemChecked()) LangChecks.check_submit('addlang', '');", + "tool_edit.gif",TRUE,TRUE); + +$listImages[] = "LangChecks.addImage('lang_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +$objListToolBar->Add("lang_del","la_ToolTip_Delete","#", "if (LangChecks.itemChecked()) swap('lang_del','toolbar/tool_delete_f2.gif');", + "if (LangChecks.itemChecked()) swap('lang_del', 'toolbar/tool_delete.gif');","if (LangChecks.itemChecked()) LangChecks.check_submit('config_lang', 'm_lang_delete');", + "tool_delete.gif",FALSE,TRUE); + +$listImages[] = "LangChecks.addImage('lang_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->Add("lang_export","la_ToolTip_Export","#", "if (LangChecks.itemChecked()) swap('lang_export','toolbar/tool_export_language_f2.gif');", + "if (LangChecks.itemChecked()) swap('lang_export', 'toolbar/tool_export_language.gif');","if (LangChecks.itemChecked()) LangChecks.check_submit('addlang_export', '');", + "tool_export_language.gif"); + +$listImages[] = "LangChecks.addImage('lang_export','$imagesURL/toolbar/tool_export_language.gif','$imagesURL/toolbar/tool_export_language_f3.gif',1); "; + +$objListToolBar->AddToInitScript($listImages); +$objListToolBar->AddToInitScript("fwLoadMenus(); \n"); + +$objLang = new clsLanguageList(); + +$SearchWords = $objSession->GetVariable("LangSearchWord"); +if(strlen($SearchWords)) +{ + $where = $objLang->AdminSearchWhereClause($SearchWords); +} +else + $where = ""; +$order = trim($objConfig->Get("Lang_LV_Sortfield")." ".$objConfig->Get("Lang_LV_Sortorder")); + +$sql = "SELECT l.*,ELT(l.Enabled+1,'".prompt_language("la_Text_Disabled")."','".prompt_language("la_Text_Enabled")."') as Status "; +$sql .= "FROM ".GetTablePrefix()."Language as l "; +if(strlen($where)) + $sql .= "WHERE ".$where." "; +if(strlen($order)) + $sql .= "ORDER BY ".$order; + +$sql .= GetLimitSQL($objSession->GetVariable("Page_LV_Lang"),$objConfig->Get("Perpage_LV_Lang")); +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + +$objLanguages->Query_Item($sql); +$itemcount = TableCount(GetTablePrefix()."Language", $where,0); + +$objListView = new clsListView($objListToolBar,$objLanguages); +$objListView->IdField = "LanguageId"; + +$order = $objConfig->Get("Lang_LV_Sortfield"); +$objListView->ColumnHeaders->Add("PackName",admin_language("la_prompt_PackName"),1,0,$order,"width=\"30%\"","Lang_LV_Sortfield","Lang_LV_Sortorder","PackName"); +$objListView->ColumnHeaders->Add("LocalName",admin_language("la_prompt_Name"),1,0,$order,"width=\"30%\"","Lang_LV_Sortfield","Lang_LV_Sortorder","LocalName"); +$objListView->ColumnHeaders->Add("Status",admin_language("la_ColHeader_Status"),1,0,$order,"width=\"30%\"","Lang_LV_Sortfield","Lang_LV_Sortorder","Status"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get("Lang_LV_Sortfield"), $objConfig->Get("Lang_LV_Sortorder")); + +$objListView->PrintToolBar = FALSE; +$objListView->checkboxes = TRUE; + +$objListView->CurrentPageVar = "Page_LV_Lang"; +$objListView->PerPageVar = "Perpage_LV_lang"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_lang_search"; + +$objListView->TotalItemCount = $itemcount; + +for($i=0;$iItems);$i++) +{ + $objListView->RowIcons[] = $objLanguages->Items[$i]->AdminIcon(); +} + + +if ($_GET['action'] == "cancel") { + $ado = GetADODBConnection(); + + $PhraseTable = "ses_".$objSession->GetSessionKey()."_".GetTablePrefix()."ImportPhrases"; + $EventTable = "ses_".$objSession->GetSessionKey()."_".GetTablePrefix()."ImportEvents"; + + $ado->Execute("DROP TABLE $PhraseTable"); + $ado->Execute("DROP TABLE $EventTable"); +} + +$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,"","",0); + +$title = prompt_language("la_Text_Configuration")." - ".prompt_language("la_tab_Regional")." ".prompt_language("la_Text_Settings"); +$h = "\n\n\n"; +int_header($objListToolBar,NULL,$title, NULL, $h); +?> +
" method=POST> + + +PrintList(); +?> + + + +" name="viewmenu"> + + + + + + + + + + + + + Index: trunk/admin/images/toolbar/tool_preview_template_f3.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-ado_access.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-ado_access.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-ado_access.inc.php (revision 13) @@ -0,0 +1,46 @@ +ADODB_ado(); + } + + function BeginTrans() { return false;} + +} + + +class ADORecordSet_ado_access extends ADORecordSet_ado { + + var $databaseType = "ado_access"; + + function ADORecordSet_ado_access($id,$mode=false) + { + return $this->ADORecordSet_ado($id,$mode); + } +} +?> \ No newline at end of file Index: trunk/themes/default/img/bgr_friendbox.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/category/images/ddarrow.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/dialog/fck_link.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/dialog/fck_link.html (revision 0) +++ trunk/admin/editor/FCKeditor/dialog/fck_link.html (revision 13) @@ -0,0 +1,315 @@ + + + + + + + + + +
+ + + +
+ + + + + + +
URL
+ + + + + + + + + + + +
    + +
+ +
+ +
+
+ + + + + +
Title
+ +
+
+ + + Index: trunk/admin/images/summary/searchbox_header.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.superscript.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/logo_bg.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_language_var.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-access.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-access.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-access.inc.php (revision 13) @@ -0,0 +1,74 @@ +ADODB_odbc(); + } + + function BeginTrans() { return false;} + + function &MetaTables() + { + global $ADODB_FETCH_MODE; + + $savem = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + $qid = odbc_tables($this->_connectionID); + $rs = new ADORecordSet_odbc($qid); + $ADODB_FETCH_MODE = $savem; + if (!$rs) return false; + + $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change; + + $arr = &$rs->GetArray(); + //print_pre($arr); + $arr2 = array(); + for ($i=0; $i < sizeof($arr); $i++) { + if ($arr[$i][2] && $arr[$i][3] != 'SYSTEM TABLE') + $arr2[] = $arr[$i][2]; + } + return $arr2; + } +} + + +class ADORecordSet_access extends ADORecordSet_odbc { + + var $databaseType = "access"; + + function ADORecordSet_access($id,$mode=false) + { + return $this->ADORecordSet_odbc($id,$mode); + } +}// class +} +?> \ No newline at end of file Index: trunk/admin/images/tab_middle.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/catindex/no_items.tpl =================================================================== diff -u --- trunk/themes/default/catindex/no_items.tpl (revision 0) +++ trunk/themes/default/catindex/no_items.tpl (revision 13) @@ -0,0 +1,16 @@ + + +

+ + + + +
+ + + + + +

+
+ \ No newline at end of file Index: trunk/themes/default/suggest_cat/suggest_cat_form.tpl =================================================================== diff -u --- trunk/themes/default/suggest_cat/suggest_cat_form.tpl (revision 0) +++ trunk/themes/default/suggest_cat/suggest_cat_form.tpl (revision 13) @@ -0,0 +1,66 @@ +
"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ (*)


*
*
 
  + " class="button"> + " class="button" onClick="javascript:history.back(); "> +



+
\ No newline at end of file Index: trunk/kernel/action.php =================================================================== diff -u --- trunk/kernel/action.php (revision 0) +++ trunk/kernel/action.php (revision 13) @@ -0,0 +1,2125 @@ +\n"; +echo 'REQUEST:'; +print_pre($_REQUEST); +*/ + switch($Action) + { + case "m_add_user": + $user_pending = (int)$_POST["user_pending"]; + $user_enabled = (int)$_POST["user_enabled"]; + $CreatedOn = DateTimestamp($_POST["user_date"],GetDateFormat()); + $dob = DateTimestamp($_POST["user_dob"],GetDateFormat()); + + $objEditItems = new clsUserManager(); + $objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); + + if(strlen($_POST["user_login"])) + { + $id = $objUsers->GetUserId($_POST["user_login"]); + } + else + $dob = 0; + $dob = 0; + if($id) + { + $lvErrorString = "la_error_duplicate_username"; + } + else + { + $password = md5($_POST["password"]); + $u = $objEditItems->Add_User($_POST["user_login"], $password, + $_POST["user_email"], $CreatedOn, $_POST["user_firstname"], + $_POST["user_lastname"], $_POST["status"], + $_POST["user_phone"], + $_POST["user_street"], $_POST["user_city"], + $_POST["user_state"], $_POST["user_zip"], $_POST["user_country"], $dob); + $objCustomEdit = new clsCustomDataList($objSession->GetEditTable("CustomMetaData")); + $objCustomEdit->LoadResource($u->Get("ResourceId")); + $CustomFields = new clsCustomFieldList(6); + $DataChanged = FALSE; + foreach($_POST as $key=>$value) + { + if(substr($key,0,1)=="_") + { + $field = substr($key,1); + $cvalue = $CustomFields->GetItemByField("FieldName",$field,FALSE); + + if(is_object($cvalue)) + { + $objCustomEdit->SetFieldValue($cvalue->Get("CustomFieldId"),$u->Get("ResourceId"),$value); + $DataChanged = TRUE; + } + } + } + if($DataChanged) + $objCustomEdit->SaveData(); + } + break; + case "m_edit_user": + //phpinfo(INFO_VARIABLES); + $CreatedOn = DateTimestamp($_POST["user_date"],GetDateFormat()); + $dob = DateTimestamp($_POST["user_dob"],GetDateFormat()); + $objEditItems = new clsUserManager(); + $objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); + $user_pending = (int)$_POST["user_pending"]; + $user_enabled = (int)$_POST["user_enabled"]; + $UserId=(int)$_POST["user_id"]; + //echo $UserId."
\n"; + if(!strlen($_POST["user_login"])) + $dob = 0; + if(strlen($_POST["password"])) + { + $password = md5($_POST["password"]); + } + else + $password = ""; + $u = $objEditItems->Edit_User($UserId, $_POST["user_login"], $password, + $_POST["user_email"], $CreatedOn, $_POST["user_firstname"], + $_POST["user_lastname"], $_POST["status"], + $_POST["user_phone"], + $_POST["user_street"], $_POST["user_city"], + $_POST["user_state"], $_POST["user_zip"], $_POST["user_country"], + $dob); + $objCustomEdit = new clsCustomDataList($objSession->GetEditTable("CustomMetaData")); + $objCustomEdit->LoadResource($u->Get("ResourceId")); + $CustomFields = new clsCustomFieldList(6); + $DataChanged = FALSE; + foreach($_POST as $key=>$value) + { + if(substr($key,0,1)=="_") + { + $field = substr($key,1); + $cvalue = $CustomFields->GetItemByField("FieldName",$field,FALSE); + + if(is_object($cvalue)) + { + $objCustomEdit->SetFieldValue($cvalue->Get("CustomFieldId"),$u->Get("ResourceId"),$value); + $DataChanged = TRUE; + } + } + } + if($DataChanged) + $objCustomEdit->SaveData(); + break; + case "m_user_primarygroup": + //print_pre($_REQUEST); + $users = explode(',', $_POST["userlist"]); + $GroupResourceId = $_POST['grouplist']; + $g = $objGroups->GetItemByField("ResourceId", $GroupResourceId); + $GroupId = $g->UniqueId(); + + if( is_array($users) ) + foreach($users as $user_id) + { + $u = $objUsers->GetItemByField("ResourceId", $user_id); + $g->AddUser($u->Get("PortalUserId"), 1); + } + break; + + case "m_edit_group": + $objEditItems = new clsGroupList(); + $objEditItems->SourceTable = $objSession->GetEditTable("PortalGroup"); + $objEditItems->Edit_Group($_POST["group_id"], $_POST["group_name"],$_POST["group_comments"]); + break; + case "m_add_group": + $objEditItems = new clsGroupList(); + $objEditItems->SourceTable = $objSession->GetEditTable("PortalGroup"); + $objEditItems->Add_Group($_POST["group_name"], $_POST["group_comments"],0); + break; + case "m_group_sysperm": + if($_POST["GroupEditStatus"]==0) + { + $objSession->ResetSysPermCache(); + $GroupId = $_POST["GroupId"]; + if($GroupId) + { + $objEditItems = new clsGroupList(); + $objEditItems->SourceTable = $objSession->GetEditTable("PortalGroup"); + $g = $objEditItems->GetItemByField("ResourceId",$GroupId); + if(is_object($g)) + { + + $PermList = explode(",",$_POST["PermList"]); + for($i=0;$iSetSystemPermission($PermList[$i],$value); + } + } + } + } + break; + case "m_user_sysperm": + + if($_POST["UserEditStatus"]==0) + { + $UserId = $_POST["ItemId"]; + if($UserId) + { + $objEditItems = new clsUserManager(); + $objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); + $u = $objEditItems->GetItemByField("ResourceId",$UserId); + unset($g); + if(is_object($u)) + { + $objSession->ResetSysPermCache(); + $g = $u->GetPersonalGroup(FALSE); + $PermList = explode(",",$_POST["PermList"]); + for($i=0;$iGetPersonalGroup(TRUE); + + $value = 0; + if(is_array($_POST["permvalue"])) + { + if(in_array($PermList[$i],$_POST["permvalue"])) + $value =1; + $g->SetSystemPermission($PermList[$i],$value); + } + else + $g->SetSystemPermission($PermList[$i],-1); + } + else + { + if(is_object($g)) + $g->SetSystemPermission($PermList[$i],-1); + } + } + } + } + } + break; + case "m_approve_user": + foreach($_POST["itemlist"] as $userid) + { + $user = $objUsers->GetItemByField("ResourceId",$userid); + $user->Approve(); + } + $objUsers->Clear(); + break; + + case "m_deny_user": + foreach($_POST["itemlist"] as $userid) + { + $user = $objUsers->GetItemByField("ResourceId",$userid); + $user->Deny(); + } + $objUsers->Clear(); + break; + case "m_delete_user": + foreach($_POST["itemlist"] as $userid) + $objUsers->Delete_User($userid); + break; + case "m_delete_group": + foreach($_POST["itemlist"] as $groupid) + { + $objGroups->Delete_Group($groupid); + } + break; + case "m_user_assign": + $useridlist = implode("-", $userlist); + $objSession->SetUserStatus($useridlist, "g_usergroup_status"); + $g_usergroup_status = $useridlist; + break; + case "m_group_assign": + foreach($grouplist as $group) + $objGroups->Add_Users_To_Group($group); + break; + case "m_remove_group": + $adodbConnection = GetAdodbConnection(); + $adodbConnection->Execute("DELETE FROM UserGroup where UserId='$UserId' AND GroupId='$GroupId'"); + break; + + case "m_SetVariable": + $objSession->SetPersistantVariable($_POST["fieldname"], $_POST["varvalue"]); + //echo "Setting $fieldname to $varvalue
\n"; + break; + case "m_SetSessionVariable": + $objSession->SetVariable($_POST["fieldname"], $_POST["varvalue"]); + //echo "Setting $fieldname to $varvalue
\n"; + if($_POST["fieldname"]=="SearchType") + $objSession->SetVariable("SearchWord",""); + break; + + case "m_edit_permissions": + if($_POST["CatEditStatus"] != -1) + { + $GroupId = $_POST["GroupId"]; + $CatId = $_POST["CategoryId"]; + $Module = $_POST["Module"]; + $ado = GetADODBConnection(); + $sql = "SELECT * FROM ".GetTablePrefix()."PermissionConfig WHERE ModuleId='$Module'"; + $rs = $ado->Execute($sql); + $PermNames = array(); + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $PermNames[] = $data["PermissionName"]; + $rs->MoveNext(); + } + + $inherit = array(); + if(is_array($_POST["inherit"])) + { + foreach($_POST["inherit"] as $perm) + { + $inherit[$perm] = 1; + } + } + $access = array(); + if(is_array($_POST["permvalue"])) + { + foreach($_POST["permvalue"] as $perm) + { + $access[$perm] = 1; + } + } + $objPermList = new clsPermList($CatId,$GroupId); + $objPermList->LoadCategory($CatId); + + for($i=0;$iGetPermByName($PermNames[$i]); + if($Perm) + { + $Id = $Perm->Get("PermissionId"); + //echo "Editing $Id
\n"; + $objPermList->Edit_Permission($Id,$CatId,$GroupId,$PermNames[$i],$PermValue,0); + } + else + { + //echo "Adding ".$PermNames[$i]; + $objPermList->Add_Permission($CatId,$GroupId,$PermNames[$i],$PermValue,0); + } + } + else + { + $Perm = $objPermList->GetPermByName($PermNames[$i]); + if($Perm) + { + $Id = $Perm->Get("PermissionId"); + $objPermList->Delete_Permission($Id); + } + } + } + //$c = $objCatList->GetItem($CatId); + //$glist = $objGroups->GetAllGroupList(); + //$ViewList = $objPermList->GetGroupPermList($c,"CATEGORY.VIEW",$glist ); + //$c->SetViewPerms("CATEGORY.VIEW",$ViewList,$glist); + //$c->Update(); + } + break; + case "m_perm_delete_group": + + $ado = GetADODBConnection(); + $CatId = $_POST["CategoryId"]; + foreach($_POST["itemlist"] as $groupid) + { + $g = $objGroups->GetItemByField("ResourceId",$groupid); + if(is_object($g)) + { + $sql = "DELETE FROM ".GetTablePrefix()."Permissions WHERE CatId=$CatId AND GroupId=".$g->Get("GroupId"); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + $ado->Execute($sql); + } + } + break; + + case "m_user_addto_group": + $user = $_POST["UserId"]; + if(is_numeric($user)) + { + if(strlen($_POST["grouplist"])) + { + $groups = explode(",",$_POST["grouplist"]); + if(is_array($groups)) + { + for($i=0; $iGetItemByField("ResourceId",$groups[$i]); + $g->AddUser($user); + } + } + else + { + $g = $objGroups->GetItem($groups); + $g->AddUser($user); + } + } + } + break; + case "m_group_add_user": + $group = $_POST["GroupId"]; + $EditGroups = new clsGroupList(); + $EditGroups->SourceTable = $objSession->GetEditTable($objGroups->SourceTable); + $g = $EditGroups->GetItem($group); +// echo "Group: $group
\n"; + if(is_numeric($group)) + { + $users = explode(",",$_POST["userlist"]); + foreach($users as $userid) + { + $u = $objUsers->GetItemByField("ResourceId",$userid); + $g->AddUser($u->Get("PortalUserId")); + } + } + + break; + case "m_group_removeuser": + $group = $_POST["GroupId"]; + $g = $objGroups->GetItem($group); + if($group>0) + { + foreach($_POST["itemlist"] as $user_id) + { + $u = $objUsers->GetItemByField("ResourceId",$user_id); + $g->DeleteUser($u->Get("PortalUserId")); + } + } + break; + case "m_user_removegroup": + $user = $_POST["UserId"]; + if($user>0) + { + foreach($_POST["itemlist"] as $groupid) + { + $g = $objGroups->GetItem($groupid); + $g->DeleteUser($user); + } + } + break; + case "m_sendmail": + $idlist = explode(",",$_POST["idlist"]); + $html = (int)$_POST["html_enable"]; + $body = inp_escape($_POST["email_body"],$html); + $subject = inp_escape($_POST["email_body"],$html); + $Email = new clsEmailMessage(); + $Email->Set("Subject",$subject); + $Email->Set("Template",$body); + if($html) + $Email->Set("MessageType","HTML"); + if(count($idlist)>0) + { + switch($_POST["IdType"]) + { + case "group": + foreach($idlist as $id) + $Email->SendToGroup($id); + break; + case "user": + foreach($idlist as $id) + $Email->SendToUser($id); + break; + }/*switch*/ + } + break; + case "m_item_recount": + RunDown($m_var_list["cat"],"UpdateCacheCounts"); + break; + case "m_cat_delete": + if($objSession->HasCatPermission("CATEGORY.DELETE",$objCatList->CurrentCategoryID())) + { + if(isset($_POST["catlist"])) + { + if(is_array($_POST["catlist"])) + foreach($_POST["catlist"] as $catid) + { + $objCatList->Delete_Category($catid); + + } + } + } + break; + case "m_cat_cut": + if(isset($_POST["catlist"])) + { + if($objSession->HasCatPermission("CATEGORY.DELETE",$catid)) + { + $objCatList->CopyToClipboard("CUT","CategoryId",$_POST["catlist"]); + } + else + $objCatList->CopyToClipboard("COPY","CategoryId",$_POST["catlist"]); + } + break; + case "m_cat_copy": + if(isset($_POST["catlist"])) + { + $objCatList->CopyToClipboard("COPY","CategoryId",$_POST["catlist"]); + } + break; + + case "m_paste": + if($objCatList->ItemsOnClipboard()>0) + { + /* category's paste function populates a sparse array where array[old_id]=new_id */ + $PastedCatIds = array(); + $objCatList->PasteFromClipboard($objCatList->CurrentCategoryID(),"Name"); + } + else + { + $clip = $objSession->GetVariable("ClipBoard"); + if(strlen($clip)) + { + $ClipBoard = ParseClipboard($clip); + $Action= strtolower($ClipBoard["table"])."_paste"; + } + } + break; + case "m_cat_move_up": + if (isset($_POST["catlist"])) + { + foreach($_POST["catlist"] as $catid) + { + $cat =& $objCatList->GetCategory($catid); + $cat->MoveUp(); + } + } + break; + case "m_cat_move_down": + if (isset($_POST["catlist"])) + { + $catlist=array_reverse($_POST["catlist"]); + foreach($catlist as $catid) + { + $cat =& $objCatList->GetCategory($catid); + $cat->MoveDown(); + } + } + break; + case "m_cat_approve": + if (isset($_POST["catlist"])) + { + foreach($_POST["catlist"] as $catid) + { + $cat =& $objCatList->GetCategory($catid); + $cat->Approve(); + } + } + break; + case "m_cat_decline": + if (isset($_POST["catlist"])) + { + foreach($_POST["catlist"] as $catid) + { + $cat =& $objCatList->GetCategory($catid); +// $cat->Deny(); + RunDown($catid,"Deny"); + } + } + break; + + case "m_rel_delete": + $adodbConnection= GetADODBConnection(); + $table = $objSession->GetEditTable("Relationship"); + if(isset($_POST["itemlist"])) + { + if(is_array($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + $sql = "DELETE FROM ".$table." WHERE RelationshipId=".$id; + $adodbConnection->Execute($sql); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + } + } + else + { + $sql = "DELETE FROM ".$table." WHERE RelationshipId=".$_POST["itemlist"]; + $adodbConnection->Execute($sql); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + } + } + break; + case "m_add_relation": + if($_POST["CatEditStatus"]==0) + { + $RelList = new clsRelationshipList(); + $RelList->SourceTable = $objSession->GetEditTable("Relationship"); + + //$r = $RelList->Add($_POST["SourceId"],$_POST["SourceType"],$_POST["TargetId"],$_POST["TargetType"], + // 0,(int)$_POST["Enabled"],$_POST["RelType"], $Rel); + $ado = GetADODBConnection(); + $rs = $ado->Execute("SELECT MIN(RelationshipId) as MinValue FROM ".$RelList->SourceTable); + $NewId = $rs->fields["MinValue"]-1; + + $r = $RelList->Add($_POST["SourceId"],$_POST["SourceType"],$_POST["TargetId"],$_POST["TargetType"], + 0,(int)$_POST["Enabled"],$_POST["RelType"], $NewId); + + $sql = "UPDATE ".$RelList->SourceTable." SET RelationshipId=".$NewId." WHERE RelationshipId=".$r->Get("RelationshipId"); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + $ado->Execute($sql); + } + break; + case "m_edit_relation": + if($_POST["CatEditStatus"]==0) + { + $RelList = new clsRelationshipList(); + $RelList->SourceTable = $objSession->GetEditTable("Relationship"); + + $r = $RelList->GetItem($_POST["RelationshipId"]); + if(is_object($r)) + { + $r->Set("Enabled",(int)$_POST["Enabled"]); + $r->Set("Type",(int)$_POST["RelType"]); + $r->Set("Priority",(int)$_POST["priority"]); + $r->Update(); + } + } + break; + case "m_rel_move_up": + $objRelList = new clsRelationshipList(); + $objRelList->SourceTable = $objSession->GetEditTable("Relationship"); + if (isset($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + $r = $objRelList->GetItem($id); + $r->MoveUp($_POST["SourceId"]); + } + } + break; + case "m_rel_move_down": + $objRelList = new clsRelationshipList(); + $objRelList->SourceTable = $objSession->GetEditTable("Relationship"); + if (isset($_POST["itemlist"])) + { + $itemlist=array_reverse($_POST["itemlist"]); + foreach($itemlist as $id) + { + $r = $objRelList->GetItem($id); + $r->MoveDown($_POST["SourceId"]); + } + } + break; + + + case "m_add_category": + if(ValidDate($_POST["cat_date"],GetDateFormat())) + { + $CreatedOn = DateTimestamp($_POST["cat_date"],GetDateFormat()); + } + else + $CreatedOn = time(); + $html = (int)$_POST["html_enable"]; + + $cat_pick = $_POST["cat_pick"]; + $Status = (int)$_POST["status"]; + $Hot=(int)$_POST["itemhot"]; + $Pop = (int)$_POST["itempop"]; + $New = (int)$_POST["itemnew"]; + + $objEditItems = new clsCatList(); + $objEditItems->SourceTable = $objSession->GetEditTable("Category"); + $cat = $objEditItems->Add($_POST["ParentId"], $_POST["cat_name"], inp_escape($_POST["cat_desc"],$html), $CreatedOn, + $cat_pick, $Status, $Hot, $New, $Pop, $_POST["Priority"], + $_POST["meta_keywords"],$_POST["meta_desc"]); + $objCustomEdit = new clsCustomDataList($objSession->GetEditTable("CustomMetaData")); + $objCustomEdit->LoadResource($cat->Get("ResourceId")); + $CustomFields = new clsCustomFieldList(1); + $DataChanged = FALSE; + foreach($_POST as $key=>$value) + { + if(substr($key,0,1)=="_") + { + $field = substr($key,1); + $cvalue = $CustomFields->GetItemByField("FieldName",$field,FALSE); + + if(is_object($cvalue)) + { + $objCustomEdit->SetFieldValue($cvalue->Get("CustomFieldId"),$cat->Get("ResourceId"),$value); + $DataChanged = TRUE; + } + } + } + if($DataChanged) + $objCustomEdit->SaveData(); + + break; + + case "m_edit_category": + $CreatedOn = DateTimestamp($_POST["cat_date"],GetDateFormat()); + $cat_pick = $_POST["cat_pick"]; + $Status = (int)$_POST["status"]; + $Hot=(int)$_POST["itemhot"]; + $Pop = (int)$_POST["itempop"]; + $New = (int)$_POST["itemnew"]; + + $html = (int)$_POST["html_enable"]; + $objEditItems = new clsCatList(); + $objEditItems->SourceTable = $objSession->GetEditTable("Category"); + $cat = $objEditItems->Edit_Category($_POST["CategoryId"],inp_escape($_POST["cat_name"],$html), inp_escape($_POST["cat_desc"],$html), $CreatedOn, $cat_pick, $Status, $Hot, $New, $Pop, $_POST["Priority"], $_POST["meta_keywords"], $_POST["meta_desc"]); + + $objCustomEdit = new clsCustomDataList($objSession->GetEditTable("CustomMetaData")); + $objCustomEdit->LoadResource($cat->Get("ResourceId")); + $CustomFields = new clsCustomFieldList(1); + $DataChanged = FALSE; + foreach($_POST as $key=>$value) + { + if(substr($key,0,1)=="_") + { + $field = substr($key,1); + $cvalue = $CustomFields->GetItemByField("FieldName",$field,FALSE); + + if(is_object($cvalue)) + { + $objCustomEdit->SetFieldValue($cvalue->Get("CustomFieldId"),$cat->Get("ResourceId"),$value); + $DataChanged = TRUE; + } + } + } + if($DataChanged) + $objCustomEdit->SaveData(); + + break; + case "m_edit_custom_data": + + $id = $_POST["ItemId"]; + $objEditData = new clsCustomDataList($objSession->GetEditTable("CustomMetaData")); + $ado = GetADODBConnection(); + if($id && is_array($_POST["CustomData"])) + { + foreach($_POST["CustomData"] as $FieldId => $Value) + { + $sql = "SELECT count(*) as reccount FROM ".$objEditData->SourceTable." WHERE CustomFieldId=$FieldId AND ResourceId=".$_POST["ItemId"]; + $rs = $ado->Execute($sql); + $intable = $rs->fields["reccount"]; + if(!$intable) + { + $sql = "INSERT INTO ".$objEditData->SourceTable." (ResourceId,CustomFieldId,Value) VALUES ('".$id."','$FieldId','$Value')"; + $ado->Execute($sql); + //echo $sql."
\n"; + } + else + { + $sql = "UPDATE ".$objEditData->SourceTable." SET Value='".$Value."' WHERE CustomFieldId=$FieldId AND ResourceId=".$_POST["ItemId"]; + $ado->Execute($sql); + //echo $sql."
\n"; + } + } + } + break; + case "m_customfield_edit": + + $DataType = $_POST["DataType"]; + $FieldId = $_POST["CustomFieldId"]; + $FieldName = $_POST["fieldname"]; + //$FieldLabel = $_POST["fieldlabel"]; + if(strlen($FieldName)) + { + $objCustomFields = new clsCustomFieldList($DataType); + $objCustomFields->EditField($FieldId,$DataType,$FieldName,"",(int)$_POST["generaltab"], + $_POST["heading"],$_POST["fieldprompt"],$_POST["input_type"], + $_POST["valuelist"]); + } + unset($objCustomFields); + break; + case "m_customfield_add": + + $DataType = $_POST["DataType"]; + $FieldName = $_POST["fieldname"]; + //$FieldLabel = $_POST["fieldlabel"]; + if(strlen($FieldName)) + { + $objCustomFields = new clsCustomFieldList($DataType); + $objCustomFields->AddField($DataType,$FieldName,"",(int)$_POST["generaltab"], + $_POST["heading"],$_POST["fieldprompt"],$_POST["input_type"], + $_POST["valuelist"]); + unset($objCustomFields); + } + break; + case "m_customfield_delete": + $DataType = $_POST["DataType"]; + $objCustomFields = new clsCustomFieldList($DataType); + + foreach($_POST["itemlist"] as $f) + { + $objCustomFields->DeleteField($f); + //$c = $objCustomFields->GetItem($f); + //$c->Delete(); + } + unset($objCustomFields); + break; + case "m_SearchConfig_Edit": + $SimpleValues = $_POST["simple"]; + $AdvValues = $_POST["advanced"]; + $module = $_POST["module"]; + $priority = $_POST["pri"]; + //phpinfo(INFO_VARIABLES); + $objSearchConfig = new clsSearchConfigList($module); + foreach($objSearchConfig->Items as $i) + { + $id = $i->Get("SearchConfigId"); + $objSearchConfig->EditFieldSettings($id,(int)$SimpleValues[$id],(int)$AdvValues[$id],$priority[$id]); + } + $objSearchConfig->Clear(); + /* save relevence settings */ + $vals = $_POST["req_increase"]; + foreach($vals as $var=>$value) + { + $cfg = "SearchRel_Increase_".$var; + $objConfig->Set($cfg,$value); + } + $vals = $_POST["rel_keyword"]; + foreach($vals as $var=>$value) + { + $cfg = "SearchRel_Keyword_".$var; + $objConfig->Set($cfg,$value); + } + $vals = $_POST["rel_pop"]; + foreach($vals as $var=>$value) + { + $cfg = "SearchRel_Pop_".$var; + $objConfig->Set($cfg,$value); + } + $vals = $_POST["rel_rating"]; + foreach($vals as $var=>$value) + { + $cfg = "SearchRel_Rating_".$var; + $objConfig->Set($cfg,$value); + } + break; + case "m_keyword_reset": + $objSearchList = new clsSearchLogList(); + foreach($_POST["itemlist"] as $k) + { + $c = $objSearchList->GetItem($k); + $c->Delete(); + } + break; + case "m_review_add": + $post_info = GetSubmitVariable($_POST, 'EditStatus'); + if($post_info['variable'] > -1) + { + $objReviews = new clsItemReviewList(); + $objReviews->SourceTable = $objSession->GetEditTable("ItemReview"); + $Pending = (int)$_POST["review_pending"]; + $Enabled = (int)$_POST["review_enabled"]; + $Status = (int)$_POST["status"]; + $CreatedOn = DateTimestamp($_POST["review_date"],GetDateFormat()); + $CreatedOn += SecondsSinceMidnight($_POST["review_time"]); + $html = (int)$_POST["html_enable"]; + $ReviewText = inp_escape($_POST["review_body"],1); + + $CreatedById = 0; + if(strlen($_POST["createdby"])>0) + { + if(strtolower($_POST["createdby"])=="root") + { + $CreatedById = -1; + } + else + { + $u = $objUsers->GetItemByField("Login",$_POST["createdby"]); + if(is_object($u)) + { + $CreatedById = $u->Get("PortalUserId"); + if($CreatedById<1) + { + $CreatedById = $objSession->Get("PortalUserId"); + } + } + else + $CreatedById = $objSession->Get("PortalUserId"); + } + } + else + $CreatedById = $objSession->Get("PortalUserId"); + + $r = $objReviews->AddReview($CreatedOn,$ReviewText,$Status, $IPAddress, + (int)$_POST["review_priority"], $_POST["ItemId"],$_POST["ItemType"], + $CreatedById,$html, $post_info['Module']); + $ado = GetADODBConnection(); + $rs = $ado->Execute("SELECT MIN(ReviewId) as MinValue FROM ".$objReviews->SourceTable); + $NewId = $rs->fields["MinValue"]-1; + $sql = "UPDATE ".$objReviews->SourceTable." SET ReviewId=".$NewId." WHERE ReviewId=".$r->Get("ReviewId"); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + $ado->Execute($sql); + } + break; + case "m_review_edit": + $post_info = GetSubmitVariable($_POST, 'EditStatus'); + if($post_info['variable'] > -1) + { + $objReviews = new clsItemReviewList(); + $objReviews->SourceTable = $objSession->GetEditTable("ItemReview"); + $Status = (int)$_POST["status"]; + $CreatedOn = DateTimestamp($_POST["review_date"],GetDateFormat()); + $CreatedOn += SecondsSinceMidnight($_POST["review_time"]); + $html = (int)$_POST["html_enable"]; + $ReviewText = inp_escape($_POST["review_body"],1); + $ReviewId = $_POST["ReviewId"]; + $CreatedById = 0; + if(strlen($_POST["createdby"])>0) + { + if(strtolower($_POST["createdby"])=="root") + { + $CreatedById = -1; + } + else + { + $u = $objUsers->GetItemByField("Login",$_POST["createdby"]); + if(is_object($u)) + { + $CreatedById = $u->Get("PortalUserId"); + if($CreatedById<1) + { + $CreatedById = $objSession->Get("PortalUserId"); + } + } + else + $CreatedById = $objSession->Get("PortalUserId"); + } + } + $r = $objReviews->EditReview($ReviewId,$CreatedOn,$ReviewText,$Status, $IPAddress, + (int)$_POST["review_priority"],$_POST["ItemId"],$_POST["ItemType"], + $CreatedById,$html, $post_info['Module']); + } + break; + case "m_review_delete": + $objReviews = new clsItemReviewList(); + $objReviews->SourceTable = $objSession->GetEditTable("ItemReview"); + foreach($_POST["itemlist"] as $id) + { + $objReviews->DeleteReview($id); + } + break; + case "m_review_approve": + if (isset($_POST["itemlist"])) + { + $objReviews = new clsItemReviewList(); + $objReviews->SourceTable = $objSession->GetEditTable("ItemReview"); + foreach($_POST["itemlist"] as $id) + { + $i = $objReviews->GetItem($id); + $i->Set("Status",1); + $i->Update(); + } + } + break; + case "m_review_deny": + if (isset($_POST["itemlist"])) + { + $objReviews = new clsItemReviewList(); + $objReviews->SourceTable = $objSession->GetEditTable("ItemReview"); + foreach($_POST["itemlist"] as $id) + { + $i = $objReviews->GetItem($id); + $i->Set("Status",0); + $i->Update(); + } + } + break; + case "m_review_move_up": + if (isset($_POST["itemlist"])) + { + $objReviews = new clsItemReviewList(); + $objReviews->SourceTable = $objSession->GetEditTable("ItemReview"); + foreach($_POST["itemlist"] as $id) + { + $i = $objReviews->GetItem($id); + $i->MoveUp(); + } + } + break; + case "m_review_move_down": + if (isset($_POST["itemlist"])) + { + $objReviews = new clsItemReviewList(); + $objReviews->SourceTable = $objSession->GetEditTable("ItemReview"); + $itemlist=array_reverse($_POST["itemlist"]); + foreach($itemlist as $id) + { + $i = $objReviews->GetItem($id); + $i->MoveDown(); + } + } + break; + case "m_theme_add": + $objEditItems = new clsThemeList(); + $objEditItems->SourceTable = $objSession->GetEditTable("Theme"); + $Primary = (int)$_POST["primary"]; + if(!(int)$_POST["enabled"]) + $Primary = 0; + $t = $objEditItems->AddTheme($_POST["name"],$_POST["description"],(int)$_POST["enabled"], + (int)$_POST["CacheTimeout"],$Primary); + + $ado = GetADODBConnection(); + $rs = $ado->Execute("SELECT MIN(ThemeId) as MinValue FROM ".$objEditItems->SourceTable); + $NewId = $rs->fields["MinValue"]-1; + $sql = "UPDATE ".$objEditItems->SourceTable." SET ThemeId=".$NewId." WHERE ThemeId=".$t->Get("ThemeId"); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + if ($Primary==1) + { + $objEditItems->SetPrimaryTheme($_POST["ThemeId"]); + } + $ado->Execute($sql); + break; + case "m_theme_edit": + $objEditItems = new clsThemeList(); + $objEditItems->SourceTable = $objSession->GetEditTable("Theme"); + $Primary = (int)$_POST["primary"]; + if(!(int)$_POST["enabled"]) + $Primary = 0; + + $objEditItems->EditTheme($_POST["ThemeId"],$_POST["name"],$_POST["description"], + (int)$_POST["enabled"],$Primary,(int)$_POST["CacheTimeout"]); + if ($Primary==1) + { + $objEditItems->SetPrimaryTheme($_POST["ThemeId"]); + } + break; + case "m_theme_delete": + if (isset($_POST["itemlist"])) + { + $Themes = new clsThemeList(); + foreach($_POST["itemlist"] as $id) + { + $Themes->DeleteTheme($id); + } + } + break; + case "m_theme_primary": + if(is_array($_POST["itemlist"])) + { + $ThemeId = (int)$_POST["itemlist"][0]; + } + else + (int)$ThemeId = $_POST["itemlist"]; + if($ThemeId) + { + $t = new clsThemeList(); + $t->SetPrimaryTheme($ThemeId); + } + break; + + case "m_template_edit": + + $ThemeId = $_POST["ThemeId"]; + $FileId = $_POST["FileId"]; + $f = new clsThemeFile($FileId); + + $f->Set("Description", $_POST["Description"] ); + $f->Update(); + $c = stripslashes($_POST["contents"]); + $f->SaveFileContents($c); + break; + case "m_template_add": + + $ThemeId = $_POST["ThemeId"]; + if( !is_object($f) ) $f = new clsThemeFile(); + + $FilePath = $_POST['name']; + + if(!$FilePath) + { + $f->SetError('Template Name is required',3); + break; + } + else + { + if( substr($FilePath,1) != '/' ) $FilePath = '/'.$FilePath; + if( substr($FilePath,-3) != '.tpl' ) $FilePath .= '.tpl'; + $FileName = basename($FilePath); + $FilePath = dirname($FilePath); + + // test if such file not already created + + $f->LoadFromDataBase( Array($FilePath,$FileName), Array('FilePath','FileName') ); + if( !$f->Get('FileId') ) + { + $f->Set( Array('FilePath','FileName','ThemeId', 'Description'), + Array($FilePath, $FileName,$_POST['ThemeId'], $_POST["Description"]) + ); + + if( $f->IsWriteablePath(true) ) + { + $f->Create(); + $c = stripslashes($_POST["contents"]); + $f->SaveFileContents($c, true); + } + } + else + $f->SetError('Template with this name already exists',4); + } + break; + case "m_template_delete": + $dummy = new clsThemeFile(); + foreach($_POST["itemlist"] as $FileId) + { + $dummy->LoadFromDatabase($FileId); + $dummy->Delete(); + } + break; + + case "m_lang_add": + $objEditItems = new clsLanguageList(); + $objEditItems->SourceTable = $objSession->GetEditTable("Language"); + $l = $objEditItems->AddLanguage($_POST["packname"],$_POST["localname"], + (int)$_POST["enabled"],(int)$_POST["primary"], + $_POST["icon"],$_POST["date_format"],$_POST["time_format"], + $_POST["decimal"],$_POST["thousand"]); + + $ado = GetADODBConnection(); + $rs = $ado->Execute("SELECT MIN(LanguageId) as MinValue FROM ".$objEditItems->SourceTable); + $NewId = $rs->fields["MinValue"]-1; + $sql = "UPDATE ".$objEditItems->SourceTable." SET LanguageId=".$NewId." WHERE LanguageId=".$l->Get("LanguageId"); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + $ado->Execute($sql); + if($_POST["importlabels"]==1 && $_POST["srcpack"]>0) + { + $sql = "SELECT * FROM ".GetTablePrefix()."Phrase WHERE LanguageId=".$_POST["srcpack"]; + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + + $rs = $ado->Execute($sql); + $plist = new clsPhraseList(); + $plist->SourceTable = $objSession->GetEditTable("Phrase"); + $sql = "SELECT MIN(PhraseId) as MinId FROM ".$plist->SourceTable; + $as = $ado->Execute($sql); + if($as && !$as->EOF) + { + $MinId = (int)$as->fields["MinId"]; + } + else + $MinId = 0; + $MinId--; + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $plist->AddPhrase($data["Phrase"],$NewId,$data["Translation"],$data["PhraseType"]); + $sql = "UPDATE ".$plist->SourceTable." SET PhraseId=$MinId WHERE PhraseId=0 LIMIT 1"; + $ado->Execute($sql); + $MinId--; + $rs->MoveNext(); + } + } + break; + case "m_lang_export": + include_once($pathtoroot."kernel/include/xml.php"); + $Ids = $_POST["LangList"]; + $filename=$_POST["filename"]; + if(strlen($filename)>0) + { + $ExportFilename = $pathtoroot.$admin."/export/".$filename; + $ExportResult = $objLanguages->ExportPhrases($ExportFilename,$Ids); + } + break; + case "m_lang_edit": + $objEditItems = new clsLanguageList(); + $objEditItems->SourceTable = $objSession->GetEditTable("Language"); + $objEditItems->EditLanguage($_POST["LanguageId"],$_POST["packname"], + $_POST["localname"],(int)$_POST["enabled"], + (int)$_POST["primary"], $_POST["icon"],$_POST["date_format"], + $_POST["time_format"], $_POST["decimal"],$_POST["thousand"]); + + if($_POST["importlabels"]==1 && $_POST["srcpack"]>0) + { + $ado = GetADODBConnection(); + $rs = $ado->Execute("SELECT * FROM ".GetTablePrefix()."Phrase WHERE LanguageId=".$_POST["srcpack"]); + $plist = new clsPhraseList(); + $plist->SourceTable = $objSession->GetEditTable("Phrase"); + $sql = "SELECT MIN(PhraseId) as MinId FROM ".$plist->SourceTable; + $as = $ado->Execute($sql); + if($as && !$as->EOF) + { + $MinId = (int)$as->fields["MinId"]; + } + else + $MinId = 0; + $MinId--; + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $plist->AddPhrase($data["Phrase"],$_POST["LanguageId"],$data["Translation"],$data["PhraseType"]); + $sql = "UPDATE ".$plist->SourceTable." SET PhraseId=$MinId WHERE PhraseId=0 LIMIT 1"; + $ado->Execute($sql); + $MinId--; + $rs->MoveNext(); + } + unset($plist); + } + + break; + case "m_lang_delete": + if (isset($_POST["itemlist"])) + { + $Phrases = new clsPhraseList(); + foreach($_POST["itemlist"] as $id) + { + $objLanguages->DeleteLanguage($id); + $Phrases->DeleteLanguage($id); + } + unset($Phrases); + } + break; + case "m_lang_select": + $LangId = (int)$_POST["langselect"]; + if($LangId) + { + if($objSession->Get("PortalUserId")>0) + { + //echo "$LangId"; + $objSession->SetPersistantVariable("Language",$LangId); + } + $objSession->Set("Language",$LangId); + $objSession->Update(); + $m_var_list_update["lang"] = $LangId; + $m_var_list["lang"] = $LangId; + } + break; + case "m_phrase_edit": + $objPhraseList = new clsPhraseList(); + if((int)$_POST["direct"] != 1) + $objPhraseList->SourceTable = $objSession->GetEditTable("Phrase"); + $Phrases = $_POST["name"]; + foreach($Phrases as $PhraseId =>$name) + { + if($PhraseId>0) + { + $objPhraseList->EditPhrase($PhraseId,$_POST["name"][$PhraseId],$_POST["LanguageId"],$_POST["translation"][$PhraseId],$_POST["phrasetype"][$PhraseId]); + } + } + + if(strlen($_POST["name"][0]) && strlen($_POST["translation"][0]) && $_POST['Action1'] == "new") + { + $r = $objPhraseList->AddPhrase($_POST["name"][0],$_POST["LanguageId"],$_POST["translation"][0],$_POST["phrasetype"][0]); + if ($r != "Error") { + $ado = GetADODBConnection(); + $rs = $ado->Execute("SELECT MIN(PhraseId) as MinValue FROM ".$objPhraseList->SourceTable); + $NewId = $rs->fields["MinValue"]-1; + $sql = "UPDATE ".$objPhraseList->SourceTable." SET PhraseId=".$NewId." WHERE PhraseId=$PhraseId"; + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
\n"; + $ado->Execute($sql); + } + else { + $add_error = "Language tag with the same name already exists!"; + } + } + else if ($_POST['Action1'] == "new") { + $add_error = "Fields name and translation are required!"; + } + unset($objPhraseList); + break; + case "m_config_missing_phrase": + //phpinfo(INFO_VARIABLES); + $LangId = $_POST["LangId"]; + $ThemeId = $_POST["ThemeId"]; + if(is_array($_POST["Phrase"])) + { + $objPhraseList = new clsPhraseList(); + $objPhraseList->SourceTable = $objSession->GetSessionKey()."_".$ThemeId."_labels"; + + foreach($_POST["Phrase"] as $p => $value) + { + if(strlen($value)) + { + $obj = $objPhraseList->GetItemByField("Phrase",$p,TRUE); + if(is_object($obj)) + { + if($obj->Get("Phrase")==$p) + { + $obj->Set("Translation",$value); + $obj->Update(); + } + else + $objPhraseList->AddPhrase($p,$LangId,$value,1); + } + else + $objPhraseList->AddPhrase($p,$LangId,$value,1); + } + } + } + break; + case "m_phrase_delete": + $objPhraseList = new clsPhraseList(); + $objPhraseList->SourceTable = $objSession->GetEditTable("Phrase"); + if (isset($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + $objPhraseList->DeletePhrase($id); + } + } + unset($objPhraseList); + break; + case "m_emailevent_disable": + $objEvents = new clsEventList(); + if (isset($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + $m =& $objEvents->GetItem($id); + $m->Set("Enabled",0); + $m->Update(); + } + } + unset($objEvents); + break; + case "m_emailevent_enable": + $objEvents = new clsEventList(); + if (isset($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + $m =& $objEvents->GetItem($id); + $m->Set("Enabled",1); + $m->Update(); + } + } + unset($objEvents); + break; + case "m_emailevent_frontonly": + $objEvents = new clsEventList(); + if (isset($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + $m =& $objEvents->GetItem($id); + $m->Set("Enabled",2); + $m->Update(); + } + } + unset($objEvents); + break; + case "m_dlid": + echo $Action.":".$DownloadId; + die(); + break; + case "m_emailevent_user": + $objEvents = new clsEventList(); + //phpinfo(INFO_VARIABLES); + //$objEvents->SourceTable = $objSession->GetEditTable("Events"); + $ids = $_POST["EventId"]; + $ids = str_replace("[","",$ids); + $ids = str_replace("]","",$ids); + $ids = str_replace("\"","",$ids); + $ids = str_replace("\\","",$ids); + + + $idlist = explode(",",$ids); + foreach($idlist as $EventId) + { + $id = (int)stripslashes($EventId); + $e =& $objEvents->GetItem((int)$EventId); + $e->Set("FromUserId", $_POST["FromUserId"]); + $e->Update(); + } + $objEvents->Clear(); + unset($objEvents); + break; + case "m_emailevent_edit": + $Template = $_POST["headers"]; + if(strlen($Template)) + { + $Template .= "\n"; + } + $Template = str_replace("\n\n","",$Template); + $Template .= "Subject: ".$_POST["subject"]."\n\n"; + $Template .= $_POST["messageBody"]; + $objMessages = new clsEmailMessageList(); + $objMessages->SourceTable = $objSession->GetEditTable("EmailMessage"); + $m =& $objMessages->GetItem($_POST["MessageId"]); + if(is_object($m)) + { + if($_POST["sendhtml"]==1) + { + $m->Set("MessageType","html"); + } + else + $m->Set("MessageType","text"); + + $m->Set("Template",$Template); + $m->Update(); + } + break; + case "m_config_edit": + //phpinfo(INFO_VARIABLES); + $objAdmin = new clsConfigAdmin(); + $objAdmin->module = $_POST["module"]; + $objAdmin->section = $_POST["section"]; + if($objAdmin->section=="in-portal:configure_users") + { + if(strlen($_POST["RootPass"]) && strlen($_POST["RootPassVerify"])) + { + if($_POST["RootPass"]==$_POST["RootPassVerify"]) + { + $_POST["RootPass"] = md5($_POST["RootPass"]); + } + } + else + { + $_POST["RootPass"] = $objConfig->Get("RootPass"); + $_POST["RootPassVerify"] = $objConfig->Get("RootPassVerify"); + } + } + $objAdmin->LoadItems(FALSE); + $objAdmin->SaveItems($_POST); + break; + + case "m_mod_enable": + if (isset($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + $m =& $objModules->GetItemByField("Name",$id); + if(is_object($m)) + { + $m->Set("Loaded",1); + $m->Update(); + } + } + $_GET["Refresh"] = 1; + } + break; + case "m_mod_disable": + if (isset($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + if($id != "In-Portal") + { + $m =& $objModules->GetItemByField("Name",$id); + if(is_object($m)) + { + $m->Set("Loaded",0); + $m->Update(); + } + } + } + $_GET["Refresh"] = 1; + } + break; + + case "m_img_add": + $objImageList = new clsImageList(); + $objImageList->SourceTable = $objSession->GetEditTable("Images"); + $LocalImage=0; + $LocalThumb=0; + $DestDir = "kernel/images/"; + + $UserThumbSource = (int)$_POST["imgLocalThumb"]; + $LocalThumb = $UserThumbSource; + + $thumb_url = !$LocalThumb? $_POST["imgThumbUrl"] : ""; + + if($_POST["imgSameImages"]) + { + $LocalImage = $LocalThumb; + $full_url = $thumb_url; + } + else + { + $LocalImage = (int)$_POST["imgLocalFull"]; + $file = $_FILES["imgFullFile"]; + $full_url = $LocalImage? "" : $_POST["imgFullUrl"]; + } + + if((!strlen($thumb_url) && !$LocalThumb) || (!strlen($full_url) && !$LocalImage)) + { + break; + } + + $ado = GetADODBConnection(); + $sql = "SELECT MIN(ImageId) as MinValue FROM ".$objImageList->SourceTable; + $rs = $ado->Execute($sql); + $NewId = ($rs->fields["MinValue"]<0)? $rs->fields["MinValue"]-1 : -1; + + $img = $objImageList->Add($_POST["imgName"], $_POST["imgAlt"], $_POST["ResourceId"], $LocalImage, $LocalThumb, $full_url, $thumb_url, (int)$_POST["imgEnabled"], 0, (int)$_POST["imgDefault"], 0,(int)$_POST["imgSameImages"], $NewId); + $img->Set("ImageId", $NewId); + +// $img->debuglevel=1; + + /* + $sql = "UPDATE ".$objImageList->SourceTable." SET ImageId=".$NewId." WHERE ImageId=0"; + $ado->Execute($sql); + +// $img->Update(); + */ +// echo "SL: $sql $NewId
"; + +// $img->debuglevel=1; + + $img->Pending=TRUE; + if($LocalImage) + { + $file = $_FILES["imgFullFile"]; + if(is_array($file)) + { + if($file["size"]>0) + { + $img->Set("LocalPath",$img->StoreUploadedImage($file,1, $DestDir,0)); + $uploaded=1; + } + } + } + + if($LocalThumb) + { + $thumb = $_FILES["imgThumbFile"]; + if(is_array($thumb)) + { + if($thumb["size"]>0) + { + $img->Set("ThumbPath",$img->StoreUploadedImage($thumb,1, $DestDir,1)); + $uploaded=1; + } + } + } + if($uploaded==1) + $img->Update(); + + break; + + case "m_img_edit": + + $objImageList = new clsImageList(); + $objImageList->SourceTable = $objSession->GetEditTable("Images"); + +// $img->debuglevel=1; + + $img = $objImageList->GetItem($_POST["ImageId"]); + + ## Get original values + $LocalImage = $img->Get("LocalImage"); + $LocalThumb = $img->Get("LocalThumb"); + $SameImages = $img->Get("SameImages"); + $ThumbPath = $img->Get("ThumbPath"); + + ## New values + $LocalThumbN = (int)$_POST["imgLocalThumb"]; + $LocalImageN = (int)$_POST["imgLocalFull"]; + + $FULLFile = $_FILES["imgFullFile"]; + $THFile = $_FILES["imgThumbFile"]; + + $DestDir = "kernel/images/"; + $img->Pending = FALSE; + + $SameImagesN = 0; + $uploaded = 0; + + ## Images were the same, but not any more + if ($SameImages && !$_POST["imgSameImages"]) + { + ## TH was a local file + if ($LocalThumb) + { + ## TH image + { + ## Try to Delete OLD FULL + $img->DeleteLocalImage(FALSE, TRUE); + + ## FULL image select, but field EMPTY - make a copy of old TH as FULL + if ($LocalImageN && !(int)$FULLFile["size"]) + { +// echo $pathToPending = $img->GetImageDir(); + if (!eregi("pending/$", $pathToPending)) + $pathToPending.= "pending/"; + + $LocalThumb_File = $img->GetFileName(1); + +// echo "CAN'T FIND FILE: ".$pathToPending.$LocalThumb_File."
"; + + if (file_exists($pathToPending.$LocalThumb_File)) + { + $LocalThumb_FileN = eregi_replace("^th_", "", $LocalThumb_File); + $LocalThumb_FullFileN = $pathToPending.$LocalThumb_FileN; + @unlink($LocalThumb_FullFileN); + @copy($pathToPending.$LocalThumb_File, $LocalThumb_FullFileN); + + $uploaded = 1; + $copied = 1; +// echo "COPING: ".$DestDir."pending/".$LocalThumb_FileN."
"; + } + else + { +// echo "CAN'T FIND FILE: ".$pathToPending.$LocalThumb_File."
"; + } + } + ## Upload new FULL image + elseif ($LocalImageN && (int)$FULLFile['size']) + { + $FULL_FileToUpload = $FULLFile; + $FULL_URL = ""; + +// echo " Upload new FULL image"; + } + ## Full is URL + elseif (!$LocalImageN) + { + $img->DeleteLocalImage(FALSE, TRUE); + $FULL_URL = $_POST['imgFullUrl']; + $FULL_FileToUpload = ""; + } + else + { +// echo " ## Unknow condition"; + } + + ## Take care of Thumbnail here + if ($LocalThumbN) + { + ## Delete old if NEW TH image selected + if ((int)$THFile['size']) + { + $img->DeleteLocalImage(TRUE, FALSE); + $TH_FileToUpload = $THFile; + } + else + $TH_FileToUpload = ""; + } + else + { + $img->DeleteLocalImage(TRUE, FALSE); + $TH_FileToUpload = ""; + $TH_URL = $_POST['imgThumbUrl']; + } + } + } + ## TH was URL + else + { + ## Take care of FULL image here + if ($LocalImageN && (int)$FULLFile["size"]) + { + $FULL_FileToUpload = $FULLFile; + $FULL_URL = ""; + } + ## Full is URL (or image size 0) + else + { + $FULL_FileToUpload = ""; + $FULL_URL = $_POST['imgFullUrl']; + } + + ## Take care of Thumbnail here + if ($LocalThumbN) + { + $TH_FileToUpload = (int)$THFile['size']? $THFile : ""; + $TH_URL = ""; + } + else + { + $TH_FileToUpload = ""; + $TH_URL = $_POST['imgThumbUrl']; + } + } + } + ## Images were the same, and still the same + elseif ($SameImages && $_POST['imgSameImages']) + { + ## Take care of Thumbnail & FULL here + if ($LocalThumbN) + { + if ((int)$THFile['size']) + { + $img->DeleteLocalImage(TRUE, FALSE); + $TH_FileToUpload = $THFile; + } + else + $TH_FileToUpload = ""; + + $FULL_URL = $TH_URL = ""; + } + else + { + $TH_FileToUpload = $FULL_FileToUpload = ""; + $FULL_URL = $TH_URL = $_POST['imgThumbUrl']; + } + + ## Delete old FULL image + $img->DeleteLocalImage(FALSE,TRUE); + + $SameImagesN = 1; + } + ## Images were NOT the same, and selected as the same now + elseif (!$SameImages && $_POST["imgSameImages"]) + { + ## Take care of Thumbnail & FULL here + if ($LocalThumbN) + { + if ((int)$THFile['size']) + { + $img->DeleteLocalImage(TRUE, FALSE); + $TH_FileToUpload = $THFile; + } + else + $TH_FileToUpload = ""; + + + $FULL_URL = $TH_URL = ""; + } + else + { + $img->DeleteLocalImage(TRUE, FALSE); + $TH_FileToUpload = $FULL_FileToUpload = ""; + $FULL_URL = $TH_URL = $_POST['imgThumbUrl']; + } + + ## Clean up FULL image + $img->DeleteLocalImage(FALSE, TRUE); + + $SameImagesN = 1; + } + ## Images were NOT the same, and selected as NOT the same + elseif (!$SameImages && !$_POST["imgSameImages"]) + { + ## Take care of Thumbnail + if ($LocalThumbN) + { + if ((int)$THFile['size']) + { + $img->DeleteLocalImage(TRUE, FALSE); + $TH_FileToUpload = $THFile; + } + else + $TH_FileToUpload = ""; + + $TH_URL = ""; + } + else + { + $img->DeleteLocalImage(TRUE, FALSE); + $TH_FileToUpload = ""; + $TH_URL = $_POST['imgThumbUrl']; + } + + ## Take care of FULL here + if ($LocalImageN) + { + if ((int)$FULLFile['size']) + { + $img->DeleteLocalImage(FALSE, TRUE); + $FULL_FileToUpload = $FULLFile; + } + else + $FULL_FileToUpload = ""; + + $FULL_URL = ""; + } + else + { + $img->DeleteLocalImage(FALSE, TRUE); + $FULL_FileToUpload = ""; + $FULL_URL = $_POST['imgFullUrl']; + } + } + ## Unknow condition + else + { + ; + } + + $img = $objImageList->Edit($_POST["ImageId"],$_POST["imgName"], $_POST["imgAlt"], $_POST["ResourceId"], $LocalImageN, $LocalThumbN, $FULL_URL, $TH_URL, (int)$_POST["imgEnabled"], (int)$_POST["imgPriority"], (int)$_POST["imgDefault"], 0, $SameImagesN); + +// echo "DATA:
LocalImageN: $LocalImageN, LocalThumbN: $LocalThumbN, FULL_URL: $FULL_URL, TH_URL: $TH_URL, SameImagesN: $SameImagesN
"; + + + $img->Pending = TRUE; + + if (!empty($FULL_FileToUpload)) + { + $img->Set("LocalPath",$img->StoreUploadedImage($FULL_FileToUpload, 1, $DestDir, 0)); + $uploaded = 1; + } + /* + elseif (!$LocalImageN) + { + $img->Set("LocalPath", ""); + $uploaded = 1; + } + */ + + if (!empty($TH_FileToUpload)) + { + $img->Set("ThumbPath", $img->StoreUploadedImage($TH_FileToUpload, 1, $DestDir, 1)); + $uploaded = 1; + } + + if ($copied) + { + $img->Set("LocalPath", $DestDir."pending/".$LocalThumb_FileN); + $uploaded = 1; + } + + if($uploaded==1) + $img->Update(); + + break; + case "m_img_move_up": + if (isset($_POST["itemlist"])) + { + $objImageList = new clsImageList(); + $objImageList->SourceTable = $objSession->GetEditTable("Images"); + foreach($_POST["itemlist"] as $id) + { + $img = $objImageList->GetItem($id); + $img->MoveUp(); + } + } + break; + case "m_img_move_down": + if (isset($_POST["itemlist"])) + { + $objImageList = new clsImageList(); + $objImageList->SourceTable = $objSession->GetEditTable("Images"); + $itemlist=array_reverse($_POST["itemlist"]); + foreach($itemlist as $id) + { + $img = $objImageList->GetItem($id); + $img->MoveDown(); + } + } + break; + + case "m_img_delete": + if(isset($_POST["itemlist"])) + { + $objImageList = new clsImageList(); + $objImageList->SourceTable = $objSession->GetEditTable("Images"); + foreach($_POST["itemlist"] as $id) + { + $img = $objImageList->GetItem($id); + $img->Set("ResourceId", 0); + $img->Update(); + //$img->Delete(); + } + } + break; + case "m_restore_delete": + $bdate = $_POST["backupdate"]; + if($bdate>0) + { + $BackupFile = $objConfig->Get("Backup_Path")."/dump".$bdate.".txt"; + if(file_exists($BackupFile)) + unlink($BackupFile); + } + break; + case "m_taglib": + include($pathtoroot."kernel/include/tag-class.php"); + ParseTagLibrary(); + break; + case "m_sql_query": + $SqlQuery = $_POST["sql"]; + $ado = GetADODBConnection(); + if(strlen($sql)) + { + $SqlResult = $ado->Execute($SqlQuery); + $SqlError = $ado->ErrorMsg(); + $SqlErrorNum = $ado->ErrorNo(); + } + break; + case "m_session_delete": + //if(isset($_POST["itemlist"])) + //{ + $ado = GetADODBConnection(); + if (count($_POST['itemlist']) > 0) { + foreach($_POST["itemlist"] as $id) + { + $sql = "DELETE FROM ".GetTablePrefix()."UserSession WHERE SessionKey='$id'"; + $ado->Execute($sql); + } + } + else { + $sql = "DELETE FROM ".GetTablePrefix()."UserSession WHERE Status='0'"; + $ado->Execute($sql); + } + //} + break; + case "m_add_rule": + $objEditItems = new clsBanRuleList(); + $objEditItems->SourceTable = $objSession->GetEditTable("BanRules"); + //$ItemType,$RuleType,$ItemField,$ItemVerb,$ItemValue,$Priority,$Status; + $objEditItems->AddRule($_POST["rule_itemtype"],$_POST["rule_type"],$_POST["rule_field"], + $_POST["rule_verb"],$_POST["rule_value"],(int)$_POST["rule_priority"], + (int)$_POST["rule_status"], $_POST['rule_error']); + break; + case "m_edit_rule": + $objEditItems = new clsBanRuleList(); + $objEditItems->SourceTable = $objSession->GetEditTable("BanRules"); + //$ItemType,$RuleType,$ItemField,$ItemVerb,$ItemValue,$Priority,$Status; + $objEditItems->EditRule($_POST["rule_id"],$_POST["rule_itemtype"],$_POST["rule_type"],$_POST["rule_field"], + $_POST["rule_verb"],$_POST["rule_value"],(int)$_POST["rule_priority"], + (int)$_POST["rule_status"], $_POST['rule_error']); + break; + case "m_rule_move_up": + if(isset($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + $i = $objBanList->GetItem($id); + $i->Increment("Priority"); + } + } + break; + case "m_rule_move_down": + if(isset($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + $i = $objBanList->GetItem($id); + $i->Decrement("Priority"); + } + } + break; + + case "m_rule_delete": + if(isset($_POST["itemlist"])) + { + foreach($_POST["itemlist"] as $id) + { + $i = $objBanList->GetItem($id); + $i->Delete(); + } + } + break; + case "m_ban_user": + if($_POST["UserEditStatus"]==1) + { + $UserId = $_POST["user_id"]; + $u = $objUsers->GetItem($UserId); + if(is_object($u)) + { + if((int)$_POST["ban_login"]) + { + if(strlen($_POST["user_login"])) + $objBanList->AddRule(6,0,"Login",3,$_POST["user_login"],0,1); + } + if((int)$_POST["ban_email"]) + { + if(strlen($_POST["user_email"])) + $objBanList->AddRule(6,0,"Email",3,$_POST["user_email"],0,1); + } + if((int)$_POST["ban_ip"]) + { + if(strlen($_POST["user_ip"])) + $objBanList->AddRule(6,0,"ip",3,$_POST["user_ip"],0,1); + } + $u->Deny(); + } + } + break; + } + +/* image upload management */ +if( isset($_POST['img']) && $_POST['img'] == 1 ) +{ + foreach($_FILES as $img => $FILE) + { + $name = $_POST["img_Name_$img"]; + $alt = $_POST["img_Alt_$img"]; + $url = $_POST["img_Url_$img"]; + $res_id = $_POST["img_Res_$img"]; + $relvalue = $_POST["img_Rel_$img"]; + $thumb = (int)$_POST["img_Thumb_$img"]; + $dest = AddSlash($_POST["img_DestDir_$img"]); + if($_POST["img_Del_$img"]=="Delete") + { + $img = $objImageList->GetImageByResource($res_id,$relvalue); + $img->Delete(); + unset($img); + $objImageList->Clear(); + } + else + { + if($FILE["size"]>0) + { + /* an image was uploaded */ + $objImageList->HandleImageUpload($FILE,$res_id,$relvalue,$dest, $name,$alt,$thumb); + } + else + { /* remote images handled here */ + if(strlen($url)>0) + { + if($relvalue>0) + { + $img = $objImageList->GetImageByResource($res_id,$relvalue); + $img->Set("Name",$name); + $img->Set("AltName", $alt); + $img->Set("IsThumbnail",$thumb); + $img->Set("Url",$url); + $img->Update(); + } + else + { + $relvalue = $objImageList->GetNextRelateValue($res_id); + $objImageList->NewRemoteImage($url,$res_id,$relvalue, $name, $alt, $thumb); + } + } + } + } + } +} + +/* category Edit */ +if( GetVar('CatEditStatus') == 1 ) +{ + $adodbConnection = GetADODBConnection(); + +// $sql = "SELECT * FROM ".$objSession->GetEditTable("Category")." WHERE CategoryId=0"; + $sql = "SELECT * FROM ".$objSession->GetEditTable("Category")." WHERE CategoryId=-1"; + $rs = $adodbConnection->Execute($sql); + while ($rs && !$rs->EOF) + { + if($rs->fields["ParentId"]>0) + RunUp($rs->fields["ParentId"],"Increment_Count"); + $rs->MoveNext(); + } + + $objCatList->CopyFromEditTable("CategoryId"); + $objCustomDataList->CopyFromEditTable("CustomDataId"); + $objCatList->Clear(); + $objImages = new clsImageList(); + $objImages->CopyFromEditTable("ImageId"); +} + +if( GetVar('CatEditStatus') == 2 ) +{ + $objCatList->PurgeEditTable("CategoryId"); + $objCustomDataList->PurgeEditTable("CustomDataId"); + $objImages = new clsImageList(); + $objImages->PurgeEditTable("ImageId"); + $objCatList->Clear(); +} + +/* User Edit */ +if( GetVar('UserEditStatus') == 1 ) +{ + $objUsers->CopyFromEditTable("PortalUserId"); + $objCustomDataList->CopyFromEditTable("CustomDataId"); + $objGroups->Clear(); + $objImages = new clsImageList(); + $objImages->CopyFromEditTable("ImageId"); +} +if( GetVar('UserEditStatus') == 2 ) +{ + $objGroups->PurgeEditTable("PortalUserId"); + $objCustomDataList->PurgeEditTable("CustomDataId"); + $objGroups->Clear(); +} + +/* Group Edit */ +if( GetVar('GroupEditStatus') == 1 ) +{ + $objGroups->CopyFromEditTable("GroupId"); + $objCustomDataList->CopyFromEditTable("CustomDataId"); + $objGroups->Clear(); +} +if( GetVar('GroupEditStatus') == 2 ) +{ + $objGroups->PurgeEditTable("GroupId"); + $objCustomDataList->PurgeEditTable("CustomDataId"); + $objGroups->Clear(); +} + +/* Theme Edit */ +if( GetVar('ThemeEditStatus') == 1 ) +{ + $objThemes->CopyFromEditTable(); + $objThemes->Clear(); +} + +if( GetVar('ThemeEditStatus') == 2 ) +{ + $objThemes->PurgeEditTable(); + $objThemes->Clear(); +} + +/* Language Edit */ +if( GetVar('LangEditStatus') == 1 ) +{ + $Messages = new clsEmailMessageList(); + $Messages->CopyFromEditTable(); + $Messages->Clear(); + $objLanguages->CopyFromEditTable(); + $objLanguages->Clear(); + + $Phrases = new clsPhraseList(); + $Phrases->CopyFromEditTable(); + $Phrases->Clear(); + $Phrases->PurgeEditTable(); +} +if( GetVar('LangEditStatus') == 2 ) +{ + $objLanguages->PurgeEditTable(); + $objLanguages->Clear(); + $Phrases = new clsPhraseList(); + $Phrases->PurgeEditTable(); + $Messages = new clsEmailMessageList(); + $Messages->PurgeEditTable(); +} + +if( GetVar('MissingLangEditStatus') == 1 ) +{ + $objPhraseList = new clsPhraseList(); + $objPhraseList->SourceTable = $objSession->GetSessionKey()."_".$ThemeId."_labels"; + + $objEditList = new clsPhraseList(); + $objEditList->SourceTable = $objSession->GetEditTable("Phrase"); + + $ado = GetADODBConnection(); + $rs = $ado->Execute("SELECT MIN(PhraseId) as MinValue FROM ".$objEditList->SourceTable); + $NewId = $rs->fields["MinValue"]-1; + + $objPhraseList->Query_Item("SELECT * FROM ".$objPhraseList->SourceTable); + foreach($objPhraseList->Items as $p) + { + if(strlen($p->Get("Translation"))>0) + { + $p->tablename = $objEditList->SourceTable; + $p->Dirty(); + $p->UnsetIDField(); + $p->Set("PhraseId",$NewId); + $NewId--; + $p->Create(); + } + } + $ado->Execute("DROP TABLE ".$objPhraseList->SourceTable); +} + +if( GetVar('MissingLangEditStatus') == 2 ) +{ + $table = $objSession->GetSessionKey()."_".$ThemeId."_labels"; + $ado = GetADODBConnection(); + $ado->Execute("DROP TABLE ".$table); +} + +/* Ban Rule Edit */ +if( GetVar('RuleEditStatus') == 1 ) +{ + $objBanList->CopyFromEditTable("RuleId"); + $objBanList->Clear(); +} +if( GetVar('RuleEditStatus') == 2 ) +{ + $objBanList->PurgeEditTable("RuleId"); + $objBanList->Clear(); +} + +?> Index: trunk/kernel/include/favorites.php =================================================================== diff -u --- trunk/kernel/include/favorites.php (revision 0) +++ trunk/kernel/include/favorites.php (revision 13) @@ -0,0 +1,144 @@ +clsItemDB(); + $this->tablename = GetTablePrefix()."Favorites"; + $this->id_field = "FavoriteId"; + $this->NoResourceId=1; + if($FavoriteId) + $this->LoadFromDatabase($FavoriteId); + } + + function LoadFromDatabase($Id) + { + global $objSession,$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 FavoriteId = '%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; + if(is_array($data)) + $this->SetFromArray($data); + $this->Clean(); + return TRUE; + } + + function LoadFavorite($PortalUserId,$ResourceId) + { + global $objSession,$Errors; + + $sql = "SELECT * FROM ".$this->tablename." WHERE PortalUserId='$PortalUserId' AND ResourceId=$ResourceId"; + $result = $this->adodbConnection->Execute($sql); + if($result === false) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase"); + return FALSE; + } + if($result->EOF) + { + return FALSE; + } + else + { + $data = $result->fields; + if(is_array($data)) + $this->SetFromArray($data); + $this->Clean(); + return TRUE; + } + } +} /* clsFavorite */ + +class clsFavoriteList extends clsItemCollection +{ + var $Page; + var $PerPage; + + function clsFavoriteList() + { + $this->clsItemCollection(); + $this->SourceTable = GetTablePrefix()."Favorites"; + $this->classname = "clsFavorite"; + $this->Page=1; + } + + function &AddFavorite($PortalUserId, $ResourceId,$ItemType) + { + $f = new clsFavorite; + $f->Set(array("PortalUserId","ResourceId","ItemTypeId","Modified"), + array($PortalUserId,$ResourceId,$ItemType,date("U"))); + $f->Create(); + return $f; + } + + function DeleteFavorite($PortalUserId,$ResourceId) + { + $sql = "DELETE FROM ".$this->SourceTable." WHERE PortalUserId=$PortalUserId AND ResourceId=$ResourceId "; + if($this->debuglevel) echo $sql; + $this->adodbConnection->Execute($sql); + } + + function GetFavoriteObject($PortalUserId,$ResourceId) + { + $c = new clsFavorite(); + if($c->LoadFavorite($PortalUserId,$ResourceId)) + { + return $c; + } + else + return FALSE; + } + + function DeleteUser($PortalUserId) + { + $sql = "DELETE FROM ".$this->SourceTable." WHERE PortalUserId=$PortalUserId"; + $this->adodbConnection->Execute($sql); + } + + function DeleteItem($ResourceId) + { + $sql = "DELETE FROM ".$this->SourceTable." WHERE ResourceId=$ResourceId"; + $this->adodbConnection->Execute($sql); + } + + function LoadFavorites($PortalUserId,$ItemTypes=NULL) + { + $where = " PortalUserId=$PortalUserId"; + if(strlen($ItemTypes)) + { + $where .= " AND ItemTypeId IN ($ItemTypes)"; + } + $sql = "SELECT * FROM ".$this->SourceTable." WHERE ".$where; + $this->Clear(); + $this->QueryItemCount=TableCount($this->SourceTable,$where,0); + $this->Query_Item($sql); + } + + function GetLimitSQL() + { + if($this->Page<1) + $this->Page=1; + + if(is_numeric($this->PerPage)) + { + $Start = ($this->Page-1)*$this->PerPage; + $limit = "LIMIT ".$Start.",".$this->PerPage; + } + else + $limit = NULL; + return $limit; + } + +} Index: trunk/admin/editor/FCKeditor/images/toolbar/button.pasteword.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_cancel.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_forum_new_custom_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/music.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/icon_bandit.gif =================================================================== diff -u Binary files differ Index: trunk/admin/help/help.php =================================================================== diff -u --- trunk/admin/help/help.php (revision 0) +++ trunk/admin/help/help.php (revision 13) @@ -0,0 +1,100 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//admin only util + +$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"); + + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot.$value."admin/include/subitems.php"; + if(file_exists($path)) + { + //echo ""; + include_once($path); + } +} + +$section = $_GET["section"]; + +$envar = BuildEnv(); +int_header(); +?> +

Not Implemented

+ + Index: trunk/admin/users/addgroup.php =================================================================== diff -u --- trunk/admin/users/addgroup.php (revision 0) +++ trunk/admin/users/addgroup.php (revision 13) @@ -0,0 +1,208 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +unset($objEditItems); + +$objEditItems = new clsGroupList(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalGroup"); +$objEditItems->EnablePaging = FALSE; + +$objCustomFields = new clsCustomFieldList(6); +//$objRelList = new clsRelationshipList(); + +//Multiedit init +if ($_GET["new"] == 1) +{ + $c = new clsPortalGroup(NULL); + $c->Set("CreatedOn", time()); + $c->Set("EndOn", time()); + $en = 0; + $action = "m_add_group"; + $objGroups->CreateEmptyEditTable("GroupId"); +// $objRelList->CreateEmptyEditTable("RelationshipId"); + $objCustomDataList->CreateEmptyEditTable("CustomDataId"); + } +else +{ + $en = (int)$_GET["en"]; + if (isset($_POST["itemlist"])) + { + $objGroups->CopyToEditTable("GroupId",$_POST["itemlist"]); + } + $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); + if(isset($_POST["itemlist"])) + { + /* make a copy of the relationship records */ + $ids = $objEditItems->GetResourceIDList(); + $objCustomDataList->CopyToEditTable("ResourceId",$ids); + } + + $itemcount=$objEditItems->NumItems(); + $c = $objEditItems->GetItemByIndex($en); + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_edit_group"; +} + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:editgroup_general'; + +if (strlen($c->Get("Name"))) + $editing_title = "'".$c->Get("Name")."' "; +else + $editing_title = ""; + + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Group")." $editing_title- ".prompt_language("la_tab_General"); +//echo $envar."
\n"; + +//Display header +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('editgroup','GroupEditStatus','".$admin."/users/user_groups.php',1);","tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('editgroup','GroupEditStatus','".$admin."/users/user_groups.php',2);","tool_cancel.gif"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/addgroup.php"; + $StatusField = "GroupEditStatus"; + $form = "editgroup"; + MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevGroup','la_NextGroup'); +} + + int_header($objCatToolBar,NULL,$title); +?> + + + + + + > + + + + + > + + + + + + > + + + +
+ "> +
+ +  
+ + "> + +
+ + + + \ No newline at end of file Index: trunk/compat/constant.php =================================================================== diff -u --- trunk/compat/constant.php (revision 0) +++ trunk/compat/constant.php (revision 13) @@ -0,0 +1,50 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: constant.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace constant() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/constant + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.0.4 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('constant')) +{ + function constant ($constant) + { + if (!defined($constant)) { + $error = sprintf('constant() Couldn\'t find constant %s', $constant); + trigger_error($error, E_USER_WARNING); + return false; + } + + eval("\$value=$constant;"); + + return $value; + } +} + +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/toolbar/button.spellcheck.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_removefromfav.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/banlist_apply.php =================================================================== diff -u --- trunk/admin/users/banlist_apply.php (revision 0) +++ trunk/admin/users/banlist_apply.php (revision 13) @@ -0,0 +1,189 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$section = "in-portal:banlist_apply"; + +$UsersPerLoad =30; + +$ado = GetADODBConnection(); + $UserIndex = (int)$_GET["UserIndex"]; + if($UserIndex==0) + { + $table = $objUsers->SourceTable; + $NumUsers = TableCount($table,"",0); + } + else + { + $NumUsers = $_GET["NumUsers"]; + $table = $objUsers->SourceTable; + } + + $title = prompt_language("la_prompt_applyingbanlist"); + + if($UserIndex <= $NumUsers) + { + $title .= " $UserIndex / $NumUsers ".prompt_language("la_Text_complete"); + } + else + $title .= " $NumUsers / $NumUsers ".prompt_language("la_Text_complete"); + + + $sql = "SELECT * FROM $table LIMIT $UserIndex,$UsersPerLoad"; + //echo $sql."
\n"; + $objUsers->Query_Item($sql); + + foreach($objUsers->Items as $u) + { + $BrokenRule = $u->CheckBanned(); + if($BrokenRule) + $u->Deny(1); // 1 - IsBanned mark in db, 0 - No such mark + + } + +int_header(NULL,NULL,$title); +?> + + +"; + echo ""; + } + else if ($percent < 60) + { + echo ""; + } + elseif ($percent == 100) + { + echo ""; + } + else + { + echo ""; + } + flush(); +?> +
$percent"; + echo "%
"; + $row2 = 100-$percent; + echo " $percent"; + echo "%
$percent%
$percent%"; + $row2 = 100-$percent; + echo "
+= $NumUsers) + { + $target = $adminURL."/users/user_list.php?env=".BuildEnv()."&ResetPage=1"; + } + else + { + if (($NumUsers - $UserIndex) < $UsersPerLoad) + $next = $UserIndex + ($NumUsers - $UserIndex); + else + $next = $UserIndex + $UsersPerLoad; + + $target = $_SERVER["PHP_SELF"]."?env=".BuildEnv()."&UserIndex=".$next."&NumUsers=$NumUsers"; + } + //print "
$target"; + print ""; +?> + Index: trunk/admin/images/tab_active_left.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_theme_primary.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/obanon.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/assjani.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_user_settings.gif =================================================================== diff -u Binary files differ Index: trunk/compat/call_user_func_array.php =================================================================== diff -u --- trunk/compat/call_user_func_array.php (revision 0) +++ trunk/compat/call_user_func_array.php (revision 13) @@ -0,0 +1,80 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: call_user_func_array.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace call_user_func_array() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/call_user_func_array + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.0.4 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('call_user_func_array')) +{ + function call_user_func_array ($function, $param_arr) + { + $param_arr = (array) $param_arr; + + // Sanity check + if (!is_callable($function)) + { + if (is_array($function) && count($function) > 2) { + $function = $function[0] . '::' . $function[1]; + } + $error = sprintf('call_user_func_array() First argument is expected to be a valid callback, \'%s\' was given', $function); + trigger_error($error, E_USER_WARNING); + return null; + } + + // Build argument string + $arg_string = ''; + $comma = ''; + for ($i = 0, $x = count($param_arr); $i < $x; $i++) { + $arg_string .= $comma . "\$param_arr[$i]"; + $comma = ', '; + } + + // Determine method of calling function + if (is_array($function)) + { + $object =& $function[0]; + $method = $function[1]; + + // Static vs method call + if (is_string($function[0])) { + eval("\$retval = $object::\$method($arg_string);"); + } else { + eval("\$retval = \$object->\$method($arg_string);"); + } + } + else { + eval("\$retval = \$function($arg_string);"); + } + + return $retval; + } +} + +?> \ No newline at end of file Index: trunk/themes/default/img/ed_format_italic.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/arrow.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/ddarrow.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_conf.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_zoom.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/icon_clown.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/events.php =================================================================== diff -u --- trunk/kernel/include/events.php (revision 0) +++ trunk/kernel/include/events.php (revision 13) @@ -0,0 +1,99 @@ +clsItemDB(); + $this->tablename = GetTablePrefix()."Events"; + $this->id_field = "EventId"; + $this->NoResourceId=1; + $this->debuglevel=0; + if($EventId) + { + $this->LoadFromDatabase($EventId); + } + } + + function LoadFromDatabase($Id) + { + global $Errors; + + $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; + } + +} + +class clsEventList extends clsItemCollection +{ + function clsEventList() + { + $this->clsItemCollection(); + $this->classname="clsEvent"; + $this->SourceTable = GetTablePrefix()."Events"; + $this->PerPageVar = "Perpage_Events"; + $this->AdminSearchFields = array("Description", "Module","Event","u.Login"); + } + + function CopyFromEditTable() + { + global $objSession; + + $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); + if($data["EventId"]>0) + { + $c->Update(); + } + $rs->MoveNext(); + } + } + + function PurgeEditTable() + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + $this->adodbConnection->Execute("DROP TABLE $edit_table"); + } + + function &GetEmailEventObject($EventName,$LangId=NULL) + { + global $objLanguages; + + if(!$LangId) + $LangId = $objLanguages->GetPrimary(); + $EmailTable = GetTablePrefix()."EmailMessage"; + $EventTable = $this->SourceTable; + $sql = "SELECT * FROM $EventTable INNER JOIN $EmailTable ON ($EventTable.EventId = $EmailTable.EventId) "; + $sql .="WHERE Event='$EventName' AND LanguageId=$LangId"; + $result = $this->adodbConnection->Execute($sql); + if ($result === FALSE) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"GetEmailEventObject"); + return FALSE; + } + $data = $result->fields; + $e = new clsEmailMessage(); + $e->SetFromArray($data); + $e->Clean(); + return $e; + } +} Index: trunk/themes/default/img/ic_mypreferences.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/relevance/rel_8.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_search_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/logo_bg_in-news.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/login.php =================================================================== diff -u --- trunk/admin/install/login.php (revision 0) +++ trunk/admin/install/login.php (revision 13) @@ -0,0 +1,46 @@ + +  Intechnic Account Login

+ + + + + + + +
 Step - Intechnic Account Login
+ + +
+ + + + + \ No newline at end of file Index: trunk/themes/default/img/ic_mylinks46.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/tag-class.php =================================================================== diff -u --- trunk/kernel/include/tag-class.php (revision 0) +++ trunk/kernel/include/tag-class.php (revision 13) @@ -0,0 +1,443 @@ +clsItemDB(); + $this->tablename = GetTablePrefix()."TagAttributes"; + $this->id_field = "AttrId"; + $this->type=-99; + $this->NoResourceId=1; + } + + function LoadFromDatabase($Id) + { + global $objSession,$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->id_field." = '%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; + if(is_array($data)) + $this->SetFromArray($data); + $this->Clean(); + return TRUE; + } + + function Write($value) + { + $ret = $name."=\"$value\""; + return $ret; + } + +} + +class clsTagAttribs extends clsItemCollection +{ + function clsTagAttribs($TagId=NULL) + { + $this->clsItemCollection(); + $this->SourceTable = GetTablePrefix()."TagAttributes"; + $this->classname = "clsAttribute"; + if($TagId) + $this->LoadTag($TagId); + } + + function LoadTag($TagId) + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE TagId=$TagId"; + $this->Query_Item($sql); + } + +} + +class clsTagFunction extends clsItemDB +{ + var $attribs; + + function clsTagFunction() + { + $this->clsItemDB(); + $this->tablename = GetTablePrefix()."TagLibrary"; + $this->id_field = "TagId"; + $this->type=-99; + $this->NoResourceId=1; + $this->attribs = new clsTagAttribs(); + } + + + function LoadAttribs() + { + if($this->attribs->NumItems()<1) + { + $this->attribs->LoadTag($this->Get("TagId")); + } + } + + function AddAttribute($name,$Type="str",$desc="",$default="",$required=FALSE) + { + if($this->attribs->NumItems()<1) + $this->attribs->LoadTag($this->Get("TagId")); + $a = $this->attribs->GetItemByField("Name",$name,FALSE); + if(!is_object($a)) + { + $a = new clsAttribute(); + $a->Set("TagId",$this->Get("TagId")); + $a->Set("Name",$name); + $a->Set("AttrType",$Type); + $a->Set("DefValue",$default); + $a->Set("Description",$desc); + $a->Set("Required",$required); + $a->Create(); + } + else + { + if($a->Get("Name")!=$name) + { + $a = new clsAttribute(); + $a->Set("TagId",$this->Get("TagId")); + $a->Set("Name",$name); + $a->Set("AttrType",$Type); + $a->Set("DefValue",$default); + $a->Set("Description",$desc); + $a->Set("Required",$required); + $a->Create(); + } + else + { + $a->Set("TagId",$this->Get("TagId")); + $a->Set("Name",$name); + $a->Set("AttrType",$Type); + $a->Set("DefValue",$default); + $a->Set("Description",$desc); + $a->Set("Required",$required); + $a->Update(); + } + } + $this->attribs->Items[] =& $a; + } + + function LoadFromDatabase($Id) + { + global $objSession,$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->id_field." = '%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; + if(is_array($data)) + $this->SetFromArray($data); + $this->attribs->LoadTag($this->Get("TagId")); + $this->Clean(); + return TRUE; + } +} + +class clsTagList extends clsItemCollection +{ + function clsTagList() + { + $this->clsItemCollection(); + $this->SourceTable = GetTablePrefix()."TagLibrary"; + $this->classname = "clsTagFunction"; + //$this->tags = array(); + } + + function DeleteTags() + { + $this->adodbConnection->Execute("DELETE FROM ".$this->SourceTable); + $this->adodbConnection->Execute("DELETE FROM ".GetTablePrefix()."TagAttributes"); + } + + + function FindStr($code,$str,$offset,$limit=0) + { + $x = $offset; + $found = FALSE; + while($x";print_r($f); echo ""; + $fname = $f[1]; + + $fname = substr($fname,0,strpos($fname,"(")); + return $fname; + } + + function ParseComments($name,$code) + { + //echo "function $name:
\n"; + + $data = array(); + $attribs = array(); + $field = ''; + for($l=0;$l0) + { + $data["name"] = $name; + $data["scope"]="global"; + } + else + { + if( isset($data["field"]) ) // process something, but don't work + { + $field = $data["field"]; + $fparts = explode(".",$field,2); + $data["name"]=$fparts[1]; + $data["scope"]=$fparts[0]; + unset($data["field"]); + } + } + $t =& $this->AddItemFromArray($data); + //echo "
";print_r($data); echo "
"; + $t->Dirty(); + if(strlen($t->get("name"))>0 && strlen($t->Get("description"))>0) + { + $t->Create(); + if(count($attribs)>0) + { + foreach($attribs as $field=>$desc) + { + $req = (substr($field,0,1)=="*"); + $t->AddAttribute($field, GetElem($attr_type,$field),$desc,GetElem($attr_default,$field),$req); + } + } + } + } + + function ParseFile($file) + { + $code = file($file); + //echo count($code)." lines
\n"; + if(count($code)) + { + $funcline = $this->FindStr($code,"function ",0); + //echo "First function $funcline :".$code[$funcline]; + while(is_numeric($funcline) && $funclineGetTagName($code[$funcline]); + //echo "Parsing function $TagName
\n"; + $comment_start = $funcline-1; + $temp = $code[$funcline-1]; + while(($comment_start>0) && (substr($temp,0,1) != "}")) + { + $comment_start--; + $temp = $code[$comment_start]; + } + //echo "Comment Start: $comment_start End: $funcline
\n"; + if(substr($code[$comment_start],0,1)=="}") + $comment_start++; + $x = $comment_start; + $comments = array(); + while($x<$funcline) + { + $comments[] = $code[$x]; + $x++; + } + $this->ParseComments($TagName,$comments); + $funcline = $this->FindStr($code,"function ",$funcline+1); + } + } + } + + function ParseItemFile($file) + { + $code = file($file); + if(count($code)) + { + $funcline = $this->FindStr($code,"function ParseObject(",0); + if($funcline>0) + { + $nextfunc = $this->FindStr($code,"function ",$funcline+1); + if($nextfunc==0) + $nextfunc = count(code); + + $comment_line = $this->FindStr($code,"/*",$funcline,$nextfunc); + while(is_numeric($comment_line)) + { + $end_comment = $this->FindStr($code,"*/",$comment_line+1,$nextfunc); + if(is_numeric($end_comment)) + { + $x=$comment_line+1; + $comments=array(); + while($x<$end_comment) + { + $comments[] = $code[$x]; + $x++; + } + + $this->ParseComments("",$comments); + //echo "
";print_r($comments);echo "
"; + unset($comments); + $comment_line=$this->FindStr($code,"/*",$end_comment+1,$nextfunc); + } + else + $comment_line=""; + + } + } + } + } + function LoadGlobalTags() + { + $this->Clear(); + $this->Query_Item("SELECT * FROM ".$this->SourceTable); + for($i=0;$i<$this->NumItems();$i++) + { + $this->Items[$i]->LoadAttribs(); + } + } + + function ParseInportalTags() + { + global $ParserFiles,$ItemTagFiles,$pathtoroot; + + $this->DeleteTags(); + $t = new clsTagFunction(); + $t->Set("name","include"); + $t->Set("description","insert template output into the current template"); + $t->Create(); + $t->AddAttribute("_template","tpl","Template to insert","",TRUE); + $t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE); + unset($t); + + $t = new clsTagFunction(); + $t->Set("name","perm_include"); + $t->Set("description","insert template output into the current template if permissions are set"); + $t->Create(); + $t->AddAttribute("_template","tpl","Template to insert","",TRUE); + $t->AddAttribute("_noaccess","tpl","Template to insert if access is denied","",FALSE); + $t->AddAttribute("_permission","","Comma-separated list of permissions, any of which will grant access","",FALSE); + $t->AddAttribute("_module","","Used in place of the _permission attribute, this attribute verifies the module listed is enabled","",FALSE); + $t->AddAttribute("_system","bool","Must be set to true if any permissions in _permission list is a system permission","",FALSE); + $t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE); + unset($t); + + $t = new clsTagFunction(); + $t->Set("name","mod_include"); + $t->Set("description","insert templates from all enabled modules. No error occurs if the template does not exist."); + $t->Create(); + $t->AddAttribute("_template","tpl","Template to insert. This template path should be relative to the module template root directory","",TRUE); + $t->AddAttribute("_modules","","Comma-separated list of modules. Defaults to all enabled modules if not set","",FALSE); + unset($t); + + $t = new clsTagFunction(); + $t->Set("name","lang_include"); + $t->Set("description","Include a template based on the current language"); + $t->Create(); + $t->AddAttribute("_template","tpl","Template to insert. This template path should be relative to the module template root directory","",TRUE); + $t->AddAttribute("_language","","Pack name of language","",FALSE); + + unset($t); + + if(is_array($ParserFiles)) + { + foreach($ParserFiles as $file) + { + $this->ParseFile($pathtoroot.$file); + } + } + if(is_array($ItemTagFiles)) + { + foreach($ItemTagFiles as $file) + { + $this->ParseItemFile($pathtoroot.$file); + } + } + } +} Index: trunk/themes/default/img/act_rate.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/lang_email.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/lang_email.php (revision 0) +++ trunk/kernel/admin/include/toolbar/lang_email.php (revision 13) @@ -0,0 +1,21 @@ + + + + +END; +?> Index: trunk/kernel/include/modules.php =================================================================== diff -u --- trunk/kernel/include/modules.php (revision 0) +++ trunk/kernel/include/modules.php (revision 13) @@ -0,0 +1,898 @@ + $value) + { + if(strlen($key)) + { + $parser_name = $key . "_ParseEnv"; + if(function_exists($parser_name)) + { + @$parser_name(); + } + } + } + + } + } + else + { + $envsections = explode(":", $env); + foreach($mod_prefix as $key => $value) + { + if(strlen($key)) + { + $parsed=FALSE; + $parser_name = $key . "_ParseEnv"; + for($i=1; $i\n"; + if ($env != "") + { + $envsections = explode(":", $env); + foreach($mod_prefix as $key => $value) + { + if(strlen($key)) + { + $parsed=FALSE; + for($i=1; $i\n"; + if(($objConfig->Get("CookieSessions")==0 || !$FrontEnd || ($objConfig->Get("CookieSessions")==2 && $SessionQueryString==TRUE))) + { + if(!$objSession->UseTempKeys) + { + $sessionkey = $objSession->GetSessionKey(); + } + else + $sessionkey = $objSession->Get("CurrentTempKey"); + $env = $sessionkey; + } + $env .= "-"; + if (isset($var_list_update["t"])) + { + if($var_list_update["t"]=="_referer_") + { + $var_list_update["t"] =$objSession->GetVariable("Template_Referer"); + } + + $t = $var_list_update["t"]; + if(!is_numeric($t)) + { + if(!is_object($theme)) + $theme = $objThemes->GetItem($m_var_list["theme"]); + $id = $theme->GetTemplateId($t); + $var_list_update["t"] = $id; + } + $env .= $var_list_update["t"]; + } + else + { + $t = $var_list["t"]; + if(!is_numeric($t)) + { + if(!is_object($theme)) + $theme = $objThemes->GetItem($m_var_list["theme"]); + $id = $theme->GetTemplateId($t); + $t = $id; + } + $env .= $t; + } + if(is_array($mod_prefix)) + { + foreach($mod_prefix as $key => $value) + { + $builder_name = $key . "_BuildEnv"; + + if(function_exists($builder_name)) + $env .= $builder_name(); + } + } + $extra = ""; + $keys = array_keys($ExtraVars); + if(is_array($keys)) + { + for($i=0;$i $value) + { + $function_name = $key."_".$basename; + if(function_exists($function_name)) + { + $function_name($CatList); + } + } +} + + +function RegisterEnv($Var,$Value) +{ + global $ExtraVars; + + $ExtraVars[$Var] = $Value; +} + +function UnregisterEnv($Var) +{ + global $ExtraVars; + + unset($ExtraVars[$Var]); +} + +function ModuleTagPrefix($name) +{ + global $modules_loaded; + + $ret = ""; + foreach($modules_loaded as $prefix=>$mod_name) + { + if($name==$mod_name) + { + $ret = $prefix; + break; + } + } + return $ret; +} + +function ModuleEnabled($name) +{ + global $template_path; + + $a = array_keys($template_path); + if(in_array($name,$a)) + return TRUE; + return FALSE; +} + +function GetModuleArray($array_name="mod_prefix") +{ + switch($array_name) + { + case "mod_prefix": + global $mod_prefix; + return $mod_prefix; + break; + case "admin": + global $mod_prefix, $modules_loaded; + $mod = array(); + if(is_array($mod_prefix) && is_array($modules_loaded)) + { + foreach ($mod_prefix as $key=>$value) + { + if(_ModuleLicensed($modules_loaded[$key]) || $key=="m") + { + $mod[$key] = $value; + } + } + } + return $mod; + break; + case "loaded": + global $modules_loaded; + return $modules_loaded; + break; + case "template": + global $template_path; + return $template_path; + case "rootcat": + global $mod_root_cats; + return $mod_root_cats; + break; + } +} + +function admin_login() +{ + global $objSession,$login_error, $objConfig,$g_Allow,$g_Deny; + + //echo "
"; print_r($objSession); echo "
"; + + $env_arr = explode('-', $_GET['env']); + $get_session_key = $env_arr[0]; + + if(!$objSession->ValidSession() || ($objSession->GetSessionKey() != $get_session_key && $_POST['adminlogin'] != 1)) { + if ($_GET['expired'] == 1) { + $login_error = admin_language("la_text_sess_expired"); + } + return FALSE; + //echo "Expired
"; + } + + if ($objSession->HasSystemPermission("ADMIN") == 1) + return TRUE; + + if(count($_POST)==0 || $_POST["adminlogin"]!=1) + return FALSE; + $login=$_POST["login"]; + $password = $_POST["password"]; + + if (strlen($login) && strlen($password)) + { + if(!_IpAccess($_SERVER['REMOTE_ADDR'],$g_Allow,$g_Deny)) + { + $login_error = admin_language("la_text_address_denied"); + return FALSE; + } + $valid = $objSession->Login($login, md5($password)); + $hasperm = ($objSession->HasSystemPermission("ADMIN") == 1); + if (($login=="root" || $hasperm) && $valid) + { + if(_ValidateModules()) + { + return TRUE; + } + else + $login_error = "Missing or invalid In-Portal License"; + } + else + { + if(!$hasperm && $valid) + { + $login_error = admin_language("la_text_nopermissions"); + } + else + { + $login_error = admin_language("la_Text_Access_Denied"); + } + return FALSE; + } + } + else + { + if(!strlen($login)) + { + $login_error = admin_language("la_Text_Missing_Username"); + } + else + if(!strlen($password)) + $login_error = admin_language("la_Text_Missing_Password"); + return FALSE; + } +} + + +#--------------------------------------------------------------------------- + +function _EnableCookieSID() +{ + global $var_list, $objConfig; + + if((!$_COOKIE["sid"] && $objConfig->Get("CookieSessions")>0 && strlen($var_list["sid"])<2 && !headers_sent()) + || strlen($_COOKIE["sid"])>0) + { + return TRUE; + } + else + return FALSE; +} + +function _IsSpider($UserAgent) +{ + global $robots, $pathtoroot; + + $lines = file($pathtoroot."robots_list.txt"); + + if(!is_array($robots)) + { + $robots = array(); + for($i=0;$i1 && !$IsIp) + { + $p = explode(".",$d); + $ret = $p[count($p)-2].".".$p[count($p)-1]; + } + else + $ret = $d; + return $ret; +} + +function _MatchIp($ip1,$ip2) +{ + $matched = TRUE; + + $ip = explode(".",$ip1); + $MatchIp = explode(".",$ip2); + for($i=0;$i"; + $domain = _GetDomain(); + //echo "Domain: ".$domain."
"; + if(!_IsLocalSite($domain)) + { + $domain = _StripDomainHost($domain); + //echo "New domain: $domain
"; + //echo "
"; print_r($i_Keys); echo "
"; + for($x=0;$x0) + { + return TRUE; + } + } + else + return TRUE; + return FALSE; +} + +function _ModuleLicensed($name) +{ + global $i_Keys, $objConfig, $pathtoroot; + + $vars = parse_ini_file($pathtoroot."config.php"); + + while($key = key($vars)) + { + $key = "g_".$key; + global $$key; + $$key = current($vars); //variable variables + if(strlen($$key)>80) + { + $lic = base64_decode($$key); + } + next($vars); + } + //$lic = base64_decode($g_License); + _ParseLicense($lic); + $modules = array(); + if(!_IsLocalSite(_GetDomain())) + { + for($x=0;$x"; + $modules = explode(",",$key["mod"]); + } + } + if(in_array($name,$modules)) { + //echo "ok
"; + return TRUE; + } + } + else { + return TRUE; + } + + return FALSE; +} + +function _GetDomain() +{ + global $objConfig, $g_Domain; + + if($objConfig->Get("DomainDetect")) + { + $d = $_SERVER['HTTP_HOST']; + } + else + $d = $g_Domain; + + return $d; +} + +function _keyED($txt,$encrypt_key) +{ + $encrypt_key = md5($encrypt_key); + $ctr=0; + $tmp = ""; + for ($i=0;$i15 && $p[1]<32) + $localb=TRUE; + } + if($domain=="localhost" || $domain=="127.0.0.1" || substr($domain,0,7)=="192.168" || + substr($domain,0,3)=="10." || $localb || strpos($domain,".")==0) + { + return TRUE; + } + return FALSE; +} + +LogEntry("Loading Modules\n"); +/* get the module list from the database */ +$adodbConnection = GetADODBConnection(); +$sql = "SELECT Name, Path, Var,TemplatePath, RootCat from ".GetTablePrefix()."Modules where Loaded=1 ORDER BY LoadOrder"; +$rs = $adodbConnection->Execute($sql); + +while($rs && !$rs->EOF) +{ + $key = $rs->fields["Var"]; + $mod_prefix[$key] = $rs->fields["Path"]; + $modules_loaded[$key] = $rs->fields["Name"]; + $name = $rs->fields["Name"]; + $template_path[$name] = $rs->fields["TemplatePath"]; + $mod_root_cats[$name] = $rs->fields["RootCat"]; + // echo $key . "=". $modules_loaded[$key]."
\n"; + $rs->MoveNext(); +} +LogEntry("Loading Module Parser scripts\n"); +/* for each module enabled, load up parser.php */ +//foreach($mod_prefix as $key => $value) +$LogLevel++; +if(is_array($mod_prefix)) +{ + foreach($mod_prefix as $key => $value) + { + + $mod = $pathtoroot . $value . "parser.php"; +// LogEntry("Loading parser $mod \n"); + require_once($mod); + + } +} +$LogLevel--; +LogEntry("Finished Loading Module Parser scripts\n"); +/*now each module gets a look at the environment string */ + +$SessionQueryString = FALSE; + +if(!isset($FrontEnd)) $FrontEnd = false; + +if($FrontEnd != 1) + $SessionQueryString = TRUE; + +if(is_array($mod_prefix)) + ParseEnv(); +/* create the session object */ + +$ip = $_SERVER["REMOTE_ADDR"]; + +if ( !isset($var_list['sid']) ) $var_list['sid'] = ''; +if ( !isset($_GET['env']) ) $_GET['env'] = ''; + +if(strlen($var_list["sid"])==0 && strlen($_GET["env"])>0 && $objConfig->Get("CookieSessions")==2) +{ + if(_IsSpider($_SERVER["HTTP_USER_AGENT"])) + { + $UseSession = FALSE; + } + else + { + /* switch user to GET session var */ + if (!$_COOKIE['sid']) { + $SessionQueryString = TRUE; + } + //else { + //$SessionQueryString = FALSE; + //} + $UseSession = TRUE; + } +} +else { + $UseSession = TRUE; +} + +if($var_list["sid"]=="_") + $var_list["sid"]=""; + +/*setup action variable*/ +$Action = isset($_REQUEST['Action']) ? $_REQUEST['Action'] : ''; + +if($Action=="m_logout") +{ + $u = new clsUserSession($var_list["sid"] ,($SessionQueryString && $FrontEnd==1)); + $u->Logout(); + unset($u); + $var_list_update["t"] = "index"; + $var_list["t"] = ""; + $var_list["sid"]=""; + setcookie("login","",time()-3600); + setcookie("sid","",time()-3600); +} + +$CookieTest = isset($_COOKIE["CookiesTest"]) ? $_COOKIE["CookiesTest"] : ''; +$HTTP_REFERER = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + +if ( ($CookieTest == 1) || !strstr($HTTP_REFERER, $_SERVER['SERVER_NAME'].$objConfig->Get("Site_Path"))) { + $SessionQueryString = FALSE; +} + +if ($FrontEnd != 1) { + $SessionQueryString = TRUE; +} + +$objSession = new clsUserSession($var_list["sid"],($SessionQueryString && $FrontEnd==1)); + +if($UseSession) +{ + if(!$objSession->ValidSession()) + { + /* Get rid of Invalid Session and make a brand new one*/ +// echo "Dumping Session ".$var_list["sid"]."
"; + unset($var_list["sid"]); + $objSession->GetNewSession(); + $var_list["sid"] = $objSession->GetSessionKey(); + $var_list_update["sid"]=$objSession->GetSessionKey(); + if(is_numeric($m_var_list["theme"])) + $objSession->SetThemeName($m_var_list["theme"]); + if($objConfig->Get("CookieSessions")>0 && !$SessionQueryString && !headers_sent()) + setcookie("sid",$var_list["sid"]); + //echo "New Session: ".$objSession->GetSessionKey()."
\n"; + if(isset($_COOKIE["login"]) && $Action != "m_logout" && $FrontEnd==1) + { + $parts = explode("|",$_COOKIE["login"]); + $username = $parts[0]; + $pass = $parts[1]; + $objSession->Login($username,$pass); + } + } + else + { //echo "Update Session
"; + if($objSession->Get("Language")!=$m_var_list["lang"]) + { + $objSession->Set("Language",$m_var_list["lang"]); + } + $objSession->LoadSessionData(); + $objSession->UpdateAccessTime(); + $objSession->Update(); + LoadEnv(); + } +} + +if(is_numeric($var_list["t"])) +{ + if( !isset($CurrentTheme) ) $CurrentTheme = null; + if(!is_object($CurrentTheme)) + $CurrentTheme = $objThemes->GetItem($m_var_list["theme"]); + + $var_list["t"] = $CurrentTheme->GetTemplateById($var_list["t"]); + $objSession->Set("Theme",$CurrentTheme->Get("Name")); +} +/*create the global current user object */ +$UserID=$objSession->Get("PortalUserId"); +$objCurrentUser = new clsPortalUser($UserID); +$objLanguageCache = new clsLanguageCache($m_var_list["lang"]); + +/* include each module's action.php script */ +LogEntry("Loading Module action scripts\n"); + +## Global Referer Template +$_local_t = $var_list["t"]; + +if(is_array($mod_prefix)) +{ + foreach($mod_prefix as $key => $value) + { + if($FrontEnd==0 || !is_numeric($FrontEnd) || $FrontEnd==2) + { + $rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); + $admin = $objConfig->Get("AdminDirectory"); + if(!strlen($admin)) + $admin = "admin"; + $adminURL = $rootURL.$admin; + $imagesURL = $adminURL."/images"; + if(_ModuleLicensed($modules_loaded[$key])) + { + + $mod = $pathtoroot.$value."module_init.php"; + if(file_exists($mod)) + require_once($mod); + + $mod = $pathtoroot . $value . "action.php"; + if(file_exists($mod)) + require_once($mod); + + $mod = $pathtoroot . $value . "searchaction.php"; + if(file_exists($mod)) + require_once($mod); + } + } + if($FrontEnd==1 || $FrontEnd==2) + { + $mod = $pathtoroot.$value."module_init.php"; + if(file_exists($mod)) + require_once($mod); + $mod = $pathtoroot . $value . "frontaction.php"; + if(file_exists($mod)) + require_once($mod); + } + } +} +if( !isset($SearchPerformed) ) $SearchPerformed = false; +if($SearchPerformed == true) $objSearch->BuildIndexes(); +LogEntry("Finished Loading Module action scripts\n"); +?> Index: trunk/admin/config/config_theme.php =================================================================== diff -u --- trunk/admin/config/config_theme.php (revision 0) +++ trunk/admin/config/config_theme.php (revision 13) @@ -0,0 +1,223 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$section = "in-portal:configure_themes"; + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} +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->Set("CheckForm","theme"); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("new_theme", "la_ToolTip_New_Theme",$adminURL."/config/addtheme.php?$envar&new=1","swap('new_theme','toolbar/tool_new_theme_f2.gif');", + "swap('new_theme', 'toolbar/tool_new_theme.gif');","",$imagesURL."/toolbar/tool_new_theme.gif"); + +$objListToolBar->Add("theme_edit","la_ToolTip_Edit","#", "if (ThemeChecks.itemChecked()) swap('theme_edit','toolbar/tool_edit_f2.gif');", + "if (ThemeChecks.itemChecked()) swap('theme_edit', 'toolbar/tool_edit.gif');","if (ThemeChecks.itemChecked()) ThemeChecks.check_submit('addtheme', '');", + "tool_edit.gif",TRUE,TRUE); +$listImages[] = "ThemeChecks.addImage('theme_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +$objListToolBar->Add("theme_del","la_ToolTip_Delete","#", "if (ThemeChecks.itemChecked()) swap('theme_del','toolbar/tool_delete_f2.gif');", + "if (ThemeChecks.itemChecked()) swap('theme_del', 'toolbar/tool_delete.gif');","if (ThemeChecks.itemChecked()) ThemeChecks.check_submit('config_theme', 'm_theme_delete');", + "tool_delete.gif",FALSE,TRUE); +$listImages[] = "ThemeChecks.addImage('theme_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->Add("theme_primary","la_ToolTip_Primary","#", "if (ThemeChecks.itemChecked()) swap('theme_primary','toolbar/tool_primary_theme_f2.gif');", + "if (ThemeChecks.itemChecked()) swap('theme_primary', 'toolbar/tool_primary_theme.gif');","if (ThemeChecks.itemChecked()) ThemeChecks.check_submit('config_theme', 'm_theme_primary');", + "tool_primary_theme.gif"); +$listImages[] = "ThemeChecks.addImage('theme_primary','$imagesURL/toolbar/tool_primary_theme.gif','$imagesURL/toolbar/tool_primary_theme_f3.gif',1); "; + +$objListToolBar->AddToInitScript($listImages); +$objListToolBar->AddToInitScript("fwLoadMenus(); \n"); + +$objThemes->CreateMissingThemes(); + +$SearchWords = $objSession->GetVariable("ThemeSearchWord"); + +if(strlen($SearchWords)) +{ + $where = $objUsers->AdminSearchWhereClause($SearchWords); +} +else + $where = ""; +$order = trim($objConfig->Get("Theme_LV_Sortfield")." ".$objConfig->Get("Theme_LV_Sortorder")); + +$sql = "SELECT t.*,ELT(t.enabled+1,'".admin_language("la_Text_Disabled")."','".admin_language("la_Text_Enabled")."') as Status "; +$sql .= "FROM ".GetTablePrefix()."Theme as t"; +if(strlen($where)) + $sql .= "WHERE ".$where." "; +if(strlen($order)) + $sql = "ORDER BY ".$order; + +$sql .= ' '.GetLimitSQL($objSession->GetVariable("Page_LV_Themes"),$objConfig->Get("Perpage_LV_Themes")); + +$objThemes->Query_Item($sql); +$itemcount = TableCount(GetTablePrefix()."Theme", $where,0); + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + +$objListView = new clsListView($objListToolBar,$objThemes); +$objListView->IdField = "ThemeId"; + +$order = $objConfig->Get("Theme_LV_Sortfield"); +$objListView->ColumnHeaders->Add("Name",admin_language("la_prompt_Name"),1,0,$order,"width=\"30%\"","Theme_LV_Sortfield","Theme_LV_Sortorder","Name"); +$objListView->ColumnHeaders->Add("Description",admin_language("la_prompt_Description"),1,0,$order,"width=\"30%\"","Theme_LV_Sortfield","Theme_LV_Sortorder","Description"); +$objListView->ColumnHeaders->Add("Status",admin_language("la_ColHeader_Status"),1,0,$order,"width=\"30%\"","Theme_LV_Sortfield","Theme_LV_Sortorder","Status"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get("Theme_LV_Sortfield"), $objConfig->Get("Theme_LV_Sortorder")); + +$objListView->PrintToolBar = FALSE; +$objListView->checkboxes = TRUE; + +$objListView->CurrentPageVar = "Page_LV_Themes"; +$objListView->PerPageVar = "Perpage_LV_Themes"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_theme_search"; + +$objListView->TotalItemCount = $itemcount; + +for($i=0;$iItems);$i++) +{ + $objListView->RowIcons[] = $objThemes->Items[$i]->AdminIcon(); +} + +$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,"","",0); + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Theme"); +$h = "\n\n\n"; +int_header($objListToolBar,NULL,$title, NULL, $h); +?> +
" method=POST> +
+ + + + + + + + + + + + + + +
Username: + +
+ Password: + +


+
+ + + + + +
+
+ +PrintList(); +?> + + + + + +" name="viewmenu"> + + + + + + + + + Index: trunk/admin/images/toolbar/tool_search.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_group_f3.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/lang_select.tpl =================================================================== diff -u --- trunk/themes/default/lang_select.tpl (revision 0) +++ trunk/themes/default/lang_select.tpl (revision 13) @@ -0,0 +1,110 @@ + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +



+ + + + + + + + + + +

+ + + + + +

 
+
+ + +
+ + + + + +

+ +
+ + + + +
+ + + + + +

+
+ + + + + + +

+ + +
+
+ +
+

+
+ + + + + +
+ + + + + +
+ + + + +
+
+ + + Index: trunk/admin/users/adduser_images.php =================================================================== diff -u --- trunk/admin/users/adduser_images.php (revision 0) +++ trunk/admin/users/adduser_images.php (revision 13) @@ -0,0 +1,333 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +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"); + +unset($objEditItems); + +$objEditItems = new clsCatList(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$objEditItems->EnablePaging = FALSE; +$itemcount=$objEditItems->NumItems(); +$c = $objEditItems->GetItemByIndex($en); + +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_item_image"; + +/* -------------------------------------- Section configuration ------------------------------------------- */ +$envar = "env=" . BuildEnv() . "&en=$en"; +$section = 'in-portal:edituser_images'; +$sec = $objSections->GetSection($section); +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_User")." '".$c->Get("Login")."' - ".prompt_language("la_tab_Images"); + +$SortFieldVar = "Image_LV_Sortfield"; +$SortOrderVar = "Image_LV_Sortorder"; +$DefaultSortField = "FullName"; +$PerPageVar = "Perpage_Images"; +$CurrentPageVar = "Page_Images"; +$CurrentFilterVar = "CatImg_View"; + +$ListForm = "imagelistform"; +$CheckClass = "ImageChecks"; +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$objListToolBar = new clsToolBar(); +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','UserEditStatus','".$admin."/users/user_list.php',1);","tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','UserEditStatus','".$admin."/users/user_list.php',2);","tool_cancel.gif"); +if($itemcount == 1) $objListToolBar->Add("divider"); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); + +//Display header + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/adduser_images.php"; + $StatusField = "UserEditStatus"; + $form = "edituser"; + MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevUser','la_NextUser'); + $objListToolBar->Add("divider"); +} + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("new_img", "la_ToolTip_New_Image",$adminURL."/users/user_addimage.php?".$envar,"swap('new_img','toolbar/tool_new_image_f2.gif');", + "swap('new_img', 'toolbar/tool_new_image.gif');", + "","tool_new_image.gif"); + +$objListToolBar->Add("img_edit","Edit","#", "if (ImageChecks.itemChecked()) swap('img_edit','toolbar/tool_edit_f2.gif');", + "if (ImageChecks.itemChecked()) swap('img_edit', 'toolbar/tool_edit.gif');","if (ImageChecks.itemChecked()) ImageChecks.check_submit('user_addimage', '');", + "tool_edit.gif",TRUE,TRUE); +$listImages[] = "ImageChecks.addImage('img_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +$objListToolBar->Add("img_del","Delete","#", "if (ImageChecks.itemChecked()) swap('img_del','toolbar/tool_delete_f2.gif');", + "if (ImageChecks.itemChecked()) swap('img_del', 'toolbar/tool_delete.gif');","if (ImageChecks.itemChecked()) ImageChecks.check_submit('adduser_images', 'm_img_delete');", + "tool_delete.gif",FALSE,TRUE); +$listImages[] = "ImageChecks.addImage('img_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("img_move_up","la_ToolTip_Move_Up","#", "if (ImageChecks.itemChecked()) swap('img_move_up','toolbar/tool_move_up_f2.gif');", + "if (ImageChecks.itemChecked()) swap('img_move_up', 'toolbar/tool_move_up.gif');","if (ImageChecks.itemChecked()) ImageChecks.check_submit('adduser_images', 'm_img_move_up');", + "tool_move_up.gif",FALSE,TRUE); +$listImages[] = "ImageChecks.addImage('img_move_up','$imagesURL/toolbar/tool_move_up.gif','$imagesURL/toolbar/tool_move_up_f3.gif',1); "; + +$objListToolBar->Add("img_move_down","la_ToolTip_Move_Down","#", "if (ImageChecks.itemChecked()) swap('img_move_down','toolbar/tool_move_down_f2.gif');", + "if (ImageChecks.itemChecked()) swap('img_move_down', 'toolbar/tool_move_down.gif');","if (ImageChecks.itemChecked()) ImageChecks.check_submit('adduser_images', 'm_img_move_down');", + "tool_move_down.gif",FALSE,TRUE); +$listImages[] = "ImageChecks.addImage('img_move_down','$imagesURL/toolbar/tool_move_down.gif','$imagesURL/toolbar/tool_move_down_f3.gif',1); "; + +$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); + +/* ----------------------------------------- Set the View Filter ---------------------------------------- */ +$Img_AllValue = 3; +$Bit_Enabled=1; +$Bit_Disabled=2; +$FilterLabels = array(); + +$FilterLabels[0] = admin_language("la_Text_Enabled"); +$FilterLabels[1] = admin_language("la_Text_Disabled"); + +$ImgView = $objConfig->Get($CurrentFilterVar); + +if(!is_numeric($ImgView)) +{ + $ImgView = $Img_AllValue; +} +else +{ + if($ImgView & $Bit_Enabled) + $Filters[] = "img.Enabled=1"; + + if($ImgView & $Bit_Disabled) + $Filters[] = "img.Enabled=0"; + + if(count($Filters)) + { + $imgFilter = implode(" OR ",$Filters); + } + else + $imgFilter = "ImageId = -1"; +} + +/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/ +$objImageList = new clsImageList(); +$objImageList->SourceTable = $objSession->GetEditTable("Images"); + +$sql = "SELECT ELT(img.Enabled+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ') as Status, "; +$sql .="img.AltName as AltName, img.ImageId as ImageId, img.Enabled as Enabled, img.Priority as Priority, "; +$sql .="concat(img.Name,ELT(img.DefaultImg+1,'','
(".admin_language("la_prompt_Primary").") ')) as FullName, "; +$sql .="if(img.LocalImage=1,'(".admin_language("la_Text_Local").") ',img.Url) as ShowURL, concat( '') AS Preview "; + +$sql .="FROM ".$objImageList->SourceTable." as img WHERE img.ResourceId=".$c->Get("ResourceId"); + +if(strlen($imgFilter)) + $sql .= " AND ($imgFilter)"; + +$order = trim($objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar)); + +$sql .=" ORDER BY Priority DESC"; +if(strlen($order)) + $sql .= ", ".$order; + +$sql .=" ".GetLimitSQL($objSession->GetVariable($CurrentPageVar),$objConfig->Get($PerPageVar)); + +$objImageList->Query_Item($sql); +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + +for($i=0;$iItems);$i++) +{ + $img =& $objImageList->GetItemRefByIndex($i); + $icon = $imagesURL."/itemicons/icon16_image_disabled.gif"; + + if($img->Get("Enabled")=="1") + { + $icon = $imagesURL."/itemicons/icon16_image.gif"; + } + $img->Set("Icon",$icon); +} + +/* ---------------------------------------- Configure the list view ---------------------------------------- */ + $objListView = new clsListView($objListToolBar,$objImageList); + $objListView->IdField = "ImageId"; + $order = $objConfig->Get("UserImage_LV_Sortfield"); + $SortOrder=0; + + if($objConfig->Get($SortOrderVar)=="asc") + $SortOrder=1; + + $objListView->ColumnHeaders->Add("FullName",admin_language("la_ColHeader_Image"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"FullName"); + $objListView->ColumnHeaders->Add("AltName",admin_language("la_ColHeader_AltValue"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"AltName"); + $objListView->ColumnHeaders->Add("ShowURL",admin_language("la_ColHeader_Url"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"ShowURL"); + $objListView->ColumnHeaders->Add("Status",admin_language("la_ColHeader_Enabled"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"Status"); + $objListView->ColumnHeaders->Add("Preview",admin_language("la_ColHeader_Preview"),1,0,$order,"width=\"40%\"",$SortFieldVar,$SortOrderVar,"Preview"); + $objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar)); + + $objListView->PrintToolBar = FALSE; + $objListView->CurrentPageVar = "Page_Images"; + $objListView->PerPageVar = "Perpage_Images"; + $objListView->CheckboxName = "itemlist[]"; + + $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, + $CurrentFilterVar,$ImgView,$Img_AllValue); + + foreach($FilterLabels as $Bit=>$Label) + { + $objListView->AddViewMenuFilter($Label,$Bit); + } + for($i=0;$iItems);$i++) + { + $img =& $objImageList->GetItemRefByIndex($i); + $objListView->RowIcons[] = $img->Get("Icon"); + } + +$objListToolBar->AddToInitScript("fwLoadMenus();\n"); + +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
" method=POST> + + +PrintList(); +?> + "> + + + + + > + + + + +
+ + +
+ +
" name="viewmenu"> + + + + +
+ + + + Index: trunk/admin/images/toolbar/tool_approve.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/slaap.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/eek3.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/images/noimage.gif =================================================================== diff -u Binary files differ Index: trunk/admin/category/addcategory_custom.php =================================================================== diff -u --- trunk/admin/category/addcategory_custom.php (revision 0) +++ trunk/admin/category/addcategory_custom.php (revision 13) @@ -0,0 +1,255 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) + +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} +unset($objEditItems); + +$objEditItems = new clsCatList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Category"); + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); + +$c = $objEditItems->GetItemByIndex($en); + +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_edit_category"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:editcategory_custom'; + +$title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Category")." '".$c->Get("Name")."' - ".admin_language("la_tab_Custom"); + +$formaction = $rootURL.$admin."/category/addcategory_custom.php?".$envar; + +//echo $envar."
\n"; + +//Display header +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); + +$ListForm = "permlistform"; +$CheckClass = "PermChecks"; +$objCatToolBar->Set("CheckClass",$CheckClass); +$objCatToolBar->Set("CheckForm",$ListForm); + +$saveURL = $admin."/category/category_maint.php"; +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('category','CatEditStatus','$saveURL',1);","tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('category','CatEditStatus','".$admin."/browse.php',2);","tool_cancel.gif"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/category/addcategory_custom.php"; + $StatusField = "CatEditStatus"; + $form = "category"; + MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevCategory','la_NextCategory'); +} + + int_header($objCatToolBar,NULL,$title); + +if ($objSession->GetVariable("HasChanges") == 1) { +?> + + + + +
+ +
+ +
+SourceTable = $objSession->GetEditTable("CustomMetaData"); + $objCustomDataList->LoadResource($c->Get("ResourceId")); + + for($i=0;$i<$objCustomFields->NumItems(); $i++) + { + $field =& $objCustomFields->GetItemRefByIndex($i); + $fieldid = $field->Get("CustomFieldId"); + + $f = $objCustomDataList->GetDataItem($fieldid); + $fieldname = "CustomData[$fieldid]"; + if(is_object($f)) + { + $val_field = "Get("Value")."\" name=\"$fieldname\">"; + $field->Set("Value", $val_field); + $field->Set("DataId",$f->Get("CustomDataId")); + } + else + { + $val_field = ""; + $field->Set("Value", $val_field); + $field->Set("DataId",0); + } + } + $objCustomFields->SortField = $objConfig->Get("CustomData_LV_Sortfield");; + $objCustomFields->SortItems($objConfig->Get("CustomData_LV_Sortorder")!="desc"); + + $objListView = new clsListView($objCatToolBar,$objCustomFields); + $objListView->IdField = "DataId"; + + $order = $objConfig->Get("CustomData_LV_Sortfield"); + $SortOrder=0; + if($objConfig->Get("CustomData_LV_Sortorder")=="asc") + $SortOrder=1; + + $objListView->ColumnHeaders->Add("FieldName",admin_language("la_ColHeader_FieldName"),1,0,$order,"width=\"30%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","FieldName"); + $objListView->ColumnHeaders->Add("FieldLabel",admin_language("la_ColHeader_FieldLabel"),1,0,$order,"width=\"30%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","FieldLabel"); + $objListView->ColumnHeaders->Add("Value",admin_language("la_ColHeader_Value"),1,0,$order,"width=\"40%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","Value"); + + $objListView->ColumnHeaders->SetSort($objConfig->Get("CustomData_LV_Sortfield"), $objConfig->Get("CustomData_LV_Sortorder")); + + $objListView->PrintToolBar = FALSE; + $objListView->checkboxes = FALSE; + + $objListView->CurrentPageVar = "Page_CustomData"; + $objListView->PerPageVar = "Perpage_CustomData"; + //$objListView->CheckboxName = "itemlist[]"; + + for($i=0;$iItems);$i++) + { + $objListView->RowIcons[] = $imagesURL."/itemicons/icon16_custom.gif"; + } + $objListView->PageLinks = $objListView->PrintPageLinks(); + + $objListView->SliceItems(); + print $objListView->PrintList(); +?> + "> + + + + + +
+ +
+ +
" name="viewmenu"> + + + + +
+ + + Index: trunk/admin/icons/icon46_summary_logs.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/bonk.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/perm_red.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_new.gif =================================================================== diff -u Binary files differ Index: trunk/admin/include/tabs.js =================================================================== diff -u --- trunk/admin/include/tabs.js (revision 0) +++ trunk/admin/include/tabs.js (revision 13) @@ -0,0 +1,262 @@ +//parses input tags looking for validation attributes + +function DataIsValid(f) +{ + var ValType = ''; + var span_id = ''; + var form_result = true; + var field_result = true; + var j = 0; + + for (var i = 0; i < f.elements.length; i++) + { + ValType = ''; + Field = f.elements[i]; + ValType = Field.getAttribute('ValidationType'); + if(ValType) + { + ValType = TransformValidationType(ValType); // for capability with old forms + span_id = 'prompt_' + Field.name; + span = document.getElementById(span_id); + if(span) + { + field_result = true; + ValType = ValType.split(','); + + j = 0; + while(j < ValType.length) + { + //alert('Validating ['+Field.name+'] as ['+ValType[j]+']'); + if(ValType[j] == 'password') + { + var repasswd = document.getElementById(Field.name + '_verify'); + if(repasswd) + { + field_result &= ValidateField(Field.value, ValType[j], repasswd.value); + document.getElementById('prompt_' + Field.name + '_verify').className = field_result ? 'text' : 'validation_error'; + } + } + else + field_result &= ValidateField(Field.value, ValType[j]); + j++; + } + span.className = field_result ? 'text' : 'validation_error'; + form_result &= field_result; + } + } + } + return form_result; +} + +function TransformValidationType(OldType) +{ + // replace old validation types with new + // on the fly in case if we have some forms + // that still use old validation types + + var NewType = ''; + switch(OldType) + { + case 'optional_date': + NewType = 'date'; + break; + default: + NewType = OldType; + break; + } + return NewType; +} + +function ValidateField(FieldValue, ValidateAs, RePasswdValue) +{ + // validate FieldValue based on ValidateAs rule specified; + // in case if password field compare it with RePasswdValue + var result = true; + switch(ValidateAs) + { + case 'exists': // field is required + if(FieldValue.length == 0) result = false; + break; + + case 'integer': // field must be integer number + result = ValidateNumber(FieldValue, ValidateAs); + break; + + case 'password': // validate as password field + result = (FieldValue == RePasswdValue) || (FieldValue.length == 0); + break; + + case 'date': // text must be a formatted date + result = ValidDate(FieldValue); + break; + + case 'time': // text must be a formatted time + result = ValidTime(FieldValue); + break; + } + return result; +} + +function MarkAsRequired(f) +{ + var ValType = ''; + var span_id = ''; + var result = true; + + for (var i = 0; i < f.elements.length; i++) + { + ValType = ''; + Field = f.elements[i]; + ValType = Field.getAttribute('ValidationType'); + if(ValType) + { + ValType = ValType.split(','); + if( InArray(ValType,'exists') !== false ) + { + span_id = 'prompt_' + Field.name; + span = document.getElementById(span_id); + span.innerHTML = span.innerHTML + '*'; + } + } + } +} + +function InArray(aArray, aValue) +{ + // checks if element in array + var k = 0; + while(k < aArray.length) + { + if(aArray[k] == aValue) return k; + k++; + } + return false; +} + +//Used to submit the form when a tab is clicked on +function edit_submit(formname, status_field, targetURL, save_value, env_str, new_target) +{ + var full_env = env; + if(env_str != null) full_env += env_str; + + if(full_env.substr(0,3)!="env") + full_env = 'env='+full_env; + + + f = document.getElementById(formname); + + if(f) + { + var valid = false; + if(save_value != 2 && save_value !=-1) + { + valid = DataIsValid(f); + } + else + { + var a = f.Action; + if(a) + { + a.value=''; + } + } + if(valid || save_value==2 || save_value==-1) + { + f.action = rootURL + targetURL + '?' + full_env; + if(status_field.length>0) + { + f.elements[status_field].value = save_value; //0= stay in temp, 1=save to perm, 2 = purge no save + } + + if(new_target != null && typeof(new_target) != 'undefined') f.target = new_target; + f.submit(); + } + else + if(!valid) + alert(ErrorMsg); + + } + else + alert('Form '+formname+' was not found.'); +} + +//Used when the save or cancel buttin is hit +function do_edit_save(formname, status_field, targetURL, save_value,env_str) +{ + var full_env = env; + if(env_str != null) full_env += env_str; + + if(full_env.substr(0,3)!="env") + full_env = 'env='+full_env; + + f = document.getElementById(formname); + if(f) + { + f.action = rootURL + targetURL + '?' + full_env; + //alert(f.action); + if(status_field.length>0) + { + f.elements[status_field].value = save_value; //0= stay in temp, 1=save to perm, 2 = purge no save + } + f.submit(); + } + else + alert('Form '+formname+' was not found.'); +} + +function jump_to_url(targetURL,env_str) +{ + var full_env = env; + if(env_str != null) full_env += env_str; + + if(full_env.substr(0,3)!="env") + full_env = 'env='+full_env; + + document.location = rootURL + targetURL + '?' + full_env; +} +// ------------------------------------------------------------------------------------------------------------- +function submit_form(formname, status_field, targetURL, save_value,env_str) +{ + // by Alex, submits form. + + var full_env = env; + if(env_str != null) full_env += env_str; + if(full_env.substr(0,3)!="env") + full_env = 'env='+full_env; + + + f = document.getElementById(formname); + + if(f) + { + var valid = false; + if(save_value != 2 && save_value !=-1) + { + valid = DataIsValid(f); + } + else + { + var a = f.Action; + if(a) + { + a.value=''; + } + } + if(valid || save_value==2 || save_value==-1) + { + f.action = rootURL + targetURL + '?' + full_env; + if(status_field.length>0) + { + f.elements[status_field].value = save_value; //0= stay in temp, 1=save to perm, 2 = purge no save + } + + f.submit(); + } + else + if(!valid) + alert(ErrorMsg); + + } + else + alert('Form '+formname+' was not found.'); +} \ No newline at end of file Index: trunk/themes/default/showimage.tpl =================================================================== diff -u --- trunk/themes/default/showimage.tpl (revision 0) +++ trunk/themes/default/showimage.tpl (revision 13) @@ -0,0 +1,18 @@ + + + Image + + + +
+"> +
+" onclick="window.close()"> +
+ \ No newline at end of file Index: trunk/admin/images/itemicons/icon16_review_disabled.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_validate_continue_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/listview/listview.php =================================================================== diff -u --- trunk/admin/listview/listview.php (revision 0) +++ trunk/admin/listview/listview.php (revision 13) @@ -0,0 +1,471 @@ +SetToolBar($ToolBar); + $this->SetListItems($ListItems); + $this->ColumnHeaders = new clsColumnHeaderList(); + $this->CurrentPage=1; + $this->CheckboxName = "itemlist[]"; + $this->SelectorType="checkbox"; + $this->RowIcons = array(); + $this->PageLinks = ""; + $this->SearchAction = ""; + $this->extra_env=""; + $this->PriorityField="Priority"; + $this->TotalItemCount = 0; + + if (!is_null($ToolBar)) + $this->JSCheckboxName = $ToolBar->Get("CheckClass"); + $this->SetFormatters(); // for setting custom formatters + } + + function SetToolbar($ToolBar) + { + $this->ToolBar=$ToolBar; + if(is_object($this->ToolBar)) + $this->CheckArray=$this->ToolBar->Get("CheckClass"); + } + + function GetPage() + { + // get current page + $this->RefreshPageVar(); + return $this->CurrentPage; + } + + function GetLimitSQL() + { + return GetLimitSQL($this->GetPage(), $this->GetPerPage() ); + } + + function SetListItems($ListItems) + { + $this->ListItems = $ListItems; + } + + function SetIDfield($field) + { + $this->IdField = $field; + } + + function SetSort($SortField,$SortOrderVariable) + { + $this->ColumnHeaders->SetSort($SortField,$SortOrder); + } + + function SetRowIcon($index,$url) + { + $this->RowIcons[$index] = $url; + } + + function ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSort,$FilterVar,$FilterValue,$FilterMax) + { + global $objConfig; + + //$FilterVal = $this->CurrentFilter; + //$fMax = $this->Filtermax; + //$sOrder = $this->CurrentSortOrder; + //$sOrderVar = $this->OrderVar; + //$sField = $this->CurrentSortField; + //$sDefault = $this->DefaultSortField; + + $this->ViewMenu = new clsViewMenu(); + $this->ViewMenu->PerPageVar = $this->PerPageVar; + $this->ViewMenu->PerPageValue = (int)$objConfig->Get($this->PerPageVar); + if($this->ViewMenu->PerPageValue==0) + $this->ViewMenu->PerPageValue = 20; + $this->ViewMenu->CurrentSortField = $objConfig->Get($SortFieldVar); + $this->ViewMenu->CurrentSortOrder = $objConfig->get($SortOrderVar); + $this->ViewMenu->SortVar = $SortFieldVar; + $this->ViewMenu->OrderVar = $SortOrderVar; + $this->ViewMenu->CurrentFilter= $FilterValue; + $this->ViewMenu->FilterVar = $FilterVar; + $this->ViewMenu->FilterMax = $FilterMax; + foreach($this->ColumnHeaders->Columns as $col) + { + $this->ViewMenu->AddSortField($col->field,$col->label,$DefaultSort==$col->field); + } + } + + function AddViewMenuFilter($Label,$Bit) + { + if(is_object($this->ViewMenu)) + $this->ViewMenu->AddFilterField($Label,$Bit); + } + + function GetViewMenu($imagesURL) + { + if(is_object($this->ViewMenu)) + { + $this->ViewMenu->CheckboxName = $this->JSCheckboxName; + return $this->ViewMenu->GetViewMenuJS($imagesURL); + } + else + return ""; + } + + function SetFormatters() + { + // for setting custom formatters + // abstract + } + + function SetFormatter($field, $type, $params) + { + // by Alex + // all params after 2nd are formmater type specific + $this->Formatters[$field]['type'] = $type; + switch($type) + { + case FT_OPTION: + $this->Formatters[$field]['options'] = $params; + break; + } + } + + function PrintItem($index) + { + if( !isset($this->ListItems->Items[$index]) ) return ''; + $li = $this->ListItems->Items[$index]; + + $o = ""; + $first=1; + + if(is_object($li)) + { + // ==== new by Alex: begin ==== + $li->Formatters =& $this->Formatters; + // ==== new by Alex: end ==== + + $id_field = $this->IdField; + $row_id = $li->Get($id_field); + if(is_numeric($li->Get($this->PriorityField))) + { + $Priority = (int)$li->Get($this->PriorityField); + } + else + $Priority=0; + $o = "\n"; + foreach($this->ColumnHeaders->Columns as $col) + { + $width=""; + $ColId = $row_id."_col_".$col->field; + if($first==1) + { + if(strlen($col->width)) + { + $width = $col->width; + } + $o .= ""; + if($this->checkboxes) + { + $onclick = "onclick=\"if (this.checked) {".$this->CheckArray.".addCheck('$row_id');} else {".$this->CheckArray.".removeCheck('$row_id');}\""; + $onclicksrc = "onclicksrc=\"if (this.checked) {".$this->CheckArray.".addCheck('$row_id');} else {".$this->CheckArray.".removeCheck('$row_id');}\""; + $o .= "SelectorType."\" name=\"".$this->CheckboxName."\" value=\"$row_id\" $onclick $onclicksrc>"; + } + if(isset($this->RowIcons[$index])) + { + $url = $this->RowIcons[$index]; + if(strlen($url)) + $o .= " "; + } + $first=0; + } + else + { + if(strlen($col->width)) + { + $o .= "width.">"; + } + else + $o .= ""; + } + if($Priority!=0) + { + $o .= "$Priority"; + $Priority=0; + } + $o .= "".stripslashes($li->GetFormatted($col->field))."\n"; + } + $o .= "\n"; + } + return $o; + } + + function PrintItems() + { + $o = ''; + $numitems = $this->ListItems->NumItems(); + for($index=0;$index<=$numitems;$index++) + { + $o .= $this->PrintItem($index); + } + return $o; + } + + function TotalPageNumbers() + { + if($this->PerPage>0) + { + $ret = $this->ListItems->NumItems() / $this->PerPage; + $ret = (int)$ret; + } + else + $ret = 1; + + return $ret; + } + + function GetPerPage() + { + global $objConfig; + $PerPage = $objConfig->Get($this->PerPageVar); + if($PerPage < 1) + { + if( defined('DEBUG_MODE') ) echo 'PerPage Variable ['.$this->PerPageVar.'] not defined in Config
'; + $PerPage = 20; + //$objConfig->Set($this->PerPageVar,20); + //$objConfig->Save(); + } + return $PerPage; + } + + function GetAdminPageLinkList($url) + { + global $objConfig; + + $PerPage = $this->GetPerPage(); + + if($this->TotalItemCount>0) + { + $NumPages = ceil($this->TotalItemCount / $PerPage); + } + else + $NumPages = ceil($this->ListItems->NumItems() / $PerPage); + + if($NumPages<1) + $NumPages =1; + //echo $this->CurrentPage." of ".$NumPages." Pages"; + + $o = ""; + if($this->CurrentPage>$NumPages) + $this->CurrentPage=$NumPages; + + $StartPage = $this->CurrentPage - 5; + if($StartPage<1) + $StartPage=1; + $EndPage = $StartPage+9; + if($EndPage>$NumPages) + { + $EndPage = $NumPages; + $StartPage = $EndPage-10; + if($StartPage<1) + $StartPage=1; + } + + $o .= "".admin_language("la_Page")." "; + if($StartPage>1) + { + $target = $this->CurrentPage-10; + $prev_url = str_replace("{TargetPage}",$target,$url); + $o .= "<<"; + } + + for($p=$StartPage;$p<=$EndPage;$p++) + { + if($p!=$this->CurrentPage) + { + $href = str_replace("{TargetPage}",$p,$url); + $o .= " $p "; + } + else + { + $o .= " $p "; + } + } + if($EndPage<$NumPages-1) + { + $target = $this->CurrentPage+10; + $next_url = str_replace("{TargetPage}",$target,$url); + $o .= " >>"; + } + return $o; + } + + function SliceItems() + { + global $objConfig; + + $PerPage = (int)$objConfig->Get($this->PerPageVar); + if($PerPage<1) + $PerPage=20; + $NumPages = ceil($this->ListItems->NumItems() / $PerPage); + if($NumPages>1) + { + $Start = ($this->CurrentPage-1)*$PerPage; + $this->ListItems->Items = array_slice($this->ListItems->Items,$Start,$PerPage); + } + } + + function RefreshPageVar() + { + global $objSession; + if( (int)GetVar('lpn') > 0) + { + $this->CurrentPage = $_GET["lpn"]; + $objSession->SetVariable($this->CurrentPageVar,$this->CurrentPage); + } + else + $this->CurrentPage = $objSession->GetVariable($this->CurrentPageVar); + + $this->ListItems->Page = $this->CurrentPage; + } + + function PrintPageLinks() + { + global $imagesURL,$objSession,$lvErrorString; + if(strlen($this->PageLinks)>0) + { + return $this->PageLinks; + } + $this->RefreshPageVar(); + + if($this->CurrentPage<1) + $this->CurrentPage = 1; + if(!strlen($this->PageURL)) + { + $this->PageURL = $_SERVER["PHP_SELF"]."?env=".BuildEnv(); + if(strlen($this->extra_env)) + $this->PageURL .= "&".$this->extra_env; + $this->PageURL .= "&lpn={TargetPage}"; + } + $cols = $this->ColumnHeaders->Count(); + $o = "\n"; + if(strlen($lvErrorString)) + { + $o .= ""; + + } + if($this->SearchBar==FALSE) + { + $o .= "\n"; + } + else + { + $val = str_replace(","," ", $this->SearchKeywords); + $o .= ""; + $o .= ""; + } + $o .= "
$lvErrorString
"; + $o .= $this->GetAdminPageLinkList($this->PageURL); + $o .= ""; + + $o .= $this->GetAdminPageLinkList($this->PageURL)."".admin_language("la_prompt_Search"); + $o .= " "; + $o .= " SearchAction."');\">"; + $o .= " SearchAction."_reset');\">"; + if(strlen($this->SearchDropdownId)>0) + { + $o .= " SearchDropdownId."');\">"; + } + $o .= "
"; + return $o; + } + + function PrintJavaScriptInit() + { + $o = ''; + if($this->checkboxes) + { + $o = ""; + } + return $o; + } + + + function PrintList() + { + global $objSession; + if((int)$this->CurrentPage<1) + $this->CurrentPage=1; + + $o = "\n"; + + if(is_object($this->ToolBar)) + { + if($this->PrintToolBar) + $o .= $this->ToolBar->Build(); + } + $o .= $this->PrintPageLinks(); + $o .= "\n"; + + if($this->ShowColumnHeaders) + { + $o .= $this->ColumnHeaders->PrintColumns(); + } + if($this->ListItems->NumItems()>0) + { + $o .= $this->PrintItems(); + + } + + $o .= "
"; + if($this->ListItems->NumItems()>0) + $o .= $this->PrintJavaScriptInit(); + return $o; + } +} Index: trunk/admin/tree/ftv2blank.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/inst_ado.php =================================================================== diff -u --- trunk/admin/install/inst_ado.php (revision 0) +++ trunk/admin/install/inst_ado.php (revision 13) @@ -0,0 +1,25 @@ +0) + { + $g_adodbConnection = ADONewConnection($g_DBType); + $connected = $g_adodbConnection->PConnect($g_DBHost,$g_DBUser,$g_DBUserPassword,$g_DBName); + if(!$connected) + { + //echo "Error connecting to database $g_DBHost
\n"; + // die(); + } + $ADODB_CACHE_DIR = $pathtoroot."cache"; + $ADODB_FETCH_MODE = 2; + $ADODB_COUNTRECS = FALSE; + $g_adodbConnection->debug = false; + $g_adodbConnection->cacheSecs = 3600; + } + return $g_adodbConnection; +} +?> Index: trunk/admin/icons/icon24_settings_custom.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_conf_general.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_view_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/category/js/core.js =================================================================== diff -u --- trunk/admin/category/js/core.js (revision 0) +++ trunk/admin/category/js/core.js (revision 13) @@ -0,0 +1,1097 @@ +/* Copyright Mihai Bazon, 2002 + * http://students.infoiasi.ro/~mishoo + * + * Version: 0.9.1 + * + * Feel free to use this script under the terms of the GNU General Public + * License, as long as you do not remove or alter this notice. + */ + +/** The Calendar object constructor. */ +Calendar = function (mondayFirst, dateStr, onSelected, onClose) { + // member variables + this.activeDiv = null; + this.currentDateEl = null; + this.checkDisabled = null; + this.timeout = null; + this.onSelected = onSelected || null; + this.onClose = onClose || null; + this.dragging = false; + this.minYear = 1970; + this.maxYear = 2050; + this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"]; + this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; + this.isPopup = true; + this.mondayFirst = mondayFirst; + this.dateStr = dateStr; + // HTML elements + this.table = null; + this.element = null; + this.tbody = null; + this.daynames = null; + // Combo boxes + this.monthsCombo = null; + this.yearsCombo = null; + this.hilitedMonth = null; + this.activeMonth = null; + this.hilitedYear = null; + this.activeYear = null; + + // one-time initializations + if (!Calendar._DN3) { + // table of short day names + var ar = new Array(); + for (var i = 8; i > 0;) { + ar[--i] = Calendar._DN[i].substr(0, 3); + } + Calendar._DN3 = ar; + // table of short month names + ar = new Array(); + for (var i = 12; i > 0;) { + ar[--i] = Calendar._MN[i].substr(0, 3); + } + Calendar._MN3 = ar; + } +}; + +// ** constants + +/// "static", needed for event handlers. +Calendar._C = null; + +/// detect a special case of "web browser" +Calendar.is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) && + (navigator.userAgent.toLowerCase().indexOf("opera") == -1) ); + +// short day names array (initialized at first constructor call) +Calendar._DN3 = null; + +// short month names array (initialized at first constructor call) +Calendar._MN3 = null; + +// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate +// library, at some point. + +Calendar.getAbsolutePos = function(el) { + var r = { x: el.offsetLeft, y: el.offsetTop }; + if (el.offsetParent) { + var tmp = Calendar.getAbsolutePos(el.offsetParent); + r.x += tmp.x; + r.y += tmp.y; + } + return r; +}; + +Calendar.isRelated = function (el, evt) { + var related = evt.relatedTarget; + if (!related) { + var type = evt.type; + if (type == "mouseover") { + related = evt.fromElement; + } else if (type == "mouseout") { + related = evt.toElement; + } + } + while (related) { + if (related == el) { + return true; + } + related = related.parentNode; + } + return false; +}; + +Calendar.removeClass = function(el, className) { + if (!(el && el.className)) { + return; + } + var cls = el.className.split(" "); + var ar = new Array(); + for (var i = cls.length; i > 0;) { + if (cls[--i] != className) { + ar[ar.length] = cls[i]; + } + } + el.className = ar.join(" "); +}; + +Calendar.addClass = function(el, className) { + el.className += " " + className; +}; + +Calendar.getElement = function(ev) { + if (Calendar.is_ie) { + return window.event.srcElement; + } else { + return ev.currentTarget; + } +}; + +Calendar.getTargetElement = function(ev) { + if (Calendar.is_ie) { + return window.event.srcElement; + } else { + return ev.target; + } +}; + +Calendar.stopEvent = function(ev) { + if (Calendar.is_ie) { + window.event.cancelBubble = true; + window.event.returnValue = false; + } else { + ev.preventDefault(); + ev.stopPropagation(); + } +}; + +Calendar.addEvent = function(el, evname, func) { + if (Calendar.is_ie) { + el.attachEvent("on" + evname, func); + } else { + el.addEventListener(evname, func, true); + } +}; + +Calendar.removeEvent = function(el, evname, func) { + if (Calendar.is_ie) { + el.detachEvent("on" + evname, func); + } else { + el.removeEventListener(evname, func, true); + } +}; + +Calendar.createElement = function(type, parent) { + var el = null; + if (document.createElementNS) { + // use the XHTML namespace; IE won't normally get here unless + // _they_ "fix" the DOM2 implementation. + el = document.createElementNS("http://www.w3.org/1999/xhtml", type); + } else { + el = document.createElement(type); + } + if (typeof parent != "undefined") { + parent.appendChild(el); + } + return el; +}; + +// END: UTILITY FUNCTIONS + +// BEGIN: CALENDAR STATIC FUNCTIONS + +/** Internal -- adds a set of events to make some element behave like a button. */ +Calendar._add_evs = function(el) { + with (Calendar) { + addEvent(el, "mouseover", dayMouseOver); + addEvent(el, "mousedown", dayMouseDown); + addEvent(el, "mouseout", dayMouseOut); + if (is_ie) { + addEvent(el, "dblclick", dayMouseDblClick); + el.setAttribute("unselectable", true); + } + } +}; + +Calendar.findMonth = function(el) { + if (typeof el.month != "undefined") { + return el; + } else if (typeof el.parentNode.month != "undefined") { + return el.parentNode; + } + return null; +}; + +Calendar.findYear = function(el) { + if (typeof el.year != "undefined") { + return el; + } else if (typeof el.parentNode.year != "undefined") { + return el.parentNode; + } + return null; +}; + +Calendar.showMonthsCombo = function () { + var cal = Calendar._C; + if (!cal) { + return false; + } + var cal = cal; + var cd = cal.activeDiv; + var mc = cal.monthsCombo; + if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + if (cal.activeMonth) { + Calendar.removeClass(cal.activeMonth, "active"); + } + var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()]; + Calendar.addClass(mon, "active"); + cal.activeMonth = mon; + mc.style.left = cd.offsetLeft; + mc.style.top = cd.offsetTop + cd.offsetHeight; + mc.style.display = "block"; +}; + +Calendar.showYearsCombo = function (fwd) { + var cal = Calendar._C; + if (!cal) { + return false; + } + var cal = cal; + var cd = cal.activeDiv; + var yc = cal.yearsCombo; + if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + if (cal.activeYear) { + Calendar.removeClass(cal.activeYear, "active"); + } + cal.activeYear = null; + var Y = cal.date.getFullYear() + (fwd ? 1 : -1); + var yr = yc.firstChild; + var show = false; + for (var i = 12; i > 0; --i) { + if (Y >= cal.minYear && Y <= cal.maxYear) { + yr.firstChild.data = Y; + yr.year = Y; + yr.style.display = "block"; + show = true; + } else { + yr.style.display = "none"; + } + yr = yr.nextSibling; + Y += fwd ? 2 : -2; + } + if (show) { + yc.style.left = cd.offsetLeft; + yc.style.top = cd.offsetTop + cd.offsetHeight; + yc.style.display = "block"; + } +}; + +// event handlers + +Calendar.tableMouseUp = function(ev) { + var cal = Calendar._C; + if (!cal) { + return false; + } + if (cal.timeout) { + clearTimeout(cal.timeout); + } + var el = cal.activeDiv; + if (!el) { + return false; + } + var target = Calendar.getTargetElement(ev); + Calendar.removeClass(el, "active"); + if (target == el || target.parentNode == el) { + Calendar.cellClick(el); + } + var mon = Calendar.findMonth(target); + var date = null; + if (mon) { + date = new Date(cal.date); + if (mon.month != date.getMonth()) { + date.setMonth(mon.month); + cal.setDate(date); + } + } else { + var year = Calendar.findYear(target); + if (year) { + date = new Date(cal.date); + if (year.year != date.getFullYear()) { + date.setFullYear(year.year); + cal.setDate(date); + } + } + } + with (Calendar) { + removeEvent(document, "mouseup", tableMouseUp); + removeEvent(document, "mouseover", tableMouseOver); + removeEvent(document, "mousemove", tableMouseOver); + cal._hideCombos(); + stopEvent(ev); + _C = null; + } +}; + +Calendar.tableMouseOver = function (ev) { + var cal = Calendar._C; + if (!cal) { + return; + } + var el = cal.activeDiv; + var target = Calendar.getTargetElement(ev); + if (target == el || target.parentNode == el) { + Calendar.addClass(el, "hilite active"); + } else { + Calendar.removeClass(el, "active"); + Calendar.removeClass(el, "hilite"); + } + var mon = Calendar.findMonth(target); + if (mon) { + if (mon.month != cal.date.getMonth()) { + if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + Calendar.addClass(mon, "hilite"); + cal.hilitedMonth = mon; + } else if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + } else { + var year = Calendar.findYear(target); + if (year) { + if (year.year != cal.date.getFullYear()) { + if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + Calendar.addClass(year, "hilite"); + cal.hilitedYear = year; + } else if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + } + } + Calendar.stopEvent(ev); +}; + +Calendar.tableMouseDown = function (ev) { + if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) { + Calendar.stopEvent(ev); + } +}; + +Calendar.calDragIt = function (ev) { + var cal = Calendar._C; + if (!(cal && cal.dragging)) { + return false; + } + var posX; + var posY; + if (Calendar.is_ie) { + posY = window.event.clientY + document.body.scrollTop; + posX = window.event.clientX + document.body.scrollLeft; + } else { + posX = ev.pageX; + posY = ev.pageY; + } + cal.hideShowCovered(); + var st = cal.element.style; + st.left = (posX - cal.xOffs) + "px"; + st.top = (posY - cal.yOffs) + "px"; + Calendar.stopEvent(ev); +}; + +Calendar.calDragEnd = function (ev) { + var cal = Calendar._C; + if (!cal) { + return false; + } + cal.dragging = false; + with (Calendar) { + removeEvent(document, "mousemove", calDragIt); + removeEvent(document, "mouseover", stopEvent); + removeEvent(document, "mouseup", calDragEnd); + tableMouseUp(ev); + } + cal.hideShowCovered(); +}; + +Calendar.dayMouseDown = function(ev) { + var el = Calendar.getElement(ev); + if (el.disabled) { + return false; + } + var cal = el.calendar; + cal.activeDiv = el; + Calendar._C = cal; + if (el.navtype != 300) with (Calendar) { + addClass(el, "hilite active"); + addEvent(document, "mouseover", tableMouseOver); + addEvent(document, "mousemove", tableMouseOver); + addEvent(document, "mouseup", tableMouseUp); + } else if (cal.isPopup) { + cal._dragStart(ev); + } + Calendar.stopEvent(ev); + if (el.navtype == -1 || el.navtype == 1) { + cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250); + } else if (el.navtype == -2 || el.navtype == 2) { + cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250); + } else { + cal.timeout = null; + } +}; + +Calendar.dayMouseDblClick = function(ev) { + Calendar.cellClick(Calendar.getElement(ev)); + if (Calendar.is_ie) { + document.selection.empty(); + } +}; + +Calendar.dayMouseOver = function(ev) { + var el = Calendar.getElement(ev); + if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) { + return false; + } + if (el.ttip) { + if (el.ttip.substr(0, 1) == "_") { + var date = null; + with (el.calendar.date) { + date = new Date(getFullYear(), getMonth(), el.caldate); + } + el.ttip = date.print(el.calendar.ttDateFormat) + el.ttip.substr(1); + } + el.calendar.tooltips.firstChild.data = el.ttip; + } + if (el.navtype != 300) { + Calendar.addClass(el, "hilite"); + } + Calendar.stopEvent(ev); +}; + +Calendar.dayMouseOut = function(ev) { + with (Calendar) { + var el = getElement(ev); + if (isRelated(el, ev) || _C || el.disabled) { + return false; + } + removeClass(el, "hilite"); + el.calendar.tooltips.firstChild.data = _TT["SEL_DATE"]; + stopEvent(ev); + } +}; + +/** + * A generic "click" handler :) handles all types of buttons defined in this + * calendar. + */ +Calendar.cellClick = function(el) { + var cal = el.calendar; + var closing = false; + var newdate = false; + var date = null; + if (typeof el.navtype == "undefined") { + Calendar.removeClass(cal.currentDateEl, "selected"); + Calendar.addClass(el, "selected"); + closing = (cal.currentDateEl == el); + if (!closing) { + cal.currentDateEl = el; + } + cal.date.setDate(el.caldate); + date = cal.date; + newdate = true; + } else { + if (el.navtype == 200) { + Calendar.removeClass(el, "hilite"); + cal.callCloseHandler(); + return; + } + date = (el.navtype == 0) ? new Date() : new Date(cal.date); + var year = date.getFullYear(); + var mon = date.getMonth(); + var setMonth = function (mon) { + var day = date.getDate(); + var max = date.getMonthDays(); + if (day > max) { + date.setDate(max); + } + date.setMonth(mon); + }; + switch (el.navtype) { + case -2: + if (year > cal.minYear) { + date.setFullYear(year - 1); + } + break; + case -1: + if (mon > 0) { + setMonth(mon - 1); + } else if (year-- > cal.minYear) { + date.setFullYear(year); + setMonth(11); + } + break; + case 1: + if (mon < 11) { + setMonth(mon + 1); + } else if (year < cal.maxYear) { + date.setFullYear(year + 1); + setMonth(0); + } + break; + case 2: + if (year < cal.maxYear) { + date.setFullYear(year + 1); + } + break; + case 100: + cal.setMondayFirst(!cal.mondayFirst); + return; + } + if (!date.equalsTo(cal.date)) { + cal.setDate(date); + newdate = el.navtype == 0; + } + } + if (newdate) { + cal.callHandler(); + } + if (closing) { + Calendar.removeClass(el, "hilite"); + cal.callCloseHandler(); + } +}; + +// END: CALENDAR STATIC FUNCTIONS + +// BEGIN: CALENDAR OBJECT FUNCTIONS + +/** + * This function creates the calendar inside the given parent. If _par is + * null than it creates a popup calendar inside the BODY element. If _par is + * an element, be it BODY, then it creates a non-popup calendar (still + * hidden). Some properties need to be set before calling this function. + */ +Calendar.prototype.create = function (_par) { + var parent = null; + if (! _par) { + // default parent is the document body, in which case we create + // a popup calendar. + parent = document.getElementsByTagName("body")[0]; + this.isPopup = true; + } else { + parent = _par; + this.isPopup = false; + } + this.date = this.dateStr ? new Date(this.dateStr) : new Date(); + + var table = Calendar.createElement("table"); + this.table = table; + table.cellSpacing = 0; + table.cellPadding = 0; + table.calendar = this; + Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown); + + var div = Calendar.createElement("div"); + this.element = div; + div.className = "calendar"; + if (this.isPopup) { + div.style.position = "absolute"; + div.style.display = "none"; + } + div.appendChild(table); + + var thead = Calendar.createElement("thead", table); + var cell = null; + var row = null; + + var cal = this; + var hh = function (text, cs, navtype) { + cell = Calendar.createElement("td", row); + cell.colSpan = cs; + cell.className = "button"; + Calendar._add_evs(cell); + cell.calendar = cal; + cell.navtype = navtype; + if (text.substr(0, 1) != "&") { + cell.appendChild(document.createTextNode(text)); + } + else { + // FIXME: dirty hack for entities + cell.innerHTML = text; + } + return cell; + }; + + row = Calendar.createElement("tr", thead); + row.className = "headrow"; + + hh("-", 1, 100).ttip = Calendar._TT["TOGGLE"]; + this.title = hh("", this.isPopup ? 5 : 6, 300); + this.title.className = "title"; + if (this.isPopup) { + this.title.ttip = Calendar._TT["DRAG_TO_MOVE"]; + this.title.style.cursor = "move"; + hh("X", 1, 200).ttip = Calendar._TT["CLOSE"]; + } + + row = Calendar.createElement("tr", thead); + row.className = "headrow"; + + hh("«", 1, -2).ttip = Calendar._TT["PREV_YEAR"]; + hh("‹", 1, -1).ttip = Calendar._TT["PREV_MONTH"]; + hh(Calendar._TT["TODAY"], 3, 0).ttip = Calendar._TT["GO_TODAY"]; + hh("›", 1, 1).ttip = Calendar._TT["NEXT_MONTH"]; + hh("»", 1, 2).ttip = Calendar._TT["NEXT_YEAR"]; + + // day names + row = Calendar.createElement("tr", thead); + row.className = "daynames"; + this.daynames = row; + for (var i = 7; i > 0; --i) { + cell = Calendar.createElement("td", row); + cell.appendChild(document.createTextNode("")); + if (!i) { + cell.navtype = 100; + cell.calendar = this; + Calendar._add_evs(cell); + } + } + this._displayWeekdays(); + + var tbody = Calendar.createElement("tbody", table); + this.tbody = tbody; + + for (i = 6; i > 0; --i) { + row = Calendar.createElement("tr", tbody); + for (var j = 7; j > 0; --j) { + cell = Calendar.createElement("td", row); + cell.appendChild(document.createTextNode("")); + cell.calendar = this; + Calendar._add_evs(cell); + } + } + + var tfoot = Calendar.createElement("tfoot", table); + + row = Calendar.createElement("tr", tfoot); + row.className = "footrow"; + + cell = hh(Calendar._TT["SEL_DATE"], 7, 300); + cell.className = "ttip"; + if (this.isPopup) { + cell.ttip = Calendar._TT["DRAG_TO_MOVE"]; + cell.style.cursor = "move"; + } + this.tooltips = cell; + + div = Calendar.createElement("div", this.element); + this.monthsCombo = div; + div.className = "combo"; + for (i = 0; i < Calendar._MN.length; ++i) { + var mn = Calendar.createElement("div"); + mn.className = "label"; + mn.month = i; + mn.appendChild(document.createTextNode(Calendar._MN3[i])); + div.appendChild(mn); + } + + div = Calendar.createElement("div", this.element); + this.yearsCombo = div; + div.className = "combo"; + for (i = 12; i > 0; --i) { + var yr = Calendar.createElement("div"); + yr.className = "label"; + yr.appendChild(document.createTextNode("")); + div.appendChild(yr); + } + + this._init(this.mondayFirst, this.date); + parent.appendChild(this.element); +}; + +/** + * (RE)Initializes the calendar to the given date and style (if mondayFirst is + * true it makes Monday the first day of week, otherwise the weeks start on + * Sunday. + */ +Calendar.prototype._init = function (mondayFirst, date) { + var today = new Date(); + var year = date.getFullYear(); + if (year < this.minYear) { + year = this.minYear; + date.setFullYear(year); + } else if (year > this.maxYear) { + year = this.maxYear; + date.setFullYear(year); + } + this.mondayFirst = mondayFirst; + this.date = new Date(date); + var month = date.getMonth(); + var mday = date.getDate(); + var no_days = date.getMonthDays(); + date.setDate(1); + var wday = date.getDay(); + var MON = mondayFirst ? 1 : 0; + var SAT = mondayFirst ? 5 : 6; + var SUN = mondayFirst ? 6 : 0; + if (mondayFirst) { + wday = (wday > 0) ? (wday - 1) : 6; + } + var iday = 1; + var row = this.tbody.firstChild; + var MN = Calendar._MN3[month]; + var hasToday = ((today.getFullYear() == year) && (today.getMonth() == month)); + var todayDate = today.getDate(); + for (var i = 0; i < 6; ++i) { + if (iday > no_days) { + row.className = "emptyrow"; + row = row.nextSibling; + continue; + } + var cell = row.firstChild; + row.className = "daysrow"; + for (var j = 0; j < 7; ++j) { + if ((!i && j < wday) || iday > no_days) { + cell.className = "emptycell"; + cell = cell.nextSibling; + continue; + } + cell.firstChild.data = iday; + cell.className = "day"; + cell.disabled = false; + if (typeof this.checkDisabled == "function") { + date.setDate(iday); + if (this.checkDisabled(date)) { + cell.className += " disabled"; + cell.disabled = true; + } + } + if (!cell.disabled) { + cell.caldate = iday; + cell.ttip = "_"; + if (iday == mday) { + cell.className += " selected"; + this.currentDateEl = cell; + } + if (hasToday && (iday == todayDate)) { + cell.className += " today"; + cell.ttip += Calendar._TT["PART_TODAY"]; + } + if (wday == SAT || wday == SUN) { + cell.className += " weekend"; + } + } + ++iday; + ((++wday) ^ 7) || (wday = 0); + cell = cell.nextSibling; + } + row = row.nextSibling; + } + this.title.firstChild.data = Calendar._MN[month] + ", " + year; + // PROFILE + // this.tooltips.firstChild.data = "Generated in " + ((new Date()) - today) + " ms"; +}; + +/** + * Calls _init function above for going to a certain date (but only if the + * date is different than the currently selected one). + */ +Calendar.prototype.setDate = function (date) { + if (!date.equalsTo(this.date)) { + this._init(this.mondayFirst, date); + } +}; + +/** Modifies the "mondayFirst" parameter (EU/US style). */ +Calendar.prototype.setMondayFirst = function (mondayFirst) { + this._init(mondayFirst, this.date); + this._displayWeekdays(); +}; + +/** + * Allows customization of what dates are enabled. The "unaryFunction" + * parameter must be a function object that receives the date (as a JS Date + * object) and returns a boolean value. If the returned value is true then + * the passed date will be marked as disabled. + */ +Calendar.prototype.setDisabledHandler = function (unaryFunction) { + this.checkDisabled = unaryFunction; +}; + +/** Customization of allowed year range for the calendar. */ +Calendar.prototype.setRange = function (a, z) { + this.minYear = a; + this.maxYear = z; +}; + +/** Calls the first user handler (selectedHandler). */ +Calendar.prototype.callHandler = function () { + if (this.onSelected) { + this.onSelected(this, this.date.print(this.dateFormat)); + } +}; + +/** Calls the second user handler (closeHandler). */ +Calendar.prototype.callCloseHandler = function () { + if (this.onClose) { + this.onClose(this); + } + this.hideShowCovered(); +}; + +/** Removes the calendar object from the DOM tree and destroys it. */ +Calendar.prototype.destroy = function () { + var el = this.element.parentNode; + el.removeChild(this.element); + Calendar._C = null; + delete el; +}; + +/** + * Moves the calendar element to a different section in the DOM tree (changes + * its parent). + */ +Calendar.prototype.reparent = function (new_parent) { + var el = this.element; + el.parentNode.removeChild(el); + new_parent.appendChild(el); +}; + +/** Shows the calendar. */ +Calendar.prototype.show = function () { + this.element.style.display = "block"; + this.hideShowCovered(); +}; + +/** + * Hides the calendar. Also removes any "hilite" from the class of any TD + * element. + */ +Calendar.prototype.hide = function () { + var trs = this.table.getElementsByTagName("td"); + for (var i = trs.length; i > 0; ) { + Calendar.removeClass(trs[--i], "hilite"); + } + this.element.style.display = "none"; +}; + +/** + * Shows the calendar at a given absolute position (beware that, depending on + * the calendar element style -- position property -- this might be relative + * to the parent's containing rectangle). + */ +Calendar.prototype.showAt = function (x, y) { + var s = this.element.style; + s.left = x + "px"; + s.top = y + "px"; + this.show(); +}; + +/** Shows the calendar near a given element. */ +Calendar.prototype.showAtElement = function (el) { + var p = Calendar.getAbsolutePos(el); + this.showAt(p.x, p.y + el.offsetHeight); +}; + +/** Customizes the date format. */ +Calendar.prototype.setDateFormat = function (str) { + this.dateFormat = str; +}; + +/** Customizes the tooltip date format. */ +Calendar.prototype.setTtDateFormat = function (str) { + this.ttDateFormat = str; +}; + +/** + * Tries to identify the date represented in a string. If successful it also + * calls this.setDate which moves the calendar to the given date. + */ +Calendar.prototype.parseDate = function (str, fmt) { + var y = 0; + var m = -1; + var d = 0; + var a = str.split(/\W+/); + if (!fmt) { + fmt = this.dateFormat; + } + var b = fmt.split(/\W+/); + var i = 0, j = 0; + for (i = 0; i < a.length; ++i) { + if (b[i] == "D" || b[i] == "DD") { + continue; + } + if (b[i] == "d" || b[i] == "dd") { + d = a[i]; + } + if (b[i] == "m" || b[i] == "mm") { + m = a[i]-1; + } + if (b[i] == "y") { + y = a[i]; + } + if (b[i] == "yy") { + y = parseInt(a[i]) + 1900; + } + if (b[i] == "M" || b[i] == "MM") { + for (j = 0; j < 12; ++j) { + if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } + } + } + } + if (y != 0 && m != -1 && d != 0) { + this.setDate(new Date(y, m, d)); + return; + } + y = 0; m = -1; d = 0; + for (i = 0; i < a.length; ++i) { + if (a[i].search(/[a-zA-Z]+/) != -1) { + var t = -1; + for (j = 0; j < 12; ++j) { + if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } + } + if (t != -1) { + if (m != -1) { + d = m+1; + } + m = t; + } + } else if (parseInt(a[i]) <= 12 && m == -1) { + m = a[i]-1; + } else if (parseInt(a[i]) > 31 && y == 0) { + y = a[i]; + } else if (d == 0) { + d = a[i]; + } + } + if (y == 0) { + var today = new Date(); + y = today.getFullYear(); + } + if (m != -1 && d != 0) { + this.setDate(new Date(y, m, d)); + } +}; + +Calendar.prototype.hideShowCovered = function () { + var tags = new Array("applet", "iframe", "select"); + var el = this.element; + + var p = Calendar.getAbsolutePos(el); + var EX1 = p.x; + var EX2 = el.offsetWidth + EX1; + var EY1 = p.y; + var EY2 = el.offsetHeight + EY1; + + for (var k = tags.length; k > 0; ) { + var ar = document.getElementsByTagName(tags[--k]); + var cc = null; + + for (var i = ar.length; i > 0;) { + cc = ar[--i]; + + p = Calendar.getAbsolutePos(cc); + var CX1 = p.x; + var CX2 = cc.offsetWidth + CX1; + var CY1 = p.y; + var CY2 = cc.offsetHeight + CY1; + + if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { + cc.style.visibility = "visible"; + } else { + cc.style.visibility = "hidden"; + } + } + } +}; + +/** Internal function; it displays the bar with the names of the weekday. */ +Calendar.prototype._displayWeekdays = function () { + var MON = this.mondayFirst ? 0 : 1; + var SUN = this.mondayFirst ? 6 : 0; + var SAT = this.mondayFirst ? 5 : 6; + var cell = this.daynames.firstChild; + for (var i = 0; i < 7; ++i) { + cell.className = "day name"; + if (!i) { + cell.ttip = this.mondayFirst ? Calendar._TT["SUN_FIRST"] : Calendar._TT["MON_FIRST"]; + cell.navtype = 100; + cell.calendar = this; + Calendar._add_evs(cell); + } + if (i == SUN || i == SAT) { + Calendar.addClass(cell, "weekend"); + } + cell.firstChild.data = Calendar._DN3[i + 1 - MON]; + cell = cell.nextSibling; + } +}; + +/** Internal function. Hides all combo boxes that might be displayed. */ +Calendar.prototype._hideCombos = function () { + this.monthsCombo.style.display = "none"; + this.yearsCombo.style.display = "none"; +}; + +/** Internal function. Starts dragging the element. */ +Calendar.prototype._dragStart = function (ev) { + if (this.dragging) { + return; + } + this.dragging = true; + var posX; + var posY; + if (Calendar.is_ie) { + posY = window.event.clientY + document.body.scrollTop; + posX = window.event.clientX + document.body.scrollLeft; + } else { + posY = ev.clientY + window.scrollY; + posX = ev.clientX + window.scrollX; + } + var st = this.element.style; + this.xOffs = posX - parseInt(st.left); + this.yOffs = posY - parseInt(st.top); + with (Calendar) { + addEvent(document, "mousemove", calDragIt); + addEvent(document, "mouseover", stopEvent); + addEvent(document, "mouseup", calDragEnd); + } +}; + +// BEGIN: DATE OBJECT PATCHES + +/** Adds the number of days array to the Date object. */ +Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); + +/** Returns the number of days in the current month */ +Date.prototype.getMonthDays = function() { + var year = this.getFullYear(); + var month = this.getMonth(); + if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { + return 29; + } else { + return Date._MD[month]; + } +}; + +/** Checks dates equality (ignores time) */ +Date.prototype.equalsTo = function(date) { + return ((this.getFullYear() == date.getFullYear()) && + (this.getMonth() == date.getMonth()) && + (this.getDate() == date.getDate())); +}; + +/** Prints the date in a string according to the given format. */ +Date.prototype.print = function (frm) { + var str = new String(frm); + var m = this.getMonth(); + var d = this.getDate(); + var y = this.getFullYear(); + var w = this.getDay(); + var s = new Array(); + s["d"] = d; + s["dd"] = (d < 10) ? ("0" + d) : d; + s["m"] = 1+m; + s["mm"] = (m < 9) ? ("0" + (1+m)) : (1+m); + s["y"] = y; + s["yy"] = new String(y).substr(2, 2); + with (Calendar) { + s["D"] = _DN3[w]; + s["DD"] = _DN[w]; + s["M"] = _MN3[m]; + s["MM"] = _MN[m]; + } + var re = /(.*)(\W|^)(d|dd|m|mm|y|yy|MM|M|DD|D)(\W|$)(.*)/; + while (re.exec(str) != null) { + str = RegExp.$1 + RegExp.$2 + s[RegExp.$3] + RegExp.$4 + RegExp.$5; + } + return str; +}; + +// END: DATE OBJECT PATCHES Index: trunk/admin/images/toolbar/tool_stop_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_in-portal.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/msn/angry_smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/devil.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-error.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-error.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-error.inc.php (revision 13) @@ -0,0 +1,238 @@ + DB_ERROR_NOSUCHTABLE, + '/Relation [\"\'].*[\"\'] already exists|Cannot insert a duplicate key into (a )?unique index.*/' => DB_ERROR_ALREADY_EXISTS, + '/divide by zero$/' => DB_ERROR_DIVZERO, + '/pg_atoi: error in .*: can\'t parse /' => DB_ERROR_INVALID_NUMBER, + '/ttribute [\"\'].*[\"\'] not found$|Relation [\"\'].*[\"\'] does not have attribute [\"\'].*[\"\']/' => DB_ERROR_NOSUCHFIELD, + '/parser: parse error at or near \"/' => DB_ERROR_SYNTAX, + '/referential integrity violation/' => DB_ERROR_CONSTRAINT + ); + + foreach ($error_regexps as $regexp => $code) { + if (preg_match($regexp, $errormsg)) { + return $code; + } + } + // Fall back to DB_ERROR if there was no mapping. + return DB_ERROR; +} + +function adodb_error_odbc() +{ +static $MAP = array( + '01004' => DB_ERROR_TRUNCATED, + '07001' => DB_ERROR_MISMATCH, + '21S01' => DB_ERROR_MISMATCH, + '21S02' => DB_ERROR_MISMATCH, + '22003' => DB_ERROR_INVALID_NUMBER, + '22008' => DB_ERROR_INVALID_DATE, + '22012' => DB_ERROR_DIVZERO, + '23000' => DB_ERROR_CONSTRAINT, + '24000' => DB_ERROR_INVALID, + '34000' => DB_ERROR_INVALID, + '37000' => DB_ERROR_SYNTAX, + '42000' => DB_ERROR_SYNTAX, + 'IM001' => DB_ERROR_UNSUPPORTED, + 'S0000' => DB_ERROR_NOSUCHTABLE, + 'S0001' => DB_ERROR_NOT_FOUND, + 'S0002' => DB_ERROR_NOSUCHTABLE, + 'S0011' => DB_ERROR_ALREADY_EXISTS, + 'S0012' => DB_ERROR_NOT_FOUND, + 'S0021' => DB_ERROR_ALREADY_EXISTS, + 'S0022' => DB_ERROR_NOT_FOUND, + 'S1000' => DB_ERROR_NOSUCHTABLE, + 'S1009' => DB_ERROR_INVALID, + 'S1090' => DB_ERROR_INVALID, + 'S1C00' => DB_ERROR_NOT_CAPABLE + ); + return $MAP; +} + +function adodb_error_ibase() +{ +static $MAP = array( + -104 => DB_ERROR_SYNTAX, + -150 => DB_ERROR_ACCESS_VIOLATION, + -151 => DB_ERROR_ACCESS_VIOLATION, + -155 => DB_ERROR_NOSUCHTABLE, + -157 => DB_ERROR_NOSUCHFIELD, + -158 => DB_ERROR_VALUE_COUNT_ON_ROW, + -170 => DB_ERROR_MISMATCH, + -171 => DB_ERROR_MISMATCH, + -172 => DB_ERROR_INVALID, + -204 => DB_ERROR_INVALID, + -205 => DB_ERROR_NOSUCHFIELD, + -206 => DB_ERROR_NOSUCHFIELD, + -208 => DB_ERROR_INVALID, + -219 => DB_ERROR_NOSUCHTABLE, + -297 => DB_ERROR_CONSTRAINT, + -530 => DB_ERROR_CONSTRAINT, + -803 => DB_ERROR_CONSTRAINT, + -551 => DB_ERROR_ACCESS_VIOLATION, + -552 => DB_ERROR_ACCESS_VIOLATION, + -922 => DB_ERROR_NOSUCHDB, + -923 => DB_ERROR_CONNECT_FAILED, + -924 => DB_ERROR_CONNECT_FAILED + ); + + return $MAP; +} + +function adodb_error_ifx() +{ +static $MAP = array( + '-201' => DB_ERROR_SYNTAX, + '-206' => DB_ERROR_NOSUCHTABLE, + '-217' => DB_ERROR_NOSUCHFIELD, + '-329' => DB_ERROR_NODBSELECTED, + '-1204' => DB_ERROR_INVALID_DATE, + '-1205' => DB_ERROR_INVALID_DATE, + '-1206' => DB_ERROR_INVALID_DATE, + '-1209' => DB_ERROR_INVALID_DATE, + '-1210' => DB_ERROR_INVALID_DATE, + '-1212' => DB_ERROR_INVALID_DATE + ); + + return $MAP; +} + +function adodb_error_oci8() +{ +static $MAP = array( + 900 => DB_ERROR_SYNTAX, + 904 => DB_ERROR_NOSUCHFIELD, + 923 => DB_ERROR_SYNTAX, + 942 => DB_ERROR_NOSUCHTABLE, + 955 => DB_ERROR_ALREADY_EXISTS, + 1476 => DB_ERROR_DIVZERO, + 1722 => DB_ERROR_INVALID_NUMBER, + 2289 => DB_ERROR_NOSUCHTABLE, + 2291 => DB_ERROR_CONSTRAINT, + 2449 => DB_ERROR_CONSTRAINT, + ); + + return $MAP; +} + +function adodb_error_mssql() +{ +static $MAP = array( + 208 => DB_ERROR_NOSUCHTABLE, + 2601 => DB_ERROR_ALREADY_EXISTS + ); + + return $MAP; +} + +function adodb_error_mysql() +{ +static $MAP = array( + 1004 => DB_ERROR_CANNOT_CREATE, + 1005 => DB_ERROR_CANNOT_CREATE, + 1006 => DB_ERROR_CANNOT_CREATE, + 1007 => DB_ERROR_ALREADY_EXISTS, + 1008 => DB_ERROR_CANNOT_DROP, + 1046 => DB_ERROR_NODBSELECTED, + 1050 => DB_ERROR_ALREADY_EXISTS, + 1051 => DB_ERROR_NOSUCHTABLE, + 1054 => DB_ERROR_NOSUCHFIELD, + 1062 => DB_ERROR_ALREADY_EXISTS, + 1064 => DB_ERROR_SYNTAX, + 1100 => DB_ERROR_NOT_LOCKED, + 1136 => DB_ERROR_VALUE_COUNT_ON_ROW, + 1146 => DB_ERROR_NOSUCHTABLE, + 1048 => DB_ERROR_CONSTRAINT, + ); + + return $MAP; +} +?> \ No newline at end of file Index: trunk/admin/images/smicon6.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/langpacks/english.lang =================================================================== diff -u --- trunk/admin/install/langpacks/english.lang (revision 0) +++ trunk/admin/install/langpacks/english.lang (revision 13) @@ -0,0 +1,1573 @@ +m/d/Yg:i:s A.,U2VhcmNoIFJlc3VsdHM= +Tm8gQ2F0ZWdvcmllcw== +Tm8gTGlua3M= +QWRkZWQ= +Q2F0ZWdvcnk= +RGF0ZSBjcmVhdGVk +TW9kaWZ5 +SGl0cw== +Tm8= +UmF0ZSBUaGlzIExpbms= +UmF0aW5n +UmV2aWV3cw== +Vm90ZXM= +WWVz +Q2F0ZWdvcnk= +T2s= +UmF0ZQ== +U2VhcmNo +Q2F0ZWdvcmllcw== +TGlua3M= +VG90YWwgbGlua3MgaW4gdGhlIGRhdGFiYXNl +QWR2YW5jZWQgU2VhcmNo +TG9naW4= +Tm90IGxvZ2dlZCBpbg== +UGFzc3dvcmQ= +UmVnaXN0ZXI= +U2VhcmNo +UGFnZTo= +UmVsYXRlZCBDYXRlZ29yaWVz +VGhlIGxpbmsgd2FzIHN1Y2Nlc3NmdWxseSByZW1vdmVkIGZyb20gIEZhdm9yaXRlcy4= +U3ViamVjdA== +RGlyZWN0b3J5 +Rm9ydW1z +UmVwbGllcw== +UG9zdGVy +Vmlld3M= +TmV3cw== +UG9zdGVk +QXV0aG9y +TWVzc2FnZSBCb2R5 +TW9kaWZ5IFRvcGlj +T3B0aW9ucw== +U2VlIEFsc28= +QWRkIExpbms= +TGluayBOYW1l +Sm9pbg== +TG9naW4gTmFtZQ== +UGhvbmU= +QU9MIElN +U3RyZWV0 +U3RyZWV0IDI= +Q2l0eQ== +U3RhdGU= +Wmlw +Q291bnRyeQ== +Tm8gUmVsYXRlZCBDYXRlZ29yaWVz +RW5kIE9u +RW5hYmxlZA== +TG9nIE91dA== +Tm8gQXJ0aWNsZXM= +RGF0ZQ== +TW9yZQ== +UmVwbHk= +VG9waWNz +T3JkZXIgdG9waWNzIGJ5 +QXNjZW5kaW5n +RGVzY2VuZGluZw== +T3JkZXIgVG9waWNzIEJ5 +QW5kIHRoZW4gYnk= +QW5kIHRoZW4gYnk= +TmV3IFRvcGljcyAoRGF5cyk= +TnVtYmVyIG9mIHRvcGljcyBwZXIgcGFnZQ== +TnVtYmVyIG9mIHBvc3RzIHRvIGJlIGNvbnNpZGVyZWQgcG9wdWxhcg== +TWluaW11bSByYXRpbmcgdG8gYmUgY29uc2lkZXJlZCBob3Q= +RGlzcGxheSBlZGl0b3IgcGlja3MgYWJvdmUgcmVndWxhciB0b3BpY3M= +TnVtYmVyIG9mIHBvc3RzIHBlciBwYWdl +TmV3IHBvc3RzIChkYXlzKQ== +U3RydWN0dXJlICYgRGF0YQ== +Q2F0YWxvZw== +VXAgYSBDYXRlZ29yeQ== +TmV3IFNlYXJjaA== +Q2xlYXIgU2VhcmNo +Q2F0ZWdvcmllcw== +Q2F0ZWdvcmllcw== +VG9waWNz +TGlua3M= +QXJ0aWNsZXM= +U2VhcmNoIENhdGVnb3JpZXM= +U2VhcmNoIFRvcGljcw== +U2VhcmNoIExpbmtz +U2VhcmNoIEFydGljbGVz +Q2F0ZWdvcmllcw== +TGlua3M= +VG9waWNz +QXJ0aWNsZXM= +UmVsYXRpb25z +UGFnZQ== +TmV3IFJlbGF0aW9u +RWRpdA== +RGVsZXRl +TW92ZSBVcA== +TW92ZSBEb3du +U2VsZWN0IEl0ZW0= +SG9tZQ== +U2VsZWN0 +Q2FuY2Vs +RWRpdGluZw== +Q2F0ZWdvcnk= +dG8= +R2VuZXJhbA== +SW1hZ2Vz +SW1hZ2U= +TmFtZQ== +SW1hZ2U= +QWx0IFZhbHVl +VVJM +U3RhdHVz +UHJldmlldw== +U2F2ZQ== +RnVsbCBTaXplIEltYWdl +U2l6ZQ== +QWx0IHZhbHVl +RW5hYmxlZA== +RGVmYXVsdA== +TG9jYXRpb24= +UmVtb3RlIFVSTA== +U2FtZQ== +YXM= +VGh1bWJuYWls +VVJM +Q2F0YWxvZw== +U2F2ZQ== +Q3JlYXRlZCBvbg== +RGVzY3JpcHRpb24= +UGVuZGluZw== +VmlzaWJsZQ== +TWV0YSBLZXl3b3Jkcw== +TWV0YSBEZXNjcmlwdGlvbg== +TUVUQSBJbmZvcm1hdGlvbg== +RW5hYmxlIEhUTUw/ +V2FybmluZzogRW5hYmxpbmcgSFRNTCBpcyBhIHNlY3VyaXR5IHJpc2sgYW5kIGNvdWxkIGRhbWFnZSB0aGUgc3lzdGVtIGlmIHVzZWQgaW1wcm9wZXJseSE= +RmllbGQgTmFtZQ== +TGFiZWw= +VmFsdWU= +Q3VzdG9t +U2VsZWN0IEdyb3Vw +UGVybWlzc2lvbnM= +Zm9y +UGVybWlzc2lvbg== +SW5oZXJpdGVk +QWNjZXNz +VHlwZQ== +Q2FuY2Vs +Q2F0ZWdvcnkgSUQ= +SW1hZ2UgSUQ= +UHJpb3JpdHk= +UmVsYXRpb24gSUQ= +VG9waWM= +U2l0ZSBTdHJ1Y3R1cmU= +U2l0ZSBTdHJ1Y3R1cmU= +QXJ0aWNsZQ== +UmV2aWV3cw== +TGluaw== +U2l0ZSBTdHJ1Y3R1cmU= +TmV3IEltYWdl +UmF0aW5n +Vm90ZXM= +SGl0cw== +Q291bnRlcnM= +KG1tLWRkLXl5eXkp +KE1pbmltdW0gMCwgTWF4aW11bSA1KQ== +KE1pbmltdW0gMSk= +KE1pbmltdW0gNCk= +R2VuZXJhdGUgZnJvbSB0aGUgYXJ0aWNsZSBib2R5 +VGl0bGU= +QXV0aG9y +QXJ0aWNsZSBCb2R5 +RWRpdG9y +QXJ0aWNsZSBFeGNlcnB0 +RnJvbnQgcGFnZSBsZWFkIGFydGljbGU= +Q2F0ZWdvcnkgbGVhZCBhcnRpY2xl +QXJjaGl2ZWQ= +QXJjaGl2YXRpb24gRGF0ZQ== +QXJ0aWNsZSBFeGNlcnB0 +Q2F0ZWdvcmllcw== +VG9waWM= +UG9zdGVy +RGF0ZS9UaW1l +UmVwbGllcw== +Vmlld3M= +Q29tbXVuaXR5 +TW9kdWxlcyAmIFNldHRpbmdz +U3VtbWFyeSAmIExvZ3M= +Q29uZmlndXJhdGlvbg== +VG9vbHM= +SGVscA== +VXNlcnM= +U2VhcmNoIFVzZXJz +U2VhcmNoIEdyb3Vwcw== +TWFpbCBMaXN0 +R3JvdXBz +SW4tYnVsbGV0aW4= +T3V0cHV0IFNldHRpbmdz +U2VhcmNoIFNldHRpbmdz +Q2Vuc29yc2hpcA== +Q2Vuc29yc2hpcA== +VG9waWNz +U3RhdGlzdGljcw== +U2VhcmNoIExvZw== +VGhlbWVz +UmVnaW9uYWw= +QmFja3Vw +UmVzdG9yZQ== +RXhwb3J0IERhdGE= +SW1wb3J0IERhdGE= +T3ZlcnZpZXc= +U21pbGV5cw== +TmV3IENhdGVnb3J5 +TWFpbiBNZW51 +QXBwcm92ZQ== +RGVjbGluZQ== +Q3V0 +Q29weQ== +UGFzdGU= +UHJpbnQ= +Vmlldw== +RmlsdGVy +U29ydA== +U2VsZWN0 +U2VhcmNo +QWxs +TmV3 +UG9wdWxhcg== +SG90 +UGVuZGluZw== +RGlzYWJsZWQ= +RGVmYXVsdA== +VW5zZWxlY3Q= +SW52ZXJ0 +U2VhcmNo +U3ViIFNlYXJjaA== +V2l0aGlu +Q3VycmVudA== +SW4tTGluayBTUUwgVHlwZQ== +SW4tTGluayBTZXJ2ZXIgTmFtZQ== +SW4tTGluayBEYXRhYmFzZSBOYW1l +SW4tTGluayBEYXRhYmFzZSBVc2VybmFtZQ== +SW4tTGluayBEYXRhYmFzZSBQYXNzd29yZA== +UmVndWxhciBVc2VyIElE +SW5pdGlhbCBJbXBvcnQgQ2F0ZWdvcnk= +TGluayBwZXJtaXNzaW9uIElEIGZvciBhbGwgcmVnaXN0ZXJlZCB1c2VycyB0byB2aWV3IGl0 +TGluayBwZXJtaXNzaW9uIElEIGZvciBhbGwgdW5yZWdpc3RlcmVkIHVzZXJzIHRvIHZpZXcgaXQ= +SW1wb3J0IERhdGE= +RS1tYWlsIFNldHRpbmdz +Q3VzdG9tIEZpZWxkcw== +QmFja3Vw +UmVzdG9yZQ== +RXhwb3J0IERhdGE= +U2VhcmNoIExvZw== +UGxlYXNlIGNoZWNrIHRoZSByZXF1aXJlZCBmaWVsZHMgYW5kIHRyeSBhZ2FpbiE= +UmVxdWlyZWQgRmllbGQ= +U2VhcmNo +RWRpdA== +RGVsZXRl +TmV3IExpbms= +TmV3IEFydGljbGU= +VXNlcnM= +VXNlcm5hbWU= +TGFzdCBOYW1l +Rmlyc3QgTmFtZQ== +RW1haWw= +UHJpbWFyeSBHcm91cA== +R3JvdXAgTmFtZQ== +VXNlciBDb3VudA== +U2VhcmNo +TmV3IFVzZXI= +RGVueQ== +VmFsaWQ= +TGFzdCBOYW1l +Rmlyc3QgTmFtZQ== +RWRpdCBVc2Vy +VXNlcg== +R3JvdXBz +VXNlcm5hbWU= +UGFzc3dvcmQ= +UmVwZWF0IFBhc3N3b3Jk +UGhvbmU= +U3RyZWV0 +Q2l0eQ== +U3RhdGU= +Wmlw +Q291bnRyeQ== +UGVyc29uYWwgSW5mb3JtYXRpb24= +UHJvcGVydGllcw== +TmV3IEdyb3Vw +U2ltcGxlIFNlYXJjaA== +Q29tbWVudHM= +R3JvdXA= +RWRpdCBHcm91cA== +VXNlcnM= +SW52YWxpZCBVc2VybmFtZQ== +SW52YWxpZCBQYXNzd29yZA== +Q3VzdG9tIEZpZWxkcw== +QWR2YW5jZWQgU2VhcmNo +UG9zdCBCb2R5 +UG9zdHM= +QWRkIFJldmlldw== +Q2Vuc29yc2hpcA== +Q2Vuc29yZWQgV29yZA== +UmVwbGFjZW1lbnQ= +TmV3IENlbnNvciBXb3Jk +RW1vdGlvbiBJY29ucw== +S2V5IFN0cm9rZQ== +SW1hZ2U= +TmV3IEVtb3Rpb24gSWNvbg== +U21pbGV5 +RW1vdGlvbiBJZA== +VXBsb2Fk +SG9tZQ== +TmV3IEN1c3RvbSBGaWVsZA== +Q2Vuc29yc2hpcA== +Q2Vuc29yc2hpcCBJZA== +Q2Vuc29yc2hpcCBXb3Jk +UmVwbGFjZW1lbnQgV29yZA== +U3VnZ2VzdCBDYXRlZ29yeQ== +TXkgUHJvZmlsZQ== +QWRkIHRvIEZhdm9yaXRlcw== +U3VnZ2VzdCBMaW5r +U3RydWN0dXJlICYgRGF0YQ== +Q29tbXVuaXR5 +TW9kdWxlcyAmIFNldHRpbmdz +Q29uZmlndXJhdGlvbg== +VG9vbHM= +SGVscA== +TmV4dA== +UHJldmlvdXM= +Q2F0ZWdvcnkgU2VsZWN0 +UmV2aWV3IFRleHQ= +UmV2aWV3ZWQgQnk= +Tm90aWZ5IE93bmVy +Q3JlYXRlZCBhdA== +TW9kaWZpZWQgT24= +TW9kaWZpZWQgYXQ= +KGhoOm1tOnNzKQ== +TmV3IFJldmlldw== +SXRlbQ== +SXRlbSBUeXBl +UmVsYXRpb24gVHlwZQ== +U3RhdHVz +T25lIFdheQ== +RW5hYmxlZA== +U29ydCB0b3BpY3MgYnk= +YW5kIHRoZW4gYnk= +TmV3IENlbnNvciBXb3Jk +Q3VzdG9tIEZpZWxk +cG9zdA== +TmV3IEZpZWxk +RmllbGQgSWQ= +RmllbGQgTmFtZQ== +RmllbGQgTGFiZWw= +RGF0YSBUeXBlIDI= +QW5kIHRoZW4gYnk= +U2VuZCBFLW1haWw= +UmV2aWV3IElE +Q3JlYXRlZCBieQ== +UmVjaXByb2NhbA== +U0FNUExFIFRFWFQ= +R2VuZXJhbA== +T3JkZXIgY2F0ZWdvcmllcyBieQ== +QW5kIHRoZW4gYnk= +TnVtYmVyIG9mIGNhdGVnb3JpZXMgcGVyIHBhZ2U= +TnVtYmVyIG9mIGRheXMgZm9yIGEgY2F0LiB0byBiZSBORVc= +RGlzcGxheSBlZGl0b3IgUElDS3MgYWJvdmUgcmVndWxhciBjYXRlZ29yaWVz +RGVmYXVsdCBNRVRBIGtleXdvcmRz +RGVmYXVsdCBNRVRBIEtleXdvcmRz +RGVmYXVsdCBNRVRBIGRlc2NyaXB0aW9u +QXJ0aWNsZXM= +T3JkZXIgYXJ0aWNsZXMgYnk= +QW5kIHRoZW4gYnk= +TnVtYmVyIG9mIGFydGljbGVzIHBlciBwYWdl +TnVtYmVyIG9mIGRheXMgZm9yIGEgYXJ0aWNsZSB0byBiZSBORVc= +TWluaW11bSByYXRpbmcgZm9yIGEgYXJ0aWNsZSB0byBiZSBIT1Q= +TnVtYmVyIG9mIGNsaWNrcyBmb3IgYW4gYXJ0aWNsZSB0byBiZSBIT1Q= +RGlzcGxheSBlZGl0b3IgUElDS3MgYWJvdmUgcmVndWxhciBhcnRpY2xlcw== +TnVtYmVyIG9mIGRheXMgdG8gYXJjaGl2ZSBhcnRpY2xlcyBhdXRvbWF0aWNhbGx5 +UmV2aWV3cw== +U29ydCByZXZpZXdzIGJ5 +QW5kIHRoZW4gYnk= +TGlua3M= +T3JkZXIgbGlua3MgYnk= +QW5kIHRoZW4gYnk= +TnVtYmVyIG9mIGxpbmtzIHBlciBwYWdl +TnVtYmVyIG9mIGRheXMgZm9yIGEgbGluayB0byBiZSBORVc= +TWluaW11bSByYXRpbmcgZm9yIGEgbGluayB0byBiZSBUT1A= +RGlzcGxheSBlZGl0b3IgUElDS3MgYWJvdmUgcmVndWxhciBsaW5rcw== +RGlzcGxheSBsaW5rIFVSTCBpbiBzdGF0dXMgYmFy +U29ydCByZXZpZXdzIGJ5 +YW5kIHRoZW4gYnk= +Q2F0ZWdvcnkgTmFtZQ== +Q2F0ZWdvcnkgRGVzY3JpcHRpb24= +QXJ0aWNsZSBUaXRsZQ== +QXJ0aWNsZSBFeGNlcnB0 +TGluayBOYW1l +TGluayBEZXNjcmlwdGlvbg== +VG9waWMgVGV4dA== +TnVtYmVyIG9mIFBvc3Rz +U3RhdHVz +Q29uZmlndXJhdGlvbg== +VGhlbWU= +R2VuZXJhbCBDb25maWd1cmF0aW9u +TmV3IFRoZW1l +VGhlbWUgSWQ= +UHJpbWFyeQ== +U3VtbWFyeSAmIExvZ3M= +U3VtbWFyeQ== +U2Vzc2lvbiBMb2c= +U2V0dGluZ3M= +UGFjayBOYW1l +UGFjaw== +TG9jYWwgTmFtZQ== +TGFuZ3VhZ2UgSWQ= +TGFiZWxz +VGVtcGxhdGVz +RGF0ZQ== +UmV2aWV3IFRleHQ= +UGljaw== +Vmlld3M= +QW5kIHRoZW4gYnk= +VVJM +RGF0ZQ== +SGl0cw== +UmF0aW5n +bGlua3M= +QXV0aG9y +RGF0ZQ== +SGl0cw== +UmF0aW5n +U3VtbWFyeQ== +R3Vlc3QgVXNlcnM= +RXhwaXJlZA== +SVAgQWRkcmVzcw== +UmVmcmVzaA== +UmVzZXQ= +U2Vzc2lvbiBMb2c= +R3Vlc3Q= +RGF0ZQ== +UGljaw== +UG9wdWxhcml0eQ== +TW9kdWxl +VGVtcGxhdGU= +VHlwZQ== +QnVpbHQgSW4= +VGVtcGxhdGU= +TmV3 +SG90 +UG9wdWxhcml0eQ== +QWN0aXZl +UGVuZGluZw== +RGlzYWJsZWQ= +TmV2ZXI= +QWx3YXlz +QXV0bw== +U3RhcnQgRGF0ZQ== +QWN0aXZl +Vmlldw== +TWluaW11bSBWb3Rlcw== +SW4tbGluaw== +SW4tbmV3eg== +UHJldmlldw== +TmV3IFRlbXBsYXRl +TmV4dCBUaGVtZQ== +UHJldmlvdXMgVGhlbWU= +TmV3IExhbmd1YWdlIFBhY2s= +TmV3IFRoZW1l +U2VuZA== +RW1haWw= +R3JvdXBz +RW1haWwgTWVzc2FnZQ== +RW1haWwgU3ViamVjdA== +RW1haWwgQm9keQ== +TXkgQWNjb3VudA== +Ynk= +UGVyIFBhZ2U= +VXNlciBSZWNlaXZlcyBOb3RpY2VzIFdoZW4= +QWRtaW5pc3RyYXRvciBSZWNlaXZlIE5vdGljZXMgV2hlbg== +VG90YWwgTGlua3M= +QWN0aXZlIEFydGljbGVz +QWN0aXZlIFRvcGljcw== +UGVuZGluZyBJdGVtcw== +U3RlcA== +RGF0YWJhc2UgU2V0dGluZ3MgLSBJbnRlY2huaWMgSW4tTGluayAyLng= +V2FybmluZyE= +SSBhZ3JlZSB0byB0aGUgdGVybXMgYW5kIGNvbmRpdGlvbnM= +U3ViQ2F0cw== +UmVsYXRpb25z +UmVsYXRpb24= +SXRlbQ== +Q2F0ZWdvcnkgUGVybWlzc2lvbnM= +UHJvcGVydGllcw== +TGluayBJZA== +UmV2aWV3 +RW5hYmxlZA== +VXNlciBTZWxlY3Q= +QWRkaW5n +Vmlld3M= +Q2F0YWxvZw== +TG9jYWw= +U3ViSXRlbXM= +RmllbGRz +TG9nZ2VkIGluIGFz +SW1hZ2Vz +TG9ja2Vk +VGh1bWJuYWlsIEltYWdl +U2FtZSBhcyB0aHVtYm5haWw= +TWFuYWdlIHRoZSBzdHJ1Y3R1cmUgb2YgeW91ciBzaXRlLCBpbmNsdWRpbmcgY2F0ZWdvcmllcywgaXRlbXMgYW5kIGNhdGVvZ3J5IHNldHRpbmdzLg== +TWFuYWdlIHVzZXJzIGFuZCBncm91cHMsIHNldCB1c2VyICYgZ3JvdXAgcGVybWlzc2lvbnMgYW5kIGRlZmluZSB1c2VyIHNldHRpbmdzLg== +TWFuYWdlIHNldHRpbmdzIG9mIGFsbCBtb2R1bGVzIHdoaWNoIGFyZSBpbnN0YWxsZWQgb24geW91ciBJbi1wb3J0YWwgc3lzdGVtLg== +VmlldyBzeXN0ZW0gc3RhdGlzdGljcywgbG9ncyBhbmQgcmVwb3J0cw== +SGVscCBzZWN0aW9uIGZvciBJbi1wb3J0YWwgYW5kIGFsbCBvZiBpdHMgbW9kdWxlcy4gQWxzbyBhY2Nlc3NpYmxlIHZpYSB0aGUgc2VjdGlvbi1zcGVjaWZpYyBpbnRlcmFjaXZlIGhlbHAgZmVhdHVyZS4= +VXNlIHZhcmlvdXMgSW4tcG9ydGFsIGRhdGEgbWFuYWdlbWVudCB0b29scywgaW5jbHVkaW5nIGJhY2t1cCwgcmVzdG9yZSwgaW1wb3J0IGFuZCBleHBvcnQ= +TWFuYWdlIHN5c3RlbS13aWRlIHNldHRpbmdzLCBlZGl0IHRoZW1lcyBhbmQgbGFuZ3VhZ2Vz +Tm9uZQ== +VmlldyBDYXRlZ29yeQ== +TW9kaWZ5IENhdGVnb3J5 +QWRkIENhdGVnb3J5 +TmV3IFBlcm1pc3Npb24= +RGVsZXRlIENhdGVnb3J5 +QWRkIFBlbmRpbmcgQ2F0ZWdvcnk= +QWRkIExpbms= +VmlldyBMaW5r +UGVuZGluZyBMaW5r +TW9kaWZ5IExpbms= +RGVsZXRlIExpbms= +UmF0ZSBMaW5r +UmV2aWV3IExpbms= +VmlldyBUb3BpYw== +QWRkIFRvcGlj +QWRkIFBlbmRpbmcgVG9waWM= +RGVsZXRlIFRvcGlj +TW9kaWZ5IFRvcGlj +RGVsZXRlIFRvcGlj +VmlldyBUb3BpYyBSZXBseQ== +QWRkIFRvcGljIFJlcGx5 +UmF0ZSBUb3BpYw== +UmV2aWV3IFRvcGlj +UmF0ZSBOZXdz +UmVwbHkgVG9waWMgTW9kaWZ5 +UmV2aWV3IE5ld3M= +VmlldyBOZXdz +QWRkIE5ld3M= +RGVsZXRlIE5ld3M= +TW9kaWZ5IE5ld3M= +QWRkIFBlbmRpbmcgTmV3cw== +U2VuZCBlLW1haWw= +VG8= +U3ViamVjdA== +QXR0YWNobWVudA== +TWVzc2FnZQ== +Y2F0ZWdvcmllcw== +U2VhcmNoIFJlc3VsdHM= +Tm8gcGVybWlzc2lvbnM= +QmxhbmsgdXNlcm5hbWUgb3IgcGFzc3dvcmQ= +RnVsbA== +R3JvdXAgTmFtZQ== +VXNlciBDb3VudA== +VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIGdlbmVyYWwgY2F0ZWdvcnkgc2V0dGluZ3M= +VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIGNhdGVnb3J5IGN1c3RvbSBmaWVsZHM= +UHJpbWFyeQ== +VG9waWMgSUQ= +UG9zdGVkIGJ5 +VGhpcyBzZWN0aW9ucyBhbGxvd3MgdG8gbWFuYWdlIHVzZXJzLCB0aGVpciBwZXJtaXNzaW9ucyBhbmQgcGVyZm9ybSBtYXNzIGVtYWls +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYWdhbmUgZ3JvdXBzLCBhc3NpZ24gdXNlcnMgdG8gZ3JvdXBzIGFuZCBwZXJmb3JtIG1hc3MgZW1haWwgc2VuZGluZw== +Q2F0ZWdvcmllcw== +R2VuZXJhbCBTZXR0aW5ncw== +QWxsb3cgbmV3IHVzZXIgcmVnaXN0cmF0aW9u +VmFsaWRhdGUgZS1tYWlsIGFkZHJlc3M= +QXNzaWduIHBhc3N3b3JkIGF1dG9tYXRpY2FsbHk= +UmVzdHJpY3Rpb25z +TnVtYmVyIG9mIGRheXMgdG8gZGVueSBtdWx0aXBsZSB2b3RlcyBmcm9tIHRoZSBzYW1lIHVzZXI= +TnVtYmVyIG9mIGRheXMgdG8gZGVueSBtdWx0aXBsZSByZXZpZXdzIGZyb20gdGhlIHNhbWUgdXNlcg== +SW5zdGFudA== +Tm90IEFsbG93ZWQ= +VXBvbiBBcHByb3ZhbA== +U2VhcmNoIFR5cGU= +S2V5d29yZA== +RnJlcXVlbmN5 +UGFyYW1ldGVy +VmFsdWU= +VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIGdlbmVyYWwgdXNlciBzZXR0aW5ncw== +VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gY29uZmlndXJlIHVzZXIgY3VzdG9tIGZpZWxkcw== +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbGluayBzZXR0aW5ncw== +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBzZXR0aW5ncw== +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tQnVsbGV0aW4gc2V0dGluZ3M= +U2VydmVyIE5hbWU= +U2VydmVyIFBhdGg= +V2ViIGFkZHJlc3M= +TGFiZWw= +UHJpbWFyeSBWYWx1ZQ== +QWRtaW4= +RnJvbnQ= +TGFiZWw= +UGhyYXNlIElk +UGhyYXNlIFR5cGU= +Qm90aA== +R2VuZXJhbCBTZXR0aW5ncw== +TGljZW5jZQ== +TmFtZQ== +Q29tcGFueQ== +UmVnaXN0cmF0aW9uIE51bWJlcg== +V2Vic2l0ZQ== +V2Vic2l0ZSBuYW1l +V2Vic2l0ZSBhZGRyZXNz +RGF0ZS9UaW1lIFNldHRpbmdz +VGltZSB6b25lIG9mIHRoZSBzZXJ2ZXI= +VGltZSB6b25lIG9mIHRoZSBzaXRl +KEdNVCAtMTI6MDAp +KEdNVCAtMTE6MDAp +KEdNVCAtMTA6MDAp +KEdNVCAtMDk6MDAp +KEdNVCAtMDg6MDAp +KEdNVCAtMDc6MDAp +KEdNVCAtMDY6MDAp +KEdNVCAtMDU6MDAp +KEdNVCAtMDQ6MDAp +KEdNVCAtMDM6MDAp +KEdNVCAtMDI6MDAp +KEdNVCAtMDE6MDAp +KEdNVCk= +KEdNVCArMDE6MDAp +KEdNVCArMDI6MDAp +KEdNVCArMDM6MDAp +KEdNVCArMDQ6MDAp +KEdNVCArMDU6MDAp +KEdNVCArMDY6MDAp +KEdNVCArMDc6MDAp +KEdNVCArMDg6MDAp +KEdNVCArMDk6MDAp +KEdNVCArMTA6MDAp +KEdNVCArMTE6MDAp +KEdNVCArMTI6MDAp +KEdNVCArMTM6MDAp +QXJjaGl2ZWQ= +Vmlld3M= +UmVwbGllcw== +R2VuZXJhbCBQZXJtaXNzaW9ucw== +QWRtaW5pc3RyYXRpb24= +RnJvbnQgRW5k +QWxsb3dzIGFjY2VzcyB0byB0aGUgQWRtaW5pc3RyYXRpb24gdXRpbGl0eQ== +R3JvdXA= +U3lzdGVtIHByZW1pc3Npb25z +dXNlcnM= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbGluayBvdXRwdXQgc2V0dGluZ3M= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBvdXRwdXQgc2V0dGluZ3M= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBkZWZhdWx0IHNlYXJjaCBjb25maWd1cmF0aW9u +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBlbWFpbCBjb25maWd1cmF0aW9u +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tbmV3eiBjdXN0b20gZmllbGRz +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tYnVsbHRlaW4gb3V0cHV0IHNldHRpbmdz +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tYnVsbHRlaW4gZGVmYXVsdCBzZWFyY2ggc2V0dGluZ3M= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgSW4tYnVsbHRlaW4gZW1haWwgc2V0dGluZ3M= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgdGhlbWVzIGFuZCBlZGl0IHRoZSBpbmRpdmlkdWFsIHRlbXBsYXRlcw== +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgcmVnaW9uYWwgc2V0dGluZ3MsIG1hbmFnZSBhbmQgZWRpdCBsYW5ndWFnZXM= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBpbXBvcnQgZGF0YSBmcm9tIG90aGVyIHByb2dyYW1zIGludG8gSW4tcG9ydGFs +QWRkIFVzZXIgVG8gR3JvdXA= +QXR0ZW50aW9uIQ== +SXRlbXM= +QmFja3VwIHN0YXR1cw== +QmFja3VwIFBhdGg= +U3RlcCBPbmU= +QmFja3VwIGluIHByb2dyZXNz +UGxlYXNlIFdhaXQ= +VGhpcyB1dGlsaXR5IGFsbG93cyB5b3UgdG8gYmFja3VwIHlvdXIgY3VycmVudCBkYXRhIGZyb20gSW4tUG9ydGFsIGRhdGFiYXNlLg== +IFJ1bm5pbmcgdGhpcyB1dGlsaXR5IHdpbGwgYWZmZWN0IHlvdXIgZGF0YWJhc2UuICBQbGVhc2UgYmUgYWR2aXNlZCB0aGF0IHlvdSBjYW4gdXNlIHRoaXMgdXRpbGl0eSBhdCB5b3VyIG93biByaXNrLiAgSW50ZWNobmljIGNvcnBvcmF0aW9uIGNhbiBub3QgYmUgaGVsZCBsaWFibGUgZm9yIGFueSBjb3JydXB0IGRhdGEgb3IgZGF0YSBsb3NzLiAgUGxlYXNlIG1ha2Ugc3VyZSB0byBiYWNrIHVwIHlvdXIgZGF0YWJhc2UocykgYmVmb3JlIHJ1bm5p +QmFjayBVcCBEYXRl +Q2hvb3NlIG9uZSBvZiB0aGUgZm9sbG93aW5nIGJhY2t1cCBkYXRlcyB0byByZXN0b3JlIG9yIGRlbGV0ZQ== +UmVzdG9yZQ== +UmVzdG9yZSBpcyBpbiBwcm9ncmVzcw== +UmVzdG9yZSBoYXMgYmVlbiBjb21wbGV0ZWQgc3VjY2Vzc2Z1bGx5 +UmVzdG9yZSBoYXMgZmFpbGVkIGFuIGVycm9yIG9jY3VyZWQ6 +UmVzdG9yZSBTdGF0dXM= +UHJlcGFyaW5nIHRvIFNlbmQgTWFpbA== +UHJlcGFyaW5nIHRvIFNlbmQgTWVzc2FnZXM= +U2VuZGluZyBNZXNzYWdlLi4= +TWFpbCBoYXMgYmVlbiBzZW50IFN1Y2Nlc3NmdWxseQ== +UGxlYXNlIFdhaXQgd2hpbGUgSW4tUG9ydGFsIHByZXBhcmVzIHRvIHNlbmQgdGhlIG1lc3NhZ2UuLg== +VGhlIEVtYWlsIE1lc3NhZ2UgaGFzIGJlZW4gc2VudA== +RW1haWwgZGVsaXZlcnkgYWJvcnRlZA== +Q2xvc2U= +Q29tcGxldGU= +UGVybWlzc2lvbiBUeXBlIEFkbWlu +UGVybWlzc2lvbiBUeXBlIEZyb250IEVuZA== +QWRkIExpbms= +VGVtcGxhdGU= +RmlsZSBJZA== +RmlsZSBuYW1l +VG9wIFJhdGVkIExpbmtz +TW9zdCBQb3B1bGFyIExpbmtz +TmV3IExpbmtz +RWRpdG9ycyBQaWNr +V2VsY29tZQ== +VHlwZQ== +QWR2YW5jZWQ= +RXZlbnRz +QWRkZWQgVG9kYXk= +Rm9ybWF0 +RnJvbS9UbyBVc2Vy +UGFnZQ== +QWN0aW9uIEJveA== +Wm9vbQ== +Y2F0ZWdvcmllcyB1cGRhdGVk +bGlua3MgdXBkYXRlZA== +UmVsYXRlZCBDYXRlZ29yaWVz +VG90YWwgQ2F0ZWdvcmllcw== +RGV0YWlscw== +U2VuZA== +UmVjb21tZW5kIHRvIGEgZnJpZW5k +cG9zdHM= +aW4= +VG90YWwgQXJ0aWNsZXM= +bmV3cyB1cGRhdGVk +cG9zdHMgdXBkYXRlZA== +U2VhcmNoIFRpcHM= +TXkgRmF2b3JpdGVz +TXkgRnJpZW5kcw== +TXkgUHJlZmVyZW5jZXM= +TG9naW4gSW5mb3JtYXRpb24= +Q29udGFjdCBJbmZvcm1hdGlvbg== +cHJvZmlsZSB1cGRhdGVk +aGVscA== +VXBkYXRl +Q2FuY2Vs +UGFzc3dvcmQgQWdhaW4= +Rmlyc3QgTmFtZQ== +TGFzdCBOYW1l +UGhvbmU= +RS1tYWls +U3RyZWV0 +Q2l0eQ== +U3RhdGU= +Wmlw +TXkgTGlua3M= +TXkgQXJ0aWNsZXM= +TXkgVG9waWNz +UmVsYXRlZCBMaW5rcw== +UmVsYXRlZCBOZXdz +cmV2aWV3cyB1cGRhdGVk +TGluayBEZXRhaWxz +ZGV0YWlscyB1cGRhdGVk +TGluayBSZXZpZXdz +VXNlcm5hbWU= +UGFzc3dvcmQ= +Rm9yZ290IFBhc3N3b3Jk +Q2F0ZWdvcmllcw== +QXNzaWduIHJlZ2lzdGVyZWQgdXNlcnMgdG8gZ3JvdXA= +QXNzaWduIHVzZXJzIG5vdCBsb2dnZWQgaW4gdG8gZ3JvdXA= +Q29uZmlybSBEZWxldGU= +WW91IGFyZSBhYm91dCB0byBkZWxldGUgdGhlIGxpbmsgYmVsb3cu +QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGlzIGxpbms/ +TXkgTmV3cw== +TmV3cyBEZXRhaWxz +UmV2aWV3Og== +UmVxdWlyZWQgRmllbGQ= +UmVtb3ZlIEZyb20gRmF2b3JpdGVz +RXJyb3I= +U2VhcmNoZWQgRm9yOg== +U2VhcmNoIEFnYWlu +TmV3IFVzZXJz +RXhpc3RpbmcgVXNlcnM= +UmVnaXN0ZXIgd2l0aCBJbi1Qb3J0YWwgZm9yIGNvbnZlbmllbnQgYWNjZXNzIHRvIHVzZXIgYWNjb3VudCBzZXR0aW5ncyBhbmQgcHJlZmVyZW5jZXMu +TG9naW4= +b3I= +Rm9yZ290IFBhc3N3b3Jk +Rm91bmQ6 +UmF0ZSBMaW5r +TGluayBSYXRpbmcgUmVzdWx0cw== +WW91IGhhdmUgYWxyZWFkeSByYXRlZCB0aGlzIGxpbmsu +VGhhbmsgZm9yIHJhdGluZyB0aGlzIGxpbmsuICBZb3VyIGlucHV0IGhhcyBiZWVuIHJlY29yZGVkLg== +TXkgUHJvZmlsZQ== +UmV2aWV3IExpbms= +TGluayBSZXZpZXcgUmVzdWx0cw== +Q2F0ZWdvcnkgSW5mb3JtYXRpb24= +Q2F0ZWdvcnkgTmFtZQ== +RGVzY3JpcHRpb24= +TWV0YSBUYWcgRGVzY3JpcHRpb24= +TWV0YSBUYWcgS2V5d29yZHM= +RnVsbC1TaXplIEltYWdlOg== +VGh1bWJuYWlsIEltYWdlOg== +U3VnZ2VzdCBDYXRlZ29yeSBSZXN1bHRz +VGhlIENhdGVnb3J5IHlvdSBzdWdnZXN0ZWQgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIHN5c3RlbS4= +TGluayBJbmZvcm1hdGlvbg== +TGluayBOYW1l +VVJM +RGVzY3JpcHRpb24= +QWRkIExpbmsgUmVzdWx0cw== +VGhlIGxpbmsgeW91IGhhdmUgc3VnZ2VzdGVkIGhhcyBiZWVuIGFkZGVkIHRvIHRoZSBkYXRhYmFzZS4= +VXNlcm5hbWU= +QmlydGhkYXRl +QWNjb3VudCBJbmZvcm1hdGlvbg== +UHJvZmlsZQ== +Q3VycmVudCBWYWx1ZQ== +RGlzcGxheSB0byBQdWJsaWM= +QXZhdGFyIEltYWdl +VG9waWNzIFBlciBQYWdl +UG9zdHMgUGVyIFBhZ2U= +Tm90aWZ5IG1lIG9uIGNoYW5nZXMgdG8gdG9waWNzIEkgY3JlYXRl +RW5hYmxlIEJCQ29kZQ== +QXR0YXRjaCBNeSBTaWduYXR1cmUgdG8gUG9zdHM= +U2lnbmF0dXJl +RGVsZXRl +T25saW5l +T2ZmbGluZQ== +SG90 +TmV3 +UG9wdWxhcg== +VG9wIFJhdGVk +VmVyc2lvbg== +TW9kdWxlcw== +RW5hYmxl +RGlzYWJsZQ== +QWRkIE1vZHVsZQ== +SW5zdGFsbGVk +Um9vdCBQYXNzd29yZA== +VmVyaWZ5IFJvb3QgUGFzc3dvcmQ= +QWN0aXZlIENhdGVnb3JpZXM= +QWN0aXZlIFVzZXJz +Q3VycmVudCBTZXNzaW9ucw== +RW1haWwgRXZlbnRz +QWRkIENhdGVnb3J5 +QWRkIFBlbmRpbmcgQ2F0ZWdvcnk= +QXBwcm92ZSBDYXRlZ29yeQ== +RGVueSBDYXRlZ29yeQ== +TW9kaWZ5IENhdGVnb3J5 +RGVsZXRlIENhdGVnb3J5 +QWRkIFVzZXI= +QWRkIFBlbmRpbmcgVXNlcg== +QXBwcm92ZSBVc2Vy +RGVueSBVc2Vy +Rm9yZ290IFBhc3N3b3Jk +VmFsaWRhdGUgVXNlcg== +QWRkIExpbms= +QWRkIFBlbmRpbmcgTGluaw== +QXBwcm92ZSBQZW5kaW5nIExpbms= +RGVueSBMaW5r +TW9kaWZ5IExpbms= +QXBwcm92ZSBMaW5rIE1vZGlmaWNhdGlvbg== +RGVjbGluZSBsaW5rIG1vZGlmaWNhdGlvbg== +TGluayBNb2RpZmljYXRpb24gUGVuZGluZw== +TGluayBSZXZpZXcgQWRkZWQ= +UGVuZGluZyBSZXZpZXcgQWRkZWQ= +QXBwcm92ZSBMaW5rIFJldmlldw== +RGVjbGluZSBMaW5rIFJldmlldw== +QWRkIEFydGljbGU= +QXBwcm92ZSBBcnRpY2xl +RGVjbGluZSBBcnRpY2xl +TW9kaWZ5IEFydGljbGU= +QXBwcm92ZSBBcnRpY2xlIE1vZGlmaWNhdGlvbg== +RGVjbGluZSBBcnRpY2xlIE1vZGlmaWNhdGlvbg== +QXJ0aWNsZSBSZXZpZXcgQWRkZWQ= +UGVuZGluZyBBcnRpY2xlIFJldmlldyBBZGRlZA== +QXBwcm92ZSBBcnRpY2xlIFJldmlldw== +RGVjbGluZSBBcnRpY2xlIFJldmlldw== +VG9waWMgQWRkZWQ= +UG9zdCBNb2RpZmllZA== +UG9zdCBBZGRlZA== +Q2F0ZWdvcmllcyBQZXIgUGFnZSAoU2hvcnRsaXN0KQ== +VG9waWNzIFBlciBQYWdlIChTaG9ydGxpc3Qp +QXJ0aWNsZXMgUGVyIFBhZ2UgKFNob3J0bGlzdCk= +UmV2aWV3cyBQZXIgUGFnZQ== +UmV2aWV3cyBQZXIgUGFnZSAoU2hvcnRsaXN0KQ== +TWluaW11bSAjIG9mIHZvdGVzIGZvciByYXRpbmcgY29uc2lkZXJhdGlvbg== +RWRpdCBDdXJyZW50IENhdGVnb3J5 +QWRkIE1vZHVsZQ== +TW9kdWxlcyBOb3QgSW5zdGFsbGVk +SW5zdGFsbA== +SW5zdGFsbGF0aW9uIFN0YXR1cw== +UmVhZHkgdG8gSW5zdGFsbA== +RW5hYmxl +RGlzYWJsZQ== +U2Vzc2lvbiBNYW5hZ2VtZW50IE1ldGhvZA== +QXV0b21hdGlj +Q29va2llcw== +UXVlcnkgU3RyaW5n +U2Vzc2lvbiBJbmFjdGl2aXR5IFRpbWVvdXQgKHNlY29uZHMp +U01UUCAobWFpbCkgU2VydmVy +TWFpbCBTZXJ2ZXIgQWRkcmVzcw== +UG9ydCAoZWcuIHBvcnQgMjUp +U2VydmVyIFJlcXVpcmVkIEF1dGhlbnRpY2F0aW9u +TWFpbCBTZXJ2ZXIgVXNlcm5hbWU= +TWFpbCBTZXJ2ZXIgUGFzc3dvcmQ= +U2VuZCBIVE1MIGVtYWls +QWRkaXRpb25hbCBNZXNzYWdlIEhlYWRlcnM= +TWVzc2FnZXMgZnJvbSBTaXRlIEFkbWluIGFyZSBmcm9t +U2VsZWN0IFNvdXJjZSBMYW5ndWFnZQ== +SWNvbiBVUkw= +Q29weSBMYWJlbHMgdG8gdGhpcyBMYW5ndWFnZQ== +TGFuZ3VhZ2UgQ2FjaGUgVGltZW91dA== +TmV3IFRvcGlj +VGhhbmsgeW91IGZvciBSZWdpc3RlcmluZyEgIFBsZWFzZSBlbnRlciB5b3VyIHVzZXJuYW1lIGFuZCBwYXNzd29yZCBiZWxvdw== +UmVnaXN0cmF0aW9uIENvbXBsZXRl +U2VsZWN0IExhbmd1YWdl +U2hvdyBTaWduYXR1cmU= +Tm90aWZ5IG1lIHdoZW4gcG9zdHMgYXJlIG1hZGUgaW4gdGhpcyB0b3BpYw== +QkJDb2Rl +U21pbGV5cw== +QWRkIFRvcGlj +QWRkIFRvcGljIFJlc3VsdHM= +VGhlIFRvcGljIHlvdSBoYXZlIGNyZWF0ZWQgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIHN5c3RlbQ== +WW91ciB0b3BpYyBoYXMgYmVlbiBhZGRlZA== +VGhlIHN5c3RlbSBhZG1pbmlzdHJhdG9yIG11c3QgYXBwcm92ZSB5b3VyIHRvcGljIGJlZm9yZSBpdCBpcyBwdWJsaWNseSBhdmFpbGFibGUu +VmlldyBUaHJlYWRlZA== +UmVwbHkgUXVvdGVk +Sm9pbmVk +TG9jYXRpb24= +b24gdGhpcyBwb3N0 +UG9zdA== +UG9zdCBSZXBseQ== +VmlldyBGbGF0 +TXkgU2V0dGluZ3M= +TXkgSXRlbXM= +RWRpdGVkIEJ5 +b24= +VG9waWMgVXBkYXRlZA== +UG9zdCBPd25lciBNb2RpZnk= +UG9zdCBPd25lciBEZWxldGU= +VG9waWMgT3duZXIgRGVsZXRl +TW9kaWZ5IFRvcGljIFBlbmRpbmc= +T3duZXIgTW9kaWZ5IFRvcGljIFBlbmRpbmc= +VG9waWMgT3duZXIgTW9kaWZ5 +TG9jay9VbmxvY2sgVG9waWNz +d3JvdGU= +RWRpdCBUb3BpYyBSZXN1bHRz +Q2hhbmdlcyBtYWRlIHRvIHRoZSB0b3BpYyBoYXZlIGJlZW4gc2F2ZWQu +RXhjZWxsZW50 +VmVyeSBHb29k +R29vZA== +QXZlcmFnZQ== +RmFpcg== +UG9vcg== +U2l0ZSBMZWFkIFN0b3J5 +Q2F0ZWdvcnkgTGVhZCBTdG9yeQ== +U2VhcmNoIFJlc3VsdHM= +UXVpY2sgTGlua3M= +VGhhbmsgeW91IGZvciBzdWdnZXN0aW5nIG91ciBzaXRlIHRv +IGhhcyBhbHJlYWR5IGJlZW4gc3VnZ2VzdGVkIHRvIHRoaXMgc2l0ZSBvbg== +UGxhaW4gVGV4dA== +SFRNTA== +U2VuZCBFbWFpbCBBcw== +RXh0cmEgTWFpbCBIZWFkZXJz +RW1haWwgRXZlbnQ= +UmF0ZSBBcnRpY2xl +UmF0ZSBBcnRpY2xlIFJlc3VsdHM= +VGhhbmsgeW91IGZvciByYXRpbmcgdGhpcyBhcnRpY2xlLiBZb3VyIHZvdGUgaGFzIGJlZW4gcmVjb3JkZWQu +UmF0ZSBUb3BpYw== +RGF0ZSBvZiBCaXJ0aA== +SXRlbSBMaXN0 +U2Vzc2lvbnM= +SW5hY3RpdmU= +QWRtaW4gTG9naW4= +RGlzcGxheSBJdGVtIFF1ZXJpZXMgKERlYnVnKQ== +RGlzcGxheSBJdGVtIExpc3QgUXVlcmllcyAoRGVidWcp +QXBwZW5kIHBocGluZm8gdG8gYWxsIHBhZ2VzIChEZWJ1Zyk= +Q2hhbmdlIFVzZXIgUHJvZmlsZXM= +U2hvdyBMYW5ndWFnZSBUYWdz +QWxsb3cgTG9naW4= +WW91ciBBY2NvdW50IEluZm9ybWF0aW9u +SXRlbXMgeW91IGhhdmUgbWFya2VkIGFzIGZhdm9yaXRl +VmlldyB5b3VyIGxpc3Qgb2YgZnJpZW5kcw== +RWRpdCB5b3VyIEluLVBvcnRhbCBQcmVmZXJlbmNlcw== +TG9nIG91dCBvZiB0aGUgc3lzdGVt +TGlua3MgeW91IGhhdmUgYWRkZWQgdG8gdGhlIHN5c3RlbQ== +TmV3cyBBcnRpY2xlcyB5b3UgaGF2ZSB3cml0dGVu +RGlzY3Vzc2lvbnMgeW91IGhhdmUgY3JlYXRlZA== +QWRkIEZyaWVuZA== +RGVsZXRlIEZyaWVuZA== +VmlldyBVc2VyIFByb2ZpbGU= +VmlldyBZb3VyIFByb2ZpbGU= +U2VuZCBQYXNzd29yZA== +Q291bnRyeQ== +TG9jay9VbmxvY2s= +SXRlbXM= +RW5hYmxlIFRhZyBDYWNoaW5n +UmVtZWJlciBMb2dpbg== +SW1wb3J0IExhbmd1YWdlIFBhY2s= +SW5zdGFsbCBMYW5ndWFnZSBQYWNr +TGFuZ3VhZ2UgRmlsZQ== +SW5zdGFsbCBQaHJhc2UgVHlwZXM6 +RnJvbnQgRW5k +TGluayBJbWFnZSBOYW1l +VXNlcm5hbWUvUGFzc3dvcmQgSW5jb3JyZWN0 +TGFzdCBQb3N0IEJ5 +VGhlbWU= +U2Nhbm5pbmc= +VGVtcGxhdGVz +TWlzc2luZyBJbiBUaGVtZQ== +UGhyYXNlcw== +TWlzc2luZyBMYWJlbHM= +SW52YWxpZCB1c2VyIG5hbWUgb3IgcGFzc3dvcmQ= +QmxhbmsgdXNlciBuYW1l +QmxhbmsgcGFzc3dvcmRzIGFyZSBub3QgYWxsb3dlZA== +Tm8gcGVybWlzc2lvbnM= +QmFjayB1cCBoYXMgYmVlbiBjb21wbGV0ZWQuIFRoZSBiYWNrdXAgZmlsZSBpczo= +VXBkYXRpbmc= +UGVyZm9ybSB0aGlzIG9wZXJhdGlvbiBub3c/ +VGhlIGNhdGVnb3J5IHRyZWUgbXVzdCBiZSB1cGRhdGVkIHRvIHJlZmxlY3QgdGhlIGxhdGVzdCBjaGFuZ2Vz +TW9kdWxlIFN0YXR1cw== +TGluayBTZWFyY2ggUmVzdWx0cw== +Q2F0ZWdvcnkgU2VhcmNoIFJlc3VsdHM= +VG9waWMgU2VhcmNoIFJlc3VsdHM= +U2ltcGxl +RW5hYmxlIFRlbXBsYXRlIENhY2hpbmc= +Q2FjaGUgVGltZW91dCAoc2Vjb25kcyk= +VGVtcGxhdGUgRXJyb3I= +TWlzc2luZyBUZW1wbGF0ZQ== +QmFjaw== +UG9zdCBTdWJqZWN0 +T3B0aW9uYWw= +TW9kaWZ5IFBvc3Q= +VG9waWMgUmF0aW5nIFJlc3VsdHM= +WW91IGhhdmUgYWxyZWFkeSByYXRlZCB0aGlzIHRvcGlj +VGhhbmsgeW91IGZvciB2b3RpbmchICBZb3VyIGlucHV0IGhhcyBiZWVuIHJlY29yZGVkLg== +QXJ0aWNsZXM= +Um9vdA== +TGFzdCBVcGRhdGU= +TW9kdWxlIFJvb3QgQ2F0ZWdvcnk= +U2VsZWN0IE1vZHVsZSBSb290IENhdGVnb3J5Og== +WW91IGhhdmUgYWxyZWFkeSByZXZpZXdlZCB0aGlzIGl0ZW0u +RmF2b3JpdGUgQXJ0aWNsZXM= +WW91IGhhdmUgYWxyZWFkeSByYXRlZCB0aGlzIGFydGljbGU= +SGVyZSBZb3UgQ2FuOg== +QWN0aW9u +Ym94 +QWxzbyBZb3UgQ2FuOg== +UnVubmluZyB0aGlzIHV0aWxpdHkgd2lsbCBhZmZlY3QgeW91ciBkYXRhYmFzZS4gIFBsZWFzZSBiZSBhZHZpc2VkIHRoYXQgeW91IGNhbiB1c2UgdGhpcyB1dGlsaXR5IGF0IHlvdXIgb3duIHJpc2suICBJbnRlY2huaWMgQ29ycG9yYXRpb24gY2FuIG5vdCBiZSBoZWxkIGxpYWJsZSBmb3IgYW55IGNvcnJ1cHQgZGF0YSBvciBkYXRhIGxvc3Mu +U1FMIFF1ZXJ5Og== +UGVyZm9ybSBTUUwgUXVlcnk= +U1FMIFF1ZXJ5IFJlc3VsdHM= +RWRpdCBRdWVyeQ== +UXVlcnkgRGF0YWJhc2U= +V2VpZ2h0 +SW5jcmVhc2UgaW1wb3J0YW5jZSBpZiBmaWVsZCBjb250YWlucyBhIHJlcXVpcmVkIGtleXdvcmQgYnk= +U2VhcmNoIFJlbGV2YW5jZSBkZXBlbmRzIG9u +S2V5d29yZA== +UG9wdWxhcml0eQ== +U2VhcmNoIFJlbGV2ZW5jZSBTZXR0aW5ncw== +RGVjaW1hbCBQb2ludA== +RGF0ZSBGb3JtYXQ= +VGltZSBGb3JtYXQ= +VGhvdXNhbmRzIFNlcGFyYXRvcg== +RXhhbXBsZQ== + +SW4tUG9ydGFsIGRvZXMgbm90IGhhdmUgYWNjZXNzIHRvIHdyaXRlIHRvIHRoaXMgZGlyZWN0b3J5 +U2VhcmNoIExpbmtz +U2VhcmNoIFR5cGU= +Q29udGludWU= +QW5k +VHJ1ZQ== +RmFsc2U= +QW55 +SXMgRXF1YWwgVG8= +SXMgTm90IEVxdWFsIFRv +Q29udGFpbnM= +RG9lcyBOb3QgQ29udGFpbg== +U2VhcmNoIENhdGVnb3JpZXM= +U2VhcmNoIEFydGljbGVz +U2VhcmNoIFRvcGljcw== +TGFuZ3VhZ2U= +QXNzaWduIG1haWxpbmcgbGlzdCBzdWJzY3JpYmVycyB0byBncm91cA== +SG9tZQ== +Q29uZmlndXJlIENhdGVnb3J5IHNlYXJjaCBvcHRpb25z +Q29uZmlndXJlIENhdGVnb3J5IEVtYWlsIEV2ZW50cw== +Q29uZmlndXJlIFVzZXIgZW1haWwgZXZlbnRz +TWFuYWdlIFVzZXIgQmFuIFJ1bGVz +VXNlciBCYW4gUnVsZXM= +VXNlciBCYW4gTGlzdA== +QWxsb3c= +SW4tTGluayBHZW5lcmFsIENvbmZpZ3VyYXRpb24gT3B0aW9ucw== +UnVsZQ== +UnVsZSBQcm9wZXJ0aWVz +UnVsZSBUeXBl +SXRlbSBGaWVsZA== +RXJyb3IgVGFn +RmllbGQgVmFsdWU= +RmllbGQgQ29tcGFyaXNpb24= +QXBwbHlpbmcgQmFuIExpc3QgdG8gRXhpc3RpbmcgVXNlcnMuLg== +RW50ZXIgeW91ciBVc2VybmFtZSBvciBFbWFpbCBBZGRyZXNzIGJlbG93IHRvIGhhdmUgeW91ciBhY2NvdW50IGluZm9ybWF0aW9uIHNlbnQgdG8gdGhlIGVtYWlsIGFkZHJlc3Mgb2YgeW91ciBhY2NvdW50Lg== +WW91IG11c3QgZW50ZXIgYSBVc2VybmFtZSBvciBFbWFpbCBBZGRyZXNzIHRvIHJldHJpdmUgeW91ciBhY2NvdW50IGluZm9ybWF0aW9u +VGhlIFVzZXJuYW1lIGNvdWxkIG5vdCBiZSBmb3VuZA== +VGhlIEVtYWlsIEFkZHJlc3MgY291bGQgbm90IGJlIGZvdW5kLg== +Qm90aCBhIFVzZXJuYW1lIGFuZCBQYXNzd29yZCBpcyByZXF1aXJlZA== +UGxlYXNlIGVudGVyIHlvdXIgcGFzc3dvcmQgYW5kIHRyeSBhZ2Fpbg== +WW91IGRpZCBub3QgZW50ZXIgeW91ciBVc2VybmFtZQ== +VXNlciBCYW4gTGlzdA== +UnVsZSBUeXBl +SXRlbSBGaWVsZA== +Q29tcGFyaXNvbiBPcGVyYXRvcg== +SXRlbSBWYWx1ZQ== +Q29udGFpbnM= +SXMgVW5pcXVl +SVAgQWRkcmVzcw== +VXNlcm5hbWU= +Rmlyc3QgTmFtZQ== +TGFzdCBOYW1l +QWRkcmVzcw== +Q2l0eQ== +U3RhdGU= +Wmlw +UGhvbmU= +QW55 +SXM= +SXMgTm90 +RG9lcyBOb3QgQ29udGFpbg== +R3JlYXRlciBUaGFu +TGVzcyBUaGFu +RXhpc3Rz +RGVueQ== +SW4tTmV3eiBnZW5lcmFsIGNvbmZpZ3VyYXRpb24gb3B0aW9ucw== +SW4tYnVsbGV0aW4gZ2VuZXJhbCBjb25maWd1cmF0aW9uIG9wdGlvbnM= +TGluayBJRA== +TmFtZQ== +RGVzY3JpcHRpb24= +VVJM +RGF0ZSBDcmVhdGVk +TGFzdCBNb2RpZmllZCBEYXRl +SGl0cw== +UmF0aW5n +TnVtYmVyIG9mIFJhdGluZyBWb3Rlcw== +TnVtYmVyIG9mIFJldmlld3M= +Q3JlYXRlZCBCeSBVc2VyIElE +TW9kaWZpZWQgQnkgVXNlciBJRA== +UHJpb3JpdHk= +U3RhdHVz +UmVzb3VyY2UgSUQ= +SXRlbSBJcyBIb3Q= +SXRlbSBJcyBQb3B1bGFy +SXRlbSBJcyBOZXc= +T3JpZ2lvbmFsIEl0ZW0gSUQ= +QWxsb3cgRHVwbGljYXRlIFJldmlld3M= +QWxsb3cgRHVwbGljYXRlIFJhdGluZyBWb3Rlcw== +TWludXRl +SG91cg== +RGF5 +RXhwb3J0IExhbmd1YWdlIFBhY2s= +U2Vjb25kcw== +V2Vla3M= +TW9udGhz +WWVhcnM= +VG9waWMgSUQ= +Tm90aWZ5IE93bmVyIG9mIENoYW5nZXM= +VG9waWMgVGV4dA== +VG9waWMgUG9zdHM= +Vmlld3M= +T3duZXIgVXNlciBJRA== +UG9zdGVkIEJ5 +TGFzdCBQb3N0IElE +RXhwb3J0IEZpbGVuYW1l +RXhwb3J0 +TGFuZ3VhZ2U= +WW91IGRvIG5vdCBoYXZlIGFjY2VzcyB0byBwZXJmb3JtIHRoaXMgb3BlcmF0aW9u +U2hvdyBNeSBTaWduYXR1cmU= +VG8gY2hhbmdlIHRoZSBwYXNzd29yZCwgZW50ZXIgdGhlIHBhc3N3b3JkIGhlcmUgYW5kIGluIHRoZSBib3ggYmVsb3c= +bGM2 +bGM1 +bGM0 +bGMz +bGMy +bGMx +Y2M2 +Y2M1 +Y2M0 +Y2Mz +Y2My +dWM2 +Y2Mx +dWM1 +dWM0 +dWMz +dWMy +UmVzdWx0cw== +RG93bmxvYWQgTGFuZ3VhZ2UgRXhwb3J0Og== +T3ZlcndyaXRlIEV4aXN0aW5nIFBocmFzZXM= +RW5hYmxpbmcgdGhpcyBvcHRpb24gd2lsbCB1bmRvIGFueSBjaGFuZ2VzIHlvdSBoYXZlIG1hZGUgdG8gZXhpc3RpbmcgcGhyYXNlcw== +Q2F0ZWdvcnkgSWQ= +UGFyZW50IElk +TWV0YSBLZXl3b3Jkcw== +TnVtYmVyIG9mIERlc2NlbmRhbnRz +Q2F0ZWdvcnkgUGF0aA== +UGFyZW50IENhdGVnb3J5IFBhdGg= +TWV0YSBEZXNjcmlwdGlvbg== +Q29udGludWU= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBydW4gdmFsaWRhdGlvbiBvbiB0aGUgbGlua3M= +TGluayBWYWxpZGF0aW9u +U3RhdHVz +TGluayBOYW1l +VmFsaWRhdGVkIE9u +Q3JlYXRlZCBPbg== +Tm90IFZhbGlkYXRlZA== +SW52YWxpZA== +VmFsaWRhdGluZyBMaW5rcw== +VmFsaWRhdGlvbiBQcm9ncmVzcw== +RXhwaXJhdGlvbiBEYXRl +VXNlciBzdWJzY3JpYmVk +VXNlciB1bnN1YnNjcmliZWQ= +VGhpcyBzZWN0aW9uIGFsbG93cyB5b3UgdG8gYnJvd3NlIHRoZSBjYXRhbG9nIGFuZCBtYW5hZ2UgY2F0ZWdvcmllcyBhbmQgaXRlbXM= +VXBsb2FkIGltYWdlIGZyb20gbG9jYWwgUEM= +VXNlIHJlbW90ZSBpbWFnZSAoVVJMKQ== +SW5oZXJpdGVkIEZyb20= +QWxsb3cgZmF2b3JpdGVz +UmV2aWV3IExpbmsgUGVuZGluZw== +TW9kaWZ5IExpbmsgUGVuZGluZw== +TGluayBNb2RpZnkgYnkgT3duZXI= +TGluayBNb2RpZnkgUGVuZGluZyBieSBPd25lcg== +TGluayBEZWxldGUgYnkgT3duZXI= +UmV2aWV3IE5ld3MgUGVuZGluZw== +T3JpZ2luYWwgVmFsdWVz +TGluayBPd25lcg== +VGFnIExpYnJhcnk= +VXNlIG5vbi1ibG9ja2luZyBzb2NrZXQgbW9kZQ== +RnJvbnQtZW5kIE9ubHk= +RnJvbnQgT25seQ== +U2VsZWN0IFVzZXI= +RW5hYmxl +RGlzYWJsZQ== +VXNlciBJRA== +TG9naW4gKFVzZXIgbmFtZSk= +UGFzc3dvcmQ= +Rmlyc3QgTmFtZQ== +TGFzdCBOYW1l +RS1tYWls +VGVsZXBob25l +U3RyZWV0IEFkZHJlc3M= +Q2l0eQ== +U3RhdGU= +WmlwIChQb3N0YWwpIENvZGU= +Q291bnRyeQ== +RGF0ZSBvZiBCaXJ0aA== +VGltZSBab25l +U2hvdyBvbiB0aGUgZ2VuZXJhbCB0YWI= +SGVhZGluZw== +RmllbGQgUHJvbXB0 +SW5wdXQgVHlwZQ== +TGlzdCBvZiBWYWx1bGVz +VGVzdA== +VGhpcyBpcyBhIGdlbmVyYWwgY29uZmd1cmF0aW9uIHNlY3Rpb24= +TmV3cyBBcnRpY2xlIElE +SW1wb3J0IGEgTGFnbnVhZ2UgUGFja2FnZQ== +RXhwb3J0 +V2VsY29tZSB0byBJbi1idWxsZXRpbiBGb3J1bXMh +Rm9ydW0gaGFzIG5ldyBwb3N0cw== +Rm9ydW0gaGFzIG5vIG5ldyBwb3N0cw== +Rm9ydW0gaXMgbG9ja2VkIGZvciBwb3N0aW5n +VW5zb3J0ZWQgbGlzdA== +U29ydGVkIGxpc3Q= +Tm8gVG9waWNz +TWFpbGluZyBMaXN0 +U3Vic2NyaWJl +RW50ZXIgeW91ciBlLW1haWwgYWRkcmVzcyB0byBzdWJzY3JpYmUgdG8gdGhlIG1haWxpbmcgbGlzdC4= +TGVnZW5k +U2ltbGllcyBvbiBieSBkZWZhdWx0 +U2lnbmF0dXJlcyBvbiBieSBkZWZhdWx0 +QWRkIG5ldyBsYWJlbA== +Tm8gZmF2b3JpdGVz +QXJ0aWNsZSBJRA== +QXJ0aWNsZSBUZXh0 +QXJ0aWNsZSBUaXRsZQ== +QXJ0aWNsZSBFeGNlcnB0 +QXJ0aWNsZSBBdXRob3I= +QXJ0aWNsZSBCb2R5 +RW5kcyBPbg== +TGVhZCBTdG9yeT8= +Q2F0ZWdvcnkgTGVhZCBTdG9yeT8= +U3RhcnQgRGF0ZQ== +QXJjaGl2ZSBEYXRl +VG9waWMgVHlwZQ== +TWVzc2FnZQ== +QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgaXRlbShzKT8gVGhpcyBhY3Rpb24gY2Fubm90IGJlIHVuZG9uZS4= +RWRpdCBDYXRlZ29yeQ== +WW91ciByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= +Tm8gSXRlbXM= +Um9vdCBjYXRlZ29yeSBuYW1lIChsYW5ndWFnZSB2YXJpYWJsZSk= +QWRtaW5pc3RyYXRpb24gUGFuZWwgVUk= +RW50ZXIgbGlzdCBvZiB2YWx1ZXMgYW5kIHRoZWlyIGRlc2NyaXB0aW9ucywgbGlrZSAxPU9uZSwgMj1Ud28= +VGV4dCBmaWVsZA== +RHJvcCBkb3duIGZpZWxk +UmFkaW8gYnV0dG9ucw== +UGFzc3dvcmQgZmllbGQ= +VGV4dCBhcmVh +TGFiZWw= +U2V0IFByaW1hcnkgR3JvdXA= +QmFu +QWRkIFVzZXIgdG8gR3JvdXA= +RGVsZXRlIFVzZXIgRnJvbSBHcm91cA== +RGVsZXRlIFVzZXIgRnJvbSBHcm91cA== +TmV3IFJ1bGU= +QXBwbHkgUnVsZXM= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2Ugc2VhcmNoIHNldHRpbmdzIGFuZCBmaWVsZHM= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgZW1haWwgZXZlbnRz +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgY3VzdG9tIGZpZWxkcw== +TnVtYmVyIG9mIGxpbmtzIHBlciBwYWdlIG9uIGEgc2hvcnQgbGlzdGluZw== +TnVtYmVyIG9mIHZvdGVzIGZvciBhIGxpbmsgdG8gYmUgSE9U +TWluaW11bSBudW1iZXIgb2Ygdm90ZXMgdG8gZW5hYmxlIGxpbmsgcmF0aW5n +Q29udGludWUgTGluayBWYWxpZGF0aW9u +U3RhcnQgTmV3IFZhbGlkYXRpb24= +VmFsaWRhdGU= +UmVzZXQgVmFsaWRhdGlvbiBTdGF0dXM= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgY2Vuc29yZWQgd29yZHMgYW5kIHRoZWlyIHJlcGxhY2VtZW50cw== +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2Ugc2ltbGV5cw== +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgY3VzdG9tIGZpZWxkcw== +UG9zdHM= +VGhpcyBzZWN0aW9uIHNob3dzIHN1bW1hcnkgc3RhdGlzdGljcw== +VGhpcyBzZWN0aW9uIHNob3dzIHRoZSBzZWFyY2ggbG9nIGFuZCBhbGxvd3MgdG8gbWFuYWdlIGl0 +VGhpcyBzZWN0aW9uIHNob3dzIGFsbCBhY3RpdmUgc2Vzc2lvbnMgYW5kIGFsbG93cyB0byBtYW5hZ2UgdGhlbQ== +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIHN5c3RlbSBiYWNrdXBz +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIGRhdGFiYXNlIHJlc3RvcmVz +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBleHBvcnQgSW4tcG9ydGFsIGRhdGE= +VGhpcyBzZWN0aW9uIGFsbG93cyB0byBwZXJmb3JtIGRpcmVjdCBTUUwgcXVlcmllcyBvbiBJbi1wb3J0YWwgZGF0YWJhc2U= +SGVyZSB5b3UgY2FuIHJlc3RvcmUgeW91ciBkYXRhYmFzZSBmcm9tIGEgcHJldmlvdXNseSBiYWNrZWQgdXAgc25hcHNob3QuIFJlc3RvcmluZyB5b3VyIGRhdGFiYXNlIHdpbGwgZGVsZXRlIGFsbCBvZiB5b3VyIGN1cnJlbnQgZGF0YSBhbmQgbG9nIHlvdSBvdXQgb2YgdGhlIHN5c3RlbS4= +UGxlYXNlIGVudGVyIHRoZSBSb290IHBhc3N3b3Jk +U2V0IFByaW1hcnkgVGhlbWU= +VGFibGU= +b2Y= +QmFja2luZyB1cA== +cm93KHMp +Ynl0ZXM= +R2VuZXJhbCBlcnJvcjogdW5hYmxlIHRvIGV4cG9ydA== +TGFuZ3VhZ2UgSW1wb3J0 +SW1wb3J0IHByb2dyZXNz +RW1haWwgZXZlbnRzIGltcG9ydCBwcm9ncmVzcw== +UGljaw== +RGlzYWJsZQ== +UGFzc3dvcmQgUmVxdWVzdCBDb25maXJtYXRpb24= +WW91IGhhdmUgY2hvc2VkIHRvIHJlc2V0IHlvdXIgcGFzc3dvcmQuIEEgbmV3IHBhc3N3b3JkIGhhcyBiZWVuIGF1dG9tYXRpY2FsbHkgZ2VuZXJhdGVkIGJ5IHRoZSBzeXN0ZW0uIEl0IGhhcyBiZWVuIGVtYWlsZWQgdG8geW91ciBhZGRyZXNzIG9uIGZpbGUu +U3VnZ2VzdCB0byBhIGZyaWVuZA== +UmVjb21tZW5kYXRpb24gQ29uZmlybWF0aW9u +VGhhbmtzIGZvciByZWNvbW1lbmRpbmcgb3VyIHNpdGUgdG8geW91ciBmcmllbmQuIFRoZSBlbWFpbCBoYXMgYmVlbiBzZW50IG91dC4= +QW4gU1FMIGVycm9yIGhhcyBvY2N1cmVk +Q29uZmlybWF0aW9u +QWRkIFBlbmRpbmcgTGluayBSZXN1bHRz +TGluayBSZXZpZXcgUGVuZGluZw== +U2l0ZSBMZWFkIFN0b3J5 +V2VsY29tZSB0byBJbi1wb3J0YWwgZm9ydW1zIQ== +TWFpbGluZyBMaXN0 +U3Vic2NyaXB0aW9uIENvbmZpcm1hdGlvbg== +QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIHN1YnNjcmliZSB0byBvdXIgbWFpbGluZyBsaXN0PyAoWW91IGNhbiB1bnN1YnNjcmliZSBhbnkgdGltZSBieSBlbnRlcmluZyB5b3VyIGVtYWlsIG9uIHRoZSBmcm9udCBwYWdlKS4= +Tm8= +WWVz +VW5zdWJzY3JpcHRpb24gQ29uZmlybWF0aW9u +QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIHVuc3Vic2NyaWJlIGZyb20gb3VyIG1haWxpbmcgbGlzdD8gKFlvdSBjYW4gYWx3YXlzIHN1YnNjcmliZSBhZ2FpbiBieSBlbnRlcmluZyB5b3VyIGVtYWlsIGF0IHRoZSBob21lIHBhZ2Up +VW5zdWJzY3JpYmU= +V2UgYXJlIHNvcnJ5IHlvdSBoYXZlIHVuc3Vic2NyaWJlZCBmcm9tIG91ciBtYWlsaW5nIGxpc3Q= +U3Vic2NyaWJlZA== +VGhhbmsgeW91IGZvciBzdWJzY3JpYmluZyB0byBvdXIgbWFpbGluZyBsaXN0IQ== +UmVjb21tZW5k +UHJpdmFjeQ== +Q2F0ZWdvcnkgTGVhZCBTdG9yeQ== +TWluaW11bSB1c2VyIG5hbWUgbGVuZ3Ro +TWluaW11bSBwYXNzd29yZCBsZW5ndGg= +QWdl +VW5zdWJzY3JpYmU= +U2V4 +QmFuIFVzZXIgSW5mb3JtYXRpb24= +SVAgQWRkcmVzcw== +QmFu +U2VjdGlvbiBPdmVydmlldw== +U2VsZWN0aW5nIENhdGVnb3JpZXM= +VXBkYXRpbmcgQ29uZmlndXJhdGlvbg== +VXBkYXRpbmcgUnVsZXM= +UGVyZm9ybWluZyBCYWNrdXA= +UGVyZm9ybWluZyBSZXN0b3Jl +UGVyZm9ybWluZyBFeHBvcnQ= +UGVyZm9ybWluZyBJbXBvcnQ= +UnVubmluZyBRdWVyeQ== +VG9waWNzIFVwZGF0ZWQ= +VXNlciBhbHJlYWR5IGV4aXN0cw== +UGFzc3dvcmQgcmVxdWlyZWQ= +Rmlyc3QgbmFtZSBpcyByZXF1aXJlZA== +RW1haWwgaXMgcmVxdWlyZWQ= +RGF0ZSBvZiBiaXJ0aCBpcyByZXF1aXJlZA== +UGFzc3dvcmQgaXMgdG9vIHNob3J0 +U3ViY2F0ZWdvcmllcw== +VXNlciBuYW1lIGlzIHRvbyBzaG9ydA== +TG9naW4= +RnVsbCBTdG9yeQ== +UmF0ZSB0aGlzIGFydGljbGU= +UmV2aWV3IHRoaXMgYXJ0aWNsZQ== +QXJ0aWNsZSBEZXRhaWxz +Rm9ybSBFcnJvcg== +RS1tYWlsIGFkZHJlc3MgbWlzc2luZyBvciBpbnZhbGlk +RS1tYWlsIGFkZHJlc3MgbWlzc2luZyBvciBpbnZhbGlk +Rm9ybSBFcnJvcg== +RS1tYWlsIGFkZHJlc3MgbWlzc2luZyBvciBpbnZhbGlk +Rm9ybSBFcnJvcg== +S2V5d29yZCBtaXNzaW5n +Q3JlZGl0cw== +T0s= +SmFu +RmVi +TWFy +QXBy +TWF5 +SnVu +SnVs +QXVn +U2Vw +T2N0 +Tm92 +RGVj +U2hvd2luZyBTdGF0aXN0aWNz +U2hvd2luZyBMb2dz +SW1wb3J0IGVuY291bnRlcmVkIGFuIGVycm9yIGFuZCBkaWQgbm90IGNvbXBsZXRlLg== +UmVhZCBPbmx5 +Q3JlYXRlZCBPbg== +SFRNTCBWZXJzaW9u +VGV4dCBWZXJzaW9u +Tm9uZQ== +Tm9uZQ== +U2hvd2luZyBMb2dz +U3RlcA== +TWlzc2luZyBvciBpbnZhbGlkIHZhbHVlcy4gUGxlYXNlIGNoZWNrIGFsbCB0aGUgZmllbGRzIGFuZCB0cnkgYWdhaW4u +U2Vzc2lvbiBFeHBpcmVk +QWN0aXZlIExpbmtz +UGVuZGluZyBSZWdpc3RyYXRpb24gQ29tcGxldGU= +RXJyb3I= +UnVubmluZyB0aGlzIHV0aWxpdHkgd2lsbCBhZmZlY3QgeW91ciBkYXRhYmFzZS4gUGxlYXNlIGJlIGFkdmlzZWQgdGhhdCB5b3UgY2FuIHVzZSB0aGlzIHV0aWxpdHkgYXQgeW91ciBvd24gcmlzay4gSW50ZWNobmljIENvcnBvcmF0aW9uIGNhbiBub3QgYmUgaGVsZCBsaWFibGUgZm9yIGFueSBjb3JydXB0IGRhdGEgb3IgZGF0YSBsb3NzLg== +UGxlYXNlIG1ha2Ugc3VyZSB0byBiYWNrIHVwIHlvdXIgZGF0YWJhc2UocykgYmVmb3JlIHJ1bm5pbmcgdGhpcyB1dGlsaXR5Lg== +U2VjdGlvbiBDb21pbmcgU29vbg== +U2hvd2luZyBVc2Vycw== +WW91IGRvIG5vdCBoYXZlIGFjY2VzcyB0byBwZXJmb3JtIHRoaXMgb3BlcmF0aW9u +VGhhbmsgeW91IGZvciByZWdpc3RlcmluZy4gWW91ciByZWdpc3RyYXRpb24gaXMgcGVuZGluZyBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbC4= +UmVjb21tZW5kIHRoaXMgc2l0ZSB0byBhIGZyaWVuZA== +RWRpdG9yJ3MgUGljaw== +TW9kaWZ5IExpbms= +TGluayBNb2RpZmljYXRpb24gQ29uZmlybWF0aW9u +WW91ciBsaW5rIGhhcyBiZWVuIG1vZGlmaWVkLg== +QWN0aXZl +VGhlIHZlcnNpb25zIG9mIHRoZSBiYWNrdXAgYW5kIHlvdXIgY29kZSBkb24ndCBtYXRjaC4gWW91ciBpbnN0YWxsYXRpb24gd2lsbCBwcm9iYWJseSBiZSBub24gb3BlcmF0aW9uYWwu +Q29udGludWUgdG8gcmVzdG9yZSBhdCBteSBvd24gcmlzaz8= +VG9waWMgTG9ja2Vk +UG9zdHMgdG8gbG9jaw== +TW9kaWZpY2F0aW9ucyB3aWxsIG5vdCB0YWtlIGVmZmVjdCB1bnRpbCB5b3UgY2xpY2sgdGhlIFNhdmUgYnV0dG9uIQ== +U2hvd2luZyBHcm91cHM= +R2VuZXJhbCBTZXR0aW5ncw== +VG90YWwgVG9waWNz +QWN0aXZlIFRvcGljcw== +UGVuZGluZyBUb3BpY3M= +RGlzYWJsZWQgVG9waWNz +TmV3IFRvcGljcw== +RWRpdG9yIFBpY2sgVG9waWNz +SG90IFRvcGljcw== +UG9wdWxhciBUb3BpY3M= +VG9waWNzIEF2ZXJhZ2UgUmF0aW5n +VG9waWMgTWF4aW11bSBIaXRz +VG9waWMgTWF4aW11bSBWb3Rlcw== +TmV3ZXN0IFRvcGljIERhdGU= +TmV3ZXN0IFRvcGljIFRpbWU= +TGFzdCBVcGRhdGVkIFRvcGljIERhdGU= +TGFzdCBVcGRhdGVkIFRvcGljIFRpbWU= +VG90YWwgVG9waWMgUmV2aWV3cw== +VG90YWwgUG9zdHM= +TmV3ZXN0IFBvc3QgRGF0ZQ== +TmV3ZXN0IFBvc3QgVGltZQ== +TGFzdCBVcGRhdGVkIFBvc3QgRGF0ZQ== +TGFzdCBVcGRhdGVkIFBvc3QgVGltZQ== +UGVuZGluZyBMaW5rcw== +RGlzYWJsZWQgTGlua3M= +TmV3IExpbmtz +RWRpdG9yJ3MgUGljayBMaW5rcw== +SG90IExpbmtz +UG9wdWxhciBMaW5rcw== +QXZlcmFnZSBSYXRpbmcgb2YgTGlua3M= +TWF4aW11bSBIaXRzIG9mIGEgTGluaw== +TWF4aW11bSBWb3RlcyBvZiBhIExpbms= +TmV3ZXN0IExpbmsgRGF0ZQ== +TGFzdCBVcGRhdGVkIExpbms= +VG90YWwgTGluayBSZXZpZXdz +VG90YWwgQXJ0aWNsZXM= +QWN0aXZlIEFydGljbGVz +UGVuZGluZyBBcnRpY2xlcw== +RGlzYWJsZWQgQXJ0aWNsZXM= +QXJjaGl2ZWQgQXJ0aWNsZXM= +TmV3IEFydGljbGVz +RWRpdG9yJ3MgUGljayBBcnRpY2xlcw== +SG90IEFydGljbGVz +TGVhZCBTdG9yeSBBcnRpY2xlcw== +Q2F0ZWdvcnkgTGVhZCBTdG9yeSBBcnRpY2xlcw== +QXZlcmFnZSBSYXRpbmcgb2YgQXJ0aWNsZXM= +UG9wdWxhciBBcnRpY2xlcw== +TWF4aW11bSBIaXRzIG9mIGFuIEFydGljbGU= +TWF4aW11bSBWb3RlcyBvZiBhbiBBcnRpY2xl +TmV3ZXN0IEFydGljbGUgRGF0ZQ== +TGFzdCBVcGRhdGVkIEFydGljbGU= +VG90YWwgQXJ0aWNsZSBSZXZpZXdz +VG90YWwgQ2F0ZWdvcmllcw== +UGVuZGluZyBDYXRlZ29yaWVz +RGlzYWJsZWQgQ2F0ZWdvcmllcw== +TmV3IENhdGVnb3JpZXM= +RWRpdG9yJ3MgUGljayBDYXRlZ29yaWVz +TmV3ZXN0IENhdGVnb3J5IERhdGU= +TGFzdCBDYXRlZ29yeSBVcGRhdGU= +VG90YWwgVXNlcnMgd2l0aCBUb3BpY3M= +QWN0aXZlIFVzZXJz +UGVuZGluZyBVc2Vycw== +RGlzYWJsZWQgVXNlcnM= +TmV3ZXN0IFVzZXIgRGF0ZQ== +TnVtYmVyIG9mIFVuaXF1ZSBDb3VudHJpZXMgb2YgVXNlcnM= +TnVtYmVyIG9mIFVuaXF1ZSBTdGF0ZXMgb2YgVXNlcnM= +VG90YWwgVXNlciBHcm91cHM= +QmFubmVkIFVzZXJz +Q3VycmVudGx5IEFjdGl2ZSBVc2VyIFNlc3Npb25z +TnVtYmVyIG9mIFRoZW1lcw== +TnVtYmVyIG9mIFJlZ2lvbiBQYWNrcw== +TnVtYmVyIG9mIERhdGFiYXNlIFRhYmxlcw== +TnVtYmVyIG9mIERhdGFiYXNlIFJlY29yZHM= +VG90YWwgU2l6ZSBvZiBTeXN0ZW0gRmlsZXM= +VG90YWwgU2l6ZSBvZiB0aGUgRGF0YWJhc2U= +TUI= +S0I= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogSW4tcG9ydGFsIHJlZ2lzdHJhdGlvbgoKRGVhciA8aW5wOnRvdXNlciBfRmllbGQ9IkZpcnN0TmFtZSIgLz4gPGlucDp0b3VzZXIgX0ZpZWxkPSJMYXN0TmFtZSIgLz4sDQoNClRoYW5rIHlvdSBmb3IgcmVnaXN0ZXJpbmcgb24gPGlucDptX3BhZ2VfdGl0bGUgLz4uIFlvdXIgcmVnaXN0cmF0aW9uIGlzIG5vdyBhY3RpdmUu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTmV3IHVzZXIgaGFzIGJlZW4gYWRkZWQKCkEgbmV3IHVzZXIgIjxpbnA6dG91c2VyIF9GaWVsZD0iVXNlck5hbWUiIC8+IiBoYXMgYmVlbiBhZGRlZC4= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogWW91IGhhdmUgYmVlbiBhcHByb3ZlZAoKV2VsY29tZSB0byBJbi1wb3J0YWwhDQpZb3VyIHVzZXIgcmVnaXN0cmF0aW9uIGhhcyBiZWVuIGFwcHJvdmVkLiBZb3VyIHVzZXIgbmFtZSBpcyAiPGlucDp0b3VzZXIgX0ZpZWxkPSJVc2VyTmFtZSIgLz4iLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciBhcHByb3ZlZAoKVXNlciAiPGlucDp0b3VzZXIgX0ZpZWxkPSJVc2VyTmFtZSIgLz4iIGhhcyBiZWVuIGFwcHJvdmVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogSW4tcG9ydGFsIHJlZ2lzdHJhdGlvbgoKV2VsY29tZSB0byBJbi1wb3J0YWwhDQpZb3VyIHVzZXIgcmVnaXN0cmF0aW9uIGhhcyBiZWVuIGFwcHJvdmVkLiBZb3VyIHVzZXIgbmFtZSBpcyAiPGlucDp0b3VzZXIgX0ZpZWxkPSJVc2VyTmFtZSIgLz4iIGFuZCB5b3VyIHBhc3N3b3JkIGlzICI8aW5wOnRvdXNlciBfRmllbGQ9InBhc3N3b3JkIiAvPiIuDQo= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciB2YWxpZGF0ZWQKClVzZXIgIjxpbnA6dG91c2VyIF9GaWVsZD0iVXNlck5hbWUiIC8+IiBoYXMgYmVlbiB2YWxpZGF0ZWQu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQWNjZXNzIGRlbmllZAoKWW91ciByZWdpc3RyYXRpb24gdG8gPGlucDptX3BhZ2VfdGl0bGUgLz4gaGFzIGJlZW4gZGVuaWVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciBkZW5pZWQKClVzZXIgIjxpbnA6dG91c2VyIF9GaWVsZD0iVXNlck5hbWUiIC8+IiBoYXMgYmVlbiBkZW5pZWQu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTG9zdCBwYXNzd29yZAoKWW91ciBsb3N0IHBhc3N3b3JkIGhhcyBiZWVuIHJlc2V0LiBZb3VyIG5ldyBwYXNzd29yZCBpczogIjxpbnA6dG91c2VyIF9GaWVsZD0iUGFzc3dvcmQiIC8+Ii4= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTG9zdCBwYXNzd29yZAoKWW91ciBsb3N0IHBhc3N3b3JkIGhhcyBiZWVuIHJlc2V0LiBZb3VyIG5ldyBwYXNzd29yZCBpczogIjxpbnA6dG91c2VyIF9GaWVsZD0iUGFzc3dvcmQiIC8+Ii4= +U3ViamVjdDogQ2F0ZWdvcnkgYWRkZWQKCllvdXIgc3VnZ2VzdGVkIGNhdGVnb3J5ICI8aW5wOm1fY2F0ZWdvcnlfZmllbGQgX0ZpZWxkPSJOYW1lIiBfU3RyaXBIVE1MPSIxIi8+IiBoYXMgYmVlbiBhZGRlZC4= + +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBhZGRlZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gYWRkZWQu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBkZWxldGVkCgpBIGNhdGVnb3J5ICI8aW5wOm1fY2F0ZWdvcnlfZmllbGQgX0ZpZWxkPSJOYW1lIiBfU3RyaXBIVE1MPSIxIi8+IiBoYXMgYmVlbiBkZWxldGVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBkZWxldGVkCgpBIGNhdGVnb3J5ICI8aW5wOm1fY2F0ZWdvcnlfZmllbGQgX0ZpZWxkPSJOYW1lIiBfU3RyaXBIVE1MPSIxIi8+IiBoYXMgYmVlbiBkZWxldGVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBtb2RpZmllZAoKWW91ciBzdWdnZXN0ZWQgY2F0ZWdvcnkgIjxpbnA6bV9jYXRlZ29yeV9maWVsZCBfRmllbGQ9Ik5hbWUiIF9TdHJpcEhUTUw9IjEiLz4iIGhhcyBiZWVuIG1vZGlmaWVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBtb2RpZmllZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gbW9kaWZpZWQu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBhcHByb3ZlZAoKWW91ciBzdWdnZXN0ZWQgY2F0ZWdvcnkgIjxpbnA6bV9jYXRlZ29yeV9maWVsZCBfRmllbGQ9Ik5hbWUiIF9TdHJpcEhUTUw9IjEiLz4iIGhhcyBiZWVuIGFwcHJvdmVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBhcHByb3ZlZAoKQSBjYXRlZ29yeSAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gYXBwcm92ZWQu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBkZW5pZWQKCllvdXIgY2F0ZWdvcnkgc3VnZ2VzdGlvbiAiPGlucDptX2NhdGVnb3J5X2ZpZWxkIF9GaWVsZD0iTmFtZSIgX1N0cmlwSFRNTD0iMSIvPiIgaGFzIGJlZW4gZGVuaWVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSBjYXRlZ29yeSBoYXMgYmVlbiBkZW5pZWQKCkEgY2F0ZWdvcnkgIjxpbnA6bV9jYXRlZ29yeV9maWVsZCBfRmllbGQ9Ik5hbWUiIF9TdHJpcEhUTUw9IjEiLz4iIGhhcyBiZWVuIGRlbmllZC4= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogU3Vic2NyaXB0aW9uIGNvbmZpcm1hdGlvbgoKWW91IGhhdmUgc3Vic2NyaWJlZCB0byA8aW5wOm1fcGFnZV90aXRsZSAvPiBtYWlsaW5nIGxpc3Qu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQSB1c2VyIGhhcyBzdWJzY3JpYmVkCgpBIHVzZXIgaGFzIHN1YnNjcmliZWQgdG8gPGlucDptX3BhZ2VfdGl0bGUgLz4gbWFpbGluZyBsaXN0Lg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogWW91IGhhdmUgYmVlbiB1bnN1YnNjcmliZWQKCllvdSBoYXZlIHN1Y2Nlc3NmdWxseSB1bnN1YnNyaWJlZCBmcm9tIDxpbnA6bV9wYWdlX3RpdGxlIC8+IG1haWxpbmcgbGlzdC4= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVXNlciB1bnN1YnNyaWJlZAoKQSB1c2VyIGhhcyB1bnN1YnNjcmliZWQu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVG9waWMgYWRkZGUKCkEgdG9waWMgaGFzIGJlZW4gYWRkZWQu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogUG9zdCBhZGRlZAoKQSBwb3N0IGhhcyBiZWVuIGFkZGVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogUG9zIG1vZGlmaWVkCgpBIHBvc3QgaGFzIGJlZW4gbW9kaWZpZWQu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogUG9zdCBhZGRlZAoKWW91ciBwb3N0IGhhcyBiZWVuIGFkZGVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhZGRlZAoKQSBsaW5rIGhhcyBiZWVuIGFkZGVk +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmllZAoKQSBsaW5rIGhhcyBiZWVuIG1vZGlmaWVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCkEgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhZGRlZAoKWW91ciBsaW5rIGhhcyBiZWVuIGFkZGVkLg== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhcHByb3ZlZAoKWW91ciBsaW5rIGhhcyBiZWVuIGFwcHJvdmVk +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBkZW5pZWQKCllvdXIgbGluayBoYXMgYmVlbiBkZW5pZWQu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmVkCgpZb3VyIGxpbmsgaGFzIGJlZW4gbW9kaWZpZWQ= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhcHByb3ZlZAoKWW91ciBsaW5rIG1vZGlmaWNhdGlvbiBoYXMgYmVlbiBhcHByb3ZlZA== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYXBwcm92ZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYXBwcm92ZWQ= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgZGVjbGluZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gZGVjbGluZWQ= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQgYW5kIGlzIHBlbmRpbmcgYXBwcm92YWwu +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmljYXRpb24gZGVuaWVkCgpZb3VyIGxpbmsgbW9kaWZpY2F0aW9uIGhhcyBiZWVuIGRlbmllZC4= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSBhZGRlZAoKQW4gYXJ0aWNsZSBoYXMgYmVlbiBhZGRlZA== +U3ViamVjdDogQXJ0aWNsZSBhZGRlZAoKWW91ciBhcnRpY2xlIGhhcyBiZWVuIGFkZGVk +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSBtb2RpZmVkCgpBbiBhcnRpY2xlIGhhcyBiZWVuIG1vZGlmaWVk +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSByZXZpZXcgYWRkZWQKCkFuIGFydGljbGUgcmV2aWV3IGhhcyBiZWVuIGFkZGVk +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSBhcHByb3ZlZAoKWW91ciBzdWJtaXR0ZWQgYXJ0aWNsZSBoYXMgYmVlbiBhcHByb3ZlZA== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSBkZWNsaW5lZAoKWW91ciBzdWJtaXR0ZWQgYXJ0aWNsZSBoYXMgYmVlbiBkZWNsaW5lZA== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSBtb2RpZmllZAoKWW91ciBhcnRpY2xlIGhhcyBiZWVuIG1vZGlmZWQ= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSBtb2RpZmljYXRpb24gYXBwcm92ZWQKCllvdXIgYXJ0aWNsZSBtb2RpZmljYXRpb24gaGFzIGJlZW4gYXBwcm92ZWQ= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSBtb2RpZmljYXRpb24gZGVjbGluZWQKCllvdXIgYXJ0aWNsZSBtb2RpZmljYXRpb24gaGFzIGJlZW4gZGVjbGluZWQ= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSByZXZpZXcgYWRkZWQKCllvdXIgcmV2aWV3IGhhcyBiZWVuIGFkZGVk +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSByZXZpZXcgYXBwcm92ZWQKCllvdXIgYXJ0aWNsZSByZXZpZXcgaGFzIGJlZW4gYXBwcm92ZWQ= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQXJ0aWNsZSByZXZpZXcgZGVjbGluZWQKCllvdXIgYXJ0aWNsZSByZXZpZXcgaGFzIGJlZW4gZGVjbGluZWQ= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogUmV2aWV3IHBlbmRpbmcKCllvdXIgYXJ0aWNsZSByZXZpZXcgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIGRhdGFiYXNlIGFuZCBpcyBjdXJyZW50bHkgcGVuZGluZyBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbA== +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogQ2hlY2sgb3V0IHRoaXMgc2l0ZQoKSGksDQoNClRoaXMgbWVzc2FnZSBoYXMgYmVlbiBzZW50IHRvIHlvdSBmcm9tIG9uZSBvZiB5b3VyIGZyaWVuZHMuDQpDaGVjayBvdXQgdGhpcyBzaXRlOiA8YSBocmVmPSI8aW5wOm1fdGhlbWVfdXJsX3BhZ2U9ImN1cnJlbnQiLz4iPjxpbnA6bV9wYWdlX3RpdGxlIC8+PC9hPiE= +WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVGhlIHNpdGUgaGFzIGJlZW4gc3VnZ2VzdGVkCgpBIHZpc2l0b3Igc3VnZ2VzdGVkIHlvdXIgc2l0ZSB0byBhIGZyaWVuZC4= + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_usertogroup_f2.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/parse.php =================================================================== diff -u --- trunk/kernel/include/parse.php (revision 0) +++ trunk/kernel/include/parse.php (revision 13) @@ -0,0 +1,982 @@ +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() + { +// global $logentry; + + $func = $this->name; +// $logentry++; +// LogEntry("Parsing Tag: $func\n"); + $override = "_".$func; + //echo "Function: $func; Parameters:
"; print_r($this->attributes); echo "
"; + if(function_exists($override)) + { + $ret = @$override($this->attributes); + } + else + { + if(function_exists($func)) + { + $ret = @$func($this->attributes); + } + else + { + //$ret = "{Unknown Tag:" .$this->name."}"; + } + } +// $LogEntry--; + 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) + { + $filename = $this->TemplateFilename($template_root); + if(file_exists($filename)) + { + //echo "Loading $filename from Filesystem
\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) + { + if(in_array($template,$this->stack)) + { + return TRUE; + } + else + return FALSE; + } + + function GetTemplate($name,$SupressError=FALSE) + { + if(!strlen($name)) + { + $ret = FALSE; + if(!$SupressError) + { + $this->ErrorNo = -2; + $this->ErrorStr=language("lu_template_error").":".language("lu_no_template_error"); + } + } + else + { + $ret = FALSE; + 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)) + { + $this->templates[$name]=$ret; + } + else + { + 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)."
\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."
\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; + + $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;$pHasCatPermission(trim($plist[$p]))) + { + $value = 1; + break; + } + else + { + if($CheckSys) + { + if($objSession->HasSystemPermission(trim($plist[$p]))) + { + $value = 1; + break; + } + } + } + } + if($value) + { + $t = $tag->GetAttributeByName("_template"); + } + else + $t = $tag->GetAttributeByName("_noaccess"); + } + else + { + $module = $tag->GetAttributeByName("_module"); + if(strlen($module)) + { + if(ModuleEnabled($module)) + { + $t = $tag->GetAttributeByName("_template"); + } + else + $t = $tag->GetAttributeByName("_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; + }//switch + + 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; + } + + /* 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->attributes["_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->attributes["_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 = "",$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 = ""; + + ## Try to find end of TagName + $TagNameEnd = strpos($html, " ", $next_tag); + + ## Support Old version +// $closer = strpos(strtolower($html),"",$next_tag); + if ($TagNameEnd) + { + $Tag = strtolower(substr($html, $next_tag, $TagNameEnd-$next_tag)); + $TagName = explode(":", $Tag); + if (strlen($TagName[1])) + $CloserTag = ""; + } + 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,"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; + } +} + +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 = "",$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),"",$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,"GetTemplate($tname,$SupressError); + if(is_object($t)) + { + $html = $this->ParseTemplateText($t->source); + $t->out = $html; + } + unset($t); + return $html; + } + + function ReadTemplateTags($tname) + { + $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; +} + +?> Index: trunk/admin/icons/icon24_stats.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/search_results/cat_search_results.tpl =================================================================== diff -u --- trunk/themes/default/search_results/cat_search_results.tpl (revision 0) +++ trunk/themes/default/search_results/cat_search_results.tpl (revision 13) @@ -0,0 +1,163 @@ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + + + + + + +


+ + + + + +

"> > + "> > +
+
 
+ + +
+ + + + + + + + +

+
+ + + + + + + + +
+ + + + + + + +

 
+ + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + +
+

+
+
"> + " class="input" style="width: 235px;">  + " class="button">
+ "> + +


+



+ + + + + + + + + +
+ + + + + + + +
+

()

+

+
+ + + + + + + + +

+ +
+ +
+

+

+ +

+

+ +
+
+ + + + Index: trunk/kernel/admin/include/toolbar/restore_toolbar.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/restore_toolbar.php (revision 0) +++ trunk/kernel/admin/include/toolbar/restore_toolbar.php (revision 13) @@ -0,0 +1,27 @@ + + + + +END; +?> \ No newline at end of file Index: trunk/admin/images/toolbar/tool_validate.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.showtableborders.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_preview_template_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/login/login_form.tpl =================================================================== diff -u --- trunk/themes/default/login/login_form.tpl (revision 0) +++ trunk/themes/default/login/login_form.tpl (revision 13) @@ -0,0 +1,59 @@ + + "> + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

*
 
*
 
  
  + ">
+
+ " class="button">  " class="button" onClick="javascript:history.back(1);"> +
 


+
+

+ +


+ "> + +
+
\ No newline at end of file Index: trunk/admin/editor/FCKeditor/css/fck_editor.css =================================================================== diff -u --- trunk/admin/editor/FCKeditor/css/fck_editor.css (revision 0) +++ trunk/admin/editor/FCKeditor/css/fck_editor.css (revision 13) @@ -0,0 +1,82 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_editor.css: Styles used by the editor structure (toolbar, etc). + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +BODY, TD, SELECT, INPUT +{ + font-size: 11px; + font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif; +} + +SELECT, INPUT +{ + vertical-align: middle; +} + +.Toolbar +{ + background-color: #efefde; +} + +.ButtonOut +{ + filter: alpha(opacity=70); + border-right: #efefde 1px solid; + border-top: #efefde 1px solid; + border-left: #efefde 1px solid; + border-bottom: #efefde 1px solid; +} + +.ButtonOver +{ + background-color: #c1d2ee; + border-right: #316ac5 1px solid; + border-top: #316ac5 1px solid; + border-left: #316ac5 1px solid; + border-bottom: #316ac5 1px solid; +} + +.ButtonOff +{ + filter: gray() alpha(opacity=30); + border-right: #efefde 1px solid; + border-top: #efefde 1px solid; + border-left: #efefde 1px solid; + border-bottom: #efefde 1px solid; +} + +.ButtonHidden +{ + visibility: hidden; +} + +.EditorBody +{ + margin-top: 5px; + margin-bottom: 5px; + margin-right: 5px; + margin-left: 5px; +} + +.EditorArea +{ + padding-right: 0px; + padding-left: 0px; + padding-bottom: 0px; + margin: 0px; + width: 100%; + padding-top: 0px; + height: 100%; +} Index: trunk/admin/icons/icon46_groupsearch.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-ado_mssql.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-ado_mssql.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-ado_mssql.inc.php (revision 13) @@ -0,0 +1,36 @@ +ADORecordSet_ado($id); + } +} +?> \ No newline at end of file Index: trunk/kernel/admin/include/toolbar/backup.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/backup.php (revision 0) +++ trunk/kernel/admin/include/toolbar/backup.php (revision 13) @@ -0,0 +1,25 @@ + + + + +END; +?> \ No newline at end of file Index: trunk/admin/images/folder.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/cs.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/cs.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/cs.js (revision 13) @@ -0,0 +1,197 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * cz.js: Czech support. + * + * Authors: + * Plachow (plachow@atlas.cz) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Vyjmout" ; +lang["Copy"] = "Kopírovat" ; +lang["Paste"] = "Vložit" ; +lang["PasteText"] = "Vložit bez formátování" ; +lang["PasteWord"] = "Vložit z Wordu" ; +lang["Find"] = "Najít" ; +lang["SelectAll"] = "Vybrat vše" ; +lang["RemoveFormat"] = "Odstranit formátování" ; +lang["InsertLink"] = "Vložit/změnit odkaz" ; +lang["RemoveLink"] = "Odstranit odkaz" ; +lang["InsertImage"] = "Vložit/změnit obrázek" ; +lang["InsertTable"] = "Vložit/změnit tabulku" ; +lang["InsertLine"] = "Vložit horizontální linku" ; +lang["InsertSpecialChar"] = "Vložit speciální znak" ; +lang["InsertSmiley"] = "Vložit smajlík" ; +lang["About"] = "O aplikaci FCKeditor" ; + +lang["Bold"] = "Tučně" ; +lang["Italic"] = "Kurzíva" ; +lang["Underline"] = "Podtržení" ; +lang["StrikeThrough"] = "Přeškrtnutí" ; +lang["Subscript"] = "Spodní index" ; +lang["Superscript"] = "Horní index" ; +lang["LeftJustify"] = "Zarovnat vlevo" ; +lang["CenterJustify"] = "Zarovnat na střed" ; +lang["RightJustify"] = "Zarovnat vpravo" ; +lang["BlockJustify"] = "Zarovnat do bloku" ; +lang["DecreaseIndent"] = "Zmenšit odsazení" ; +lang["IncreaseIndent"] = "Zvětšit odsazení" ; +lang["Undo"] = "Zpět" ; +lang["Redo"] = "Znovu" ; +lang["NumberedList"] = "Číslovaný seznam" ; +lang["BulettedList"] = "Seznam s odrážkami" ; + +lang["ShowTableBorders"] = "Zobrazit ohraničení tabulek" ; +lang["ShowDetails"] = "Zobrazit podrobnosti" ; + +lang["FontStyle"] = "Styl" ; +lang["FontFormat"] = "Formát" ; +lang["Font"] = "Písmo" ; +lang["FontSize"] = "Velikost" ; +lang["TextColor"] = "Barva textu" ; +lang["BGColor"] = "Barva pozadí" ; +lang["Source"] = "Zdroj" ; + +// Context Menu + +lang["EditLink"] = "Vlastnosti odkazu" ; +lang["InsertRow"] = "Vložit řádek" ; +lang["DeleteRows"] = "Smazat řádek" ; +lang["InsertColumn"] = "Vložit sloupec" ; +lang["DeleteColumns"] = "Smazat sloupec" ; +lang["InsertCell"] = "Vložit buňku" ; +lang["DeleteCells"] = "Smazat buňky" ; +lang["MergeCells"] = "Sloučit buňky" ; +lang["SplitCell"] = "Rozdělit buňku" ; +lang["CellProperties"] = "Vlastnosti buňky" ; +lang["TableProperties"] = "Vlastnosti tabulky" ; +lang["ImageProperties"] = "Vlastnosti obrázku" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Zpracovávám XHTML. Moment, prosím..." ; +lang["Done"] = "Hotovo" ; +lang["PasteWordConfirm"] = "Text, který právě vkládáte do dokumentu, pochází pravděpodobně z aplikace MS Word.\nChcete provést vyčištění zdojového kódu?" ; +lang["NotCompatiblePaste"] = "Tento příkaz je funkční pouze v IE verze 5.5 a vyšší. Chcete vložit text bez vyčištění?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Zrušit" ; +lang["DlgBtnClose"] = "Zavřít" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Vložit obrázek" ; +lang["DlgImgTitleEdit"] = "Změnit obrázek" ; +lang["DlgImgBtnUpload"] = "Poslat na server" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Upload" ; +lang["DlgImgBtnBrowse"] = "Procházet server" ; +lang["DlgImgAlt"] = "Alternativní text" ; +lang["DlgImgWidth"] = "Šířka" ; +lang["DlgImgHeight"] = "Výška" ; +lang["DlgImgLockRatio"] = "Zachovat poměr stran" ; +lang["DlgBtnResetSize"] = "Původní velikost" ; +lang["DlgImgBorder"] = "Okraj" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Zarovnání" ; +lang["DlgImgAlignLeft"] = "Left" ; +lang["DlgImgAlignAbsBottom"] = "Abs Bottom" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Middle" ; +lang["DlgImgAlignBaseline"] = "Baseline" ; +lang["DlgImgAlignBottom"] = "Bottom" ; +lang["DlgImgAlignMiddle"] = "Middle" ; +lang["DlgImgAlignRight"] = "Right" ; +lang["DlgImgAlignTextTop"] = "Text Top" ; +lang["DlgImgAlignTop"] = "Top" ; +lang["DlgImgPreview"] = "Náhled" ; +lang["DlgImgMsgWrongExt"] = "Jsou povoleny pouze následující datové typy:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperace zrušena." ; +lang["DlgImgAlertSelect"] = "Please select an image to upload." ; // TODO + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; // TODO +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Upload" ; +lang["DlgLnkTarget"] = "Cíl" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Nové okno (_blank)" ; +lang["DlgLnkTargetParent"] = "Rodičovské okno (_parent)" ; +lang["DlgLnkTargetSelf"] = "Stejné okno (_self)" ; +lang["DlgLnkTargetTop"] = "Hlavní okno (_top)" ; +lang["DlgLnkTitle"] = "Nadpis" ; +lang["DlgLnkBtnUpload"] = "Poslat na server" ; +lang["DlgLnkBtnBrowse"] = "Procházet server" ; +lang["DlgLnkMsgWrongExtA"] = "Pro upload jsou povoleny pouze následující datové typy:\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperace zrušena." ; +lang["DlgLnkMsgWrongExtD"] = "Tyto datové typy nejsou povoleny pro upload:\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperace zrušena." ; + +// Color Dialog +lang["DlgColorTitle"] = "Vyberte barvu" ; +lang["DlgColorBtnClear"] = "Vymazat" ; +lang["DlgColorHighlight"] = "Zvýraznit" ; +lang["DlgColorSelected"] = "Vybraná" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Vložení smajlíku" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Vložení speciálního znaku" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Vložení tabulky" ; +lang["DlgTableTitleEdit"] = "Editace tabulky" ; +lang["DlgTableRows"] = "Řádky" ; +lang["DlgTableColumns"] = "Sloupce" ; +lang["DlgTableBorder"] = "Tloušťka okrajů" ; +lang["DlgTableAlign"] = "Zarovnání" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Vlevo" ; +lang["DlgTableAlignCenter"] = "Na střed" ; +lang["DlgTableAlignRight"] = "Vpravo" ; +lang["DlgTableWidth"] = "Šířka" ; +lang["DlgTableWidthPx"] = "pixelů" ; +lang["DlgTableWidthPc"] = "procent" ; +lang["DlgTableHeight"] = "Výška" ; +lang["DlgTableCellSpace"] = "Mezera mezi buňkami" ; +lang["DlgTableCellPad"] = "Odsazení v buňce" ; +lang["DlgTableCaption"] = "Titulek" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Vlastnosti buňky" ; +lang["DlgCellWidth"] = "Šířka" ; +lang["DlgCellWidthPx"] = "pixelů" ; +lang["DlgCellWidthPc"] = "procent" ; +lang["DlgCellHeight"] = "Výška" ; +lang["DlgCellWordWrap"] = "Zalomení textu" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Ano" ; +lang["DlgCellWordWrapNo"] = "ne" ; +lang["DlgCellHorAlign"] = "Horizontální zarovnání" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Vlevo" ; +lang["DlgCellHorAlignCenter"] = "Na střed" ; +lang["DlgCellHorAlignRight"] = "Vpravo" ; +lang["DlgCellVerAlign"] = "Vertikální zarovnání" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Top" ; +lang["DlgCellVerAlignMiddle"] = "Middle" ; +lang["DlgCellVerAlignBottom"] = "Bottom" ; +lang["DlgCellVerAlignBaseline"] = "Baseline" ; +lang["DlgCellRowSpan"] = "Spřežení řádků" ; +lang["DlgCellCollSpan"] = "Spřežení sloupců" ; +lang["DlgCellBackColor"] = "Barva pozadí" ; +lang["DlgCellBorderColor"] = "Barva okrajů" ; +lang["DlgCellBtnSelect"] = "Vybrat..." ; + +// About Dialog +lang["DlgAboutVersion"] = "verze" ; +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "For further information go to" ; Index: trunk/themes/default/mailing_list/error.tpl =================================================================== diff -u --- trunk/themes/default/mailing_list/error.tpl (revision 0) +++ trunk/themes/default/mailing_list/error.tpl (revision 13) @@ -0,0 +1,114 @@ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +



+ + + + + + + + + + + +

+ + + + + + +

+ + + + + + + +
" width="18" height="12" alt="" />
   
+
+ +

+ + + + + + + + +

+
+ + " /> + + + + + + + + + + + + + + + + + + + + + +



  +
+


+ +

+



+
+ " class="button"> +
+
+ + +

+
+ + + Index: trunk/themes/default/img/ic_pop.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/crazy.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/advsearch/alt_item_form_last.tpl =================================================================== diff -u --- trunk/themes/default/advsearch/alt_item_form_last.tpl (revision 0) +++ trunk/themes/default/advsearch/alt_item_form_last.tpl (revision 13) @@ -0,0 +1,5 @@ + + +
+   + Index: trunk/kernel/include/theme.php =================================================================== diff -u --- trunk/kernel/include/theme.php (revision 0) +++ trunk/kernel/include/theme.php (revision 13) @@ -0,0 +1,735 @@ +clsItem(); + $this->tablename = GetTablePrefix()."ThemeFiles"; + $this->id_field = "FileId"; + $this->NoResourceId=1; + $this->Root = ""; + $this->Contents = ''; + if($id) $this->LoadFromDatabase($id); + } + + 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"); + //echo "Full Path is $path
\n"; + return str_replace('//','/',$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]
"; + 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); + $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="") + { + global $objConfig; + + $this->Clear(); + $this->ThemeId=$id; + $sql = "SELECT * FROM ".$this->SourceTable. " WHERE ThemeId=$id "; + if(strlen(trim($where))) + $sql .= $where." "; + if(strlen(trim($orderBy))) + $sql .= "ORDER BY $orderBy"; + + 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
\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."
\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); + //echo $f->Get("FilePath")."/".$f->Get("FileName")."
\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) + { + global $objConfig, $pathchar, $pathtoroot, $ttt_time; + + $this->Clear(); + $fullpath = $pathtoroot."themes/".$path; + $this->LoadFiles($this->ThemeId); + + //assemble directoy file list + $files = filelist($fullpath, NULL, "tpl"); + + //assemble DB file list + $tt_inc=0; + $db_file_array=array(0 => '0'); + foreach($this->Items as $f) + { + $db_file_array[$tt_inc]=$f->Get("FilePath").$f->Get("FileName"); + $tt_inc++; + } + + //iterate through all files in the directory + for($i=0;$iAddFile($file_path,$file_base,$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() + { + $sql = "SELECT * FROM ".GetTablePrefix()."ThemeFiles WHERE ThemeId=".$this->Get("ThemeId"); + $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
\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 "
"; print_r($this->IdCache); echo "
"; + } + + 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() + { + 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"))); + } + + 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); + } + + function Delete() + { + $this->Files->DeleteAll(); + $dir = $this->ThemeDirectory(); + if(is_writable($dir)) + @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()."?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="",$order="") + { + global $objConfig; + + $this->Clear(); + $sql = "SELECT * FROM ".$this->SourceTable." "; + if(strlen(trim($where))) + $sql .= "WHERE ".$where." "; + if(strlen(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) + { + $t = new clsTheme(); + $t->tablename = $this->SourceTable; + $t->Set(array("Name","Description","Enabled","PrimaryTheme","CacheTimeout"), + array($Name,$Description,$Enabled,$Primary,$CacheTimeout)); + $t->Create(); + 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) + { + $t = $this->GetItem($ThemeId); + $t->Set(array("Name","Description","Enabled","PrimaryTheme","CacheTimeout"), + array($Name, $Description, $Enabled, $Primary, $CacheTimeout)); + $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); + $t->Delete(); + } + + function SetPrimaryTheme($ThemeId) + { + $theme = $this->GetItem($ThemeId); + 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() + { + global $objConfig,$pathchar, $pathtoroot; + + $path = $pathtoroot."themes"; + + $themes = array(); + if ($dir = @opendir($path)) + { + while (($file = readdir($dir)) !== false) + { + if($file !="." && $file !=".." && substr($file,0,1)!="_") + { + if(is_dir($path."/".$file)) + { + $file = strtolower($file); + $themes[$file]=0; + } + } + } + } + closedir($dir); + $this->Clear(); + $this->Query_Item("SELECT * FROM ".$this->SourceTable); + foreach($this->Items as $i) + { + $n = strtolower($i->Get("Name")); + $themes[$n] = $i->Get("ThemeId"); + } + $names = array_keys($themes); + for($i=0;$iAddTheme($name,"New Theme",0,0); + $themes[$name] = $t->Get("ThemeId"); + } + } + $where = implode(",",array_values($themes)); + $sql = "DELETE FROM ".$this->SourceTable." WHERE ThemeId NOT IN ($where)"; + } + + function CopyFromEditTable() + { + global $objSession; + + $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(); + $c->CreateDirectory(); + } + if($c->Get("PrimaryTheme")) + { + $this->SetPrimaryTheme($c->Get("ThemeId")); + } + $rs->MoveNext(); + } + $this->adodbConnection->Execute($sql); + } + + function PurgeEditTable() + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + $this->adodbConnection->Execute("DROP TABLE $edit_table"); + } + + +} +?> Index: trunk/admin/editor/FCKeditor/filemanager/upload/aspx/upload.xml =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/upload/aspx/upload.xml (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/upload/aspx/upload.xml (revision 13) @@ -0,0 +1,20 @@ + + + + 24 + \ No newline at end of file Index: trunk/kernel/include/adodb/drivers/adodb-borland_ibase.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-borland_ibase.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-borland_ibase.inc.php (revision 13) @@ -0,0 +1,79 @@ +ADODB_ibase(); + } + + function ServerInfo() + { + $arr['dialect'] = $this->dialect; + switch($arr['dialect']) { + case '': + case '1': $s = 'Interbase 6.5, Dialect 1'; break; + case '2': $s = 'Interbase 6.5, Dialect 2'; break; + default: + case '3': $s = 'Interbase 6.5, Dialect 3'; break; + } + $arr['version'] = '6.5'; + $arr['description'] = $s; + return $arr; + } + + // Note that Interbase 6.5 uses ROWS instead - don't you love forking wars! + // SELECT col1, col2 FROM table ROWS 5 -- get 5 rows + // SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2 + // Firebird uses + // SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE + function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $arg3=false,$secs2cache=0) + { + if ($nrows > 0) { + if ($offset <= 0) $str = " ROWS $nrows "; + else { + $a = $offset+1; + $b = $offset+$nrows; + $str = " ROWS $a TO $b"; + } + } else { + // ok, skip + $a = $offset + 1; + $str = " ROWS $a TO 999999999"; // 999 million + } + $sql .= $str; + + return ($secs2cache) ? + $this->CacheExecute($secs2cache,$sql,$inputarr,$arg3) + : + $this->Execute($sql,$inputarr,$arg3); + } + +}; + + +class ADORecordSet_borland_ibase extends ADORecordSet_ibase { + + var $databaseType = "borland_ibase"; + + function ADORecordSet_borland_ibase($id,$mode=false) + { + $this->ADORecordSet_ibase($id,$mode); + } +} +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/bigsmile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_summary_logs.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/configure.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/configure.php (revision 0) +++ trunk/kernel/admin/include/toolbar/configure.php (revision 13) @@ -0,0 +1,7 @@ + Index: trunk/admin/users/user_addimage.php =================================================================== diff -u --- trunk/admin/users/user_addimage.php (revision 0) +++ trunk/admin/users/user_addimage.php (revision 13) @@ -0,0 +1,343 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$cssURL = $adminURL."/include"; +$browseURL = $adminURL."/browse"; + +$pathtolocal = $pathtoroot."kernel/"; +require_once ($pathtoroot.$admin."/include/elements.php"); +require_once ($pathtoroot."kernel/admin/include/navmenu.php");; +require_once($pathtoroot.$admin."/browse/toolbar.php"); +require_once($pathtoroot.$admin."/listview/listview.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditItems); + +$objEditItems = new clsUserManager(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); +$objEditItems->EnablePaging = FALSE; +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); +$c = $objEditItems->GetItemByIndex($en); + +unset($objEditItems); + +$objEditItems = new clsImageList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Images"); + +if(isset($_POST["itemlist"])) +{ + if(is_array($_POST["itemlist"])) + { + $ImageId = $_POST["itemlist"][0]; + } + else + { + $ImageId = $_POST["itemlist"]; + } + + $img = $objEditItems->GetItem($ImageId); +// print_r($img); + $action = "m_img_edit"; + $name = $img->Get("Name"); +} +else +{ + $img = new clsImage(); + $img->Set("ResourceId",$c->Get("ResourceId")); + $action = "m_img_add"; + $name = "'New Image'"; + +} + +$envar = "env=" . BuildEnv() . "&en=$en"; +$section = 'in-portal:edituser_image'; +$ado = GetADODBConnection(); + +/* page header */ +print << + + In-portal + + + + + + + + + + + +END; + + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_User")." '".$c->Get("Login")."' - ".prompt_language("la_Text_Image"); +$title .= " '".$name."'"; +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('user','UserEditStatus','".$admin."/users/adduser_images.php',0);",$imagesURL."/toolbar/tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('user','UserEditStatus','".$admin."/users/adduser_images.php',-1);",$imagesURL."/toolbar/tool_cancel.gif"); + +//echo "
"; print_r($objCatToolBar); echo "
"; +int_header($objCatToolBar,NULL,$title); +?> + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + + + + + > + + Get("LocalThumb")==1 || strlen($img->Get("LocalThumb"))==0) + { + $local="checked"; + $remote = ""; + } + else + { + $remote="checked"; + $local = ""; + } + ?> + + + + + + + + +> + + Get("SameImages")=="1") || !$img->Get("ImageId") || ($img->Get("ImageId") == "-1")) + { + + $checked = "CHECKED"; + $disabled = "DISABLED=\"true\""; + } + ?> + + + +> + + Get("LocalImage")==1 || strlen($img->Get("LocalImage"))==0) + { + $local="checked"; + $remote = ""; + } + else + { + $remote="checked"; + $local = ""; + } + ?> + + + + + + + "> + "> + +
Get("ImageId") != -1) echo $img->Get("ImageId"); ?>
">
">
+ Get("Enabled")==1) echo "CHECKED"; ?> VALUE="1"> + Get("Enabled")==0) echo "CHECKED"; ?> VALUE="0"> +
Get("DefaultImg")==1) echo "CHECKED"; ?> VALUE="1">
">
+ + + + + + + + + +
+ VALUE="1">: + +
+
+ VALUE="0"> : + + ">
+
+
+ +
ONCLICK="enableFullImage(this);">
+ + + + + + + + + +
+ VALUE="1">: + +
+
+ VALUE="0"> : + + ">
+
+
+ +
+ + +
+ + + + +
+ + + + Index: trunk/kernel/include/adodb/adodb-sybase.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-sybase.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-sybase.inc.php (revision 13) @@ -0,0 +1,215 @@ +Execute('select @@identity'); + if ($rs == false || $rs->EOF) return false; + $id = $rs->fields[0]; + $rs->Close(); + return $id; + } + // might require begintrans -- committrans + function _affectedrows() + { + $rs = $this->Execute('select @@rowcount'); + if ($rs == false || $rs->EOF) return false; + $id = $rs->fields[0]; + $rs->Close(); + return $id; + } + + + function BeginTrans() + { + $this->Execute('BEGIN TRAN'); + return true; + } + + function CommitTrans() + { + $this->Execute('COMMIT TRAN'); + return true; + } + + function RollbackTrans() + { + $this->Execute('ROLLBACK TRAN'); + return true; + } + + + function SelectDB($dbName) { + $this->databaseName = $dbName; + if ($this->_connectionID) { + return @sybase_select_db($dbName); + } + else return false; + } + + /* Returns: the last error message from previous database operation + Note: This function is NOT available for Microsoft SQL Server. */ + + function ErrorMsg() { + $this->_errorMsg = sybase_get_last_message(); + return $this->_errorMsg; + } + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = sybase_pconnect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + // returns query ID if successful, otherwise false + function _query($sql,$inputarr) + { + //@sybase_free_result($this->_queryID); + return sybase_query($sql,$this->_connectionID); + } + + // returns true or false + function _close() + { + return @sybase_close($this->_connectionID); + } + + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ +global $ADODB_sybase_mths; +$ADODB_sybase_mths = array('JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12); + +class ADORecordset_sybase extends ADORecordSet { + + var $databaseType = "sybase"; + var $canSeek = true; + // _mths works only in non-localised system + var $_mths = array('JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12); + + function ADORecordset_sybase($id) + { + return $this->ADORecordSet($id); + } + + + /* Returns: an object containing field information. + Get column information in the Recordset object. fetchField() can be used in order to obtain information about + fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by + fetchField() is retrieved. */ + function &FetchField($fieldOffset = -1) + { + if ($fieldOffset != -1) { + $o = @sybase_fetch_field($this->_queryID, $fieldOffset); + } + else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */ + $o = @sybase_fetch_field($this->_queryID); + } + // older versions of PHP did not support type, only numeric + if ($o && !isset($o->type)) $o->type = ($o->numeric) ? 'float' : 'varchar'; + return $o; + } + + function _initrs() + { + global $ADODB_COUNTRECS; + $this->_numOfRows = ($ADODB_COUNTRECS)? @sybase_num_rows($this->_queryID):-1; + $this->_numOfFields = @sybase_num_fields($this->_queryID); + } + + function _seek($row) + { + return @sybase_data_seek($this->_queryID, $row); + } + + function _fetch($ignore_fields=false) { + $this->fields = @sybase_fetch_array($this->_queryID); + return ($this->fields == true); + } + + /* close() only needs to be called if you are worried about using too much memory while your script + is running. All associated result memory for the specified result identifier will automatically be freed. */ + function _close() { + return @sybase_free_result($this->_queryID); + } + + // sybase/mssql uses a default date like Dec 30 2000 12:00AM + function UnixDate($v) + { + global $ADODB_sybase_mths; + //Dec 30 2000 12:00AM + // added fix by Toni for day 15 Mar 2001 + if (!ereg( "([A-Za-z]{3})[-/\. ]([0-9 ]{1,2})[-/\. ]([0-9]{4}))" + ,$v, $rr)) return parent::UnixDate($v); + + if ($rr[3] <= 1970) return 0; + + $themth = substr(strtoupper($rr[1]),0,3); + $themth = $ADODB_sybase_mths[$themth]; + if ($themth <= 0) return false; + // h-m-s-MM-DD-YY + return mktime(0,0,0,$themth,$rr[2],$rr[3]); + } + + function UnixTimeStamp($v) + { + global $ADODB_sybase_mths; + //Dec 30 2000 12:00AM + if (!ereg( "([A-Za-z]{3})[-/\. ]([0-9]{1,2})[-/\. ]([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})" + ,$v, $rr)) return parent::UnixTimeStamp($v); + if ($rr[3] <= 1970) return 0; + + $themth = substr(strtoupper($rr[1]),0,3); + $themth = $ADODB_sybase_mths[$themth]; + if ($themth <= 0) return false; + + if (strtoupper($rr[6]) == 'P') { + if ($rr[4]<12) $rr[4] += 12; + } else { + if ($rr[4]==12) $rr[4] = 0; + } + // h-m-s-MM-DD-YY + return mktime($rr[4],$rr[5],0,$themth,$rr[2],$rr[3]); + } + +} +?> \ No newline at end of file Index: trunk/themes/default/img/ic_offline.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_item_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.justifyfull.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/common/footer.tpl =================================================================== diff -u --- trunk/themes/default/common/footer.tpl (revision 0) +++ trunk/themes/default/common/footer.tpl (revision 13) @@ -0,0 +1,16 @@ + + +
+ + + + + + + + +

+ + + + Index: trunk/admin/images/icon_question_sm.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/msn/sad_smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/icon24_link_editor.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_conf_regional.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_settings_custom.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/cros.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tree/ua.js =================================================================== diff -u --- trunk/admin/tree/ua.js (revision 0) +++ trunk/admin/tree/ua.js (revision 13) @@ -0,0 +1,328 @@ +// ua.js - Detect Browser + +// Requires JavaScript 1.1 + +/* + +The contents of this file are subject to the Netscape Public + +License Version 1.1 (the "License"); you may not use this file + +except in compliance with the License. You may obtain a copy of + +the License at http://www.mozilla.org/NPL/ + + + +Software distributed under the License is distributed on an "AS + +IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + +implied. See the License for the specific language governing + +rights and limitations under the License. + + + +The Initial Developer of the Original Code is Bob Clary. + + + +Contributor(s): Bob Clary, Original Work, Copyright 1999-2000 + + Bob Clary, Netscape Communications, Copyright 2001 + + + +Alternatively, the contents of this file may be used under the + +terms of the GNU Public License (the "GPL"), in which case the + +provisions of the GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only + +under the terms of the GPL and not to allow others to use your + +version of this file under the NPL, indicate your decision by + +deleting the provisions above and replace them with the notice + +and other provisions required by the GPL. If you do not delete + +the provisions above, a recipient may use your version of this + +file under either the NPL or the GPL. + +*/ + + + +// work around bug in xpcdom Mozilla 0.9.1 + +window.saveNavigator = window.navigator; + + + +// Handy functions + +function noop() {} + +function noerror() { return true; } + + + +function defaultOnError(msg, url, line) + +{ + + // customize this for your site + + if (top.location.href.indexOf('_files/errors/') == -1) + + top.location = '/evangelism/xbProjects/_files/errors/index.html?msg=' + escape(msg) + '&url=' + escape(url) + '&line=' + escape(line); + +} + + + +// Display Error page... + +// XXX: more work to be done here + +// + +function reportError(message) + +{ + + // customize this for your site + + if (top.location.href.indexOf('_files/errors/') == -1) + + top.location = '/evangelism/xbProjects/_files/errors/index.html?msg=' + escape(message); + +} + + + +function pageRequires(cond, msg, redirectTo) + +{ + + if (!cond) + + { + + msg = 'This page requires ' + msg; + + top.location = redirectTo + '?msg=' + escape(msg); + + } + + // return cond so can use in onclick handlers to exclude browsers + + // from pages they do not support. + + return cond; + +} + + + +function detectBrowser() + +{ + + var oldOnError = window.onerror; + + var element = null; + + + + window.onerror = defaultOnError; + + + + navigator.OS = ''; + + navigator.version = 0; + + navigator.org = ''; + + navigator.family = ''; + + + + var platform; + + if (typeof(window.navigator.platform) != 'undefined') + + { + + platform = window.navigator.platform.toLowerCase(); + + if (platform.indexOf('win') != -1) + + navigator.OS = 'win'; + + else if (platform.indexOf('mac') != -1) + + navigator.OS = 'mac'; + + else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1) + + navigator.OS = 'nix'; + + } + + + + var i = 0; + + var ua = window.navigator.userAgent.toLowerCase(); + + + + if (ua.indexOf('opera') != -1) + + { + + i = ua.indexOf('opera'); + + navigator.family = 'opera'; + + navigator.org = 'opera'; + + navigator.version = parseFloat('0' + ua.substr(i+6), 10); + + } + + else if ((i = ua.indexOf('msie')) != -1) + + { + + navigator.org = 'microsoft'; + + navigator.version = parseFloat('0' + ua.substr(i+5), 10); + + + + if (navigator.version < 4) + + navigator.family = 'ie3'; + + else + + navigator.family = 'ie4' + + } + + else if (typeof(window.controllers) != 'undefined' && typeof(window.locationbar) != 'undefined') + + { + + i = ua.lastIndexOf('/') + + navigator.version = parseFloat('0' + ua.substr(i+1), 10); + + navigator.family = 'gecko'; + + + + if (ua.indexOf('netscape') != -1) + + navigator.org = 'netscape'; + + else if (ua.indexOf('compuserve') != -1) + + navigator.org = 'compuserve'; + + else + + navigator.org = 'mozilla'; + + } + + else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1)) + + { + + var is_major = parseFloat(navigator.appVersion); + + + + if (is_major < 4) + + navigator.version = is_major; + + else + + { + + i = ua.lastIndexOf('/') + + navigator.version = parseFloat('0' + ua.substr(i+1), 10); + + } + + navigator.org = 'netscape'; + + navigator.family = 'nn' + parseInt(navigator.appVersion); + + } + + else if ((i = ua.indexOf('aol')) != -1 ) + + { + + // aol + + navigator.family = 'aol'; + + navigator.org = 'aol'; + + navigator.version = parseFloat('0' + ua.substr(i+4), 10); + + } + + + + navigator.DOMCORE1 = (typeof(document.getElementsByTagName) != 'undefined' && typeof(document.createElement) != 'undefined'); + + navigator.DOMCORE2 = (navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined' && typeof(document.createElementNS) != 'undefined'); + + navigator.DOMHTML = (navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined'); + + navigator.DOMCSS1 = ( (navigator.family == 'gecko') || (navigator.family == 'ie4') ); + + + + navigator.DOMCSS2 = false; + + if (navigator.DOMCORE1) + + { + + element = document.createElement('p'); + + navigator.DOMCSS2 = (typeof(element.style) == 'object'); + + } + + + + navigator.DOMEVENTS = (typeof(document.createEvent) != 'undefined'); + + + + window.onerror = oldOnError; + +} + + + +detectBrowser(); + + + Index: trunk/kernel/include/adodb/drivers/adodb-csv.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-csv.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-csv.inc.php (revision 13) @@ -0,0 +1,202 @@ +_insertid; + } + + function _affectedrows() + { + return $this->_affectedrows; + } + + function &MetaDatabases() + { + return false; + } + + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + if (strtolower(substr($argHostname,0,7)) !== 'http://') return false; + $this->_url = $argHostname; + return true; + } + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + if (strtolower(substr($argHostname,0,7)) !== 'http://') return false; + $this->_url = $argHostname; + return true; + } + + function &MetaColumns($table) + { + return false; + } + + + // parameters use PostgreSQL convention, not MySQL + function &SelectLimit($sql,$nrows=-1,$offset=-1,$arg3=false) + { + global $ADODB_FETCH_MODE; + + $url = $this->_url.'?sql='.urlencode($sql)."&nrows=$nrows&fetch=". + (($this->fetchMode !== false)?$this->fetchMode : $ADODB_FETCH_MODE). + "&offset=$offset&arg3=".urlencode($arg3); + $err = false; + $rs = csv2rs($url,$err,false); + + if ($this->debug) print "$url
$err
"; + + $at = strpos($err,'::::'); + if ($at === false) { + $this->_errorMsg = $err; + $this->_errorNo = (integer)$err; + } else { + $this->_errorMsg = substr($err,$at+4,1024); + $this->_errorNo = -9999; + } + if ($this->_errorNo) + if ($fn = $this->raiseErrorFn) { + $fn($this->databaseType,'EXECUTE',$this->ErrorNo(),$this->ErrorMsg(),$sql,''); + } + + if (is_object($rs)) { + + $rs->databaseType='csv'; + $rs->fetchMode = ($this->fetchMode !== false) ? $this->fetchMode : $ADODB_FETCH_MODE; + $rs->connection = &$this; + } + return $rs; + } + + // returns queryID or false + function &Execute($sql,$inputarr=false,$arg3=false) + { + global $ADODB_FETCH_MODE; + + if (!$this->_bindInputArray && $inputarr) { + $sqlarr = explode('?',$sql); + $sql = ''; + $i = 0; + foreach($inputarr as $v) { + + $sql .= $sqlarr[$i]; + // from Ron Baldwin + // Only quote string types + if (gettype($v) == 'string') + $sql .= $this->qstr($v); + else if ($v === null) + $sql .= 'NULL'; + else + $sql .= $v; + $i += 1; + + } + $sql .= $sqlarr[$i]; + if ($i+1 != sizeof($sqlarr)) + print "Input Array does not match ?: ".htmlspecialchars($sql); + $inputarr = false; + } + + $url = $this->_url.'?sql='.urlencode($sql)."&fetch=". + (($this->fetchMode !== false)?$this->fetchMode : $ADODB_FETCH_MODE); + if ($arg3) $url .= "&arg3=".urlencode($arg3); + $err = false; + + $rs = csv2rs($url,$err,false); + if ($this->debug) print urldecode($url)."
$err
"; + $at = strpos($err,'::::'); + if ($at === false) { + $this->_errorMsg = $err; + $this->_errorNo = (integer)$err; + } else { + $this->_errorMsg = substr($err,$at+4,1024); + $this->_errorNo = -9999; + } + + if ($this->_errorNo) + if ($fn = $this->raiseErrorFn) { + $fn($this->databaseType,'EXECUTE',$this->ErrorNo(),$this->ErrorMsg(),$sql,$inputarr); + } + if (is_object($rs)) { + $rs->fetchMode = ($this->fetchMode !== false) ? $this->fetchMode : $ADODB_FETCH_MODE; + + $this->_affectedrows = $rs->affectedrows; + $this->_insertid = $rs->insertid; + $rs->databaseType='csv'; + $rs->connection = &$this; + } + return $rs; + } + + /* Returns: the last error message from previous database operation */ + function ErrorMsg() + { + return $this->_errorMsg; + } + + /* Returns: the last error number from previous database operation */ + function ErrorNo() + { + return $this->_errorNo; + } + + // returns true or false + function _close() + { + return true; + } +} // class + +class ADORecordset_csv extends ADORecordset { + function ADORecordset_csv($id,$mode=false) + { + $this->ADORecordset($id,$mode); + } + + function _close() + { + return true; + } +} + +} // define + +?> \ No newline at end of file Index: trunk/admin/images/summary/usersbox_cl.gif =================================================================== diff -u Binary files differ Index: trunk/admin/config/edit_customfields.php =================================================================== diff -u --- trunk/admin/config/edit_customfields.php (revision 0) +++ trunk/admin/config/edit_customfields.php (revision 13) @@ -0,0 +1,210 @@ +Logout(); + header("Location: ".$adminURL."/login.php"); + die(); + //require_once($pathtoroot."admin/login.php"); +} + +//admin only util +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL=$rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$FieldType = $_GET["DataType"]; +$section = $_GET["section"]; + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} +unset($objEditItems); + +$objCustomFields = new clsCustomFieldList($FieldType); + +$envar = "section=$section&DataType=$FieldType&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","FieldChecks"); +$objListToolBar->Set("CheckForm","configform"); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("new_field", "la_ToolTip_New_CustomField",$adminURL."/config/addcustomfield.php?$envar&new=1","swap('new_field','toolbar/tool_forum_new_custom_f2.gif');", + "swap('new_field', 'toolbar/tool_forum_new_custom.gif');","",$imagesURL."/toolbar/tool_forum_new_custom.gif"); + +$objListToolBar->Add("field_edit","la_ToolTip_Edit","#", "if (FieldChecks.itemChecked()) swap('field_edit','toolbar/tool_edit_f2.gif');", + "if (FieldChecks.itemChecked()) swap('field_edit', 'toolbar/tool_edit.gif');","if (FieldChecks.itemChecked()) FieldChecks.check_submit('addcustomfield', '');", + "tool_edit.gif",TRUE,TRUE); +$listImages[] = "FieldChecks.addImage('field_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +$objListToolBar->Add("field_del","la_ToolTip_Delete","#", "if (FieldChecks.itemChecked()) swap('field_del','toolbar/tool_delete_f2.gif');", + "if (FieldChecks.itemChecked()) swap('field_del', 'toolbar/tool_delete.gif');","if (FieldChecks.itemChecked()) FieldChecks.check_submit('edit_customfields', 'm_customfield_delete');", + "tool_delete.gif", FALSE, TRUE); +$listImages[] = "FieldChecks.addImage('field_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->AddToInitScript($listImages); + +//$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_CustomFields"); + +$where = "Type = ".$FieldType; +$order = trim($objConfig->Get("CustomConfig_LV_Sortfield")." ".$objConfig->Get("CustomConfig_LV_Sortorder")); + +$objCustomFields->Query_CustomField($where,$order); + +$objListView = new clsListView($objListToolBar,$objCustomFields); +$objListView->IdField = "CustomFieldId"; + +$order = $objConfig->Get("CustomConfig_LV_Sortfield"); +$objListView->ColumnHeaders->Add("FieldName",admin_language("la_ColHeader_FieldName"),1,0,$order,"width=\"30%\"","CustomConfig_LV_Sortfield","CustomConfig_LV_Sortorder","FieldName"); +$objListView->ColumnHeaders->Add("FieldLabel",admin_language("la_ColHeader_FieldLabel"),1,0,$order,"width=\"30%\"","CustomConfig_LV_Sortfield","CustomConfig_LV_Sortorder","FieldLabel"); +$objListView->ColumnHeaders->SetSort($objConfig->Get("CustomConfig_LV_Sortfield"), $objConfig->Get("CustomConfig_LV_Sortorder")); + +$objListView->PrintToolBar = FALSE; +$objListView->checkboxes = TRUE; + +$objListView->CurrentPageVar = "Page_CustomData"; +$objListView->PerPageVar = "Perpage_CustomData"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->extra_env = "section=$section&DataType=$FieldType"; + +for($i=0;$iItems);$i++) +{ + $objListView->RowIcons[] = $imagesURL."/itemicons/icon16_custom.gif"; +} + + +$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,"","",0); + +$objListToolBar->AddToInitScript("fwLoadMenus();"); +$h = "\n\n\n"; + +int_header($objListToolBar,NULL,$title, NULL, $h); +?> +
" method=POST> + + +PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */ + $objListView->SliceItems(); + print $objListView->PrintList(); + +?> + + + + + +" name="viewmenu"> + + + + + + + + + Index: trunk/themes/default/img/star.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/edituser_image.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/edituser_image.php (revision 0) +++ trunk/kernel/admin/include/toolbar/edituser_image.php (revision 13) @@ -0,0 +1,55 @@ + + + + +END; +?> Index: trunk/admin/editor/FCKeditor/images/smiley/fun/boid.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_search_reset_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_language_f3.gif =================================================================== diff -u Binary files differ Index: trunk/obscure.php =================================================================== diff -u --- trunk/obscure.php (revision 0) +++ trunk/obscure.php (revision 13) @@ -0,0 +1,221 @@ +#!/usr/local/bin/php +$start,"end"=>$end,"attribs"=>$attribs,"newname"=>$newname); + } + } + } + //echo "
"; print_r($functions); echo "
"; + + function GetVarName($s) + { + $alphabet = "abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + $name = ""; + $var_end = 0; + $char = substr($s,$var_end,1); + if(substr($s,0,1)=="$") + { + $var_end++; + $char = substr($s,$var_end,1); + } + while(is_numeric(strpos($alphabet,$char)) && strlen($char)) + { + $name .= $char; + $var_end++; + $char = substr($s,$var_end,1); + } + return $name; + } + + function obscure_func($NewName,$Attribs,$code) + { + global $functions; + + $globals = array(); + + $globals[] = '$this'; + $globals[] = '$_GET'; + $globals[] = '$_FILES'; + $globals[] = '$_POST'; + $globals[] = '$_COOKIE'; + $globals[] = '$_SERVER'; + + $variables = array(); + + $new_code = array(); + for($x=0;$x<=count($code);$x++) + { + $line = $code[$x]; + $line = ltrim($line); + $line = str_replace("\t","",$line); + $g = strpos($line,"global"); + if(is_numeric($g)) + { + $vars = substr($line,$g+7); + $vars = substr($vars,0,-2); + $v = explode(",",$vars); + for($z=0;$z$attr) + { + $line = $code[$x]; + $code[$x] = str_replace($name,$attr["newname"],$line); + } + } + + $VarCount =0; + if(strlen($Attribs)>3) + { + $a = explode(",",substr($Attribs,1,-2)); + if (is_array($a)) { + foreach($a as $attr) + { + $variables[$attr] = '$_'.md5($VarCount++); + } + } + } + + for($x=0;$x0) + { + if(substr($line,$p,2)!="$$") + { + $name=GetVarName(substr($line,$p)); + if(strlen($name)) + { + $name = "$".trim($name); + if(!in_array($name,$globals) && !array_key_exists($name,$variables)) + $variables[$name] = '$_'.md5($VarCount++); + } + } + $p = strpos($line,"$",$p+1); + } + } + + for($x=0;$x$varname) + { + $p = strpos($code[$x],$v); + while(is_numeric($p)) + { + $t = GetVarName(substr($code[$x],$p)); + if('$'.$t == $v) + { + $code[$x] = substr_replace($code[$x],$varname,$p,strlen($t)+1); + } + $p = strpos($code[$x],$v,$p+1); + } + } + } + + $o = "function $NewName"."("; + if (is_array($a)) { + foreach($a as $attr) + { + $av[] = $variables[$attr]; + } + } + if(count($av)>0) + $o .= implode(",",$av); + $o .= ")"; + $o .= implode(" ",$code); + //$o = str_replace("\n","",$o); + return $o; + } + + $out = ""; + $outline = 0; + foreach($functions as $name =>$pos) + { + $dest = $pos["start"]; + $newname = $pos["newname"]; + if(!$outline) + $outline = $dest; + + + unset($code); + for($x=$dest+1;$x<=$pos["end"];$x++) + { + $code[] = $php[$x]; + } + $newcode = obscure_func($newname,$pos["attribs"],$code); + $out .= $newcode; + } + foreach($functions as $name=>$pos) + { + for($x=$pos["start"];$x<=$pos["end"];$x++) + { + $php[$x] = ""; + } + } + + $code =array(); + for($x=0;$x$attr) + { + $line = str_replace($name,$attr["newname"],$line); + } + $code[$x] = $line; + } + $php = $code; + + $line=1; + + $tmp_file = fopen($argv[1].'_', 'w'); + + for($x=0;$x \ No newline at end of file Index: trunk/admin/icons/icon46_stats.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_cat.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-mysqlt.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-mysqlt.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-mysqlt.inc.php (revision 13) @@ -0,0 +1,76 @@ + + + Requires mysql client. Works on Windows and Unix. +*/ + + +include_once(ADODB_DIR."/drivers/adodb-mysql.inc.php"); + + +class ADODB_mysqlt extends ADODB_mysql { + var $databaseType = 'mysqlt'; + var $ansiOuter = true; // for Version 3.23.17 or later + var $hasTransactions = true; + + function BeginTrans() + { + if ($this->transOff) return true; + $this->transCnt += 1; + $this->Execute('SET AUTOCOMMIT=0'); + $this->Execute('BEGIN'); + return true; + } + + function CommitTrans($ok=true) + { + if ($this->transOff) return true; + if (!$ok) return $this->RollbackTrans(); + + if ($this->transCnt) $this->transCnt -= 1; + $this->Execute('COMMIT'); + $this->Execute('SET AUTOCOMMIT=1'); + return true; + } + + function RollbackTrans() + { + if ($this->transOff) return true; + if ($this->transCnt) $this->transCnt -= 1; + $this->Execute('ROLLBACK'); + $this->Execute('SET AUTOCOMMIT=1'); + return true; + } + +} + +class ADORecordSet_mysqlt extends ADORecordSet_mysql{ + var $databaseType = "mysqlt"; + + function ADORecordSet_mysqlt($queryID,$mode=false) { + return $this->ADORecordSet_mysql($queryID,$mode); + } + + function MoveNext() + { + if ($this->EOF) return false; + + $this->_currentRow++; + // using & below slows things down by 20%! + $this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode); + if ($this->fields) return true; + $this->EOF = true; + + return false; + } +} +?> \ No newline at end of file Index: trunk/kernel/include/adodb/adodb-ado_access.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-ado_access.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-ado_access.inc.php (revision 13) @@ -0,0 +1,38 @@ +ADORecordSet_ado($id); + } +} +?> \ No newline at end of file Index: trunk/admin/tree/ftv2node.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/group_addpermission.php =================================================================== diff -u --- trunk/admin/users/group_addpermission.php (revision 0) +++ trunk/admin/users/group_addpermission.php (revision 13) @@ -0,0 +1,200 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +unset($objEditItems); + +$objEditItems = new clsGroupList(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalGroup"); +$objEditItems->EnablePaging = FALSE; +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); +$c = $objEditItems->GetItemByIndex($en); + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_edit_group"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:editgroup_permissions'; + +//Display header +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('editgroup','GroupEditStatus','".$admin."/users/addgroup_permissions.php',0);","tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('editgroup','GroupEditStatus','".$admin."/users/addgroup_permissions.php',-1);","tool_cancel.gif"); + +$PermModule = $_GET["module"]; + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Group")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Permissions"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/group_addpermission.php"; + $StatusField = "GroupEditStatus"; + $form = "editgroup"; + MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'&module='.$_REQUEST['module'],'la_PrevGroup','la_NextGroup'); +} + +int_header($objCatToolBar,NULL,$title); +?> +
+ + + + + +
+ + + + ".prompt_language("la_prompt_Description")."\n"; + ?> + +Get("GroupId"); + $ado = GetADODBConnection(); + $sql = "SELECT * FROM ".GetTablePrefix()."PermissionConfig WHERE ModuleId='$PermModule'"; + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + + $permlist = array(); + $rs = $ado->Execute($sql); + while($rs && !$rs->EOF) + { + $Permission = $rs->fields["PermissionName"]; + echo "\n"; + echo " \n"; + $checked = ""; + $value = $c->HasSystemPermission($Permission); + $disabled = ""; + if($value==-1) + { + $checked = " checked"; + $disabled = "DISABLED=\"true\""; + } + echo " \n"; + $checked = ""; + if($value==1) + { + $checked = "checked"; + $imgsrc = "green"; + } + else + $imgsrc = "red"; + echo " "; + echo ""; + $permlist[]=$Permission; + $rs->MoveNext(); + } +?> + +"> +"> + + +
".prompt_language("la_ColHeader_PermInherited")."".prompt_language("la_ColHeader_PermAccess")."
".prompt_language($rs->fields["Description"]).""; + echo "
+ Index: trunk/kernel/include/adodb/drivers/adodb-ado_mssql.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-ado_mssql.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-ado_mssql.inc.php (revision 13) @@ -0,0 +1,59 @@ +ADODB_ado(); + } + + function _insertid() + { + return $this->GetOne('select @@identity'); + } + + function _affectedrows() + { + return $this->GetOne('select @@rowcount'); + } + +} + +class ADORecordSet_ado_mssql extends ADORecordSet_ado { + + var $databaseType = 'ado_mssql'; + + function ADORecordSet_ado_mssql($id,$mode=false) + { + return $this->ADORecordSet_ado($id,$mode); + } +} +?> \ No newline at end of file Index: trunk/admin/images/toolbar/tool_disconnect.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/my_friends/friend_online_element.tpl =================================================================== diff -u --- trunk/themes/default/my_friends/friend_online_element.tpl (revision 0) +++ trunk/themes/default/my_friends/friend_online_element.tpl (revision 13) @@ -0,0 +1,10 @@ + +
+
+
+
"> +
+ ">
+
+ + Index: trunk/themes/default/img/ic_post_locked.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_error_big.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_validate.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/relevance/rel_7.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_search_f2.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/userselect.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/userselect.php (revision 0) +++ trunk/kernel/admin/include/toolbar/userselect.php (revision 13) @@ -0,0 +1,154 @@ +Get("User_ViewNormal")==0) + $ViewNormal=0; + + +$ViewDisabled=1; +if($objConfig->Get("User_ViewDisabled")==0) + $ViewDisabled=0; + +$ViewPending=1; +if($objConfig->Get("User_ViewPending")==0) + $ViewPending=0; + +if($ViewNormal) +{ + $UserFilter = "(Enabled=1 AND Pending=0)"; +} + +if($ViewDisabled) +{ + if(strlen($UserFilter)) + $UserFilter .= " OR "; + $UserFilter = "(Enabled = 0)"; +} + +if($ViewPening) +{ + if(strlen($UserFilter)) + $UserFilter .= " OR "; + $UserFilter = "(Pending = 0)"; +} + +$browseURL = $adminURL."/browse"; + + +$destform = isset( $_POST['destform'] ) ? $_POST['destform'] : $_GET['destform']; +$destfield = $_GET["destfield"]; +$dosubmit=(int)$_GET["dosubmit"]; + +$lang_users = language("la_Text_Users"); +$lang_Username = language("la_prompt_Username"); +$lang_LastName = language("la_prompt_LastName"); +$lang_FirstName = language("la_prompt_FirstName"); +$lang_Email = language("la_prompt_Email"); +$lang_PrimaryGroup = language("la_prompt_PrimaryGroup"); +$lang_Valid = language("la_Text_Valid"); + +print << + + + + + + + + + +END; +?> Index: trunk/themes/default/advsearch/alt_item_form.tpl =================================================================== diff -u --- trunk/themes/default/advsearch/alt_item_form.tpl (revision 0) +++ trunk/themes/default/advsearch/alt_item_form.tpl (revision 13) @@ -0,0 +1,5 @@ + + +
+ + \ No newline at end of file Index: trunk/kernel/include/permissions.php =================================================================== diff -u --- trunk/kernel/include/permissions.php (revision 0) +++ trunk/kernel/include/permissions.php (revision 13) @@ -0,0 +1,416 @@ +clsItemDB(); + $this->tablename = GetTablePrefix()."Permissions"; + $this->BasePermission="GRANT"; + $this->id_field = "PermissionId"; + $this->NoResourceId = 1; + $this->Inherited=FALSE; + if($PermissionId) + $this->LoadFromDatabase($PermissionId); + } + + 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; + } +} + +class clsPermList extends clsItemCollection +{ + var $CatId; + var $GroupId; + var $CatBranch; + + function clsPermList($CatId=NULL,$GroupId=NULL) + { + $this->clsItemCollection(); + $this->classname = "clsPermission"; + $this->SourceTable = GetTablePrefix()."Permissions"; + $this->Clear(); + $this->GroupId = $GroupId; + $this->CatId = $CatId; + } + + function GetPermId($PermName) + { + $val = 0; + $sql = "SELECT PermissionConfigId,PermissionName FROM ".GetTablePrefix()."PermissionConfig WHERE PermissionName='$PermName'"; + //echo $sql."
\n"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + $val = $rs->fields["PermissionConfigId"]; + return $val; + } + + function GetPermByName($Perm) + { + foreach($this->Items as $p) + { + if($p->Get("Permission")==$Perm && $p->Get("GroupId")==$this->GroupId) + { + return $p; + } + } + return false; + } + + function AddItemFromArray($data) + { + global $objCatList; + + $p = new clsPermission(); + + foreach($data as $field => $value) + $p->Set($field,$value); + if($data["Type"]==0) + { + if($p->Get("CatId") != $this->CatId) + { + $p->Inherited = TRUE; + } + else + $p->Inherited = FALSE; + } + array_push($this->Items,$p); + } + + function LoadCategory($Id) + { + if($this->GroupId == NULL) + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE CatId=$Id AND Type=0 AND GroupId IS NULL"; + } + else + $sql = "SELECT * FROM ".$this->SourceTable." WHERE CatId=$Id AND Type=0 AND GroupId=".$this->GroupId; + + $rs = $this->adodbConnection->Execute($sql); + while ($rs && !$rs->EOF) + { + $data = $rs->fields; + $current = $this->GetPermByName($data["Permission"]); + if(!is_object($current)) + { + $this->AddItemFromArray($data); + } + unset($current); + $rs->MoveNext(); + } + } + + function LoadPermTree($c) + { + /* load all permissions for group on this category */ + global $objCatList; + + $this->CatId=$c->Get("CategoryId"); + $cats = explode("|",substr($c->Get("ParentPath"),1,-1)); + if(is_array($cats)) + { + $cats = array_reverse($cats); + $cats[] = 0; + $this->CatBranch = $cats; + foreach($cats as $catid) + { + $this->LoadCategory($catid); + } + } + } + + function GetDefinedCategory($Perm,$GroupId) + { + $ret = ""; + if(is_array($this->CatBranch)) + { + for($index=0;$indexCatBranch);$index++) + { + foreach($this->Items as $p) + { + if($p->Get("Permission")==$Perm) + { + if($p->Get("Permission")==$Perm && $p->Get("GroupId")==$GroupId && + $p->Get("CatId")==$this->CatBranch[$index]) + { + $ret = $this->CatBranch[$index]; + break; + } + } + } + if(is_numeric($ret)) + break; + } + } + return $ret; + } + + + function GetPermissionValue($PermName) + { + $p = $this->GetPermByName($PermName); + if(!is_object($p)) + { + $ret = NULL; + } + else + $ret = $p->Get("PermissionValue"); + return $ret; + } + + function LoadSystemPermissions() + { + $sql = "SELECT * FROM Permissions WHERE Type=1 AND GroupId=".$this->GroupId; + $rs = $this->adodbConnection->Execute($sql); + $this->clear(); + $this->CatId=NULL; + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $this->AddItemFromArray($data); + } + } + + function Add_Permission($CategoryId,$GroupId,$PermName,$Value,$Type) + { + $p = new clsPermission(); + $p->Set(array("CatId","GroupId","Permission","PermissionValue","Type"), + array($CategoryId,$GroupId,$PermName,$Value,$Type)); + $p->Create(); + array_push($this->Items,$p); + return $p; + } + + function Edit_Permission($PermissionId,$CategoryId,$GroupId,$PermName,$Value,$Type) + { + $p = $this->GetItem($PermissionId); + if(is_object($p)) + { + $p->Set(array("CatId","GroupId","Permission","PermissionValue","Type"), + array($CategoryId,$GroupId,$PermName,$Value,$Type)); + $p->Update(); + } + return $p; + } + + function Delete_Permission($PermissionId) + { + $p = $this->GetItem($PermissionId); + if(is_object($p)) + { + $p->Delete(); + } + } + + function Copy_Permissions($SrcCat,$DestCat) + { + $sql = "DELETE FROM ".$this->SourceTable." WHERE CatId=$DestCat"; + $this->adodbConnection->Execute($sql); + $sql = "SELECT * FROM ".$this->SourceTable." WHERE CatId=".$SrcCat; + $rs = $this->adodbConnection->Execute($sql); + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $this->Add_Permission($DestCat,$data["GroupId"],$data["Permission"],$data["PermissionValue"],$data["Type"]); + $rs->MoveNext(); + } + } + + function Delete_CatPerms($CatId) + { + $sql = "DELETE FROM ".$this->SourceTable." WHERE CatId=$CatId"; + $this->adodbConnection->Execute($sql); + } + + /* return an array of group ids which have access to permission $perm for a category*/ + function GetGroupPermList($c, $Perm, $AllGroups) + { + $ret = array(); + $this->Clear(); + if(strlen($Perm) && count($AllGroups)) + { + for($i=0;$iCatId=$c->Get("CategoryId"); + $this->GroupId = $AllGroups[$i]; + $this->LoadPermTree($c); + if($this->GetPermissionValue($Perm)==1) + { + $ret[] = $AllGroups[$i]; + } + } + } + return $ret; + } + + function GetAllViewPermGroups($c, $AllGroups) + { + $perms = array(); + $sql = "SELECT PermissionConfigId, PermissionName FROM ".GetTablePrefix()."PermissionConfig WHERE PermissionName LIKE '%.VIEW'"; + //echo $sql."
\n"; + $rs = $this->adodbConnection->Execute($sql); + while($rs && !$rs->EOF) + { + $perms[$rs->fields["PermissionName"]] = $this->GetGroupPermList($c,$rs->fields["PermissionName"],$AllGroups); + $rs->MoveNext(); + } + return $perms; + } +} + +class clsPermCache extends clsItemDB +{ + function clsPermCache($id=NULL) + { + $this->clsItemDB(); + $this->tablename = GetTablePrefix()."PermCache"; + $this->BasePermission="GRANT"; + $this->id_field = "PermCacheId"; + $this->NoResourceId = 1; + + if($id) + $this->LoadFromDatabase($id); + } + + 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; + } +} + +class clsPermCacheList extends clsItemCollection +{ + function clsPermCacheList() + { + $this->clsItemCollection(); + $this->classname = "clsPermCache"; + $this->SourceTable = GetTablePrefix()."PermCache"; + $this->Clear(); + } + + function &GetPerm($CategoryId,$PermId) + { + $found = FALSE; + foreach($this->Items as $p) + { + if($p->Get("CategoryId")==$CategoryId && $p->Get("PermId")==$PermId) + { + $found = TRUE; + break; + } + } + if(!$found) + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE CategoryId=$CategoryId AND PermId=$PermId"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $data = $rs->fields; + $p = $this->AddItemFromArray($data); + } + else + $p = FALSE; + } + return $p; + } + + function &AddPermCache($CatId,$PermId,$Acl,$Dacl) + { + if(strlen($Acl)>0 || strlen($Dacl)>0) + { + $p = new $this->classname; + $p->Set(array("CategoryId","PermId","ACL","DACL"),array($CatId,$PermId,$Acl,$Dacl)); + $p->Create(); + return $p; + } + else + return FALSE; + } + + function EditPermCache($PermCacheId,$CatId,$PermId,$Acl,$Dacl) + { + if($PermCacheId) + { + $p = $this->GetItem($PermCacheId); + if(is_object($p)) + { + $p->Set(array("CategoryId","PermId","ACL","DACL"),array($CatId,$PermId,$Acl,$Dacl)); + $p->Update(); + } + } + } + + function DeletePermCache($PermCacheId) + { + if($PermCacheId) + { + $p = $this->GetItem($PermCacheId); + if(is_object($p)) + { + $p->Delete(); + } + } + } + + function DeleteCategory($CategoryId) + { + $this->adodbConnection->Execute("DELETE FROM ".$this->SourceTable." WHERE CategoryId=$CategoryId"); + } + + function CopyCategory($SourceCat,$DestCat) + { + $this->Clear(); + $this->Query_Item("SELECT * FROM ".$this->SourceTable." WHERE CategoryId=$SourceCat"); + if($this->NumItems()>0) + { + foreach($this->Items as $p) + { + $p->UnsetIdField(); + $p->Set("CategoryId",$DestCat); + $p->Create(); + } + } + } +} +?> Index: trunk/compat/array_combine.php =================================================================== diff -u --- trunk/compat/array_combine.php (revision 0) +++ trunk/compat/array_combine.php (revision 13) @@ -0,0 +1,71 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: array_combine.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace array_combine() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.array_combine + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('array_combine')) +{ + function array_combine ($keys, $values) + { + if (!is_array($keys)) { + trigger_error('array_combine() expects parameter 1 to be array, ' . gettype($keys) . ' given', E_USER_WARNING); + return null; + } + + if (!is_array($values)) { + trigger_error('array_combine() expects parameter 2 to be array, ' . gettype($values) . ' given', E_USER_WARNING); + return null; + } + + if (count($keys) !== count($values)) { + trigger_error('array_combine() Both parameters should have equal number of elements', E_USER_WARNING); + return false; + } + + if (count($keys) === 0 || count($values) === 0) { + trigger_error('array_combine() Both parameters should have number of elements at least 0', E_USER_WARNING); + return false; + } + + $keys = array_values($keys); + $values = array_values($values); + + $combined = array (); + + for ($i = 0, $cnt = count($values); $i < $cnt; $i++) { + $combined[$keys[$i]] = $values[$i]; + } + + return $combined; + } +} + +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/sick.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/2col.css =================================================================== diff -u --- trunk/admin/install/2col.css (revision 0) +++ trunk/admin/install/2col.css (revision 13) @@ -0,0 +1,56 @@ +HTML, BODY { + margin: 0; + padding: 0; + background: #fff; + color: #333 + } + +OL.install { + font: bold 12px verdana, sans-serif; + color: #fff; + line-height: 20px + } +.install LI.current { + color: #005786 + } + +#nav { + margin-left: -1px; + text-align: center; + float: left + } + +#content { + padding: 10px; + color: darkblue; + float: right + } + +#header { + background-color: #fff; + color: #006; + border-bottom: 1px solid #006; + margin-bottom: 0px + } + +#footer { + background-color: #fff; + color: #006; + border-top: 1px solid #006; + font-size: 11px; + text-align: right; + padding: 2px 10px 0 0; + clear: both + } + +.spacer {clear: both} + +p { + padding: 0; + margin-top: 0px; + font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Helvetica, Arial, sans-serif; + } + +dd, dt { + font: 0.95em 'Lucida Grande', Verdana, Geneva, Lucida, Helvetica, Arial, sans-serif; + } Index: trunk/admin/images/toolbar/tool_move_up.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/_docs/translationsnotes.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/_docs/translationsnotes.html (revision 0) +++ trunk/admin/editor/FCKeditor/_docs/translationsnotes.html (revision 13) @@ -0,0 +1,34 @@ + + + + FCKeditor - Notes for Translations + + + +

+ Notes for Translations
+
(Revised: 23rd July 2003)

+

The languages files must be created inside the lang directory of the project. + You can use the file en.js as the base file for your + translations. The file names respect the RFC 1766 standards + (but in lowercase). So, for example, a file for the Portuguese language + should be called �pt.js�.

+

Translation could also be localized for a specific country. In this case, for + example, a Brazilian Portuguese translation file should be called pt-br.js.

+

The client�s language auto detection system uses the first available language + that best fits the client settings. For example, if a client computer is set to + Brazilian Portuguese and there is no pt-br.js file available, the pt.js is used + if available. If not, the default language is used (from the fck_config.js + file).

+

To test the translations you need to add a line in the fck_lang.js file like: +
+ AvailableLangs["pt"] = true ;

+

An important think is to save the files in a UTF-8 encoded + format. In other case, some strange characters could appear instead of some + special chars, like accented letters, symbols, etc. +

+

All translated files must be sent by e-mail to + fckeditor@fredck.com. +

+ + Index: trunk/admin/images/toolbar/tool_primary_group_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/category/addcategory_customfields.php =================================================================== diff -u --- trunk/admin/category/addcategory_customfields.php (revision 0) +++ trunk/admin/category/addcategory_customfields.php (revision 13) @@ -0,0 +1,223 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} +unset($objEditItems); + +$objEditItems = new clsCatList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Category"); +$objCustomFields = new clsCustomFieldList(TYPE_CATEGORY,$objSession->GetEditTable("CustomField")); + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); +echo $itemcount . " items loaded..
\n"; +$c = $objEditItems->GetItemByIndex($en); + +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_edit_category"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:editcategory_custom'; + +$formaction = $adminURL."/category/addcategory_custom.php?".$envar; + +//echo $envar."
\n"; + +//Display header +$sec = $objSections->GetSection($section); + + $objCatToolBar = new clsToolBar(); + $objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','".$admin."/browse.php',1);","tool_select.gif"); + $objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','".$admin."/browse.php',2);","tool_cancel.gif"); + +if($en_prev or $en_next) +{ + if($en_prev>-1) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + $onClick= $sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_prev"; + $link=$_SERVER["PHP_SELF"].$var; + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Category"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + else + { + $MouseOver=""; + $MouseOut=""; + $onClick=""; + $link="#"; + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Category"),"#","","","","tool_prev_f3.gif"); + + } + if($en_next>-1) + { + $MouseOver="swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="swap('moveright', 'toolbar/tool_next.gif');"; + $onClick=$sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_next"; + $link=$_SERVER["PHP_SELF"].$var; + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Category"),$link,$MouseOver,$MouseOut,"","tool_next.gif"); + } + else + { + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Category"),$link,$MouseOver,$MouseOut,"","tool_next_f3.gif"); + } + + + int_header($objCatToolBar,NULL,$title); +} +else + int_header($objCatToolBar,NULL,$title); + + +?> + + +Items as $f) + { + $o .= ""; + $o .= ""; + $o .= ""; + $o .= ""; + } +?> + + + + + +> + + + + + > + +
Get("CustomFieldId")."\">"; + $o .= $f->Get("FieldName")."".$f->Get("FieldLabel")."
+ + +
+
+ + + New Custom Field Name: + Label: + +
+
+
+ + +
+ \ No newline at end of file Index: trunk/themes/default/img/lang/russian.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.strikethrough.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/lang/swedish.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ed_font.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/edituser_permissions.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/edituser_permissions.php (revision 0) +++ trunk/kernel/admin/include/toolbar/edituser_permissions.php (revision 13) @@ -0,0 +1,77 @@ + + + + +END; +?> Index: trunk/themes/default/misc/form_prompt.tpl =================================================================== diff -u --- trunk/themes/default/misc/form_prompt.tpl (revision 0) +++ trunk/themes/default/misc/form_prompt.tpl (revision 13) @@ -0,0 +1 @@ + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/msn/cake.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-postgres.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-postgres.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-postgres.inc.php (revision 13) @@ -0,0 +1,357 @@ + + jlim - changed concat operator to || and data types to MetaType to match documented pgsql types + see http://www.postgresql.org/devel-corner/docs/postgres/datatype.htm + 22 Nov 2000 jlim - added changes to FetchField() and MetaTables() contributed by "raser" + 27 Nov 2000 jlim - added changes to _connect/_pconnect from ideas by "Lennie" + 15 Dec 2000 jlim - added changes suggested by Additional code changes by "Eric G. Werk" egw@netguide.dk. + 31 Jan 2001 jlim - finally installed postgresql. testing + 01 Mar 2001 jlim - Freek Dijkstra changes, also support for text type +*/ + +class ADODB_postgres extends ADODBConnection{ + var $databaseType = 'postgres'; + var $hasInsertID = true; + var $_resultid = false; + var $concat_operator='||'; + var $metaTablesSQL = "select tablename from pg_tables where tablename not like 'pg_%' order by 1"; + +/* +# show tables and views suggestion +"SELECT c.relname AS tablename FROM pg_class c + WHERE (c.relhasrules AND (EXISTS ( + SELECT r.rulename FROM pg_rewrite r WHERE r.ev_class = c.oid AND bpchar(r.ev_type) = '1' + ))) OR (c.relkind = 'v') AND c.relname NOT LIKE 'pg_%' +UNION +SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg_%' ORDER BY 1" +*/ + var $metaColumnsSQL = "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull FROM pg_class c, pg_attribute a,pg_type t WHERE relkind = 'r' AND c.relname='%s' AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum"; + // get primary key etc -- from Freek Dijkstra + var $metaKeySQL = "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid AND (i.indkey[0] = a.attnum OR i.indkey[1] = a.attnum OR i.indkey[2] = a.attnum OR i.indkey[3] = a.attnum OR i.indkey[4] = a.attnum OR i.indkey[5] = a.attnum OR i.indkey[6] = a.attnum OR i.indkey[7] = a.attnum) AND a.attrelid = bc.oid AND bc.relname = '%s'"; + + var $_hastrans = false; + var $hasAffectedRows = false; + var $hasTop = false; + var $hasLimit = false; // set to true for pgsql 7 only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10 + // below suggested by Freek Dijkstra + var $true = 't'; // string that represents TRUE for a database + var $false = 'f'; // string that represents FALSE for a database + var $fmtDate = "'Y-m-d'"; // used by DBDate() as the default date format used by the database + var $fmtTimeStamp = "'Y-m-d h:i:s'"; // used by DBTimeStamp as the default timestamp fmt. + var $hasMoveFirst = true; + var $hasGenID = true; + var $_genIDSQL = "SELECT NEXTVAL('%s')"; + var $_genSeqSQL = "CREATE SEQUENCE %s"; + + // The last (fmtTimeStamp is not entirely correct: + // PostgreSQL also has support for time zones, + // and writes these time in this format: "2001-03-01 18:59:26+02". + // There is no code for the "+02" time zone information, so I just left that out. + // I'm not familiar enough with both ADODB as well as Postgres + // to know what the concequences are. The other values are correct (wheren't in 0.94) + // -- Freek Dijkstra + + function ADODB_postgres() + { + } + + /* Warning from http://www.php.net/manual/function.pg-getlastoid.php: + Using a OID as a unique identifier is not generally wise. + Unless you are very careful, you might end up with a tuple having + a different OID if a database must be reloaded. */ + function _insertid() + { + return pg_getlastoid($this->_resultid); + } + + // I get this error ??? - jlim + // Warning: This compilation does not support pg_cmdtuples() in d:/inetpub/wwwroot/php/adodb/adodb-postgres.inc.php on line 44 + function _Affected_Rows() + { + //print_r($this->_resultid); + return pg_cmdtuples($this->_resultid); + } + + + // returns true/false + function BeginTrans() + { + $this->_hastrans = true; + return @pg_Exec($this->_connectionID, "begin"); + } + + // returns true/false. + function CommitTrans() + { + $this->_hastrans = false; + return @pg_Exec($this->_connectionID, "commit"); + } + + // returns true/false + function RollbackTrans() + { + $this->_hastrans = false; + return @pg_Exec($this->_connectionID, "rollback"); + } + + // converts table to lowercase + function &MetaColumns($table) + { + if (!empty($this->metaColumnsSQL)) { + // the following is the only difference -- we lowercase it + $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtolower($table))); + if ($rs === false) return false; + + if (!empty($this->metaKeySQL)) { + // If we want the primary keys, we have to issue a separate query + // Of course, a modified version of the metaColumnsSQL query using a + // LEFT JOIN would have been much more elegant, but postgres does + // not support OUTER JOINS. So here is the clumsy way. + $rskey = $this->Execute(sprintf($this->metaKeySQL,strtolower($table))); + // fetch all result in once for performance. + $keys = $rskey->GetArray(); + $rskey->Close(); + unset($rskey); + } + + $retarr = array(); + while (!$rs->EOF) { //print_r($rs->fields); + $fld = new ADODBFieldObject(); + $fld->name = $rs->fields[0]; + $fld->type = $rs->fields[1]; + $fld->max_length = $rs->fields[2]; + if ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4; + if ($fld->max_length <= 0) $fld->max_length = -1; + + //Freek + if ($rs->fields[4] == $this->true) { + $fld->not_null = true; + } + + // Freek + if (is_array($keys)) { + reset ($keys); + while (list($x,$key) = each($keys)) { + if ($fld->name == $key['column_name'] AND $key['primary_key'] == $this->true) + $fld->primary_key = true; + if ($fld->name == $key['column_name'] AND $key['unique_key'] == $this->true) + $fld->unique = true; // What name is more compatible? + } + } + + $retarr[strtoupper($fld->name)] = $fld; + + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + return false; + } + + + // returns true or false + // + // examples: + // $db->Connect("host=host1 user=user1 password=secret port=4341"); + // $db->Connect('host1','user1','secret'); + function _connect($str,$user='',$pwd='',$db='') + { + if ($user || $pwd || $db) { + if ($str) { + $host = split(":", $str); + if ($host[0]) $str = "host=$host[0]"; + else $str = 'localhost'; + if (isset($host[1])) $str .= " port=$host[1]"; + } + if ($user) $str .= " user=".$user; + if ($pwd) $str .= " password=".$pwd; + if ($db) $str .= " dbname=".$db; + } + + //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432"; + $this->_connectionID = pg_connect($str); + if ($this->_connectionID === false) return false; + $this->Execute("set datestyle='ISO'"); + return true; + } + + // returns true or false + // + // examples: + // $db->PConnect("host=host1 user=user1 password=secret port=4341"); + // $db->PConnect('host1','user1','secret'); + function _pconnect($str,$user='',$pwd='',$db='') + { + if ($user || $pwd || $db) { + if ($str) { + $host = split(":", $str); + if ($host[0]) $str = "host=$host[0]"; + else $str = 'localhost'; + if (isset($host[1])) $str .= " port=$host[1]"; + } + if ($user) $str .= " user=".$user; + if ($pwd) $str .= " password=".$pwd; + if ($db) $str .= " dbname=".$db; + } + $this->_connectionID = pg_pconnect($str); + if ($this->_connectionID === false) return false; + $this->Execute("set datestyle='ISO'"); + return true; + } + + // returns queryID or false + function _query($sql,$inputarr) + { + $this->_resultid= pg_Exec($this->_connectionID,$sql); + return $this->_resultid; + } + + + /* Returns: the last error message from previous database operation */ + function ErrorMsg() { + $this->_errorMsg = @pg_errormessage($this->_connectionID); + return $this->_errorMsg; + } + + // returns true or false + function _close() + { + if ($this->_hastrans) $this->RollbackTrans(); + @pg_close($this->_connectionID); + return true; + } + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_postgres extends ADORecordSet{ + + var $databaseType = "postgres"; + var $canSeek = true; + var $fetchMode; + function ADORecordSet_postgres($queryID) { + global $ADODB_FETCH_MODE; + + switch ($ADODB_FETCH_MODE) + { + case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break; + case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break; + default: + case ADODB_FETCH_DEFAULT: + case ADODB_FETCH_BOTH:$this->fetchMode = PGSQL_BOTH; break; + } + + $this->ADORecordSet($queryID); + } + + function _initrs() + { + global $ADODB_COUNTRECS; + $this->_numOfRows = ($ADODB_COUNTRECS)? @pg_numrows($this->_queryID):-1; + $this->_numOfFields = @pg_numfields($this->_queryID); + } + + function &FetchField($fieldOffset = 0) + { + $off=$fieldOffset; // offsets begin at 0 + + $o= new ADODBFieldObject(); + $o->name = @pg_fieldname($this->_queryID,$off); + $o->type = @pg_fieldtype($this->_queryID,$off); + $o->max_length = @pg_fieldsize($this->_queryID,$off); + //print_r($o); + //print "off=$off name=$o->name type=$o->type len=$o->max_length
"; + return $o; + } + + function _seek($row) + { + return @pg_fetch_row($this->_queryID,$row); + } + + // 10% speedup to move MoveNext to child class + function MoveNext($ignore_fields=false) + { + if ($this->_numOfRows != 0 && !$this->EOF) { + $this->_currentRow++; + $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode); + if (is_array($this->fields)) return true; + } + $this->EOF = true; + return false; + } + function _fetch($ignore_fields=false) + { + $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode); + return (is_array($this->fields)); + } + + function _close() { + return @pg_freeresult($this->_queryID); + } + + function MetaType($t,$len=-1,$fieldobj=false) + { + switch (strtoupper($t)) { + case 'CHAR': + case 'CHARACTER': + case 'VARCHAR': + case 'NAME': + case 'BPCHAR': + if ($len <= $this->blobSize) return 'C'; + + case 'TEXT': + return 'X'; + + case 'IMAGE': // user defined type + case 'BLOB': // user defined type + case 'BIT': // This is a bit string, not a single bit, so don't return 'L' + case 'VARBIT': + case 'BYTEA': + return 'B'; + + case 'BOOL': + case 'BOOLEAN': + return 'L'; + + case 'DATE': + return 'D'; + + case 'TIME': + case 'DATETIME': + case 'TIMESTAMP': + return 'T'; + + case 'SMALLINT': + case 'BIGINT': + case 'INTEGER': + case 'INT8': + case 'INT4': + case 'INT2': + if (isset($fieldobj) && + empty($fieldobj->primary_key) && empty($fieldobj->unique)) return 'I'; + + case 'OID': + case 'SERIAL': + return 'R'; + + default: + return 'N'; + } + } + +} +?> Index: trunk/admin/images/toolbar/tool_refresh.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/msn/tounge_smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/images/spanner.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_validate_continue_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_myfriends.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_empty.jpg =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/phrase_editor.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/phrase_editor.php (revision 0) +++ trunk/kernel/admin/include/toolbar/phrase_editor.php (revision 13) @@ -0,0 +1,96 @@ + + + + + +END; + +?> Index: trunk/admin/images/toolbar/tool_search_a_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_user_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icons16_permissions_inherited.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_view_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_stop_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/thumbup.gif =================================================================== diff -u Binary files differ Index: trunk/admin/browse/toolbar_002.css =================================================================== diff -u --- trunk/admin/browse/toolbar_002.css (revision 0) +++ trunk/admin/browse/toolbar_002.css (revision 13) @@ -0,0 +1,3 @@ +.toolbarDiv {background-color: #F0F1EB; width: 100%;} +.toolbarTable {background-color: #F0F1EB;} +.toolbarTD {padding: 2px} \ No newline at end of file Index: trunk/admin/editor/FCKeditor/dialog/fck_image.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/dialog/fck_image.html (revision 0) +++ trunk/admin/editor/FCKeditor/dialog/fck_image.html (revision 13) @@ -0,0 +1,440 @@ + + + + + + + + + + + + + + + + + + +
+ + + + + + +
URL
+ + + + + + + + + + + +
    + + +
+ +
+ +
+
+
Alternative Text
+ +
+ + + + + + +
+
+ + + + + + + + + +
Width  +
Height  +
+ + Lock Ratio +
+
+
+ + + + + + + + + + + + + + + + + +
Border  +
HSpace  +
VSpace  +
Align 
+
    + + + + + + + +
Preview
+
+ Magnus es, domine, et laudabilis valde: magna virtus tua, + et sapientiae tuae non est numerus. et laudare te vult homo, aliqua portio + creaturae tuae, et homo circumferens mortalitem suam, circumferens testimonium + peccati sui et testimonium, quia superbis resistis: et tamen laudare te vult + homo, aliqua portio creaturae tuae.tu excitas, ut laudare te delectet, quia + fecisti nos ad te et inquietum est cor nostrum, donec requiescat in te. da + mihi, domine, scire et intellegere, utrum sit prius invocare te an laudare te, + et scire te prius sit an invocare te. sed quis te invocat nesciens te? aliud + enim pro alio potest invocare nesciens. an potius invocaris, ut sciaris? + quomodo autem invocabunt, in quem non crediderunt? aut quomodo credent sine + praedicante? et laudabunt dominum qui requirunt eum. quaerentes enim inveniunt + eum et invenientes laudabunt eum. quaeram te, domine, invocans te, et invocem + te credens in te: praedicatus enim es nobis. invocat te, domine, fides mea, + quam dedisti mihi, quam inspirasti mihi per humanitatem filii tui, per + ministerium praedicatoris tui. +
+
+
+
+ + + Index: trunk/admin/images/smicon5.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/banrules.php =================================================================== diff -u --- trunk/kernel/include/banrules.php (revision 0) +++ trunk/kernel/include/banrules.php (revision 13) @@ -0,0 +1,84 @@ +clsItemDB(); + $this->tablename=GetTablePrefix()."BanRules"; + $this->type=61; + $this->BasePermission=""; + $this->id_field = "RuleId"; + $this->NoResourceId=1; + $this->debuglevel = 0; + + if(isset($RuleId)) + $this->LoadFromDatabase($RuleId); + } +} + +class clsBanRuleList extends clsItemCollection +{ + function clsBanRuleList() + { + $this->clsItemCollection(); + $this->classname = "clsBanRule"; //class type for items + $this->SourceTable = GetTablePrefix()."BanRules"; + $this->PerPageVar = "Perpage_BanRules"; + $this->Page = 1; + $this->AdminSearchFields = array("ItemValue"); + $this->BasePermission = ""; + $this->debuglevel = 0; + } + + function LoadItemRules($ItemType) + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE ItemType=$ItemType AND Status=1 ORDER BY Priority DESC"; + $this->Clear(); + return $this->Query_Item($sql); + } + + function GetMaxPriority() + { + $sql = "SELECT MAX(Priority) as MaxPri FROM ".GetTablePrefix()."BanRules"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + return $rs->fields["MaxPri"]; + + return 0; + } + + function &AddRule($ItemType,$RuleType,$ItemField,$ItemVerb,$ItemValue,$Priority,$Status, $ErrorTag = NULL) + { + $r = new clsBanRule(NULL); + $r->tablename = $this->SourceTable; + if($Priority==0) + $Priority = $this->GetMaxPriority()+1; + //echo "Creating User..
\n"; + $r->Set(array("ItemType", "RuleType", "ItemField", "ItemVerb", "ItemValue", "Status", "Priority", "ErrorTag"), + array($ItemType, $RuleType, $ItemField, $ItemVerb, $ItemValue, $Status, $Priority, $ErrorTag)); + $r->Create(); + + return $r; + } + + function EditRule($RuleId,$ItemType,$RuleType,$ItemField,$ItemVerb,$ItemValue,$Priority,$Status, $ErrorTag) + { + $r = $this->GetItem($RuleId); + if(is_object($r)) + { + $r->tablename = $this->SourceTable; + $r->Set(array("ItemType", "RuleType", "ItemField", "ItemVerb", "ItemValue", "Status", "Priority", "ErrorTag"), + array($ItemType, $RuleType, $ItemField, $ItemVerb, $ItemValue, $Status, $Priority, $ErrorTag)); + $r->Update(); + return $r; + } + else + return FALSE; + } + + function DeleteRule($RuleId) + { + $r = $this->GetItem($RuleId); + $r->Delete(); + } +} \ No newline at end of file Index: trunk/admin/images/toolbar/tool_usertogroup2_f3.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/catlist/catlist_element.tpl =================================================================== diff -u --- trunk/themes/default/catlist/catlist_element.tpl (revision 0) +++ trunk/themes/default/catlist/catlist_element.tpl (revision 13) @@ -0,0 +1,18 @@ + + + + + + + + + + + + +
+ ">

"> ( ) + <inp:m_language _Phrase=" /> + <inp:m_language _Phrase=" /> +
  
( )
+
Index: trunk/admin/category/images/ddarrow_over.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/catindex.tpl =================================================================== diff -u --- trunk/themes/default/catindex.tpl (revision 0) +++ trunk/themes/default/catindex.tpl (revision 13) @@ -0,0 +1,68 @@ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +



+ + + + + + + + + + + +

+ + + + + + +

+ + + + + + + +
" width="18" height="12" alt="" />
   
+
+ +

+ + + + + + +

+
+ + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/wouaf.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/love.gif =================================================================== diff -u Binary files differ Index: trunk/compat/http_build_query.php =================================================================== diff -u --- trunk/compat/http_build_query.php (revision 0) +++ trunk/compat/http_build_query.php (revision 13) @@ -0,0 +1,101 @@ + | +// | Aidan Lister +// +----------------------------------------------------------------------+ +// +// $Id: http_build_query.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace function http_build_query() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.http-build-query + * @author Stephan Schmidt + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('http_build_query')) +{ + function http_build_query ($formdata, $numeric_prefix = null) + { + // If $formdata is an object, convert it to an array + if (is_object($formdata)) { + $formdata = get_object_vars($formdata); + } + + // Check we have an array to work with + if (!is_array($formdata)) { + trigger_error('http_build_query() Parameter 1 expected to be Array or Object. Incorrect value given.', E_USER_WARNING); + return false; + } + + // If the array is empty, return null + if (empty($formdata)) { + return null; + } + + // Start building the query + $tmp = array (); + foreach ($formdata as $key => $val) + { + if (is_integer($key) && $numeric_prefix != null) { + $key = $numeric_prefix . $key; + } + + if (is_scalar($val)) { + array_push($tmp, urlencode($key).'='.urlencode($val)); + continue; + } + + // If the value is an array, recursively parse it + if (is_array($val)) { + array_push($tmp, __http_build_query($val, urlencode($key))); + continue; + } + } + + return implode('&', $tmp); + } + + // Helper function + function __http_build_query ($array, $name) + { + $tmp = array (); + foreach ($array as $key => $value) + { + if (is_array($value)) { + array_push($tmp, __http_build_query($value, sprintf('%s[%s]', $name, $key))); + } + + elseif (is_scalar($value)) { + array_push($tmp, sprintf('%s[%s]=%s', $name, urlencode($key), urlencode($value))); + } + + elseif (is_object($value)) { + array_push($tmp, __http_build_query(get_object_vars($value), sprintf('%s[%s]', $name, $key))); + } + } + + return implode('&', $tmp); + } +} +?> \ No newline at end of file Index: trunk/themes/default/common/pagetop.tpl =================================================================== diff -u --- trunk/themes/default/common/pagetop.tpl (revision 0) +++ trunk/themes/default/common/pagetop.tpl (revision 13) @@ -0,0 +1,41 @@ + + + + + + + +
+ + + + + +
">In-Portal Logo (Home)
+ + + + + + + + + +

+ + + + + + + + + + + + + +
">
">
">
">
+ +

+
Index: trunk/themes/default/img/ic_mytopics46.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/fckeditor.htc =================================================================== diff -u --- trunk/admin/editor/FCKeditor/fckeditor.htc (revision 0) +++ trunk/admin/editor/FCKeditor/fckeditor.htc (revision 13) @@ -0,0 +1,108 @@ + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/msn/thumbs_up.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/misc/right_subscribe.tpl =================================================================== diff -u --- trunk/themes/default/misc/right_subscribe.tpl (revision 0) +++ trunk/themes/default/misc/right_subscribe.tpl (revision 13) @@ -0,0 +1,32 @@ + + + + + + + + + + +

\ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/asthanos.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/act_review.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_validate.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/bs.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/bs.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/bs.js (revision 13) @@ -0,0 +1,198 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * en.js: English support. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Isjeci" ; +lang["Copy"] = "Kopiraj" ; +lang["Paste"] = "Zalijepi" ; +lang["PasteText"] = "Zalijepi kao obi�an tekst" ; +lang["PasteWord"] = "Zalijepi iz Word-a" ; +lang["Find"] = "Na�i" ; +lang["SelectAll"] = "Selektuj sve" ; +lang["RemoveFormat"] = "Ukloni format" ; +lang["InsertLink"] = "Insertuj/Edituj link" ; +lang["RemoveLink"] = "Ukloni Link" ; +lang["InsertImage"] = "Insertuj/Edituj sliku" ; +lang["InsertTable"] = "Insertuj/Edituj tabelu" ; +lang["InsertLine"] = "Insertuj horizontalnu liniju" ; +lang["InsertSpecialChar"] = "Insertuj specijalni karakter" ; +lang["InsertSmiley"] = "Insertuj smje�ka" ; +lang["About"] = "O FCKeditoru" ; + +lang["Bold"] = "Podebljana" ; +lang["Italic"] = "Nako�ena" ; +lang["Underline"] = "Podvu�ena" ; +lang["StrikeThrough"] = "Linija kroz" ; +lang["Subscript"] = "Subskript" ; +lang["Superscript"] = "Superskript" ; +lang["LeftJustify"] = "Lijevo poravnanje" ; +lang["CenterJustify"] = "Centralno poravnanje" ; +lang["RightJustify"] = "Desno poravnanje" ; +lang["BlockJustify"] = "Blokiraj poravnanje" ; +lang["DecreaseIndent"] = "Smanji uvod" ; +lang["IncreaseIndent"] = "Pove�aj uvod" ; +lang["Undo"] = "Vrati" ; +lang["Redo"] = "Ponovi" ; +lang["NumberedList"] = "Broj�ana Lista" ; +lang["BulettedList"] = "Lista" ; + +lang["ShowTableBorders"] = "Prika�i ivice tabela" ; +lang["ShowDetails"] = "Prika�i detalje" ; + +lang["FontStyle"] = "Stil" ; +lang["FontFormat"] = "Format" ; +lang["Font"] = "Font" ; +lang["FontSize"] = "Veli�ina" ; +lang["TextColor"] = "Boja teksta" ; +lang["BGColor"] = "Boja pozadine" ; +lang["Source"] = "HTML k�d" ; + +// Context Menu + +lang["EditLink"] = "Edituj link" ; +lang["InsertRow"] = "Ubaci red" ; +lang["DeleteRows"] = "Bri�i redove" ; +lang["InsertColumn"] = "Ubaci kolonu" ; +lang["DeleteColumns"] = "Bri�i kolone" ; +lang["InsertCell"] = "Ubaci �elije" ; +lang["DeleteCells"] = "Bri�i �elije" ; +lang["MergeCells"] = "Priljepi �elije" ; +lang["SplitCell"] = "Raspolovi �elije" ; +lang["CellProperties"] = "Svojstva �elije" ; +lang["TableProperties"] = "Svojstva tabele" ; +lang["ImageProperties"] = "Svojstva slike" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Procesiram XHTML. Molim pri�ekajte..." ; +lang["Done"] = "Gotovo" ; +lang["PasteWordConfirm"] = "Tekst koji �elite da priljepite se �ini da je kopiran iz Word-a. Da li �elite da ga prethodno o�istim?" ; +lang["NotCompatiblePaste"] = "Komanda je podr�ana u Internet Exploreru verzije 5.5 ili novija. Da li �elite priljepiti bez �i��enja?" ; + +// Dialogs +lang["DlgBtnOK"] = "Uredu" ; +lang["DlgBtnCancel"] = "Odustani" ; +lang["DlgBtnClose"] = "Zatvori" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Insertuj sliku" ; +lang["DlgImgTitleEdit"] = "Edituj sliku" ; +lang["DlgImgBtnUpload"] = "Po�alji na server" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Po�alji" ; +lang["DlgImgBtnBrowse"] = "Listaj server" ; +lang["DlgImgAlt"] = "Alternativni Tekst" ; +lang["DlgImgWidth"] = "�irina" ; +lang["DlgImgHeight"] = "Visina" ; +lang["DlgImgLockRatio"] = "Zaklju�aj odnos" ; +lang["DlgBtnResetSize"] = "Resetuj veli�inu" ; +lang["DlgImgBorder"] = "Ivica" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Poravnanje" ; +lang["DlgImgAlignLeft"] = "Lijevo" ; +lang["DlgImgAlignAbsBottom"] = "Abs dno" ; +lang["DlgImgAlignAbsMiddle"] = "Abs sredina" ; +lang["DlgImgAlignBaseline"] = "Dno" ; +lang["DlgImgAlignBottom"] = "Dole" ; +lang["DlgImgAlignMiddle"] = "Sredina" ; +lang["DlgImgAlignRight"] = "Desno" ; +lang["DlgImgAlignTextTop"] = "Tekst na vrhu" ; +lang["DlgImgAlignTop"] = "Vrh" ; +lang["DlgImgPreview"] = "Prikaz" ; +lang["DlgImgMsgWrongExt"] = "�ao nam je. Mo�ete poslati samo slike ovih ekstenzija:\n\n" + config.ImageUploadAllowedExtensions + "\n\nSlanje prekinuto." ; +lang["DlgImgAlertSelect"] = "Izaberite sliku za slanjes." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; // NEW +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Slanje" ; +lang["DlgLnkTarget"] = "Meta" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Novi prozor (_blank)" ; +lang["DlgLnkTargetParent"] = "Glavni prozor (_parent)" ; +lang["DlgLnkTargetSelf"] = "Isti prozor (_self)" ; +lang["DlgLnkTargetTop"] = "Najvi�i prozor (_top)" ; +lang["DlgLnkTitle"] = "Naslov" ; +lang["DlgLnkBtnUpload"] = "Po�alji na server" ; +lang["DlgLnkBtnBrowse"] = "Listaj server" ; +lang["DlgLnkMsgWrongExtA"] = "�ao nam je. Mo�ete poslati samo fajlove ovih ekstenzija:\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgLnkMsgWrongExtD"] = "�ao nam je. Ne mo�ete poslati fajlove ovih ekstenzija::\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperation canceled." ; + +// Color Dialog +lang["DlgColorTitle"] = "Izaberite boju" ; +lang["DlgColorBtnClear"] = "Izbri�i" ; +lang["DlgColorHighlight"] = "Posvjetli" ; +lang["DlgColorSelected"] = "Selektovana" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Ubaci smje�ka" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Ubaci specijalni karakter" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Ubaci Tabelu" ; +lang["DlgTableTitleEdit"] = "Edituj Tabelu" ; +lang["DlgTableRows"] = "Redovi" ; +lang["DlgTableColumns"] = "Kolone" ; +lang["DlgTableBorder"] = "Veli�ina Okvira" ; +lang["DlgTableAlign"] = "Poravnanje" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Ljevo" ; +lang["DlgTableAlignCenter"] = "Centar" ; +lang["DlgTableAlignRight"] = "Desno" ; +lang["DlgTableWidth"] = "�irina" ; +lang["DlgTableWidthPx"] = "Pixela" ; +lang["DlgTableWidthPc"] = "Procenata" ; +lang["DlgTableHeight"] = "Visina" ; +lang["DlgTableCellSpace"] = "Rastojanje �elije" ; +lang["DlgTableCellPad"] = "Unutra�nje margine �elije" ; +lang["DlgTableCaption"] = "Naziv Tabele" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Svojstva �elije" ; +lang["DlgCellWidth"] = "�irina" ; +lang["DlgCellWidthPx"] = "Pixels" ; +lang["DlgCellWidthPc"] = "Percent" ; +lang["DlgCellHeight"] = "Visina" ; +lang["DlgCellWordWrap"] = "Vrapovanje teksta" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Da" ; +lang["DlgCellWordWrapNo"] = "Ne" ; +lang["DlgCellHorAlign"] = "Horizontalno poravnanje" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Lijevo" ; +lang["DlgCellHorAlignCenter"] = "Centar" ; +lang["DlgCellHorAlignRight"] = "Desno" ; +lang["DlgCellVerAlign"] = "Vertikalno poravnanje" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Vrh" ; +lang["DlgCellVerAlignMiddle"] = "Sredina" ; +lang["DlgCellVerAlignBottom"] = "Dole" ; +lang["DlgCellVerAlignBaseline"] = "Dno" ; +lang["DlgCellRowSpan"] = "Pretvori u jedan red" ; +lang["DlgCellCollSpan"] = "Pretvori u jednu kolonu" ; +lang["DlgCellBackColor"] = "Boja pozadine" ; +lang["DlgCellBorderColor"] = "Boja okvira" ; +lang["DlgCellBtnSelect"] = "Selektuj..." ; + +// About Dialog +lang["DlgAboutVersion"] = "Verzija" ; +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "Za dalje informacije idite na" ; \ No newline at end of file Index: trunk/admin/icons/icon24_tool_import.gif =================================================================== diff -u Binary files differ Index: trunk/admin/templates/cat_element.tpl =================================================================== diff -u --- trunk/admin/templates/cat_element.tpl (revision 0) +++ trunk/admin/templates/cat_element.tpl (revision 13) @@ -0,0 +1,17 @@ + +
+ " name="catlist[]"> + + ');">" border="0" align="absMiddle"> + + ');">: + + + ( / ) +
+
+
+ () +
+
+ Index: trunk/kernel/admin/include/toolbar/catperm_setperm.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/catperm_setperm.php (revision 0) +++ trunk/kernel/admin/include/toolbar/catperm_setperm.php (revision 13) @@ -0,0 +1,56 @@ + + + + +END; +?> Index: trunk/admin/images/perm_green.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/suggest_cat/suggest_cat_confirm.tpl =================================================================== diff -u --- trunk/themes/default/suggest_cat/suggest_cat_confirm.tpl (revision 0) +++ trunk/themes/default/suggest_cat/suggest_cat_confirm.tpl (revision 13) @@ -0,0 +1,111 @@ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +



+ + + + + + + + + + + +

+ + + + + + +

+ + + + + + + +
" width="18" height="12" alt="" />
   
+
+ +

+ + + + + + + + +

+
+ + "> + + + + + + + + + + + + + + + + + + + + + +



 
+

+

+



+
+ " class="button"> +
+
+ + +

+
+ + + Index: trunk/themes/default/search_results/category_search_results_element.tpl =================================================================== diff -u --- trunk/themes/default/search_results/category_search_results_element.tpl (revision 0) +++ trunk/themes/default/search_results/category_search_results_element.tpl (revision 13) @@ -0,0 +1,27 @@ +
+ + + + + + + + + + + +
+ + "> +     +
+

"> ( ) + <inp:m_language _Phrase=" /> + <inp:m_language _Phrase=" /> +
  
( )
+ Index: trunk/admin/images/itemicons/icon16_user_disabled.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/eltaf.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_warning_big.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-proxy.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-proxy.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-proxy.inc.php (revision 13) @@ -0,0 +1,30 @@ +ADORecordset($id,$mode); + } + }; +} // define + +?> \ No newline at end of file Index: trunk/admin/images/toolbar/tool_new_item_f2.gif =================================================================== diff -u Binary files differ Index: trunk/html_parse.php =================================================================== diff -u --- trunk/html_parse.php (revision 0) +++ trunk/html_parse.php (revision 13) @@ -0,0 +1,75 @@ +# string $tagFn : function to call for each tag. This function +# is called for *every* tag, opening and closing. +# It would be easy to change this to call a +# different function for open and close tags. +# The tagFn has these arguments: +# function tagFn($tag, $attribs) +# string $tag : the tag +# string $attribs : all the attributes, as one long string +# wouldn't be hard to change this to an assoc array +# string $dataFn : function to call for data (non-tag). This function +# is called for all the data in between tags, including +# comments. The dataFn has these arguments: +# function dataFn($data) +# string $data : the text +# string $data : the html to parse + +function html_parse($tagFn, $dataFn, $data) +{ + $comment = false; + + # Split on '<', so the beginning of each array entry + # will be a tag. + $TagLine = explode('<', $data); + + # Loop through each entry -- each entry is a tag + # followed by everything up to the next tag. + foreach ($TagLine as $l) { + # If we're not in a comment block, then check if + # one starts here. + if (!$comment) { + if (substr(ltrim($l), 0, 3) == "!--") { + # this is the beginning of a comment, not a tag + $comment = true; + $commentline = ""; + } + } + + # If we're in a comment block, add this entry to + # the comment block, and check if it ends here. + if ($comment) { + $commentline .= "<".$l; + if (strstr($l, "-->")) { + $line = $commentline; + $tag = ""; + $comment = false; + } + else { + $line = ""; + $tag = ""; + } + } + # Otherwise, split on '>' to separate the tag from + # the data. + else { + list($tag, $line) = explode('>', $l, 2); + } + + # If there's a tag, call the tag function + if (strlen($tag)) { + $tag = trim($tag); + list($tag, $attribline) = explode(' ', $tag, 2); + + # I could split $attribline into an + # associative array, but I don't need + # that functionality now. + $tagFn($tag, $attribline); + } + + # If there's data, call the data function + if (strlen($line)) { + $dataFn($line); + } + } +} + Index: trunk/admin/images/toolbar/tool_upcat.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-postgres.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-postgres.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-postgres.inc.php (revision 13) @@ -0,0 +1,14 @@ + \ No newline at end of file Index: trunk/admin/images/version_bg.gif =================================================================== diff -u Binary files differ Index: trunk/admin/listview/viewmenu.php =================================================================== diff -u --- trunk/admin/listview/viewmenu.php (revision 0) +++ trunk/admin/listview/viewmenu.php (revision 13) @@ -0,0 +1,140 @@ +FilterFields = array(); + $this->SortFields = array(); + $this->CurrentFilter =0; + $this->FilterMax = 0; + $this->CurrentSortOrder = ""; + $this->CurrentSortField = ""; + } + + function AddFilterField($Label,$BitPlace) + { + $this->FilterFields[$Label]=$BitPlace; + } + + function AddSortField($Field,$Label,$IsDefault=FALSE) + { + $this->SortFields[$Field] = $Label; + if($IsDefault) + $this->DefaultSortField = $Field; + } + + function GetViewMenuJS($imagesURL) + { + $FilterVal = (int)$this->CurrentFilter; + $FilterVar = $this->FilterVar; + $fMax = $this->Filtermax; + $sOrder = $this->CurrentSortOrder; + $sOrderVar = $this->OrderVar; + $sField = $this->CurrentSortField; + $sDefault = $this->DefaultSortField; + if(!strlen($sField)) + $sField = $sDefault; + if(!strlen($sOrder)) + $sOrder = "asc"; + + $AllValue = $this->FilterMax; + $PerPageVal = $this->PerPageValue; + $PerPageVar = $this->PerPageVar; + $SortVar = $this->SortVar; + $CheckboxName = $this->CheckboxName; + + ob_start(); + print <<FilterFields)>0) +{ +echo " + window.menu_filter = new Menu(lang_View); + menu_filter.imagePath = '$imagesURL'+'/'; + menu_filter.addMenuItem(lang_All,\"config_val('$FilterVar',$AllValue);\",FilterView==$AllValue); + menu_filter.addMenuSeparator(); + +"; + foreach($this->FilterFields as $Label=>$Bit) + { + if($Label =="-") + { + print " menu_filter.addMenuSeparator();\n"; + } + else + print " menu_filter.addMenuItem('$Label',\"FlipBit('$FilterVar',FilterView,$Bit);\",BitStatus(FilterView,$Bit));\n"; + } +} +else + echo "var menu_filter = false;\n"; + print <<SortFields as $field=>$label) + { + print " menu_sorting.addMenuItem('$label',\"config_val('$SortVar','$field');\",RadioIsSelected(SortField,'$field'));\n"; + } + print <<FieldCount() : 0; + + if ($sql) $sql = urlencode($sql); + // metadata setup + + if ($max <= 0 || $rs->dataProvider == 'empty') { // is insert/update/delete + if (is_object($conn)) { + $sql .= ','.$conn->Affected_Rows(); + $sql .= ','.$conn->Insert_ID(); + } else + $sql .= ',,'; + + $text = "====-1,0,$sql\n"; + return $text; + } else { + $tt = ($rs->timeCreated) ? $rs->timeCreated : time(); + $line = "====0,$tt,$sql\n"; + } + // column definitions + for($i=0; $i < $max; $i++) { + $o = $rs->FetchField($i); + $line .= urlencode($o->name).':'.$rs->MetaType($o->type,$o->max_length).":$o->max_length,"; + } + $text = substr($line,0,strlen($line)-1)."\n"; + + + // get data + if ($rs->databaseType == 'array') { + $text .= serialize($rs->_array); + } else { + $rows = array(); + while (!$rs->EOF) { + $rows[] = $rs->fields; + $rs->MoveNext(); + } + $text .= serialize($rows); + } + $rs->MoveFirst(); + return $text; + } + + +/** +* Open CSV file and convert it into Data. +* +* @param url file/ftp/http url +* @param err returns the error message +* @param timeout dispose if recordset has been alive for $timeout secs +* +* @return recordset, or false if error occured. If no +* error occurred in sql INSERT/UPDATE/DELETE, +* empty recordset is returned +*/ + function &csv2rs($url,&$err,$timeout=0) + { + $fp = @fopen($url,'r'); + $err = false; + if (!$fp) { + $err = $url.'file/URL not found'; + return false; + } + flock($fp, LOCK_SH); + $arr = array(); + $ttl = 0; + + if ($meta = fgetcsv ($fp, 32000, ",")) { + // check if error message + if (substr($meta[0],0,4) === '****') { + $err = trim(substr($meta[0],4,1024)); + fclose($fp); + return false; + } + // check for meta data + // $meta[0] is -1 means return an empty recordset + // $meta[1] contains a time + + if (substr($meta[0],0,4) === '====') { + + if ($meta[0] == "====-1") { + if (sizeof($meta) < 5) { + $err = "Corrupt first line for format -1"; + fclose($fp); + return false; + } + fclose($fp); + + if ($timeout > 0) { + $err = " Illegal Timeout $timeout "; + return false; + } + $rs->fields = array(); + $rs->timeCreated = $meta[1]; + $rs = new ADORecordSet($val=true); + $rs->EOF = true; + $rs->_numOfFields=0; + $rs->sql = urldecode($meta[2]); + $rs->affectedrows = (integer)$meta[3]; + $rs->insertid = $meta[4]; + return $rs; + } + # Under high volume loads, we want only 1 thread/process to _write_file + # so that we don't have 50 processes queueing to write the same data. + # Would require probabilistic blocking write + # + # -2 sec before timeout, give processes 1/16 chance of writing to file with blocking io + # -1 sec after timeout give processes 1/4 chance of writing with blocking + # +0 sec after timeout, give processes 100% chance writing with blocking + if (sizeof($meta) > 1) { + if($timeout >0){ + $tdiff = $meta[1]+$timeout - time(); + if ($tdiff <= 2) { + switch($tdiff) { + case 2: + if ((rand() & 15) == 0) { + fclose($fp); + $err = "Timeout 2"; + return false; + } + break; + case 1: + if ((rand() & 3) == 0) { + fclose($fp); + $err = "Timeout 1"; + return false; + } + break; + default: + fclose($fp); + $err = "Timeout 0"; + return false; + } // switch + + } // if check flush cache + }// (timeout>0) + $ttl = $meta[1]; + } + $meta = false; + $meta = fgetcsv($fp, 16000, ","); + if (!$meta) { + fclose($fp); + $err = "Unexpected EOF 1"; + return false; + } + } + + // Get Column definitions + $flds = array(); + foreach($meta as $o) { + $o2 = explode(':',$o); + if (sizeof($o2)!=3) { + $arr[] = $meta; + $flds = false; + break; + } + $fld = new ADOFieldObject(); + $fld->name = urldecode($o2[0]); + $fld->type = $o2[1]; + $fld->max_length = $o2[2]; + $flds[] = $fld; + } + } else { + fclose($fp); + $err = "Recordset had unexpected EOF 2"; + return false; + } + + // slurp in the data + $MAXSIZE = 128000; + $text = fread($fp,$MAXSIZE); + $cnt = 1; + while (strlen($text) == $MAXSIZE*$cnt) { + $text .= fread($fp,$MAXSIZE); + $cnt += 1; + } + + fclose($fp); + $arr = @unserialize($text); + + //var_dump($arr); + if (!is_array($arr)) { + $err = "Recordset had unexpected EOF (in serialized recordset)"; + if (get_magic_quotes_runtime()) $err .= ". Magic Quotes Runtime should be disabled!"; + return false; + } + $rs = new ADORecordSet_array(); + $rs->timeCreated = $ttl; + $rs->InitArrayFields($arr,$flds); + return $rs; + } +?> \ No newline at end of file Index: trunk/kernel/admin/include/summary/users.php =================================================================== diff -u --- trunk/kernel/admin/include/summary/users.php (revision 0) +++ trunk/kernel/admin/include/summary/users.php (revision 13) @@ -0,0 +1,72 @@ +UserCount(""); +$ActiveUsers = (int)$objUsers->CountActive(); +$PendingUsers = (int)$objUsers->CountPending(); +$DisabledUsers = (int)$objUsers->CountDisabled(); + +print << +
+
+ $lang_Search $lang_Users +
+
+
+ +
+
+
+
+
+ + + + + +
$lang_Users ($TotalUsers)
+
+ +
+ +END; +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/tigi.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/rootpass.php =================================================================== diff -u --- trunk/admin/install/rootpass.php (revision 0) +++ trunk/admin/install/rootpass.php (revision 13) @@ -0,0 +1,49 @@ + +  Set Root Password

+ + + + + + + +
 Step - Set Root Password
+ + +
+ + + + + \ No newline at end of file Index: trunk/admin/images/tab_active_back.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.showdetails.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/arrow16_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/include/toolbar.php =================================================================== diff -u --- trunk/admin/include/toolbar.php (revision 0) +++ trunk/admin/include/toolbar.php (revision 13) @@ -0,0 +1,2 @@ + \ No newline at end of file Index: trunk/admin/images/divider_right.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_itemsearch.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_pick2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install.php =================================================================== diff -u --- trunk/admin/install.php (revision 0) +++ trunk/admin/install.php (revision 13) @@ -0,0 +1,1821 @@ + $section) + { + foreach($section as $key => $value) + { + $key = "g_".$key; + global $$key; + $$key = $value; + } + } +} +else +{ + $state=""; + $write_access = is_writable($pathtoroot); + if($write_access) + { + set_ini_value("Database", "DBType", ""); + set_ini_value("Database", "DBHost", ""); + set_ini_value("Database", "DBUser", ""); + set_ini_value("Database", "DBUserPassword", ""); + set_ini_value("Database", "DBName", ""); + set_ini_value("Module Versions", "In-Portal", ""); + save_values(); + } +} + +$titles[1] = "General Site Setup"; +$configs[1] = "in-portal:configure_general"; +$mods[1] = "In-Portal"; + +$titles[2] = "User Setup"; +$configs[2] = "in-portal:configure_users"; +$mods[2] = "In-Portal:Users"; + +$titles[3] = "Category Display Setup"; +$configs[3] = "in-portal:configure_categories"; +$mods[3] = "In-Portal"; + +if(strlen($g_DBType)>0 && strlen($state)>0 && $state !="dbinfo" && $state !="db_config_save") +{ + require_once($pathtoroot."kernel/startup.php"); + $localURL=$rootURL."kernel/"; + $adminURL = $rootURL.$admin; + $imagesURL = $adminURL."/images"; + +//admin only util + + $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"); +} + +function GetPathChar($path = null) +{ + if( !isset($path) ) $path = $GLOBALS['pathtoroot']; + $pos = strpos($path, ':'); + return ($pos === false) ? "/" : "\\"; +} + +function SuperStrip($str, $inverse = false) +{ + $str = $inverse ? str_replace("%5C","\\",$str) : str_replace("\\","%5C",$str); + return stripslashes($str); +} + +require_once($pathtoroot.$admin."/install/inst_ado.php"); + +?> + + +In-Portal Installation + + + + + + + + +"> +
+ + + + + + + + + + + + + + +
+ Root Password: + +
+ Confirm Root Password: + +


+
+ + + + + + + +
+
+ + + + +
'; + } + $general_error .= "Install cannot write to config.php in the root directory of your in-portal installation ($pathtoroot)."; + //die(); + } + + if(!is_writable($pathtoroot."themes/")) + { + if ($general_error != '') { + $general_error .= '

'; + } + $general_error .= "In-portal's Theme directory must be writable (".$pathtoroot."themes/)."; + //die(); + } + + if(!is_writable($pathtoroot."kernel/images/")) + { + if ($general_error != '') { + $general_error .= '

'; + } + $general_error .= "In-portal's Image Upload directory must be writable (".$pathtoroot."kernel/images/)."; + //die(); + } + + if(!is_writable($pathtoroot."admin/backupdata/")) + { + if ($general_error != '') { + $general_error .= '

'; + } + $general_error .= "In-portal's Backup directory must be writable (".$pathtoroot."admin/backupdata/)."; + //die(); + } + + if(!is_writable($pathtoroot."admin/export/")) + { + if ($general_error != '') { + $general_error .= '

'; + } + $general_error .= "In-portal's Exportd directory must be writable (".$pathtoroot."admin/export/)."; + //die(); + } + + if($installed) + { + $state="reinstall"; + } + else { + $state="dbinfo"; + } + +} +if($state=="reinstall_process") +{ + $lic = base64_decode($g_License); + if(strlen($lic)) + { + inst_ParseLicense($lic); + $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0)); + } + + $LoggedIn = FALSE; + if($_POST["UserName"]=="root") + { + $ado = inst_GetADODBConnection(); + $sql = "SELECT * FROM ".$g_TablePrefix."ConfigurationValues WHERE VariableName='RootPass'"; + + $rs = $ado->Execute($sql); + if($rs && !$rs->EOF) + { + $RootPass = $rs->fields["VariableValue"]; + + if(strlen($RootPass)>0) + $LoggedIn = ($RootPass==md5($_POST["UserPass"])); + } + } + else + { + $rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['UserName'])."&password=".md5($_POST['UserPass'])."&domain=".$_SERVER['SERVER_NAME'], "r"); + if (!$rfile) { + $LoggedIn = false; + } + else { + $rcontents = ''; + while (!feof($rfile)) { + $line = fgets($rfile, 10000); + $rcontents .= $line; + } + @fclose($rfile); + + if (substr($rcontents, 0, 5) == 'Error') { + $LoggedIn = false; + } + else { + $LoggedIn = true; + } + } + //$LoggedIn = ($i_User == $_POST["UserName"] && ($i_Pswd == $_POST["UserPass"]) && strlen($i_User)>0) || strlen($i_User)==0; + } + + if($LoggedIn) + { + if (!(int)$_POST["inp_opt"]) { + $state="reinstall"; + $inst_error = "Please select one of the options above!"; + } + else { + switch((int)$_POST["inp_opt"]) + { + case 0: + $inst_error = "Please select an option above"; + break; + case 1: + /* clean out all tables */ + $install_type = 4; + $ado = inst_GetADODBConnection(); + $filename = $pathtoroot.$admin."/install/inportal_remove.sql"; + RunSchemaFile($ado,$filename); + /* run install again */ + $state="license"; + break; + case 2: + $install_type = 3; + $state="dbinfo"; + break; + case 3: + $install_type = 5; + $state="license"; + break; + case 4: + $install_type = 6; + /* clean out all tables */ + $ado = inst_GetADODBConnection(); + //$filename = $pathtoroot.$admin."/install/inportal_remove.sql"; + //RunSchemaFile($ado,$filename); + /* run install again */ + $state="restore_select"; + break; + case 5: + $install_type = 7; + /* change DB config */ + $state="db_reconfig"; + break; + case 6: + $install_type = 8; + $state = "upgrade"; + break; + } + } + } + else + { + $state="reinstall"; + $login_error = "Invalid Username or Password - Try Again"; + } +} + +if ($state == "upgrade") { + $ado = inst_GetADODBConnection(); + + $Modules = array(); + $Texts = array(); + + $sql = "SELECT Name, Version FROM ".$g_TablePrefix."Modules"; + $rs = $ado->Execute($sql); + + while ($rs && !$rs->EOF) { + $p = strtolower($rs->fields['Name']); +// $modules .= strtolower($rs->fields['Name']).','; +// $rs->MoveNext(); +// } + +// $mod_arr = explode(",", substr($modules, 0, strlen($modules) - 1)); + +// foreach($mod_arr as $p) +// { + if ($p == 'in-portal') { + $p = ''; + } + + $dir_name = $pathtoroot.$p."/admin/install/upgrades/"; + $dir = @dir($dir_name); + //echo "
"; print_r($dir); echo "
"; + + while ($file = $dir->read()) { + if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) + { + $file = str_replace("inportal_upgrade_v", "", $file); + $file = str_replace(".sql", "", $file); + + if ($file != '') { + $sql = "SELECT count(*) AS count FROM ".$g_TablePrefix."Modules WHERE Name = '".$rs->fields['Name']."' AND Version = '$file'"; + $rs1 = $ado->Execute($sql); + + if ($rs1->fields['count'] == 0) { +// $sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '".$p."'"; +// $rs2 = $ado->Execute($sql); + $Texts[] = $rs->fields['Name']." (".$rs->fields['Version']." ".prompt_language("la_to")." ".$file.")"; + $Modules[] = $rs->fields['Name']; + } + } + } + } + $rs->MoveNext(); + } + + $include_file = "install/upgrade.php"; +} + +if ($state == "upgrade_process") { + + $mod_arr = $_POST['modules']; + + foreach($mod_arr as $p) + { + $mod_name = strtolower($p); + + if ($mod_name == 'in-portal') { + $mod_name = ''; + } + + $dir_name = $pathtoroot.$mod_name."/admin/install/upgrades/"; + $dir = @dir($dir_name); + + $new_version = ''; + $tmp1 = 0; + $tmp2 = 0; + while ($file = $dir->read()) { + if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) + { + $file = str_replace("inportal_upgrade_v", "", $file); + $file = str_replace(".sql", "", $file); + + if ($file != '') { + $tmp1 = str_replace(".", "", $file); + if ($tmp1 > $tmp2) { + $new_version = $file; + } + } + } + $tmp2 = $tmp1; + } + + + $version_nrs = explode(".", $new_version); + + for ($i = 0; $i < $version_nrs[0] + 1; $i++) { + for ($j = 0; $j < $version_nrs[1] + 1; $j++) { + for ($k = 0; $k < $version_nrs[2] + 1; $k++) { + $try_version = "$i.$j.$k"; + + $filename = $pathtoroot.$mod_name."/admin/install/upgrades/inportal_upgrade_v$try_version.sql"; + + if(file_exists($filename)) + { + RunSQLFile($ado, $filename); + set_ini_value("Module Versions", $p, $try_version); + save_values(); + } + } + } + } + } + + $state = "finish"; + $include_file = "install/install_finish.php"; +} + +if($state=="db_reconfig_save") +{ + $ini_vars = parse_ini_file($ini_file,TRUE); + + foreach($ini_vars as $secname => $section) + { + foreach($section as $key => $value) + { + $key = "g_".str_replace("-", "", $key); + global $$key; + $$key = $value; + } + } + unset($ado); + $ado = inst_GetADODBConnection(); + if($ado->ErrorNo()!=0) + { + $db_error = "Connection Error: (".$ado->ErrorNo().") ".$ado->ErrorMsg(); + $state = "db_reconfig"; + + } + else + { + if(!TableExists($ado,"ConfigurationAdmin,Category,Permissions")) + { + $state="db_reconfig"; + $db_error = "An In-Portal Database was not found at this location"; + } + else { + set_ini_value("Database", "DBType",$_POST["ServerType"]); + set_ini_value("Database", "DBHost",$_POST["ServerHost"]); + set_ini_value("Database", "DBName",$_POST["ServerDB"]); + set_ini_value("Database", "DBUser",$_POST["ServerUser"]); + set_ini_value("Database", "DBUserPassword",$_POST["ServerPass"]); + set_ini_value("Database","TablePrefix",$_POST["TablePrefix"]); + + save_values(); + + $state = "finish"; + $include_file = "install/install_finish.php"; + } + } +} + + +if($state=="db_reconfig") +{ + $include_file = "install/db_reconfig.php"; +} + +if($state=="restore_file") +{ + if($_POST["submit"]=="Update") + { + $filepath = $_POST["backupdir"]; + $state="restore_select"; + } + else + { + $filepath = stripslashes($_POST['backupdir']); + $backupfile = $filepath.$path_char.str_replace('(.*)', $_POST['backupdate'], BACKUP_NAME); + + if(file_exists($backupfile) && is_readable($backupfile)) + { + $ado = inst_GetADODBConnection(); + + $show_warning = false; + + if (!$_POST['warning_ok']) { + // Here we comapre versions between backup and config + $file_contents = file_get_contents($backupfile); + + $file_tmp_cont = explode("#------------------------------------------", $file_contents); + $tmp_vers = $file_tmp_cont[0]; + + $vers_arr = explode(";", $tmp_vers); + $ini_values = parse_ini_file($ini_file); + + foreach ($ini_values as $key => $value) { + foreach ($vers_arr as $k) { + if (strstr($k, $key)) { + if (!strstr($k, $value)) { + $show_warning = true; + } + } + } + } + //$show_warning = true; + } + + if (!$show_warning) { + $filename = $pathtoroot.$admin.$path_char.'install'.$path_char.'inportal_remove.sql'; + RunSchemaFile($ado,$filename); + $state="restore_run"; + } + else { + $state = "warning"; + $include_file = "install/warning.php"; + } + } + else { + if ($_POST['backupdate'] != '') { + $include_file = "install/restore_select.php"; + $restore_error = "$backupfile not found or could not be read"; + } + else { + $include_file = "install/restore_select.php"; + $restore_error = "No backup selected!!!"; + } + } + } + //echo $restore_error; +} + +if($state=="restore_select") +{ + if( isset($_POST['backupdir']) ) $filepath = stripslashes($_POST['backupdir']); + $include_file = "install/restore_select.php"; +} + +if($state=="restore_run") +{ + $ado = inst_GetADODBConnection(); + $FileOffset = (int)$_GET["Offset"]; + if(!strlen($backupfile)) + $backupfile = SuperStrip($_GET['File'], true); + + $include_file = "install/restore_run.php"; +} + +if($state=="db_config_save") +{ + set_ini_value("Database", "DBType",$_POST["ServerType"]); + set_ini_value("Database", "DBHost",$_POST["ServerHost"]); + set_ini_value("Database", "DBName",$_POST["ServerDB"]); + set_ini_value("Database", "DBUser",$_POST["ServerUser"]); + set_ini_value("Database", "DBUserPassword",$_POST["ServerPass"]); + set_ini_value("Database","TablePrefix",$_POST["TablePrefix"]); + + save_values(); + $ini_vars = parse_ini_file($ini_file,TRUE); + + foreach($ini_vars as $secname => $section) + { + foreach($section as $key => $value) + { + $key = "g_".str_replace("-", "", $key); + global $$key; + $$key = $value; + } + } + unset($ado); + $ado = inst_GetADODBConnection(); + if($ado->ErrorNo()!=0) + { + $db_error = "Connection Error: (".$ado->ErrorNo().") ".$ado->ErrorMsg(); + $state = "dbinfo"; + + } + else + { + if(TableExists($ado,"ConfigurationAdmin,Category,Permissions")) + { + $state="dbinfo"; + $db_error = "An In-Portal Database already exists at this location"; + } + else + $state = "license"; + } +} + +if($state=="dbinfo") +{ + if ($install_type == '') { + $install_type = 1; + } + $include_file = "install/dbinfo.php"; +} + +if ($state == "download_license") { + $ValidLicense = FALSE; + if ($_POST['login'] != '' && $_POST['password'] != '') { + // Here we determine weather login is ok & check available licenses + + $rfile = @fopen(GET_LICENSE_URL."?login=".md5($_POST['login'])."&password=".md5($_POST['password'])."&domain=".$_SERVER['SERVER_NAME'], "r"); + if (!$rfile) { + $get_license_error = "Unable to connect to the Intechnic server! Please try again later!"; + $state = "get_license"; + $include_file = "install/get_license.php"; + } + else { + $rcontents = ''; + while (!feof($rfile)) { + $line = fgets($rfile, 10000); + $rcontents .= $line; + } + @fclose($rfile); + + if (substr($rcontents, 0, 5) == 'Error') { + $get_license_error = substr($rcontents, 6); + $state = "get_license"; + $include_file = "install/get_license.php"; + } + else { + if (substr($rcontents, 0, 3) == "SEL") { + $state = "download_license"; + $license_select = substr($rcontents, 4); + $include_file = "install/download_license.php"; + } + else { + // Here we get one license + $data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $rcontents)); + inst_ParseLicense($data); + $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0)); + if($ValidLicense) + { + set_ini_value("Intechnic","License",base64_encode($data)); + save_values(); + $state="domain_select"; + $got_license = 1; + } + else { + $license_error="Invalid License File"; + } + if(!$ValidLicense) + { + $state="license"; + } + } + } + } + + } + else if ($_POST['licenses'] == '') { + $state = "get_license"; + $get_license_error = "Username and / or password not specified!!!"; + $include_file = "install/get_license.php"; + } + else { + // Here we download license + $rfile = @fopen(GET_LICENSE_URL."?license_id=".md5($_POST['licenses'])."&dlog=".md5($_POST['dlog'])."&dpass=".md5($_POST['dpass'])."&domain=".$_POST['domain'], "r"); + if (!$rfile) { + $get_license_error = "Unable to connect to the Intechnic server! Please try again later!"; + $state = "get_license"; + $include_file = "install/get_license.php"; + } + else { + $rcontents = ''; + while (!feof($rfile)) { + $line = fgets($rfile, 10000); + $rcontents .= $line; + } + @fclose($rfile); + + if (substr($rcontents, 0, 5) == 'Error') { + $download_license_error = substr($rcontents, 6); + $state = "download_license"; + $include_file = "install/download_license.php"; + } + else { + $data = base64_decode(str_replace("In-Portal License File - do not edit!\n", "", $rcontents)); + inst_ParseLicense($data); + $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0)); + if($ValidLicense) + { + set_ini_value("Intechnic","License",base64_encode($data)); + save_values(); + $state="domain_select"; + } + else { + $license_error="Invalid License File"; + } + if(!$ValidLicense) + { + $state="license"; + } + } + } + } +} + +if($state=="license_process") +{ + $ValidLicense = FALSE; + switch($_POST["lic_opt"]) + { + case 1: /* download from intechnic */ + $include_file = "install/get_license.php"; + $state = "get_license"; + //if(!$ValidLicense) + //{ + // $state="license"; + //} + break; + case 2: /* upload file */ + $file = $_FILES["licfile"]; + if(is_array($file)) + { + move_uploaded_file($file["tmp_name"],$pathtoroot."themes/tmp.lic"); + $fp = @fopen($pathtoroot."themes/tmp.lic","rb"); + if($fp) + { + $lic = fread($fp,filesize($pathtoroot."themes/tmp.lic")); + fclose($fp); + } + $data = inst_LoadLicense(FALSE,$pathtoroot."themes/tmp.lic"); + @unlink($pathtoroot."themes/tmp.lic"); + inst_ParseLicense($data); + $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0)); + if($ValidLicense) + { + set_ini_value("Intechnic","License",base64_encode($data)); + save_values(); + $state="domain_select"; + } + else + $license_error="Invalid License File"; + } + if(!$ValidLicense) + { + $state="license"; + } + break; + case 3: /* existing */ + if(strlen($g_License)) + { + $lic = base64_decode($g_License); + inst_ParseLicense($lic); + $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0)); + if($ValidLicense) + { + $state="domain_select"; + } + else + { + $state="license"; + $license_error="Invalid or corrupt license detected"; + } + } + else + { + $state="license"; + $license_error="Missing License File"; + } + if(!$ValidLicense) + { + $state="license"; + } + break; + case 4: + $state="domain_select"; + break; + } + if($ValidLicense) + $state="domain_select"; +} + +if($state=="license") +{ + $include_file = "install/sel_license.php"; + +} + +if($state=="reinstall") +{ + $ado = inst_GetADODBConnection(); + + $show_upgrade = false; + + $sql = "SELECT Name FROM ".$g_TablePrefix."Modules"; + $rs = $ado->Execute($sql); + + $modules = ''; + while ($rs && !$rs->EOF) { + $modules .= strtolower($rs->fields['Name']).','; + $rs->MoveNext(); + } + + $mod_arr = explode(",", substr($modules, 0, strlen($modules) - 1)); + + foreach($mod_arr as $p) + { + if ($p == 'in-portal') { + $p = ''; + } + + $dir_name = $pathtoroot.$p."/admin/install/upgrades/"; + $dir = @dir($dir_name); + //echo "
"; print_r($dir); echo "
"; + + while ($file = $dir->read()) { + if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) + { + $file = str_replace("inportal_upgrade_v", "", $file); + $file = str_replace(".sql", "", $file); + + if ($file != '') { + if ($p == '') { + $p = 'in-portal'; + } + $sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = '".$p."'"; + $rs = $ado->Execute($sql); + + if (str_replace(".", "", $rs->fields['Version']) < str_replace(".", "", $file)) { + $show_upgrade = true; + } + } + } + } + } + + if ($install_type == '') { + $install_type = 2; + } + + $include_file = "install/reinstall.php"; +} + +if($state=="login") +{ + $lic = base64_decode($g_License); + if(strlen($lic)) + { + inst_ParseLicense($lic); + $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0)); + } + + if(!$ValidLicense) + { + $state="license"; + } + else + if($i_User == $_POST["UserName"] || $i_Pswd == $_POST["UserPass"]) + { + $state = "domain_select"; + } + else + { + $state="getuser"; + $login_error = "Invalid User Name or Password. If you don't know your username or password, contact Intechnic Support"; + } + + //die(); +} + +if($state=="getuser") +{ + $include_file = "install/login.php"; +} + +if($state=="set_domain") +{ + if(!is_array($i_Keys)) + { + $lic = base64_decode($g_License); + if(strlen($lic)) + { + inst_ParseLicense($lic); + $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0)); + } + } + if($_POST["domain"]==1) + { + $domain = $_SERVER['HTTP_HOST']; + set_ini_value("Intechnic","Domain",$domain); + save_values(); + $state="runsql"; + } + else + { + $domain = str_replace(" ", "", $_POST["other"]); + if ($domain != '') { + set_ini_value("Intechnic","Domain",$domain); + save_values(); + $state="runsql"; + } + else { + $DomainError = 'Please enter valid domain!'; + $state = "domain_select"; + } + } +} + +if($state=="domain_select") +{ + if(!is_array($i_Keys)) + { + $lic = base64_decode($g_License); + if(strlen($lic)) + { + inst_ParseLicense($lic); + $ValidLicense = ((strlen($i_User)>0) && (strlen($i_Pswd)>0)); + } + } + + $include_file = "install/domain.php"; +} + + +if($state=="runsql") +{ + $ado = inst_GetADODBConnection(); + $installed = TableExists($ado,"ConfigurationAdmin,Category,Permissions"); + if(!$installed) + { + // create tables + $filename = $pathtoroot.$admin."/install/inportal_schema.sql"; + RunSchemaFile($ado,$filename); + + // insert default info + $filename = $pathtoroot.$admin."/install/inportal_data.sql"; + RunSQLFile($ado,$filename); + + $sql = "SELECT Version FROM ".$g_TablePrefix."Modules WHERE Name = 'In-Portal'"; + $rs = $ado->Execute($sql); + + set_ini_value("Module Versions", "In-Portal", $rs->fields['Version']); + save_values(); + + require_once $pathtoroot.'kernel/include/tag-class.php'; + if( !is_object($objTagList) ) $objTagList = new clsTagList(); + + // install kernel specific tags + $objTagList->DeleteTags(); // delete all existing tags in db + + // create 3 predifined tags (because there no functions with such names + $t = new clsTagFunction(); + $t->Set("name","include"); + $t->Set("description","insert template output into the current template"); + $t->Create(); + $t->AddAttribute("_template","tpl","Template to insert","",TRUE); + $t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE); + $t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE); + $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE); + unset($t); + + $t = new clsTagFunction(); + $t->Set("name","perm_include"); + $t->Set("description","insert template output into the current template if permissions are set"); + $t->Create(); + $t->AddAttribute("_template","tpl","Template to insert","",TRUE); + $t->AddAttribute("_noaccess","tpl","Template to insert if access is denied","",FALSE); + $t->AddAttribute("_permission","","Comma-separated list of permissions, any of which will grant access","",FALSE); + $t->AddAttribute("_module","","Used in place of the _permission attribute, this attribute verifies the module listed is enabled","",FALSE); + $t->AddAttribute("_system","bool","Must be set to true if any permissions in _permission list is a system permission","",FALSE); + $t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE); + $t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE); + $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE); + unset($t); + + $t = new clsTagFunction(); + $t->Set("name","mod_include"); + $t->Set("description","insert templates from all enabled modules. No error occurs if the template does not exist."); + $t->Create(); + $t->AddAttribute("_template","tpl","Template to insert. This template path should be relative to the module template root directory","",TRUE); + $t->AddAttribute("_modules","","Comma-separated list of modules. Defaults to all enabled modules if not set","",FALSE); + $t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE); + $t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE); + $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE); + + $objTagList->ParseFile($pathtoroot.'kernel/parser.php'); // insert module tags + + if( is_array($ItemTagFiles) ) + foreach($ItemTagFiles as $file) + $objTagList->ParseItemFile($pathtoroot.$file); + + $state="RootPass"; + } + else { + $include_file = "install/install_finish.php"; + $state="finish"; + } +} + +if ($state == "finish") { + $include_file = "install/install_finish.php"; +} + +if($state=="RootSetPass") +{ + $pass = $_POST["RootPass"]; + if(strlen($pass)<4) + { + $PassError = "Root Password must be at least 4 characters"; + $state = "RootPass"; + + } + else if ($pass != $_POST["RootPassConfirm"]) { + $PassError = "Passwords does not match"; + $state = "RootPass"; + } + else + { + $pass = md5($pass); + $sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$pass' WHERE VariableName='RootPass' OR VariableName='RootPassVerify'"; + $ado = inst_GetADODBConnection(); + $ado->Execute($sql); + $state="modselect"; + } +} + +if($state=="RootPass") +{ + $include_file = "install/rootpass.php"; +} + +if($state=="lang_install_init") +{ + include_once($pathtoroot."kernel/include/xml.php"); + + $ado = inst_GetADODBConnection(); + + if (TableExists($ado, "Language,Phrase")) { + $MaxInserts = 200; + $PhraseTable = GetTablePrefix()."ImportPhrases"; + $EventTable = GetTablePrefix()."ImportEvents"; + + $sql = "CREATE TABLE $PhraseTable SELECT Phrase,Translation,PhraseType,LanguageId FROM ".GetTablePrefix()."Phrase WHERE PhraseId=-1"; + $ado->Execute($sql); + + $sql = "CREATE TABLE $EventTable SELECT Template,MessageType,EventId,LanguageId FROM ".GetTablePrefix()."EmailMessage WHERE EmailMessageId=-1"; + $ado->Execute($sql); + $sql = "SELECT EventId,Event,Type FROM ".GetTablePrefix()."Events"; + $rs = $ado->Execute($sql); + $Events = array(); + while($rs && !$rs->EOF) + { + $Events[$rs->fields["Event"]."_".$rs->fields["Type"]] = $rs->fields["EventId"]; + $rs->MoveNext(); + } + + if(count($_POST["lang"])>0) + { + $Langs = $_POST["lang"]; + for($x=0;$xparse(); + + $objInXML->getTag(0,$name,$attribs,$contents,$tags); + + if(is_array($tags)) + { + foreach($tags as $t) + { + $LangRoot =& $objInXML->getTagByID($t); + $PackName = $LangRoot->attributes["PACKNAME"]; + $l = $objLanguages->GetItemByField("PackName",$PackName); + if(is_object($l)) + { + $LangId = $l->Get("LanguageId"); + } + else + { + $l = new clsLanguage(); + $l->Set("Enabled",1); + $l->Create(); + $NewLang = TRUE; + $LangId = $l->Get("LanguageId"); + } + foreach($LangRoot->children as $tag) + { + switch($tag->name) + { + case "PHRASES": + foreach($tag->children as $PhraseTag) + { + $Phrase = $PhraseTag->attributes["LABEL"]; + $Translation = base64_decode($PhraseTag->contents); + $PhraseType = $PhraseTag->attributes["TYPE"]; + $psql = "INSERT INTO $PhraseTable (Phrase,Translation,PhraseType,LanguageId) VALUES ('$Phrase','$Translation',$PhraseType,$LangId)"; + $ado->Execute($psql); + //echo "$psql
\n"; + } + break; + case "DATEFORMAT": + $DateFormat = $tag->contents; + break; + case "TIMEFORMAT": + $TimeFormat = $tag->contents; + break; + case "DECIMAL": + $Decimal = $tag->contents; + break; + case "THOUSANDS": + $Thousands = $tag->contents; + break; + case "EVENTS": + foreach($tag->children as $EventTag) + { + $event = $EventTag->attributes["EVENT"]; + $MsgType = strtolower($EventTag->attributes["MESSAGETYPE"]); + $template = base64_decode($EventTag->contents); + $Type = $EventTag->attributes["TYPE"]; + $EventId = $Events[$event."_".$Type]; + + $esql = "INSERT INTO $EventTable (Template,MessageType,EventId,LanguageId) VALUES ('$template','$MsgType',$EventId,$LangId)"; + $ado->Execute($esql); + //echo htmlentities($esql)."
\n"; + } + break; + } + if($NewLang) + { + $l->Set("PackName",$PackName); + $l->Set("LocalName",$PackName); + $l->Set("DateFormat",$DateFormat); + $l->Set("TimeFormat",$TimeFormat); + $l->Set("DecimalPoint",$Decimal); + $l->Set("ThousandSep",$Thousands); + $l->Update(); + } + } + } + } + + } + $state="lang_install"; + } + else { + $state="lang_select"; + } + } + else { + $general_error = 'Database error! No language tables found!'; + } +} + +if($state=="lang_install") +{ + /* do pack install */ + $Offset = (int)$_GET["Offset"]; + $Status = (int)$_GET["Status"]; + $PhraseTable = GetTablePrefix()."ImportPhrases"; + $EventTable = GetTablePrefix()."ImportEvents"; + if($Status==0) + { + $Total = TableCount($PhraseTable,"",0); + } + else + { + $Total = TableCount($EventTable,"",0); + } + + if($Status==0) + { + $Offset = $objLanguages->ReadImportTable($PhraseTable, 1,"0,1,2",TRUE,200,$Offset); + if($Offset>=$Total) + { + $Offset=0; + $Status=1; + } + + if ($_POST['next_step']) { + $next_step = $_POST['next_step']; + } + else if ($_GET['next_step']) { + $next_step = $_GET['next_step']; + } + + $NextUrl = $_SERVER['PHP_SELF']."?Offset=$Offset&Status=$Status&state=lang_install&next_step=$next_step&install_type=$install_type"; + $include_file = "install/lang_run.php"; + } + else + { + if(!is_object($objMessageList)) + $objMessageList = new clsEmailMessageList(); + + + $Offset = $objMessageList->ReadImportTable($EventTable,TRUE,100,$Offset); + + if($Offset>$Total) + { + if ($_POST['next_step']) { + $next_step = $_POST['next_step']; + } + else if ($_GET['next_step']) { + $next_step = $_GET['next_step']; + } + $NextUrl = $_SERVER['PHP_SELF']."?Offset=$Offset&Status=$Status&State=lang_install&next_step=$next_step&install_type=$install_type"; + $include_file = "install/lang_run.php"; + } + else + $state="lang_default"; + } +} + +if($state=="lang_default_set") +{ +// phpinfo(INFO_VARIABLES); + $ado = inst_GetADODBConnection(); + $PhraseTable = GetTablePrefix()."ImportPhrases"; + $EventTable = GetTablePrefix()."ImportEvents"; + $ado->Execute("DROP TABLE $PhraseTable"); + $ado->Execute("DROP TABLE $EventTable"); + + $Id = $_POST["lang"]; + + $objLanguages->SetPrimary($Id); + $state="postconfig_1"; +} + +if($state=="lang_default") +{ + $Packs = Array(); + $objLanguages->Clear(); + + $objLanguages->LoadAllLanguages(); + foreach($objLanguages->Items as $l) + { + $Packs[$l->Get("LanguageId")] = $l->Get("PackName"); + } + $include_file = "install/lang_default.php"; +} + + + +if($state=="modinstall") +{ + $doms = $_POST["domain"]; + if(is_array($doms)) + { + $ado = inst_GetADODBConnection(); + require_once $pathtoroot.'kernel/include/tag-class.php'; + if( !is_object($objTagList) ) $objTagList = new clsTagList(); + foreach($doms as $p) + { + $filename = $pathtoroot.$p."/admin/install.php"; + if(file_exists($filename)) + { + include($filename); + } + } + + } + + $sql = "SELECT Name FROM ".GetTablePrefix()."Modules"; + $rs = $ado->Execute($sql); + + while($rs && !$rs->EOF) + { + $p = $rs->fields['Name']; + $mod_name = strtolower($p); + + if ($mod_name == 'in-portal') { + $mod_name = ''; + } + + $dir_name = $pathtoroot.$mod_name."/admin/install/upgrades/"; + $dir = @dir($dir_name); + + $new_version = ''; + $tmp1 = 0; + $tmp2 = 0; + while ($file = $dir->read()) { + if ($file != "." && $file != ".." && !is_dir($dir_name.$file)) + { + $file = str_replace("inportal_upgrade_v", "", $file); + $file = str_replace(".sql", "", $file); + + if ($file != '') { + $tmp1 = str_replace(".", "", $file); + if ($tmp1 > $tmp2) { + $new_version = $file; + } + } + } + $tmp2 = $tmp1; + } + + + $version_nrs = explode(".", $new_version); + + for ($i = 0; $i < $version_nrs[0] + 1; $i++) { + for ($j = 0; $j < $version_nrs[1] + 1; $j++) { + for ($k = 0; $k < $version_nrs[2] + 1; $k++) { + $try_version = "$i.$j.$k"; + + $filename = $pathtoroot.$mod_name."/admin/install/upgrades/inportal_upgrade_v$try_version.sql"; + + if(file_exists($filename)) + { + RunSQLFile($ado, $filename); + set_ini_value("Module Versions", $p, $try_version); + save_values(); + } + } + } + } + + $rs->MoveNext(); + } + + $state="lang_select"; +} + +if($state=="lang_select") +{ + $Packs = GetLanguageList(); + $include_file = "install/lang_select.php"; +} + +if($state=="modselect") +{ + /* /admin/install.php */ + $UrlLen = (strlen($admin) + 12)*-1; + $pathguess =substr($_SERVER["SCRIPT_NAME"],0,$UrlLen); + $sitepath = $pathguess; + $esc_path = str_replace("\\","/",$pathtoroot); + $esc_path = str_replace("/","\\",$esc_path); + //set_ini_value("Site","DomainName",$_SERVER["SERVER_NAME"]); + //$g_DomainName= $_SERVER["SERVER_NAME"]; + save_values(); + + $ado = inst_GetADODBConnection(); + if(substr($sitepath,0,1)!="/") + $sitepath="/".$sitepath; + if(substr($sitepath,-1)!="/") + $sitepath .= "/"; + + $sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$sitepath' WHERE VariableName='Site_Path'"; + $ado->Execute($sql); + $sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$g_Domain' WHERE VariableName='Server_Name'"; + $ado->Execute($sql); + $Modules = inst_GetModuleList(); + $include_file = "install/modselect.php"; +} + +if(substr($state,0,10)=="postconfig") +{ + $p = explode("_",$state); + $step = $p[1]; + + if ($_POST['Site_Path'] != '') { + //echo "ok
"; + $rfile = @fopen(GET_LICENSE_URL."?url=".base64_encode($_SERVER['SERVER_NAME'].$_POST['Site_Path'])."&domain=".md5($_SERVER['SERVER_NAME']), "r"); + if (!$rfile) { + $get_license_error = "Unable to connect to the Intechnic server! Please try again later!"; + $state = "postconfig_1"; + $include_file = "install/postconfig.php"; + } + else { + $rcontents = ''; + while (!feof($rfile)) { + $line = fgets($rfile, 10000); + $rcontents .= $line; + } + @fclose($rfile); + } + + } + + if(strlen($_POST["oldstate"])>0) + { + $s = explode("_",$_POST["oldstate"]); + $oldstep = $s[1]; + if($oldstepSaveItems($_POST,TRUE); + } + } + $section = $configs[$step]; + $module = $mods[$step]; + $title = $titles[$step]; + + $step++; + + if($step <= count($configs)+1) + { + $include_file = "install/postconfig.php"; + } + else + $state = "theme_sel"; +} + +if($state=="theme_sel") +{ + $objThemes->CreateMissingThemes(); + $include_file = "install/theme_select.php"; +} + +if($state=="theme_set") +{ + ## get & define Non-Blocking & Blocking versions ## + $blocking_sockets = minimum_php_version("4.3.0")? 0 : 1; + + $ado = inst_GetADODBConnection(); + $sql = "UPDATE ".$g_TablePrefix."ConfigurationValues SET VariableValue = '$blocking_sockets' WHERE VariableName='SocketBlockingMode'"; + $ado->Execute($sql); + ## get & define Non-Blocking & Blocking versions ## + + + $theme_id = $_POST["theme"]; + $pathchar="/"; + //$objThemes->SetPrimaryTheme($theme_id); + $t = $objThemes->GetItem($theme_id); + $t->Set("Enabled",1); + $t->Set("PrimaryTheme",1); + $t->Update(); + $t->VerifyTemplates(); + $include_file = "install/install_finish.php"; + $state="finish"; +} + +if ($state == "adm_login") { + echo ""; +} + +switch($state) +{ +case "modselect": + $title = "Select Modules"; + $help = "

Select the In-Portal modules you wish to install. The modules listed to the right "; + $help .="are all modules included in this installation that are licensed to run on this server.

"; +break; +case "reinstall": + $title = "Installation Maintenance"; + $help = "

A Configuration file has been detected on your system and it appears In-Portal is correctly installed. "; + $help .="In order to work with the maintenance functions provided to the left you must provide the Intechnic "; + $help .="Username and Password you used when obtaining the license file residing on the server, or your admin Root password. "; + $help .=" (Use Username 'root' if using your root password)

"; + $help .= "

To removing your existing database and start with a fresh installation, select the first option "; + $help .= "provided. Note that this operation cannot be undone and no backups are made! Use at your own risk.

"; + $help .="

If you wish to scrap your current installation and install to a new location, choose the second option. "; + $help .="If this option is selected you will be prompted for new database configuration information.

"; + $help .="

The Update License Information option is used to update your In-Portal license data. Select this option if you have "; + $help .="modified your licensing status with Intechnic, or you have received new license data via email

"; +break; +case "RootPass": + $title = "Set Admin Root Password"; + $help = "

The Root Password is initially required to access the admin sections of In-Portal. "; + $help .="The root user cannot be used to access the front-end of the system, so it is recommended that you "; + $help .="create additional users with admin privlidges.

"; +break; +case "finish": + $title = "Thank You!"; + $help ="

Thanks for using In-Portal! Be sure to visit www.in-portal.net "; + $help.=" for the latest news, module releases and support.

"; +break; +case "license": + $title = "License Configuration"; + $help ="

A License is required to run In-Portal on a server connected to the Internet. You "; + $help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN. "; + $help.="If Intechnic has provided you with a license file, upload it here. Otherwise select the first "; + $help.="option to allow Install to download your license for you.

"; + $help.="

If a valid license has been detected on your server, you can choose the Use Existing License "; + $help.="and continue the installation process

"; +break; +case "domain_select": + $title="Select Licensed Domain"; + $help ="

Select the domain you wish to configure In-Portal for. The Other option "; + $help.=" can be used to configure In-Portal for use on a local domain.

"; + $help.="

For local domains, enter the hostname or LAN IP Address of the machine running In-Portal.

"; +break; +case "db_reconfig": +case "dbinfo": + $title="Database Configuration"; + $help = "

In-Portal needs to connect to your Database Server. Please provide the database server type*, "; + $help .="host name (normally \"localhost\"), Database user name, and database Password. "; + $help .="These fields are required to connect to the database.

If you would like In-Portal "; + $help .="to use a table prefix, enter it in the field provided. This prefix can be any "; + $help .=" text which can be used in the names of tables on your system. The characters entered in this field "; + $help .=" are placed before the names of the tables used by In-Portal. For example, if you enter \"inp_\""; + $help .=" into the prefix field, the table named Category will be named inp_Category.

"; +break; +case "lang_select": + $title="Language Pack Installation"; + $help = "

Select the language packs you wish to install. Each language pack contains all the phrases "; + $help .="used by the In-Portal administration and the default template set. Note that at least one "; + $help .="pack must be installed.

"; +break; +case "lang_default": + $title="Select Default Language"; + $help = "

Select which language should be considered the \"default\" language. This is the language "; + $help .="used by In-Portal when a language has not been selected by the user. This selection is applicable "; + $help .="to both the administration and front-end.

"; +break; +case "lang_install": + $title="Installing Language Packs"; + $help = "

The language packs you have selected are being installed. You may install more languages at a "; + $help.="later time from the Regional admin section.

"; +break; +case "postconfig_1": + $help = "

These options define the general operation of In-Portal. Items listed here are "; + $help .="required for In-Portal's operation.

When you have finished, click save to continue.

"; +break; +case "postconfig_2": + $help = "

User Management configuration options determine how In-Portal manages your user base.

"; + $help .="

The groups listed to the right are pre-defined by the installation process and may be changed "; + $help .="through the Groups section of admin.

"; +break; +case "postconfig_3": + $help = "

The options listed here are used to control the category list display functions of In-Portal.

"; +break; +case "theme_sel": + $title="Select Default Theme"; + $help = "

This theme will be used whenever a front-end session is started. "; + $help .="If you intend to upload a new theme and use that as default, you can do so through the "; + $help .="admin at a later date. A default theme is required for session management.

"; +break; +case "get_license": + $title="Download License from Intechnic"; + $help ="

A License is required to run In-Portal on a server connected to the Internet. You "; + $help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN.

"; + $help.="

Here as you have selected download license from Intechnic you have to input your username and "; + $help.="password of your In-Business account in order to download all your available licenses.

"; +break; +case "download_license": + $title="Download License from Intechnic"; + $help ="

A License is required to run In-Portal on a server connected to the Internet. You "; + $help.="can run In-Portal on localhost, non-routable IP addresses, or other computers on your LAN.

"; + $help.="

Please choose the license from the drop down for this site!

"; +break; +case "restore_select": + $title="Select Restore File"; + $help = "

Select the restore file to use to reinstall In-Portal. If your backups are not performed "; + $help .= "in the default location, you can enter the location of the backup directory and click the "; + $help .="Update button.

"; +case "restore_run": + $title= "Restore in Progress"; + $help = "

Restoration of your system is in progress. When the restore has completed, the installation "; + $help .="will continue as normal. Hitting the Cancel button will restart the entire installation process. "; +break; +case "warning": + $title = "Restore in Progress"; + $help = "

Please approve that you understand that you are restoring your In-Portal data base from other version of In-Portal.

"; +break; +case "update": + $title = "Update In-Portal"; + $help = "

Select modules from the list, you need to update to the last downloaded version of In-Portal

"; +break; +} + +if ($_POST['next_step']) { + $tmp_step = $_POST['next_step']; +} +else if ($_GET['next_step']) { + $tmp_step = $_GET['next_step']; +} + +if (!$tmp_step) { + $tmp_step = 1; +} + +if ($got_license == 1) { + $tmp_step++; +} + +$next_step = $tmp_step + 1; + +if ($general_error != '') { + $state = ''; + $title = ''; + $help = ''; + $general_error = $general_error.'

Installation cannot continue!'; +} + +if ($include_file == '' && $general_error == '' && $state == '') { + $state = ''; + $title = ''; + $help = ''; + $filename = $pathtoroot.$admin."/install/inportal_remove.sql"; + RunSQLFile($ado,$filename); + $general_error = 'Unexpected installation error!

Installation has been stopped!'; +} + +if ($restore_error != '') { + $next_step = 3; + $tmp_step = 2; +} + +if ($PassError != '') { + $tmp_step = 4; + $next_step = 5; +} + +if ($DomainError != '') { + $tmp_step--; + $next_step = $tmp_step + 1; +} + +if ($db_error != '') { + $tmp_step--; + $next_step = $tmp_step + 1; +} + +if ($state == "warning") { + $tmp_step--; + $next_step = $tmp_step + 1; +} +?> + +
+ + +
+ + + + + + + + + + +
In-portalIn-portal 
In-Portal Version 1.0.0: English US


+
+ + + + +
+
+ Installation + + + +
    +
  1. class="current">Database Configuration +
  2. class="current">Select License +
  3. class="current">Select Domain +
  4. class="current">Set Root Password +
  5. class="current">Select Modules to Install +
  6. class="current">Install Language Packs +
  7. class="current">Post-Install Configuration +
  8. class="current">Finish +
+ +
    +
  1. class="current">License Verification + +
+ +
    +
  1. License Verification +
  2. class="current">Database Configuration +
  3. class="current">Select License +
  4. class="current">Select Domain +
  5. class="current">Set Root Password +
  6. class="current">Select Modules to Install +
  7. class="current">Install Language Packs +
  8. class="current">Post-Install Configuration +
  9. class="current">Finish +
+ +
    +
  1. class="current">License Verification +
  2. class="current">Select License +
  3. class="current">Select Domain +
  4. class="current">Set Root Password +
  5. class="current">Select Modules to Install +
  6. class="current">Install Language Packs +
  7. class="current">Post-Install Configuration +
  8. class="current">Finish +
+ +
    +
  1. class="current">License Verification +
  2. class="current">Select License +
  3. class="current">Select Domain +
  4. class="current">Finish +
+ +
    +
  1. class="current">License Verification +
  2. class="current">Select Backup File +
  3. class="current">Finish +
+ +
    +
  1. class="current">License Verification +
  2. class="current">Database Configuration +
  3. class="current">Finish +
+ +
    +
  1. class="current">License Verification +
  2. class="current">Select Modules to Upgrade +
  3. class="current">Finish +
+ + + + + +
+ + + + + + + +
+
+
+
+ + + + + + Powered by In-portal © 1997-2004, Intechnic Corporation. All rights reserved. +
+ + + + + + + \ No newline at end of file Index: trunk/admin/images/list_arrow_dn.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_conf_regional.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_settings_in-link.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_search_reset_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_language_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_tool_import.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/warning.php =================================================================== diff -u --- trunk/admin/install/warning.php (revision 0) +++ trunk/admin/install/warning.php (revision 13) @@ -0,0 +1,44 @@ + +  Approve Restore from Backup

+ + + + + + + +
 Step - Approve Restore from Backup
+ + +
+ + + + + \ No newline at end of file Index: trunk/admin/users/user_select.php =================================================================== diff -u --- trunk/admin/users/user_select.php (revision 0) +++ trunk/admin/users/user_select.php (revision 13) @@ -0,0 +1,304 @@ +Logout(); + header("Location: ".$adminURL."/login.php"); + die(); + //require_once($pathtoroot."admin/login.php"); +} + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//admin only util + +$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 +if(strlen($_GET["section"])) +{ + $section = $_GET["section"]; +} +else + $section = 'in-portal:userselect'; + +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +//Display header + +$objListToolBar = new clsToolBar(); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass","UserChecks"); + +$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_cancel_f2.gif');", + "swap('cancel', 'toolbar/tool_cancel.gif');","window.close();","tool_cancel.gif"); + + +//$objListToolBar->AddToInitScript($listImages); + +$order = $objConfig->Get("UserSelect_SortOrder"); + +$SearchWords = $objSession->GetVariable("UserSelectSearchWord"); + +if(strlen($SearchWords)) + $SearchWhere = $objUsers->AdminSearchWhereClause($SearchWords); + +$where = strlen($SearchWhere) ? "AND $SearchWhere" : ''; + +$SelectorType = $_REQUEST["Selector"] ? $_REQUEST["Selector"] : 'checkbox'; + +if(strlen($_GET["source"])>0) +{ + switch($_GET["source"]) + { + case "addgroup_users": + $SelectorType = "radio"; + $ado = GetADODBConnection(); + $sql = "SELECT Distinct(PortalUserId) FROM ".GetTablePrefix()."UserGroup WHERE GroupId=".$_GET["GroupId"]; + $rs = $ado->Execute($sql); + $inlist = array(); + while($rs && !$rs->EOF) + { + array_push($inlist,$rs->fields["PortalUserId"]); + $rs->MoveNext(); + } + if(count($inlist)>0) + { + $catlist = implode(",",$inlist); + $field = $objConfig->Get("UserSelect_SortField"); + if(!strlen($field)) + $field = "Login"; + $orderby = $field." ".$order; + $sql = "SELECT u.*,g.Name as GroupName,ELT(u.status+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ','".admin_language("la_Text_Pending")."') as UserStatus, "; + $sql .="FROM_UNIXTIME(u.CreatedOn,'%m-%d-%Y') as DateCreated FROM ".GetTablePrefix()."PortalUser as u "; + $sql .="LEFT JOIN ".GetTablePrefix()."UserGroup as ug ON (u.PortalUserId=ug.PortalUserId) "; + $sql .="LEFT JOIN ".GetTablePrefix()."PortalGroup as g ON (ug.GroupId=g.GroupId) WHERE "; + $sql .= "u.PortalUserId NOT IN (".$catlist.")"; + + $sql .=" ".GetLimitSQL($objSession->GetVariable("Page_UserSelect"),$objConfig->Get("Perpage_User")); + $objUsers->Query_Item($sql); + + $itemcount = TableCount(GetTablePrefix()."PortalUser","PortalUserId NOT IN ($catlist)",0); + } + else + { + $sql = "SELECT u.*,g.Name as GroupName,ELT(u.status+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ','".admin_language("la_Text_Pending")."') as UserStatus, "; + $sql .="FROM_UNIXTIME(u.CreatedOn,'%m-%d-%Y') as DateCreated FROM ".GetTablePrefix()."PortalUser as u "; + $sql .="LEFT JOIN ".GetTablePrefix()."UserGroup as ug ON (u.PortalUserId=ug.PortalUserId) "; + $sql .="LEFT JOIN ".GetTablePrefix()."PortalGroup as g ON (ug.GroupId=g.GroupId) WHERE ug.PrimaryGroup!=0"; + $sql .=" ".GetLimitSQL($objSession->GetVariable("Page_UserSelect"),$objConfig->Get("Perpage_User")); + $objUsers->Query_Item($sql); + $itemcount = TableCount(GetTablePrefix()."PortalUser","PortalUserId NOT IN ($catlist)",0); + + } + break; + } +} +else +{ + $sql = "SELECT u.*,g.Name as GroupName,ELT(u.status+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ','".admin_language("la_Text_Pending")."') as UserStatus, "; + $sql .="FROM_UNIXTIME(u.CreatedOn,'%m-%d-%Y') as DateCreated FROM ".GetTablePrefix()."PortalUser as u "; + $sql .="LEFT JOIN ".GetTablePrefix()."UserGroup as ug ON (u.PortalUserId=ug.PortalUserId) "; + $sql .="LEFT JOIN ".GetTablePrefix()."PortalGroup as g ON (ug.GroupId=g.GroupId) WHERE ug.PrimaryGroup!=0 $where"; + $sql .=" ".GetLimitSQL($objSession->GetVariable("Page_UserSelect"),$objConfig->Get("Perpage_User")); + + $objUsers->Query_Item($sql); + $itemcount = TableCount(GetTablePrefix()."PortalUser","PortalUserId NOT IN ($catlist)",0); +} + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
\n"; + +$objListView = new clsListView($objListToolBar,$objUsers); +if(strlen($_GET["IdField"])>0) +{ + $objListView->IdField = $_GET["IdField"]; +} +else + $objListView->IdField = "ResourceId"; +if(strlen($_GET["ReturnField"])>0) +{ + $ReturnField = $_GET["ReturnField"]; +} +else + $ReturnField = $objListView->IdField; + +$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl"; + +$objListView->ColumnHeaders->Add("Login",admin_language("la_prompt_Username"),1,0,$order,"width=\"15%\"","User_SortField","User_SortOrder","Login"); +$objListView->ColumnHeaders->Add("LastName",admin_language("la_prompt_Last_Name"),1,0,$order,"width=\"15%\"","User_SortField","User_SortOrder","LastName"); +$objListView->ColumnHeaders->Add("FirstName",admin_language("la_prompt_First_Name"),1,0,$order,"width=\"15%\"","User_SortField","User_SortOrder","FirstName"); +$objListView->ColumnHeaders->Add("Email",admin_language("la_prompt_Email"),1,0,$order,"width=\"20%\"","User_SortField","User_SortOrder","Email"); +$objListView->ColumnHeaders->Add("GroupName",admin_language("la_prompt_PrimaryGroup"),1,0,$order,"width=\"20%\"","User_SortField","User_SortOrder","GroupName"); +$objListView->ColumnHeaders->Add("DateCreated",admin_language("la_prompt_CreatedOn"),1,0,$order,"width=\"15%\"","User_SortField","User_SortOrder","DateCreated"); +$objListView->ColumnHeaders->SetSort($objConfig->Get("User_SortField"),$order); + + +$objListView->PrintToolBar = FALSE; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_userselect_search"; +$objListView->CurrentPageVar = "Page_UserSelect"; +$objListView->PerPageVar = "Perpage_User"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->SelectorType=$SelectorType; +$objListView->TotalItemCount = $itemcount; + +$vals = array_keys($_GET); +for($i=0;$iextra_env = $extra_env; + +for($i=0;$iItems);$i++) +{ + $u =& $objUsers->GetItemRefByIndex($i); + $objListView->RowIcons[] = $u->StatusIcon(); +} + +int_header($objListToolBar); + + +if(strlen($_GET["values"])) +{ + $current_value = explode(",",$_GET["values"]); +} +?> +
+PrintList(); +?> + + + +
" name="viewmenu"> + + + + + + +
+ + + + + + + + Index: trunk/kernel/admin/include/toolbar/editcategory_relationselect.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/editcategory_relationselect.php (revision 0) +++ trunk/kernel/admin/include/toolbar/editcategory_relationselect.php (revision 13) @@ -0,0 +1,656 @@ +Get("CatTab_Hide"); + +$CategoryView = $objConfig->Get("Category_View"); +if(!is_numeric($CategoryView)) +{ + $CategoryView = 127; +} + +$Category_Sortfield = $objConfig->Get("Category_Sortfield"); +if(!strlen($Category_Sortfield)) + $Category_Sortfield = "Name"; + +$Category_Sortorder = $objConfig->Get("Category_Sortorder"); +if(!strlen($Category_Sortorder)) + $Category_Sortorder = "desc"; + +$Perpage_Category = (int)$objConfig->Get("Perpage_Category"); +if(!$Perpage_Category) + $Perpage_Category="'all'"; + + +if($CategoryView == 127) +{ + $Category_ShowAll = 1; +} +else +{ + $Category_ShowAll=0; + $Status = array(); + $Mod = array(); + if($CategoryView & $Bit_Pending) + $Status[] = STATUS_PENDING; + + if($CategoryView & $Bit_Active) + $Status[] = STATUS_ACTIVE; + + + if($CategoryView & $Bit_Disabled) + $Status[] = STATUS_DISABLED; + + if(count($Status)) + { + $CategoryFilter .= " AND (Status IN (".implode(",",$Status).") "; + } + else + $CategoryFilter .= " AND ((Status=-1) "; + + if($CategoryView & $Bit_Ed) + { + $CategoryFilter .= " OR (EditorsPick=1) "; + } + + if($CategoryView & $Bit_New) + { + $cutoff = adodb_date("U") - ($objConfig->Get("Category_DaysNew") * 86400); + $CategoryFilter .= " OR (CreatedOn > ".$cutoff.") "; + } + $CategoryFilter .= ")"; +} + +$list = $objSession->GetVariable("SearchWord"); +if(strlen($list)) +{ + $CatScope = $objSession->GetVariable("SearchScope"); + switch($CatScope) + { + case 0 : + $CatScopeClause = ""; + break; + case 1: + $cat = $objCatList->CurrentCategoryID(); + if($cat>0) + { + $allcats = $objCatList->AllSubCats($cat); + if(count($allcats)>0) + { + $catlist = implode(",",$allcats); + $CatScopeClause = " CategoryId IN ($catlist) "; + } + } + break; + case 2: + $CatScopeClause = "CategoryId=".$objCatList->CurrentCategoryID(); + break; + } +} +else + $CatScopeClause=""; + +$mnuClearSearch = language("la_SearchMenu_Clear"); +$mnuNewSearch = language("la_SearchMenu_New"); +$mnuSearchCategory = language("la_SearchMenu_Categories"); + +$lang_New = language("la_Text_New"); +$lang_Hot = language("la_Text_Hot"); +$lang_EdPick = language("la_prompt_EditorsPick"); +$lang_Pop = language("la_Text_Pop"); + +$lang_Rating = language("la_prompt_Rating"); +$lang_Hits = language("la_prompt_Hits"); +$lang_Votes = language("la_prompt_Votes"); +$lang_Name = language("la_prompt_Name"); + +$lang_Categories = language("la_ItemTab_Categories"); +$lang_Description = language("la_prompt_Description"); +$lang_MetaKeywords = language("la_prompt_MetaKeywords"); +$lang_SubSearch = language("la_prompt_SubSearch"); +$lang_Within = language("la_Text_Within"); +$lang_Current = language("la_Text_Current"); +$lang_Active = language("la_Text_Active"); +$lang_SubCats = language("la_Text_SubCats"); +$lang_SubItems = language("la_Text_Subitems"); + +$selector = isset($_GET['Selector']) ? '&Selector='.$_GET['Selector'] : ''; +print << +var Category_Sortfield = '$Category_Sortfield'; +var Category_Sortorder = '$Category_Sortorder'; +var Category_Perpage = $Perpage_Category; +var Category_ShowAll = $Category_ShowAll; +var CategoryView = $CategoryView; +var default_tab = "$DefaultTab"; + +//JS Language variables +var lang_New = "$lang_New"; +var lang_Hot = "$lang_Hot"; +var lang_EdPick = "$lang_EdPick"; + +var lang_Pop = "$lang_Pop"; +var lang_Rating = "$lang_Rating"; +var lang_Hits = "$lang_Hits"; +var lang_Votes = "$lang_Votes"; +var lang_Name = "$lang_Name"; +var lang_Categories = "$lang_Categories"; +var lang_Description = "$lang_Description"; +var lang_MetaKeywords = "$lang_MetaKeywords"; +var lang_SubSearch = "$lang_SubSearch"; +var lang_Within="$lang_Within"; +var lang_Current = "$lang_Current"; +var lang_Active = "$lang_Active"; +var lang_SubCats = "$lang_SubCats"; +var lang_SubItems = "$lang_SubItems"; + +var m_tab_CatTab_hide = $m_tab_CatTab_Hide; +var hostname = '$rootURL'; +var env = '$envar'; +var actionlist = new Array(); +var homeURL = "$homeURL$selector"; +var upURL = "$upURL$selector"; +var Categories_Paste = false; + + function InitPage() + { + addCommonActions(); + initToolbar('mainToolBar', actionHandler); + initCheckBoxes(); + toggleMenu(); + } + + function AddButtonAction(actionname,actionval) + { + var item = new Array(actionname,actionval); + actionlist[actionlist.length] = item; + } + + function actionHandler(button) + { + //alert('a button has been pressed!'); + for(i=0; i0) + path = path + '?'+attr; + + //alert(path); + window.location.href=path; + return true; + } + + function check_submit() + { + var formname = ''; + + if ((activeTab) && (!isAnyChecked('categories'))) + { + form_name = activeTab.id; + } + else + { + form_name = 'categories'; + } + var f = document.getElementsByName(form_name+'_form')[0]; + var bf = window.opener.document.getElementById('popup'); + + if(bf) + { + if(LastCheckedItem) + { + try{ + item_id = LastCheckedItem.value; + item_type = LastCheckedItem.ItemType; + } + catch(err) + { + } + bf.TargetId.value = item_id; + bf.TargetType.value = item_type; + bf.submit(); + window.close(); + } + else { + theMainScript.Alert(lang_Selection_Empty); + } + } + } // check submit + + function flip_current(field_suffix) + { + if(activeTab) + { + field = activeTab.getAttribute("tabTitle")+field_suffix; + return flip(eval(field)); + } + } + + function config_current(field_suffix,value) + { + if(activeTab) + { + field = activeTab.getAttribute("tabTitle")+field_suffix; + config_val(field,value); + } + } + + function getSType(type,value) + { + f = document.getElementById("admin_search"); + if(f) + { + if (f.SearchType.value == type) return 2; else return 0; + } else return 0; + + } + + function getSScope(scope) + { + f = document.getElementById("admin_search"); + if(f) + { + if (f.SearchScope.value == scope) return 2; else return 0; + } else return 0; + + } + + function setSearchMenu() + { + + window.SearchMenu = new Menu("search"); + SearchMenu.addMenuItem(lang_All,"SetSearchType('all');",getSType('all')); + SearchMenu.addMenuSeparator() + + SearchMenu.addMenuItem(lang_Categories, "SetSearchType('categories');",getSType('categories')); + param = ""; + + for (var i = 0; i < tabIDs.length; i++) + { + d = document.getElementById(tabIDs[i]); + if(d) + { + tabname = d.getAttribute("tabTitle"); + param = "SetSearchType('"+tabname+"');"; + + SearchMenu.addMenuItem(tabname,param,getSType(tabname)); + } + } + + SearchMenu.addMenuSeparator(); + SearchMenu.addMenuItem(lang_All+' '+lang_Categories,"SetSearchScope('0');",getSScope(0)); + SearchMenu.addMenuItem(lang_SubSearch,"ToggleNewSearch();",isNewSearch()); + SearchMenu.addMenuItem(lang_Current+' '+lang_Categories,"SetSearchScope('2');",getSScope(2)); + SearchMenu.addMenuItem(lang_Within+' '+lang_Categories,"SetSearchScope('1');",getSScope(1)); + + SearchMenu.addMenuSeparator(); + + window.SearchMenu.addMenuItem('$mnuClearSearch',"ClearSearch();",""); + window.triedToWriteMenus = false; + window.SearchMenu.writeMenus(); + } + + function Category_SortMenu(caption) + { + menu_sorting = new Menu(caption); + + menu_sorting.addMenuItem(lang_Asc,"config_val('Category_Sortorder','asc');",RadioIsSelected(Category_Sortorder,'asc')); + menu_sorting.addMenuItem(lang_Desc,"config_val('Category_Sortorder','desc');",RadioIsSelected(Category_Sortorder,'desc')); + menu_sorting.addMenuSeparator(); + + menu_sorting.addMenuItem(lang_Default,"config_val('Category_Sortfield','Name');",""); + menu_sorting.addMenuItem(lang_Name,"config_val('Category_Sortfield','Name');",RadioIsSelected(Category_Sortfield,'Name')); + menu_sorting.addMenuItem(lang_Description,"config_val('Category_Sortfield','Description');",RadioIsSelected(Category_Sortfield,'Description')); + + menu_sorting.addMenuItem(lang_CreatedOn,"config_val('Category_Sortfield','CreatedOn');",RadioIsSelected(Category_Sortfield,'CreatedOn')); + menu_sorting.addMenuItem(lang_SubCats,"config_val('Category_Sortfield','CachedDescendantCatsQty');",RadioIsSelected(Category_Sortfield,'CachedDescendantCatsQty')); + menu_sorting.addMenuItem(lang_SubItems,"config_val('Category_Sortfield','SubItems');",RadioIsSelected(Category_Sortfield,'SubItems')); + + return menu_sorting; + + } + + + function Category_FilterMenu(caption) + { + menu_filter = new Menu(caption); + menu_filter.addMenuItem(lang_All,"config_val('Category_View', 127);",CategoryView==127); + menu_filter.addMenuSeparator(); + menu_filter.addMenuItem(lang_Active,"FlipBit('Category_View',CategoryView,6);",BitStatus(CategoryView,6)); + menu_filter.addMenuItem(lang_Pending,"FlipBit('Category_View',CategoryView,5);", BitStatus(CategoryView,5)); + menu_filter.addMenuItem(lang_Disabled,"FlipBit('Category_View',CategoryView,4);",BitStatus(CategoryView,4)); + + menu_filter.addMenuSeparator(); + menu_filter.addMenuItem(lang_New,"FlipBit('Category_View',CategoryView,3);",BitStatus(CategoryView,3)); + menu_filter.addMenuItem(lang_EdPick,"FlipBit('Category_View',CategoryView,0);",BitStatus(CategoryView,0)); + + return menu_filter; + } + + function toggleMenu() + { + //var tab_title = GetTabTitle(activeTab.id); + //alert(tab_title); + if ((document.getElementById('categories').active) && (activeTab)) + { + filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu();'; + + window.cat_menu_filter_sub = Category_FilterMenu(lang_Categories); + window.sub_menu_filter_sub = eval(filterfunc); + + window.cat_menu_filter = new Menu(lang_View); + cat_menu_filter.addMenuItem(cat_menu_filter_sub); + cat_menu_filter.addMenuItem(sub_menu_filter_sub); + } + else + { + if (document.getElementById('categories').active) + { + window.cat_menu_filter = Category_FilterMenu(lang_View); + } + if (activeTab) + { + filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu();'; + window.cat_menu_filter = eval(filterfunc); + } + } // Filter + + //Sorting + if ((document.getElementById('categories').active) && (activeTab)) + { + //Sort->Categories + sortfunc = activeTab.getAttribute("tabTitle")+'_SortMenu();'; + + window.cat_menu_sorting_sub = Category_SortMenu(lang_Categories); + window.sub_menu_sorting_sub = eval(sortfunc); + + window.cat_menu_sorting = new Menu(lang_Sort); + cat_menu_sorting.addMenuItem(cat_menu_sorting_sub); + cat_menu_sorting.addMenuItem(sub_menu_sorting_sub); + } + else + { + if (document.getElementById('categories').active) + { + window.cat_menu_sorting = Category_SortMenu(lang_Sort); + + } // categories + if (activeTab) + { + window.cat_menu_sorting = Category_SortMenu(lang_Sort); + } + + } // && Sorting + if ((document.getElementById('categories').active) && (activeTab)) + { + window.cat_menu_select_sub = new Menu(lang_Categories); + cat_menu_select_sub.addMenuItem(lang_All,"javascript:selectAll('categories');",""); + cat_menu_select_sub.addMenuItem(lang_Unselect,"javascript:unselectAll('categories');",""); + cat_menu_select_sub.addMenuItem(lang_Invert,"javascript:invert('categories');",""); + + selectfunc = activeTab.getAttribute("tabTitle")+"_SelectMenu();"; + + window.sub_menu_select_sub = eval(selectfunc); +// sub_menu_select_sub.addMenuItem(lang_All,"javascript:selectAll('"+activeTab.id+"');",""); +// sub_menu_select_sub.addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');",""); +// sub_menu_select_sub.addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');",""); + +END; +if (!$hideSelectAll) { +echo " + window.cat_menu_select = new Menu(lang_Select); + cat_menu_select.addMenuItem(cat_menu_select_sub); + cat_menu_select.addMenuItem(sub_menu_select_sub);"; +} +print << + +END; +?> Index: trunk/admin/images/summary/searchbox_bg.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/aiua.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.bgcolor.gif =================================================================== diff -u Binary files differ Index: trunk/globals.php =================================================================== diff -u --- trunk/globals.php (revision 0) +++ trunk/globals.php (revision 13) @@ -0,0 +1,1313 @@ +0) + { + $g_adodbConnection = ADONewConnection($g_DBType); + $connected = $g_adodbConnection->Connect($g_DBHost,$g_DBUser,$g_DBUserPassword,$g_DBName); + if(!$connected) + { + echo "Error connecting to database $g_DBHost
\n"; + die(); + } + $ADODB_CACHE_DIR = $pathtoroot."cache"; + $ADODB_FETCH_MODE = 2; + $ADODB_COUNTRECS = FALSE; + $g_adodbConnection->debug = false; + $g_adodbConnection->cacheSecs = 3600; + } + elseif (!strlen($g_DBType)) { + global $rootURL; + echo "In-Portal is probably not installed, or configuration file is missing.
"; + echo "Please use the installation script to fix the problem.

"; + if (!preg_match('/admin/', $_SERVER['SCRIPT_FILENAME'])) { + $ins = 'admin/'; + } + echo "Go to installation script

"; + flush(); + die(); + } + return $g_adodbConnection; +} + +function GetNextResourceId($Increment=1) +{ + $sql = "UPDATE ".GetTablePrefix()."IdGenerator SET lastid=lastid+".$Increment; + $adodbConnection = GetADODBConnection(); + $adodbConnection->Execute($sql); + $rs = $adodbConnection->Execute("SELECT lastid FROM ".GetTablePrefix()."IdGenerator"); + $val = $rs->fields["lastid"]; + if(!$rs || $rs->EOF) + { + echo $adodbConnection->ErrorMsg(); + $sql = "INSERT INTO ".GetTablePrefix()."IdGenerator (lastid) VALUES ($Increment)"; + $adodbConnection->Execute($sql); + $val = 1; + } + $val = $val-($Increment-1); + return $val; +} + +function AddSlash($s) +{ + if(substr($s,-1) != "/") + { + return $s."/"; + } + else + return $s; +} + +function StripNewline($s) +{ + $bfound = false; + while (strlen($s)>0 && !$bfound) + { + if(ord(substr($s,-1))<32) + { + $s = substr($s,0,-1); + } + else + $bfound = true; + } + return $s; +} + +function DeleteElement($array, $indice) +{ + for($i=$indice;$i -1) + unset($haystack[$gotcha]); +} + +function TableCount($TableName, $where="",$JoinCats=1) +{ + $db = GetADODBConnection(); + if(!$JoinCats) + { + $sql = "SELECT count(*) as TableCount FROM $TableName"; + } + else + $sql = "SELECT count(*) as TableCount FROM $TableName INNER JOIN ".GetTablePrefix()."CategoryItems ON ".GetTablePrefix()."CategoryItems.ItemResourceId=$TableName.ResourceId"; + if(strlen($where)>0) + $sql .= " WHERE ".$where; + $rs = $db->Execute($sql); + +// echo "SQL TABLE COUNT: ".$sql."
\n"; + + $res = $rs->fields["TableCount"]; + return $res; +} + +Function QueryCount($sql) +{ + $countsql = "SELECT count(*) as TableCount ".substr($sql,strpos($sql," FROM ")); + if(strpos($countsql,"LIMIT")) + $countsql = substr($countsql,0,strpos($countsql,"LIMIT")); + if(strpos($countsql,"ORDER BY")) + $countsql = substr($countsql,0,strpos($countsql,"ORDER BY")); + + $db = GetADODBConnection(); + $rs = $db->Execute($countsql); + //echo $countsql."
\n"; + $res = $rs->fields["TableCount"]; + return $res; +} + +function GetPageCount($ItemsPerPage,$NumItems) +{ + if($ItemsPerPage==0 || $NumItems==0) + { + return 1; + } + $value = $NumItems/$ItemsPerPage; + return ceil($value); +} + + +function GetTablePrefix() +{ + global $g_TablePrefix; + + return $g_TablePrefix; +} + +function TableHasPrefix($t) +{ + $pre = GetTablePrefix(); + + if(strlen($pre)>0) + { + if(substr($t,0,strlen($pre))==$pre) + { + return TRUE; + } + else + return FALSE; + } + else + return TRUE; +} + +function AddTablePrefix($t) +{ + if(!TableHasPrefix($t)) + $t = GetTablePrefix().$t; + + return $t; +} + +function ThisDomain() +{ + global $objConfig, $g_Domain; + + if($objConfig->Get("DomainDetect")) + { + $d = $_SERVER['HTTP_HOST']; + } + else + $d = $g_Domain; + + return $d; +} + +function GetIndexUrl($secure=0) +{ + global $indexURL, $rootURL, $secureURL; + + switch($secure) + { + case 0: + $ret = $indexURL; + break; + case 1: + $ret = $secureURL."index.php"; + break; + case 2: + $ret = $rootURL."index.php"; + break; + default: + $ret = $i; + } + return $ret; +} + +function GetLimitSQL($Page,$PerPage) +{ + if($Page<1) + $Page=1; + + if(is_numeric($PerPage)) + { + if($PerPage==0) + $PerPage = 20; + $Start = ($Page-1)*$PerPage; + $limit = "LIMIT ".$Start.",".$PerPage; + } + else + $limit = NULL; + return $limit; +} + +function filelist ($currentdir, $startdir=NULL,$ext=NULL) +{ + global $pathchar; + + //chdir ($currentdir); + + // remember where we started from + if (!$startdir) + { + $startdir = $currentdir; + } + + $d = @opendir($currentdir); + + $files = array(); + if(!$d) + return $files; + //list the files in the dir + while (false !== ($file = readdir($d))) + { + if ($file != ".." && $file != ".") + { + if (is_dir($currentdir."/".$file)) + { + // If $file is a directory take a look inside + $a = filelist ($currentdir."/".$file, $startdir,$ext); + if(is_array($a)) + $files = array_merge($files,$a); + } + else + { + if($ext!=NULL) + { + $extstr = stristr($file,".".$ext); + if(strlen($extstr)) + $files[] = $currentdir."/".$file; + } + else + $files[] = $currentdir.'/'.$file; + } + } + } + + closedir ($d); + + return $files; +} + +function DecimalToBin($dec,$WordLength=8) +{ + $bits = array(); + + $str = str_pad(decbin($dec),$WordLength,"0",STR_PAD_LEFT); + for($i=$WordLength;$i>0;$i--) + { + $bits[$i-1] = (int)substr($str,$i-1,1); + } + return $bits; +} + +function inp_escape($in, $html_enable=0) +{ + $out = stripslashes($in); + $out = str_replace("\n", "\n^br^", $out); + if($html_enable==0) + { + $out=ereg_replace("<","<",$out); + $out=ereg_replace(">",">",$out); + $out=ereg_replace("\"",""",$out); + $out = str_replace("\n^br^", "\n
", $out); + } + else + $out = str_replace("\n^br^", "\n", $out); + $out=addslashes($out); + + return $out; +} + +function inp_unescape($in) +{ + $out=stripslashes($in); + + return $out; +} + +function inp_textarea_unescape($in) +{ + $out=stripslashes($in); + $out = str_replace("\n
", "\n", $out); + return $out; +} + +function HighlightKeywords($Keywords, $html, $OpenTag="", $CloseTag="") +{ + global $objConfig; + + if(!strlen($OpenTag)) + $OpenTag = ""; + if(!strlen($CloseTag)) + $CloseTag = ""; + + $r = preg_split('((>)|(<))', $html, -1, PREG_SPLIT_DELIM_CAPTURE); + + foreach ($Keywords as $k) { + for ($i = 0; $i < count($r); $i++) { + if ($r[$i] == "<") { + $i++; continue; + } + $r[$i] = preg_replace("/($k)/i", "$OpenTag\\1$CloseTag", $r[$i]); + } + } + return join("", $r); +} + +/* +function HighlightKeywords($Keywords,$html, $OpenTag="", $CloseTag="") +{ + global $objConfig; + + if(!strlen($OpenTag)) + $OpenTag = ""; + if(!strlen($CloseTag)) + $CloseTag = ""; + $ret = strip_tags($html); + + foreach ($Keywords as $k) + { + if(strlen($k)) + { + //$html = str_replace("<$k>", ":#:", $html); + //$html = str_replace("", ":##:", $html); + //$html = strip_tags($html); + if ($html = preg_replace("/($k)/Ui","$OpenTag\\1$CloseTag", $html)) + //if ($html = preg_replace("/(>[^<]*)($k)([^<]*< )/Ui","$OpenTag\\1$CloseTag", $html)) + $ret = $html; + //$ret = str_replace(":#:", "<$k>", $ret); + //$ret = str_replace(":##:", "", $ret); + } + } + return $ret; +} +*/ +function ExtractDatePart($part,$datestamp) +{ + switch($part) + { + case "month": + if($datestamp<=0) + { + $ret = ""; + } + else + $ret = adodb_date("m",$datestamp); + break; + case "day": + if($datestamp<=0) + { + $ret = ""; + } + else + $ret = adodb_date("d", $datestamp); + break; + case "year": + if($datestamp<=0) + { + $ret = ""; + } + else + $ret = adodb_date("Y", $datestamp); + break; + case "time_24hr": + if($datestamp<=0) + { + $ret = ""; + } + else + $ret = adodb_date("H:i", $datestamp); + break; + case "time_12hr": + if($datestamp<=0) + { + $ret = ""; + } + else + $ret = adodb_date("g:i a",$datestamp); + break; + } + return $ret; +} + +function GetLocalTime($TimeStamp,$TargetZone=NULL) +{ + if($TargetZone==NULL) + $TargetZone = $objConfig->Get("Config_Site_Time"); + $server = $objConfig->Get("Config_Server_Time"); + if($TargetZone!=$server) + { + $offset = ($server - $TargetZone) * -1; + $TimeStamp = $TimeStamp + (3600 * $offset); + } + return $TimeStamp; +} + +function _unhtmlentities ($string) +{ + $trans_tbl = get_html_translation_table (HTML_ENTITIES); + $trans_tbl = array_flip ($trans_tbl); + return strtr ($string, $trans_tbl); +} + +function getLastStr($hay, $need){ + $getLastStr = 0; + $pos = strpos($hay, $need); + if (is_int ($pos)){ //this is to decide whether it is "false" or "0" + while($pos) { + $getLastStr = $getLastStr + $pos + strlen($need); + $hay = substr ($hay , $pos + strlen($need)); + $pos = strpos($hay, $need); + } + return $getLastStr - strlen($need); + } else { + return -1; //if $need wasn´t found it returns "-1" , because it could return "0" if it´s found on position "0". + } +} + +function ReplaceSingleTag($tag,$text) +{ + $opentag = "[".$tag; + $closetag = "[/".$tag."]"; + + if(strstr($text,$opentag)) + { + $pos = strpos($text,$opentag." "); + if($pos === false) + { + $pos = strpos($text,$opentag."]"); + } + $endopen = strpos($text,"]",$pos); + $closepos = strpos($text,$closetag,$pos); + + if($closepos) + { + $taglength = ($closepos - $endopen) + strlen($closetag); + $tagText = substr($text,$pos, $closepos + strlen($closetag) - $pos); + $innerText = substr($text,$endopen+1,$closepos - $endopen-1); + if($tag=="UL") + $innerText = str_replace("[*]","
  • ",$innerText); + $tagText = substr($tagText,1,($endopen - $pos)-1); + //echo "Matched $tagText
    \n"; + $tagText = "<".$tagText.">"; + $replace_text = $tagText.$innerText.""; + $text = substr($text,0,$pos).$replace_text.substr($text,$closepos+strlen($closetag)); + return $text; + } + else + return $text; + } + else + return $text; +} + +function ReplaceTag($tag,$text) +{ + $new_text = ReplaceSingleTag($tag,$text); + + while($new_text != $text) + { + $text = $new_text; + $new_text = ReplaceSingleTag($tag,$text); + } + return $new_text; +} + +function ReplaceURL($text) +{ + while(strstr($text,"[URL")) + { + $urlpos = strpos($text,"[URL"); + $endopen = strpos($text,"]",$urlpos); + if($endopen) + { + $url = "",$text); + return $text; +} + + +function ReplaceBBCode($text) +{ + global $objConfig; + + $tags = explode(",",$objConfig->Get("BBTags")); + for($i=0;$iexecute($sql); + if($rs) + $ret = (int)$rs->fields["val"]; + return $ret; +} + +function getmicrotime() +{ + list($usec, $sec) = explode(" ",microtime()); + return ((float)$usec + (float)$sec); +} + +function SetMissingDataErrors($f) +{ + global $FormError; + + $count = 0; + if(is_array($_POST)) + { + if(is_array($_POST["required"])) + { + foreach($_POST["required"] as $r) + { + $found = FALSE; + if(is_array($_FILES)) + { + if($_FILES[$r]["size"]>0) + $found=TRUE; + } + + if(!strlen(trim($_POST[$r])) && !$found) + { + $count++; + + if (($r == "dob_day") || ($r == "dob_month") || ($r == "dob_year")) + $r = "dob"; + + $tag = $_POST["errors"][$r]; + if(!strlen($tag)) + $tag = "lu_ferror_".$f."_".$r; + $FormError[$f][$r] = language($tag); + } + } + } + } + return $count; +} + +function makepassword($length=10) +{ + $pass_length=$length; + + $p1=array('b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z'); + $p2=array('a','e','i','o','u'); + $p3=array('1','2','3','4','5','6','7','8','9'); + $p4=array('(','&',')',';','%'); // if you need real strong stuff + + // how much elements in the array + // can be done with a array count but counting once here is faster + + $s1=21;// this is the count of $p1 + $s2=5; // this is the count of $p2 + $s3=9; // this is the count of $p3 + $s4=5; // this is the count of $p4 + + // possible readable combinations + + $c1='121'; // will be like 'bab' + $c2='212'; // will be like 'aba' + $c3='12'; // will be like 'ab' + $c4='3'; // will be just a number '1 to 9' if you dont like number delete the 3 +// $c5='4'; // uncomment to active the strong stuff + + $comb='4'; // the amount of combinations you made above (and did not comment out) + + + + for ($p=0;$p<$pass_length;) + { + mt_srand((double)microtime()*1000000); + $strpart=mt_rand(1,$comb); + // checking if the stringpart is not the same as the previous one + if($strpart<>$previous) + { + $pass_structure.=${'c'.$strpart}; + + // shortcutting the loop a bit + $p=$p+strlen(${'c'.$strpart}); + } + $previous=$strpart; + } + + + // generating the password from the structure defined in $pass_structure + for ($g=0;$g0) + $elapsed = getmicrotime() - $last; + + if(strlen($el)>10) + $el = substr($el,0,10); + $indent = str_repeat(" ",$LogLevel); + $text = str_pad($text,$LogLevel,"==",STR_PAD_LEFT); + $LogData .= "$el:". round($elapsed,6).":$indent $text"; + $last = getmicrotime(); + if($writefile==TRUE && is_writable($g_LogFile)) + { + if(!$LogFile) + { + if(file_exists($g_LogFile)) + unlink($g_LogFile); + $LogFile=@fopen($g_LogFile,"w"); + } + if($LogFile) + { + fputs($LogFile,$LogData); + } + } + } +} + +function ValidEmail($email) +{ + if (eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $email)) + { + return TRUE; + } + else + { + return FALSE; + } +} + +function language($phrase,$LangId=0) +{ + global $objSession, $objLanguageCache, $objLanguages; + + if($LangId==0) + $LangId = $objSession->Get("Language"); + + if($LangId==0) + $LangId = $objLanguages->GetPrimary(); + + $translation = $objLanguageCache->GetTranslation($phrase,$LangId); + + return $translation; +} + +function admin_language($phrase,$lang=0,$LinkMissing=FALSE) +{ + global $objSession, $objLanguageCache, $objLanguages; + + //echo "Language passed: $lang
    "; + + if($lang==0) + $lang = $objSession->Get("Language"); + + //echo "Language from session: $lang
    "; + + if($lang==0) + $lang = $objLanguages->GetPrimary(); + + //echo "Language after primary: $lang
    "; + //echo "Phrase: $phrase
    "; + $translation = $objLanguageCache->GetTranslation($phrase,$lang); + if($LinkMissing && substr($translation,0,1)=="!" && substr($translation,-1)=="!") + { + $res = "
    $translation"; + return $res; + } + else + return $translation; +} + +function prompt_language($phrase,$lang=0) +{ + return admin_language($phrase,$lang,TRUE); +} + +function GetPrimaryTranslation($Phrase) +{ + global $objLanguages; + + $l = $objLanguages->GetPrimary(); + return language($Phrase,$l); +} + +function CategoryNameCount($ParentId,$Name) +{ + $cat_table = GetTablePrefix()."Category"; + $sql = "SELECT Name from $cat_table WHERE ParentId=$ParentId AND "; + $sql .="(Name LIKE '".addslashes($Name)."' OR Name LIKE 'Copy of ".addslashes($Name)."' OR Name LIKE 'Copy % of ".addslashes($Name)."')"; + + $ado = GetADODBConnection(); + $rs = $ado->Execute($sql); + $ret = array(); + while($rs && !$rs->EOF) + { + $ret[] = $rs->fields["Name"]; + $rs->MoveNext(); + } + return $ret; +} + +function CategoryItemNameCount($CategoryId,$Table,$Field,$Name) +{ + $cat_table = GetTablePrefix()."CategoryItems"; + $sql = "SELECT $Field FROM $Table INNER JOIN $cat_table ON ($Table.ResourceId=$cat_table.ItemResourceId) "; + $sql .=" WHERE ($Field LIKE 'Copy % of $Name' OR $Field LIKE '$Name' OR $Field LIKE 'Copy of $Name') AND CategoryId=$CategoryId"; + //echo $sql."
    \n "; + $ado = GetADODBConnection(); + $rs = $ado->Execute($sql); + $ret = array(); + while($rs && !$rs->EOF) + { + $ret[] = $rs->fields[$Field]; + $rs->MoveNext(); + } + return $ret; +} + +function &GetItemCollection($ItemName) +{ + global $objItemTypes; + + if(is_numeric($ItemName)) + { + $item = $objItemTypes->GetItem($ItemName); + } + else + $item = $objItemTypes->GetTypeByName($ItemName); + if(is_object($item)) + { + $module = $item->Get("Module"); + $prefix = ModuleTagPrefix($module); + $func = $prefix."_ItemCollection"; + if(function_exists($func)) + { + $var =& $func(); + } + } + return $var; +} + + +function UpdateCategoryCount($ItemTypeName=0,$ListType=NULL) +{ + global $objCountCache, $objItemTypes; + + if(is_numeric($ItemName)) + { + $item = $objItemTypes->GetItem($ItemName); + } + else + $item = $objItemTypes->GetTypeByName($ItemName); + if(is_object($item)) + { + $ItemType = $item->Get("ItemType"); + + $sql = "DELETE FROM ".$objCountCache->SourceTable." WHERE ItemType=$ItemType"; + if(is_numeric($ListType)) + { + $sql .= " AND ListType=$ListType"; + } + $objCountCache->adodbConnection->Execute($sql); + } +} + +function UpdateModifiedCategoryCount($ItemTypeName,$CatId=NULL,$Modifier=0,$ExtraId=NULL) +{ +} + +function UpdateGroupCategoryCount($ItemTypeName,$CatId=NULL,$Modifier=0,$GroupId=NULL) +{ +} + +function GetTagCache($module,$tag,$attribs,$env) +{ + global $objSystemCache, $objSession, $objConfig; + + if($objConfig->Get("SystemTagCache")) + { + $name = $tag; + if(is_array($attribs)) + { + foreach($attribs as $n => $val) + { + $name .= "-".$val; + } + } + $CachedValue = $objSystemCache->GetContextValue($name,$module,$env, $objSession->Get("GroupList")); + } + else + $CachedValue=""; + return $CachedValue; +} + +function SaveTagCache($module, $tag, $attribs, $env, $newvalue) +{ + global $objSystemCache, $objSession, $objConfig; + + if($objConfig->Get("SystemTagCache")) + { + $name = $tag; + if(is_array($attribs)) + { + foreach($attribs as $a => $val) + { + $name .= "-".$val; + } + } + $objSystemCache->EditCacheItem($name,$newvalue,$module,0,$env,$objSession->Get("GroupList")); + } +} + +function DeleteTagCache($name,$extraparams, $env="") +{ + global $objSystemCache, $objConfig; + + if($objConfig->Get("SystemTagCache")) + { + $where = "Name LIKE '$name%".$extraparams."'"; + if(strlen($env)) + $where .= " AND Context LIKE $env"; + $objSystemCache->DeleteCachedItem($where); + } +} + +function ParseTagLibrary() +{ + $objTagList = new clsTagList(); + $objTagList->ParseInportalTags(); + unset($objTagList); +} + +function GetDateFormat($LangId=0) +{ + global $objLanguages; + + if(!$LangId) + $LangId= $objLanguages->GetPrimary(); + $l = $objLanguages->GetItem($LangId); + if(is_object($l)) + { + $fmt = $l->Get("DateFormat"); + } + else + $fmt = "m-d-Y"; + return $fmt; +} + +function GetTimeFormat($LangId=0) +{ + global $objLanguages; + + if(!$LangId) + $LangId= $objLanguages->GetPrimary(); + $l = $objLanguages->GetItem($LangId); + if(is_object($l)) + { + $fmt = $l->Get("TimeFormat"); + } + else + $fmt = "H:i:s"; + return $fmt; +} + +function LangDate($TimeStamp=NULL,$LangId=0) +{ + $fmt = GetDateFormat($LangId); + $ret = adodb_date($fmt,$TimeStamp); + return $ret; +} + +function LangTime($TimeStamp=NULL,$LangId=0) +{ + $fmt = GetTimeFormat($LangId); + $ret = adodb_date($fmt,$TimeStamp); + return $ret; +} + +function LangNumber($Num,$DecPlaces=NULL,$LangId=0) +{ + global $objLanguages; + + if(!$LangId) + $LangId= $objLanguages->GetPrimary(); + $l = $objLanguages->GetItem($LangId); + if(is_object($l)) + { + $ret = number_format($Num,$DecPlaces,$l->Get("DecimalPoint"),$l->Get("ThousandSep")); + } + else + $ret = $num; + + return $ret; +} + +function replacePngTags($x, $spacer="images/spacer.gif") +{ + global $rootURL,$pathtoroot; + + // make sure that we are only replacing for the Windows versions of Internet + // Explorer 5+, and not Opera identified as MSIE + $msie='/msie\s([5-9])\.?[0-9]*.*(win)/i'; + $opera='/opera\s+[0-9]+/i'; + if(!isset($_SERVER['HTTP_USER_AGENT']) || + !preg_match($msie,$_SERVER['HTTP_USER_AGENT']) || + preg_match($opera,$_SERVER['HTTP_USER_AGENT'])) + return $x; + + // find all the png images in backgrounds + preg_match_all('/background-image:\s*url\(\'(.*\.png)\'\);/Uis',$x,$background); + for($i=0;$i|)/Uis',$x,$images); + while(list($imgnum,$v)=@each($images[0])){ + $original=$v; + $atts=''; $width=0; $height=0; + // If the size is defined by styles, find + preg_match_all('/style=".*(width: ([0-9]+))px.*'. + '(height: ([0-9]+))px.*"/Ui',$v,$arr2); + if(is_array($arr2) && count($arr2[0])){ + // size was defined by styles, get values + $width=$arr2[2][0]; + $height=$arr2[4][0]; + } + // size was not defined by styles, get values + preg_match_all('/width=\"?([0-9]+)\"?/i',$v,$arr2); + if(is_array($arr2) && count($arr2[0])){ + $width=$arr2[1][0]; + } + preg_match_all('/height=\"?([0-9]+)\"?/i',$v,$arr2); + if(is_array($arr2) && count($arr2[0])){ + $height=$arr2[1][0]; + } + preg_match_all('/src=\"([^\"]+\.png)\"/i',$v,$arr2); + if(isset($arr2[1][0]) && !empty($arr2[1][0])) + $image=$arr2[1][0]; + else + $image=NULL; + + // We do this so that we can put our spacer.gif image in the same + // directory as the image + $tmp=split('[\\/]',$image); + array_pop($tmp); + $image_path=join('/',$tmp); + if(substr($image,0,strlen($rootURL))==$rootURL) + { + $path = str_replace($rootURL,$pathtoroot,$image); + } + else + { + $path = $pathtoroot."themes/telestial/$image"; + } +// echo "Sizing $path..
    \n"; +// echo "Full Tag: ".htmlentities($image)."
    \n"; + //if(!$height || !$width) + //{ + + $g = imagecreatefrompng($path); + if($g) + { + $height = imagesy($g); + $width = imagesx($g); + } + //} + if(strlen($image_path)) $image_path.='/'; + + // end quote is already supplied by originial src attribute + $replace_src_with=$spacer.'" style="width: '.$width. + 'px; height: '.$height.'px; filter: progid:DXImageTransform.'. + 'Microsoft.AlphaImageLoader(src=\''.$image.'\', sizingMethod='. + '\'scale\')'; + + // now create the new tag from the old + $new_tag=str_replace($image,$replace_src_with,$original); + + // now place the new tag into the content + $x=str_replace($original,$new_tag,$x); + } + return $x; +} + +function print_pre($str) +{ + // no comments here :) + echo '
    '.print_r($str, true).'
    '; +} + +function GetOptions($field) // by Alex +{ + // get dropdown values from custom field + $tmp =& new clsCustomField(); + + $tmp->LoadFromDatabase($field, 'FieldName'); + $tmp_values = $tmp->Get('ValueList'); + unset($tmp); + $tmp_values = explode(',', $tmp_values); + + foreach($tmp_values as $mixed) + { + $elem = explode('=', trim($mixed)); + $ret[ $elem[0] ] = $elem[1]; + } + return $ret; +} + +function ResetPage($module_prefix, $page_variable = 'p') +{ + // resets page in specific module when category is changed + if(!is_object($objSession)) // when changing pages session doesn't exist -> InPortal BUG + { + global $var_list, $SessionQueryString, $FrontEnd; + //if(!$var_list["sid"]) $var_list["sid"] = $_COOKIE["sid"]; + $objSession = new clsUserSession($var_list["sid"],($SessionQueryString && $FrontEnd==1)); + } + //echo "SID_RESET: ".$GLOBALS['var_list']["sid"].'(COOKIE_SID: '.$_COOKIE["sid"].')
    '; + $last_cat = $objSession->GetVariable('last_category'); + $prev_cat = $objSession->GetVariable('prev_category'); + //echo "Resetting Page [$prev_cat] -> [$last_cat]
    "; + + if($prev_cat != $last_cat) $GLOBALS[$module_prefix.'_var_list'][$page_variable] = 1; +} + +function GetVar($name) +{ + return isset($_REQUEST[$name]) ? $_REQUEST[$name] : false; +} + +function PassVar(&$source) +{ + // source array + any count of key names in passed array + $params = func_get_args(); + array_shift($params); + + if( count($params) ) + { + $ret = Array(); + foreach($params as $var_name) + if( isset($source[$var_name]) ) + $ret[] = $var_name.'='.$source[$var_name]; + $ret = '&'.implode('&', $ret); + } + return $ret; +} + +function GetSubmitVariable(&$array, $postfix) +{ + // gets edit status of module + // used in case if some modules share + // common action parsed by kernel parser, + // but each module uses own EditStatus variable + + $modules = Array('In-Link' => 'Link', 'In-News' => 'News', 'In-Bulletin' => 'Topic'); + foreach($modules as $module => $prefix) + if( isset($array[$prefix.$postfix]) ) + return Array('Module' => $module, 'variable' => $array[$prefix.$postfix]); + return false; +} + +function GetModuleByAction() +{ + $prefix2module = Array('m' => 'In-Portal', 'l' => 'In-Link', 'n' => 'In-News', 'bb' => 'In-Bulletin'); + $action = $_REQUEST['Action']; + $module_prefix = explode('_', $action); + return $prefix2module[ $module_prefix[0] ]; +} + +function dir_size($dir) { + // calculates folder size based on filesizes inside it (recursively) + $totalsize=0; + if ($dirstream = @opendir($dir)) { + while (false !== ($filename = readdir($dirstream))) { + if ($filename!="." && $filename!="..") + { + if (is_file($dir."/".$filename)) + $totalsize+=filesize($dir."/".$filename); + + if (is_dir($dir."/".$filename)) + $totalsize+=dir_size($dir."/".$filename); + } + } + } + closedir($dirstream); + return $totalsize; +} + +function size($bytes) { + // shows formatted file/directory size + $types = Array("la_bytes","la_kilobytes","la_megabytes","la_gigabytes","la_terabytes"); + $current = 0; + while ($bytes > 1024) { + $current++; + $bytes /= 1024; + } + return round($bytes,2)." ".language($types[$current]); +} + +function echod($str) +{ + // echo debug output + echo str_replace( Array('[',']'), Array('[', ']'), $str).'
    '; +} + + +function PrepareParams($source, $to_lower, $mapping) +{ + // prepare array with form values to use with item + $result = Array(); + foreach($to_lower as $field) + $result[ $field ] = $source[ strtolower($field) ]; + + if( is_array($mapping) ) + { + foreach($mapping as $field_from => $field_to) + $result[$field_to] = $source[$field_from]; + } + + return $result; +} + +function GetELT($field, $phrases = Array()) +{ + // returns FieldOptions equivalent in In-Portal + $ret = Array(); + foreach($phrases as $phrase) + $ret[] = admin_language($phrase); + $ret = "'".implode("','", $ret)."'"; + return 'ELT('.$field.','.$ret.')'; +} + +function GetModuleImgPath($module) +{ + global $rootURL, $admin; + return $rootURL.$module.'/'.$admin.'/images'; +} + +function ActionPostProcess($StatusField, $ListClass, $ListObjectName = '', $IDField = null) +{ + // each action postprocessing stuff from admin + if( !isset($_REQUEST[$StatusField]) ) return false; + + $list =& $GLOBALS[$ListObjectName]; + if( !is_object($list) ) $list = new $ListClass(); + $SFValue = $_REQUEST[$StatusField]; // status field value + switch($SFValue) + { + case 1: // User hit "Save" button + $list->CopyFromEditTable($IDField); + break; + case 2: // User hit "Cancel" button + $list->PurgeEditTable($IDField); + break; + } + if( function_exists('SpecificProcessing') ) SpecificProcessing($StatusField, $SFValue); + if($SFValue == 1 || $SFValue == 2) $list->Clear(); +} + +function GetElem(&$array, $index) +{ + // returns array element by index if + // such index exists + return isset($array[$index]) ? $array[$index] : false; +} + +function MakeHTMLTag($element, $attrib_prefix) +{ + $result = Array(); + $ap_length = strlen($attrib_prefix); + foreach($element->attributes as $attib_name => $attr_value) + if( substr($attib_name, $ap_length) == $ap_length ) + $result[] = substr($attib_name, $ap_length, strlen($attib_name)).'="'.$attr_value.'"'; + return count($result) ? implode(' ', $result) : false; +} + +/* so I dont forget: + - the decrypt function is defined in adodb-time and is called xp() + - the keygen function is also declared in adodb-time as $b + and eval'd() in dates.php +*/ + + + +/* //this comes from line 15; moved by PSK for readability + + $g_DBType = "mysql"; + $g_DBHost = "kiev"; + + $g_DBUser = "root"; + $g_DBUserPassword = ""; + $g_DBName = "inportal"; + + +//$g_DBUser = "bloopered"; +//$g_DBUserPassword = "vFWPqJT017"; +//$g_DBName = "inportal"; + + $g_TablePrefix = ""; + + $g_EnableCookies = FALSE; + $g_SessionExpirationLimit = 3600*1; // 1 hour + +//$g_PrivateMessageExpirationLimit = 2592000; // 30 days +//$g_PrivateMessageThreadLimit = 50; +//$g_DebugMode=0; + +//$g_defaultLanguage = "English"; +//$g_defaultTheme = "default"; + + $g_TopRate = 4; + $g_PopRate = 80; + $g_NewDate = 5; + + + $g_adodbConnection=NULL; +*/ +?> Index: trunk/admin/icons/icon24_lock_login.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/relevance/rel_6.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemtabs/tab_inactive.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_tool_import.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/missing_lang_labels.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/missing_lang_labels.php (revision 0) +++ trunk/kernel/admin/include/toolbar/missing_lang_labels.php (revision 13) @@ -0,0 +1,91 @@ + +Get("m_Phrase_LV_Sortfield")); +$SortOrder = trim($objConfig->Get("m_Phrase_LV_Sortorder")); + +if(!strlen($SortOrder)) + $SortOrder = "asc"; + +/* Set the Items PerPage value */ +$Phrase_Page = (int)$objConfig->Get("Perpage_Phrase"); +if(!$Phrase_Page) + $Phrase_Page = 20; + +$Current = $objSession->GetVariable("m_Page_Phrase"); +if(!$Current) + $Current = 1; + +$item_select = $adminURL."/relations/item_type.php"; +$cat_select = $adminURL."/cat_select.php"; + +$phrase_edit = $adminURL."/config/edit_label.php"; +$missing_edit = $adminURL."/config/missing_label_search.php"; + +$lang_Theme = language("la_by_theme"); +$lang_Front = language("la_front_end"); +$lang_Admin = language("la_admin"); +$lang_Phrase = language("la_prompt_Label"); +$lang_Translation = language("la_prompt_Value"); +$lang_PrimaryValue = language("la_prompt_PrimaryValue"); +$lang_Type = language("la_prompt_Type"); +$lang_Phrases = language("la_prompt_Phrases"); + +$template_filter = $objSession->GetVariable("LangTemplate"); + +print<< + + + + +END; +?> Index: trunk/admin/images/tab.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/parser.php =================================================================== diff -u --- trunk/kernel/admin/include/parser.php (revision 0) +++ trunk/kernel/admin/include/parser.php (revision 13) @@ -0,0 +1,251 @@ +NumCategories()==0) + return "
    No Categories

    "; + + $o="
  • + + + + + + + + + + + + +
    + + +


    +
    + + "> + "> + + + + +
    +
    "; + + $i=1; + $list = $objSession->GetVariable("SearchWord"); + if(strlen($list)) + $Keywords = explode(",",$list); + + $template = $pathtoroot.$admin."/templates/".$template; + + $topleft = 0; + $topright = 0; + $rightcount = 0; + $totalcats = 0; + $totalcats = $objCatList->NumItems(); + $topleft = ceil($totalcats/2); + $topright = $totalcats-$topleft; + + for ($x=0;$x<$topleft;$x++) + { + //printingleft + $cat = $objCatList->Items[$x]; + + if($cat->Get("CategoryId")!=$ParentId) + { + if ($i > 2) + { + $o.="\n"; + $i = 1; + } + + //$cat->LoadPermissions($objSession->Get("GroupId")); + if(strlen($list)) + { + $h = $cat->AdminParseTemplate($template); + $h = HighlightKeywords($Keywords, $h); + $o .= $h; + $h = ""; + } + else + $o.=$cat->AdminParseTemplate($template); + + $i++; + } + //printingright + + if ($rightcount < $topright && (($x+$topleft) <$totalcats)) + { + $cat = $objCatList->Items[$x+$topleft]; + if($cat->Get("CategoryId")!=$ParentId) + { + if ($i > 2) + { + $o.="\n"; + $i = 1; + } + //$cat->LoadPermissions($objSession->Get("GroupId")); + if(strlen($list)) + { + $h = $cat->AdminParseTemplate($template); + $h = HighlightKeywords($Keywords, $h); + $o .= $h; + $h = ""; + } + else + $o.=$cat->AdminParseTemplate($template); + + $i++; + } + $rightcount++; + } + } + $o .="\n
    \n"; + return $o; +} + +function list_custom($c,$Type) +{ + global $objSession, $objCustomFieldList, $objCustomDataList, + $imagesURL; + + $field_list = $objCustomFieldList->Query_CustomField("Type=$Type"); + + if (count($field_list) == 0) + return "No Custom Fields

    "; + + $o=""; + + $i = 1; + $objCustomDataList->SourceTable = $objSession->GetEditTable("CustomMetaData"); + $objCustomDataList->LoadResource($c->Get("ResourceId")); + foreach($field_list as $field) + { + $fieldname = $field->Get("FieldName"); + $fieldlabel = $field->Get("FieldLabel"); + $fieldid = $field->Get("CustomFieldId"); + + $f = $objCustomDataList->GetDataItem($fieldid); + if(is_object($f)) + { + $fieldvalue = $f->Get("Value"); + } + else + $fieldvalue=""; + $o .=""; + $o .=" $fieldname + $fieldlabel + + + \n"; + + $i++; + } + return $o; +} + + +function adListRelatedCategories($Item) +{ + global $objCatList; + + if(is_object($Item)) + { + $catlist = $Item->GetRelatedCategories(0); + $o = ""; + foreach($catlist as $catrel) + { + $o .= "Get("RelationshipId")."\">"; + $cat = $objCatList->GetByResource($catrel->Get("TargetId")); + $path = $cat->ParentNames(); + if(strlen($path)) + { + $o .= implode(">",$path); + } + $o .="
    \n"; + } + } + return $o; +} + +function adListRelatedItems($Item) +{ + global $objCatList; + + if(is_object($Item)) + { + $item_list=$Item->GetRelatedItems(0); + $o = ""; + foreach($item_list as $i) + { + $data = $i->GetTargetItemData(); + $o .= ""; + $o .= ""; + $o .= "Get("RelationshipId")."\">"; + $o .= $data[$data["TitleField"]]; + $o .= ""; + $o .= "".$data["SourceTable"].""; + $cat =& $objCatList->GetCategory($data["CategoryId"]); + $o .= ""; + $path = $cat->ParentNames(); + if(strlen($path)) + { + $o .= implode(">",$path); + } + $o .= ""; + } + } + return $o; +} + +function adListItemReviews($Item) +{ + global $pathtoroot,$admin; + + $Reviews = $Item->GetItemReviews(); + $o = ""; + if($Reviews->ItemCount()>0) + { + foreach($Reviews->ItemList as $r) + { + $o .= ""; + $o .= ""; + if($r->Get("Pending")==0) + { + $o .= "Get("ReviewId")."\"> Delete"; + } + $o .= ""; + if($r->Get("Pending")!=0) + { + $o .= "Get("ReviewId")."\"> Approve"; + } + $o .= ""; + $o .= $r->parse_template(admintemplate($pathtoroot.$admin."/templates/review_element.tpl")); + $o .= ""; + } + } + return $o; +} + + +function adImageUploadFormTags($img) +{ + static $file_count=0; + + $o = ""; + if($file_count==0) + { + $o .= ""; + } + $o .= "Get("Name")."\">"; + $o .= "Get("AltName")."\">"; + $o .= ""; + + $o .= "Get("Url")."\">"; + $o .= ""; + $o .= "Get("Url")."\" NAME=\"$file_count\">"; + + $o .= "Get("ResourceId")."\">"; + $o .= "Get("RelatedTo")."\">"; + $o .= "Get("IsThumbnail")."\">"; + $parts = pathinfo($img->Get("LocalPath")); + $destdir = $parts["dirname"]; + + $o .= ""; + if($img->Get("RelatedTo")>0) + $o .= ""; + $o .= ""; + $file_count++; + return $o; +} + + function m_GetModuleInfo($info_type) + { + // get information for building sql in + // Edit Category -> Relations List + if($info_type = 'rel_list') + return Array( 'MainTable' => 'Category', 'ItemNameField' => 'CachedNavbar', + 'ItemNamePhrase' => 'la_Text_Category', 'TargetType' => 1); + return false; + } + +?> Index: trunk/admin/email/sendmail.php =================================================================== diff -u --- trunk/admin/email/sendmail.php (revision 0) +++ trunk/admin/email/sendmail.php (revision 13) @@ -0,0 +1,191 @@ +"; print_r($_POST); echo ""; + +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$browseURL = $adminURL."/browse"; + +//admin only util + +$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."/browse/toolbar.php"); + +//Set Section +$section = 'in-portal:sendmail'; + +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +$objListToolBar = new clsToolBar(); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",""); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("select", "la_ToolTip_SendEmail","#","swap('select','toolbar/tool_select_f2.gif');", + "swap('select', 'toolbar/tool_select.gif');", + "SendMail();", + $imagesURL."/toolbar/tool_select.gif"); + +$objListToolBar->Add("cancel", "la_ToolTip_Stop","#","swap('cancel','toolbar/tool_stop_f2.gif');", + "swap('cancel', 'toolbar/tool_stop.gif');","window.close();", + $imagesURL."/toolbar/tool_stop.gif"); + + +int_header($objListToolBar); +if(count(explode(",",$recip_ids))>1) +{ + $action = "email_multi_send"; +} +else + $action = "email_single_send"; +if ($addr_list != '' || $addr_list != null) { + $addresses = implode(",",$addr_list); +} +?> + + + + + + + > + + + + + > + + + + + + > + + + + + + + > + + + + > + + + + + +
    + + + + +
    + "> +
    + +
    +
    + + + + +
    + +
    + +
    + + Index: trunk/admin/images/toolbar/tool_cut_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_sessions_log.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_language_var_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/settings.php =================================================================== diff -u --- trunk/admin/install/settings.php (revision 0) +++ trunk/admin/install/settings.php (revision 13) @@ -0,0 +1,47 @@ + +  Set Root Password

    + + + + + + + +
     Step - Set Root Password
    + + +
    + + + + + \ No newline at end of file Index: trunk/kernel/include/adodb/drivers/adodb-ado.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-ado.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-ado.inc.php (revision 13) @@ -0,0 +1,589 @@ +_affectedRows = new VARIANT; + } + + function ServerInfo() + { + if (!empty($this->_connectionID)) $desc = $this->_connectionID->provider; + return array('description' => $desc, 'version' => ''); + } + + function _affectedrows() + { + return $this->_affectedRows->value; + } + + // you can also pass a connection string like this: + // + // $DB->Connect('USER ID=sa;PASSWORD=pwd;SERVER=mangrove;DATABASE=ai',false,false,'SQLOLEDB'); + function _connect($argHostname, $argUsername, $argPassword, $argProvider= 'MSDASQL') + { + $u = 'UID'; + $p = 'PWD'; + + if (!empty($this->charPage)) + $dbc = new COM('ADODB.Connection',null,$this->charPage); + else + $dbc = new COM('ADODB.Connection'); + + if (! $dbc) return false; + + /* special support if provider is mssql or access */ + if ($argProvider=='mssql') { + $u = 'User Id'; //User parameter name for OLEDB + $p = 'Password'; + $argProvider = "SQLOLEDB"; // SQL Server Provider + + // not yet + //if ($argDatabasename) $argHostname .= ";Initial Catalog=$argDatabasename"; + + //use trusted conection for SQL if username not specified + if (!$argUsername) $argHostname .= ";Trusted_Connection=Yes"; + } else if ($argProvider=='access') + $argProvider = "Microsoft.Jet.OLEDB.4.0"; // Microsoft Jet Provider + + if ($argProvider) $dbc->Provider = $argProvider; + + if ($argUsername) $argHostname .= ";$u=$argUsername"; + if ($argPassword)$argHostname .= ";$p=$argPassword"; + + if ($this->debug) ADOConnection::outp( "Host=".$argHostname."
    \n version=$dbc->version"); + // @ added below for php 4.0.1 and earlier + @$dbc->Open((string) $argHostname); + + $this->_connectionID = $dbc; + + $dbc->CursorLocation = $this->_cursor_location; + return $dbc->State > 0; + } + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argProvider='MSDASQL') + { + return $this->_connect($argHostname,$argUsername,$argPassword,$argProvider); + } + +/* + adSchemaCatalogs = 1, + adSchemaCharacterSets = 2, + adSchemaCollations = 3, + adSchemaColumns = 4, + adSchemaCheckConstraints = 5, + adSchemaConstraintColumnUsage = 6, + adSchemaConstraintTableUsage = 7, + adSchemaKeyColumnUsage = 8, + adSchemaReferentialContraints = 9, + adSchemaTableConstraints = 10, + adSchemaColumnsDomainUsage = 11, + adSchemaIndexes = 12, + adSchemaColumnPrivileges = 13, + adSchemaTablePrivileges = 14, + adSchemaUsagePrivileges = 15, + adSchemaProcedures = 16, + adSchemaSchemata = 17, + adSchemaSQLLanguages = 18, + adSchemaStatistics = 19, + adSchemaTables = 20, + adSchemaTranslations = 21, + adSchemaProviderTypes = 22, + adSchemaViews = 23, + adSchemaViewColumnUsage = 24, + adSchemaViewTableUsage = 25, + adSchemaProcedureParameters = 26, + adSchemaForeignKeys = 27, + adSchemaPrimaryKeys = 28, + adSchemaProcedureColumns = 29, + adSchemaDBInfoKeywords = 30, + adSchemaDBInfoLiterals = 31, + adSchemaCubes = 32, + adSchemaDimensions = 33, + adSchemaHierarchies = 34, + adSchemaLevels = 35, + adSchemaMeasures = 36, + adSchemaProperties = 37, + adSchemaMembers = 38 + +*/ + + function &MetaTables() + { + $arr= array(); + $dbc = $this->_connectionID; + + $adors=@$dbc->OpenSchema(20);//tables + if ($adors){ + $f = $adors->Fields(2);//table/view name + $t = $adors->Fields(3);//table type + while (!$adors->EOF){ + $tt=substr($t->value,0,6); + if ($tt!='SYSTEM' && $tt !='ACCESS') + $arr[]=$f->value; + //print $f->value . ' ' . $t->value.'
    '; + $adors->MoveNext(); + } + $adors->Close(); + } + + return $arr; + } + + function &MetaColumns($table) + { + $table = strtoupper($table); + $arr= array(); + $dbc = $this->_connectionID; + + $adors=@$dbc->OpenSchema(4);//tables + + if ($adors){ + $t = $adors->Fields(2);//table/view name + while (!$adors->EOF){ + + + if (strtoupper($t->Value) == $table) { + + $fld = new ADOFieldObject(); + $c = $adors->Fields(3); + $fld->name = $c->Value; + $fld->type = 'CHAR'; // cannot discover type in ADO! + $fld->max_length = -1; + $arr[strtoupper($fld->name)]=$fld; + } + + $adors->MoveNext(); + } + $adors->Close(); + } + + return $arr; + } + + /* returns queryID or false */ + function &_query($sql,$inputarr=false) + { + + $dbc = $this->_connectionID; + + // return rs + if ($inputarr) { + + if (!empty($this->charPage)) + $oCmd = new COM('ADODB.Command',null,$this->charPage); + else + $oCmd = new COM('ADODB.Command'); + $oCmd->ActiveConnection = $dbc; + $oCmd->CommandText = $sql; + $oCmd->CommandType = 1; + + foreach($inputarr as $val) { + // name, type, direction 1 = input, len, + $this->adoParameterType = 130; + $p = $oCmd->CreateParameter('name',$this->adoParameterType,1,strlen($val),$val); + //print $p->Type.' '.$p->value; + $oCmd->Parameters->Append($p); + } + $p = false; + $rs = $oCmd->Execute(); + $e = $dbc->Errors; + if ($dbc->Errors->Count > 0) return false; + return $rs; + } + + $rs = @$dbc->Execute($sql,$this->_affectedRows, $this->_execute_option); + /* + $rs = new COM('ADODB.Recordset'); + if ($rs) { + $rs->Open ($sql, $dbc, $this->_cursor_type,$this->_lock_type, $this->_execute_option); + } + */ + if ($dbc->Errors->Count > 0) return false; + if (! $rs) return false; + + if ($rs->State == 0) return true; // 0 = adStateClosed means no records returned + return $rs; + } + + + function BeginTrans() + { + if ($this->transOff) return true; + + if (isset($this->_thisTransactions)) + if (!$this->_thisTransactions) return false; + else { + $o = $this->_connectionID->Properties("Transaction DDL"); + $this->_thisTransactions = $o ? true : false; + if (!$o) return false; + } + @$this->_connectionID->BeginTrans(); + $this->transCnt += 1; + return true; + } + function CommitTrans($ok=true) + { + if (!$ok) return $this->RollbackTrans(); + if ($this->transOff) return true; + + @$this->_connectionID->CommitTrans(); + if ($this->transCnt) @$this->transCnt -= 1; + return true; + } + function RollbackTrans() { + if ($this->transOff) return true; + @$this->_connectionID->RollbackTrans(); + if ($this->transCnt) @$this->transCnt -= 1; + return true; + } + + /* Returns: the last error message from previous database operation */ + + function ErrorMsg() + { + $errc = $this->_connectionID->Errors; + if ($errc->Count == 0) return ''; + $err = $errc->Item($errc->Count-1); + return $err->Description; + } + + function ErrorNo() + { + $errc = $this->_connectionID->Errors; + if ($errc->Count == 0) return 0; + $err = $errc->Item($errc->Count-1); + return $err->NativeError; + } + + // returns true or false + function _close() + { + if ($this->_connectionID) $this->_connectionID->Close(); + $this->_connectionID = false; + return true; + } + + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_ado extends ADORecordSet { + + var $bind = false; + var $databaseType = "ado"; + var $dataProvider = "ado"; + var $_tarr = false; // caches the types + var $_flds; // and field objects + var $canSeek = true; + var $hideErrors = true; + + function ADORecordSet_ado($id,$mode=false) + { + if ($mode === false) { + global $ADODB_FETCH_MODE; + $mode = $ADODB_FETCH_MODE; + } + $this->fetchMode = $mode; + return $this->ADORecordSet($id,$mode); + } + + + // returns the field object + function FetchField($fieldOffset = -1) { + $off=$fieldOffset+1; // offsets begin at 1 + + $o= new ADOFieldObject(); + $rs = $this->_queryID; + $f = $rs->Fields($fieldOffset); + $o->name = $f->Name; + $t = $f->Type; + $o->type = $this->MetaType($t); + $o->max_length = $f->DefinedSize; + $o->ado_type = $t; + + + //print "off=$off name=$o->name type=$o->type len=$o->max_length
    "; + return $o; + } + + /* Use associative array to get fields array */ + function Fields($colname) + { + if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname]; + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + + return $this->fields[$this->bind[strtoupper($colname)]]; + } + + + function _initrs() + { + $rs = $this->_queryID; + $this->_numOfRows = $rs->RecordCount; + + $f = $rs->Fields; + $this->_numOfFields = $f->Count; + } + + + // should only be used to move forward as we normally use forward-only cursors + function _seek($row) + { + $rs = $this->_queryID; + // absoluteposition doesn't work -- my maths is wrong ? + // $rs->AbsolutePosition->$row-2; + // return true; + if ($this->_currentRow > $row) return false; + @$rs->Move((integer)$row - $this->_currentRow-1); //adBookmarkFirst + return true; + } + +/* + OLEDB types + + enum DBTYPEENUM + { DBTYPE_EMPTY = 0, + DBTYPE_NULL = 1, + DBTYPE_I2 = 2, + DBTYPE_I4 = 3, + DBTYPE_R4 = 4, + DBTYPE_R8 = 5, + DBTYPE_CY = 6, + DBTYPE_DATE = 7, + DBTYPE_BSTR = 8, + DBTYPE_IDISPATCH = 9, + DBTYPE_ERROR = 10, + DBTYPE_BOOL = 11, + DBTYPE_VARIANT = 12, + DBTYPE_IUNKNOWN = 13, + DBTYPE_DECIMAL = 14, + DBTYPE_UI1 = 17, + DBTYPE_ARRAY = 0x2000, + DBTYPE_BYREF = 0x4000, + DBTYPE_I1 = 16, + DBTYPE_UI2 = 18, + DBTYPE_UI4 = 19, + DBTYPE_I8 = 20, + DBTYPE_UI8 = 21, + DBTYPE_GUID = 72, + DBTYPE_VECTOR = 0x1000, + DBTYPE_RESERVED = 0x8000, + DBTYPE_BYTES = 128, + DBTYPE_STR = 129, + DBTYPE_WSTR = 130, + DBTYPE_NUMERIC = 131, + DBTYPE_UDT = 132, + DBTYPE_DBDATE = 133, + DBTYPE_DBTIME = 134, + DBTYPE_DBTIMESTAMP = 135 + + ADO Types + + adEmpty = 0, + adTinyInt = 16, + adSmallInt = 2, + adInteger = 3, + adBigInt = 20, + adUnsignedTinyInt = 17, + adUnsignedSmallInt = 18, + adUnsignedInt = 19, + adUnsignedBigInt = 21, + adSingle = 4, + adDouble = 5, + adCurrency = 6, + adDecimal = 14, + adNumeric = 131, + adBoolean = 11, + adError = 10, + adUserDefined = 132, + adVariant = 12, + adIDispatch = 9, + adIUnknown = 13, + adGUID = 72, + adDate = 7, + adDBDate = 133, + adDBTime = 134, + adDBTimeStamp = 135, + adBSTR = 8, + adChar = 129, + adVarChar = 200, + adLongVarChar = 201, + adWChar = 130, + adVarWChar = 202, + adLongVarWChar = 203, + adBinary = 128, + adVarBinary = 204, + adLongVarBinary = 205, + adChapter = 136, + adFileTime = 64, + adDBFileTime = 137, + adPropVariant = 138, + adVarNumeric = 139 +*/ + function MetaType($t,$len=-1,$fieldobj=false) + { + if (is_object($t)) { + $fieldobj = $t; + $t = $fieldobj->type; + $len = $fieldobj->max_length; + } + + if (!is_numeric($t)) return $t; + + switch ($t) { + case 0: + case 12: // variant + case 8: // bstr + case 129: //char + case 130: //wc + case 200: // varc + case 202:// varWC + case 128: // bin + case 204: // varBin + case 72: // guid + if ($len <= $this->blobSize) return 'C'; + + case 201: + case 203: + return 'X'; + case 128: + case 204: + case 205: + return 'B'; + case 7: + case 133: return 'D'; + + case 134: + case 135: return 'T'; + + case 11: return 'L'; + + case 16:// adTinyInt = 16, + case 2://adSmallInt = 2, + case 3://adInteger = 3, + case 4://adBigInt = 20, + case 17://adUnsignedTinyInt = 17, + case 18://adUnsignedSmallInt = 18, + case 19://adUnsignedInt = 19, + case 20://adUnsignedBigInt = 21, + return 'I'; + default: return 'N'; + } + } + + // time stamp not supported yet + function _fetch() + { + $rs = $this->_queryID; + if (!$rs or $rs->EOF) { + $this->fields = false; + return false; + } + $this->fields = array(); + + if (!$this->_tarr) { + $tarr = array(); + $flds = array(); + for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) { + $f = $rs->Fields($i); + $flds[] = $f; + $tarr[] = $f->Type; + } + // bind types and flds only once + $this->_tarr = $tarr; + $this->_flds = $flds; + } + $t = reset($this->_tarr); + $f = reset($this->_flds); + + if ($this->hideErrors) $olde = error_reporting(E_ERROR|E_CORE_ERROR);// sometimes $f->value be null + for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) { + + switch($t) { + case 135: // timestamp + $this->fields[] = date('Y-m-d H:i:s',(integer)$f->value); + break; + + case 133:// A date value (yyyymmdd) + $val = $f->value; + $this->fields[] = substr($val,0,4).'-'.substr($val,4,2).'-'.substr($val,6,2); + break; + case 7: // adDate + $this->fields[] = date('Y-m-d',(integer)$f->value); + break; + case 1: // null + $this->fields[] = false; + break; + case 6: // currency is not supported properly; + ADOConnection::outp( ''.$f->Name.': currency type not supported by PHP'); + $this->fields[] = (float) $f->value; + break; + default: + $this->fields[] = $f->value; + break; + } + //print " $f->value $t, "; + $f = next($this->_flds); + $t = next($this->_tarr); + } // for + if ($this->hideErrors) error_reporting($olde); + @$rs->MoveNext(); // @ needed for some versions of PHP! + + if ($this->fetchMode & ADODB_FETCH_ASSOC) { + $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); + } + return true; + } + + + function _close() { + $this->_flds = false; + @$this->_queryID->Close();// by Pete Dishman (peterd@telephonetics.co.uk) + $this->_queryID = false; + } + +} + +?> \ No newline at end of file Index: trunk/admin/lv/js/in-portal.js =================================================================== diff -u --- trunk/admin/lv/js/in-portal.js (revision 0) +++ trunk/admin/lv/js/in-portal.js (revision 13) @@ -0,0 +1,187 @@ +function MainScript() + +{ + + this.Cookies = new Array(); + + this.ReadCookies(); + + this.Grids = new Array(); + +} + + + +MainScript.prototype.SetCookie = function(name, value) + +{ + + document.cookie = name+'='+value+';'; + +} + + + + + +MainScript.prototype.ReadCookies = function() + +{ + + var cookies = document.cookie.split(' '); + + + + for (var i=0; i \ No newline at end of file Index: trunk/admin/install/theme_select.php =================================================================== diff -u --- trunk/admin/install/theme_select.php (revision 0) +++ trunk/admin/install/theme_select.php (revision 13) @@ -0,0 +1,51 @@ + + + + + + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/lang/no.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/no.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/no.js (revision 13) @@ -0,0 +1,199 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * en.js: English support. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Klipp ut" ; +lang["Copy"] = "Kopier" ; +lang["Paste"] = "Lim inn" ; +lang["PasteText"] = "Lim inn som ren tekst" ; +lang["PasteWord"] = "Lim inn fra Word" ; +lang["Find"] = "Finn" ; +lang["SelectAll"] = "Merk alt" ; +lang["RemoveFormat"] = "Fjern formatering" ; +lang["InsertLink"] = "Sett inn/Rediger lenke" ; +lang["RemoveLink"] = "Fjern lenke" ; +lang["InsertImage"] = "Sett inn/Rediger bilde" ; +lang["InsertTable"] = "Sett inn/Rediger tabell" ; +lang["InsertLine"] = "Sett inn horisontal linje" ; +lang["InsertSpecialChar"] = "Sett inn tegn" ; +lang["InsertSmiley"] = "Sett inn smil" ; +lang["About"] = "Om FCKeditor" ; + +lang["Bold"] = "Fet" ; +lang["Italic"] = "Kursiv" ; +lang["Underline"] = "Understrek" ; +lang["StrikeThrough"] = "Gjennomstrek" ; +lang["Subscript"] = "Senket skrift" ; +lang["Superscript"] = "Hevet skrift" ; +lang["LeftJustify"] = "Venstrejuster" ; +lang["CenterJustify"] = "Midtstill" ; +lang["RightJustify"] = "Høyrejuster" ; +lang["BlockJustify"] = "Juster" ; +lang["DecreaseIndent"] = "Øk innrykk" ; +lang["IncreaseIndent"] = "Minsk innrykk" ; +lang["Undo"] = "Andre" ; +lang["Redo"] = "Gjør om" ; +lang["NumberedList"] = "Numrert liste" ; +lang["BulettedList"] = "Punktliste" ; + +lang["ShowTableBorders"] = "Vis tabellkanter" ; +lang["ShowDetails"] = "Vis detaljer" ; + +lang["FontStyle"] = "Stil" ; +lang["FontFormat"] = "Format" ; +lang["Font"] = "Skrift" ; +lang["FontSize"] = "Størrelse" ; +lang["TextColor"] = "Tekstfarge" ; +lang["BGColor"] = "Bakgrunnsfarge" ; +lang["Source"] = "Kilde" ; + +// Context Menu + +lang["EditLink"] = "Rediger lenke" ; +lang["InsertRow"] = "Sett inn rad" ; +lang["DeleteRows"] = "Slett rader" ; +lang["InsertColumn"] = "Sett inn kolonne" ; +lang["DeleteColumns"] = "Slett kolonner" ; +lang["InsertCell"] = "Sett inn celle" ; +lang["DeleteCells"] = "Slett celler" ; +lang["MergeCells"] = "Slå sammen celler" ; +lang["SplitCell"] = "Del opp celler" ; +lang["CellProperties"] = "Celleegenskaper" ; +lang["TableProperties"] = "Tabellegenskaper" ; +lang["ImageProperties"] = "Bildeegenskaper" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Prosseserer XHTML. Venligst vent..." ; +lang["Done"] = "Ferdig" ; +lang["PasteWordConfirm"] = "Teksten du prøver å lime inn ser ut til å komme fra Word, vil du fjerne formatet før du limer inn?" ; +lang["NotCompatiblePaste"] = "Denne kommandoen er ikke tiljenglig for Internet Explorer version 5.5 eller høyrer. Vil du lime inn uten å rense?" ; + + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Avbryt" ; +lang["DlgBtnClose"] = "Lukk" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Sett inn bilde" ; +lang["DlgImgTitleEdit"] = "Rediger bilde" ; +lang["DlgImgBtnUpload"] = "Send til server" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Last opp" ; +lang["DlgImgBtnBrowse"] = "Bla igjennom server" ; +lang["DlgImgAlt"] = "Alternativ tekst" ; +lang["DlgImgWidth"] = "Bredde" ; +lang["DlgImgHeight"] = "Høyde" ; +lang["DlgImgLockRatio"] = "Lås forhold" ; +lang["DlgBtnResetSize"] = "Tilbakestill størrelse" ; +lang["DlgImgBorder"] = "Ramme" ; +lang["DlgImgHSpace"] = "Horisontalt rom" ; +lang["DlgImgVSpace"] = "Vertikalt rom" ; +lang["DlgImgAlign"] = "Juster" ; +lang["DlgImgAlignLeft"] = "Venstre" ; +lang["DlgImgAlignAbsBottom"] = "Abs bunn" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Midten" ; +lang["DlgImgAlignBaseline"] = "Baselinje" ; +lang["DlgImgAlignBottom"] = "Bunn" ; +lang["DlgImgAlignMiddle"] = "Midten" ; +lang["DlgImgAlignRight"] = "Høyre" ; +lang["DlgImgAlignTextTop"] = "Tekst topp" ; +lang["DlgImgAlignTop"] = "Topp" ; +lang["DlgImgPreview"] = "Forhåndsvisning" ; +lang["DlgImgMsgWrongExt"] = "Beklager, du kan kun laste opp følgende filer:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgImgAlertSelect"] = "Venligst velg ett bilde å laste opp." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Lenke" ; // NEW +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Last opp" ; +lang["DlgLnkTarget"] = "Mål" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Nytt Vindu (_blank)" ; +lang["DlgLnkTargetParent"] = "Foreldre vindu (_parent)" ; +lang["DlgLnkTargetSelf"] = "Samme vindu (_self)" ; +lang["DlgLnkTargetTop"] = "Hele vinduet (_top)" ; +lang["DlgLnkTitle"] = "Tittel" ; +lang["DlgLnkBtnUpload"] = "Send til server" ; +lang["DlgLnkBtnBrowse"] = "Bla igjennom server" ; +lang["DlgLnkMsgWrongExtA"] = "Beklager, Kun følgende filer er lov å laste opp:\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgLnkMsgWrongExtD"] = "Beklager, følgende filer er ikke lov å laste opp:\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperation canceled." ; + +// Color Dialog +lang["DlgColorTitle"] = "Velg farge" ; +lang["DlgColorBtnClear"] = "Ingen farge" ; +lang["DlgColorHighlight"] = "Merk" ; +lang["DlgColorSelected"] = "Valgt" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Sett inn ett smil" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Sett inn tegn" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Sett inn tabell" ; +lang["DlgTableTitleEdit"] = "Rediger tabell" ; +lang["DlgTableRows"] = "Rader" ; +lang["DlgTableColumns"] = "Kolonner" ; +lang["DlgTableBorder"] = "Rammestørrelse" ; +lang["DlgTableAlign"] = "Plassering" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Venstre" ; +lang["DlgTableAlignCenter"] = "Midten" ; +lang["DlgTableAlignRight"] = "Høyre" ; +lang["DlgTableWidth"] = "Bredde" ; +lang["DlgTableWidthPx"] = "Pixler" ; +lang["DlgTableWidthPc"] = "Prosent" ; +lang["DlgTableHeight"] = "Høyde" ; +lang["DlgTableCellSpace"] = "Cellemellomrom" ; +lang["DlgTableCellPad"] = "Cellemarginer" ; +lang["DlgTableCaption"] = "Tittel" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Celleegenskaper" ; +lang["DlgCellWidth"] = "Bredde" ; +lang["DlgCellWidthPx"] = "Pixler" ; +lang["DlgCellWidthPc"] = "Prosent" ; +lang["DlgCellHeight"] = "Høyde" ; +lang["DlgCellWordWrap"] = "Tekstflyt" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Ja" ; +lang["DlgCellWordWrapNo"] = "Nei" ; +lang["DlgCellHorAlign"] = "Horisontal plassering" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Venstre" ; +lang["DlgCellHorAlignCenter"] = "Midten" ; +lang["DlgCellHorAlignRight"] = "Høyre" ; +lang["DlgCellVerAlign"] = "Vertikal plassering" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Toppen" ; +lang["DlgCellVerAlignMiddle"] = "Midten" ; +lang["DlgCellVerAlignBottom"] = "Bunnen" ; +lang["DlgCellVerAlignBaseline"] = "Baselinje" ; +lang["DlgCellRowSpan"] = "Radspenn" ; +lang["DlgCellCollSpan"] = "Kolonnespenn" ; +lang["DlgCellBackColor"] = "Bakgrunnsfarge" ; +lang["DlgCellBorderColor"] = "Rammefarge" ; +lang["DlgCellBtnSelect"] = "Velg..." ; + +// About Dialog +lang["DlgAboutVersion"] = "versjon" ; +lang["DlgAboutLicense"] = "Lisensert under betingelsene av GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "For mer informasjon gå til" ; \ No newline at end of file Index: trunk/themes/default/misc/right_quicklinks.tpl =================================================================== diff -u --- trunk/themes/default/misc/right_quicklinks.tpl (revision 0) +++ trunk/themes/default/misc/right_quicklinks.tpl (revision 13) @@ -0,0 +1,11 @@ + +
    + + + + + + + + + + +
    + Enter the URL which the In-Portal root directory () corresponds to on your web server. + http:// + "> + + +


    +
    + + + + + + + +
    +
    +  Select Default Theme

    + + + + + + + +
     Step - Select Default Theme
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_new_user_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_edit_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_language_primary.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/tab_back.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/addgroup_permissions.php =================================================================== diff -u --- trunk/admin/users/addgroup_permissions.php (revision 0) +++ trunk/admin/users/addgroup_permissions.php (revision 13) @@ -0,0 +1,181 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$browseURL = $adminURL."/browse"; +$cssURL = $adminURL."/include"; + +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +unset($objEditItems); + +$objEditItems = new clsGroupList(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalGroup"); +$objEditItems->EnablePaging = FALSE; +$en = (int)$_GET["en"]; +$sql ="SELECT * FROM ".$objEditItems->SourceTable; +$objEditItems->Query_Item($sql); +//echo $sql."
    \n"; +$itemcount=$objEditItems->NumItems(); +$c = $objEditItems->GetItemByIndex($en); + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_edit_group"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:editgroup_permissions'; + +//Display header +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('editgroup','GroupEditStatus','".$admin."/users/user_groups.php',1);","tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('editgroup','GroupEditStatus','".$admin."/users/user_groups.php',2);","tool_cancel.gif"); + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Group")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Permissions"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/addgroup_permissions.php"; + $StatusField = "GroupEditStatus"; + $form = "editgroup"; + MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevGroup','la_NextGroup'); +} + +int_header($objCatToolBar,NULL,$title); +?> +
    + + + + + + + + + + +
    + Default Theme: + +


    +
    + + + + + + + +
    +
    + + + + + +
    + + +Get("PortalUserId"); + + for($i=0;$i"; + echo ""; + echo ""; + } +?> + +"> +"> + + +
    "; + $getvar = "?env=".BuildEnv()."&en=$en&module=$mod_id"; + echo "$module
    + Index: trunk/kernel/include/adodb/drivers/adodb-odbc_mssql.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-odbc_mssql.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-odbc_mssql.inc.php (revision 13) @@ -0,0 +1,164 @@ +ADODB_odbc(); + } + + // crashes php... + function xServerInfo() + { + $row = $this->GetRow("execute sp_server_info 2"); + $arr['description'] = $row[2]; + $arr['version'] = ADOConnection::_findvers($arr['description']); + return $arr; + } + + + function _insertid() + { + // SCOPE_IDENTITY() + // Returns the last IDENTITY value inserted into an IDENTITY column in + // the same scope. A scope is a module -- a stored procedure, trigger, + // function, or batch. Thus, two statements are in the same scope if + // they are in the same stored procedure, function, or batch. + return $this->GetOne($this->identitySQL); + } + + function &MetaTables() + { + return ADOConnection::MetaTables(); + } + + function &MetaColumns($table) + { + return ADOConnection::MetaColumns($table); + } + + function _query($sql,$inputarr) + { + if (is_string($sql)) $sql = str_replace('||','+',$sql); + return ADODB_odbc::_query($sql,$inputarr); + } + + // "Stein-Aksel Basma" + // tested with MSSQL 2000 + function &MetaPrimaryKeys($table) + { + $sql = "select k.column_name from information_schema.key_column_usage k, + information_schema.table_constraints tc + where tc.constraint_name = k.constraint_name and tc.constraint_type = + 'PRIMARY KEY' and k.table_name = '$table'"; + + $a = $this->GetCol($sql); + if ($a && sizeof($a)>0) return $a; + return false; + } + + // Format date column in sql string given an input format that understands Y M D + function SQLDate($fmt, $col=false) + { + if (!$col) $col = $this->sysTimeStamp; + $s = ''; + + $len = strlen($fmt); + for ($i=0; $i < $len; $i++) { + if ($s) $s .= '+'; + $ch = $fmt[$i]; + switch($ch) { + case 'Y': + case 'y': + $s .= "datename(yyyy,$col)"; + break; + case 'M': + $s .= "convert(char(3),$col,0)"; + break; + case 'm': + $s .= "replace(str(month($col),2),' ','0')"; + break; + case 'Q': + case 'q': + $s .= "datename(quarter,$col)"; + break; + case 'D': + case 'd': + $s .= "replace(str(day($col),2),' ','0')"; + break; + case 'h': + $s .= "substring(convert(char(14),$col,0),13,2)"; + break; + + case 'H': + $s .= "replace(str(datepart(mi,$col),2),' ','0')"; + break; + + case 'i': + $s .= "replace(str(datepart(mi,$col),2),' ','0')"; + break; + case 's': + $s .= "replace(str(datepart(ss,$col),2),' ','0')"; + break; + case 'a': + case 'A': + $s .= "substring(convert(char(19),$col,0),18,2)"; + break; + + default: + if ($ch == '\\') { + $i++; + $ch = substr($fmt,$i,1); + } + $s .= $this->qstr($ch); + break; + } + } + return $s; + } + +} + +class ADORecordSet_odbc_mssql extends ADORecordSet_odbc { + + var $databaseType = 'odbc_mssql'; + + function ADORecordSet_odbc_mssql($id,$mode=false) + { + return $this->ADORecordSet_odbc($id,$mode); + } +} +?> \ No newline at end of file Index: trunk/admin/icons/icon24_itemsearch.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_actionbox.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_searchgroups.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-oci8.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-oci8.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-oci8.inc.php (revision 13) @@ -0,0 +1,1061 @@ + + + 13 Nov 2000 jlim - removed all ora_* references. +*/ + +/* +NLS_Date_Format +Allows you to use a date format other than the Oracle Lite default. When a literal +character string appears where a date value is expected, the Oracle Lite database +tests the string to see if it matches the formats of Oracle, SQL-92, or the value +specified for this parameter in the POLITE.INI file. Setting this parameter also +defines the default format used in the TO_CHAR or TO_DATE functions when no +other format string is supplied. + +For Oracle the default is dd-mon-yy or dd-mon-yyyy, and for SQL-92 the default is +yy-mm-dd or yyyy-mm-dd. + +Using 'RR' in the format forces two-digit years less than or equal to 49 to be +interpreted as years in the 21st century (2000�2049), and years over 50 as years in +the 20th century (1950�1999). Setting the RR format as the default for all two-digit +year entries allows you to become year-2000 compliant. For example: +NLS_DATE_FORMAT='RR-MM-DD' + +You can also modify the date format using the ALTER SESSION command. +*/ +class ADODB_oci8 extends ADOConnection { + var $databaseType = 'oci8'; + var $dataProvider = 'oci8'; + var $replaceQuote = "''"; // string to use to replace quotes + var $concat_operator='||'; + var $sysDate = "TRUNC(SYSDATE)"; + var $sysTimeStamp = 'SYSDATE'; + var $metaDatabasesSQL = "SELECT USERNAME FROM ALL_USERS WHERE USERNAME NOT IN ('SYS','SYSTEM','DBSNMP','OUTLN') ORDER BY 1"; + var $_stmt; + var $_commit = OCI_COMMIT_ON_SUCCESS; + var $_initdate = true; // init date to YYYY-MM-DD + var $metaTablesSQL = "select table_name from cat where table_type in ('TABLE','VIEW')"; + var $metaColumnsSQL = "select cname,coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno"; //changed by smondino@users.sourceforge. net + var $_bindInputArray = true; + var $hasGenID = true; + var $_genIDSQL = "SELECT (%s.nextval) FROM DUAL"; + var $_genSeqSQL = "CREATE SEQUENCE %s START WITH %s"; + var $_dropSeqSQL = "DROP SEQUENCE %s"; + var $hasAffectedRows = true; + var $upperCase = 'upper'; + var $noNullStrings = false; + var $connectSID = false; + var $_bind = false; + var $_hasOCIFetchStatement = false; + var $_getarray = false; // currently not working + var $leftOuter = '(+)='; + var $session_sharing_force_blob = false; // alter session on updateblob if set to true + var $firstrows = true; // enable first rows optimization on SelectLimit() + var $selectOffsetAlg1 = 100; // when to use 1st algorithm of selectlimit. + var $NLS_DATE_FORMAT = 'YYYY-MM-DD'; + var $useDBDateFormatForTextInput=false; + + // var $ansiOuter = true; // if oracle9 + + function ADODB_oci8() + { + + $this->_hasOCIFetchStatement = ADODB_PHPVER >= 0x4200; + } + + /* Function &MetaColumns($table) added by smondino@users.sourceforge.net*/ + function &MetaColumns($table) + { + global $ADODB_FETCH_MODE; + + $save = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false); + + $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table))); + + if (isset($savem)) $this->SetFetchMode($savem); + $ADODB_FETCH_MODE = $save; + if (!$rs) return false; + $retarr = array(); + while (!$rs->EOF) { //print_r($rs->fields); + $fld = new ADOFieldObject(); + $fld->name = $rs->fields[0]; + $fld->type = $rs->fields[1]; + $fld->max_length = $rs->fields[2]; + $fld->scale = $rs->fields[3]; + if ($rs->fields[1] == 'NUMBER' && $rs->fields[3] == 0) { + $fld->type ='INT'; + $fld->max_length = $rs->fields[4]; + } + + $fld->not_null = $rs->fields[5]; + $fld->default_value = $rs->fields[6]; + $retarr[strtoupper($fld->name)] = $fld; + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + +/* + + Multiple modes of connection are supported: + + a. Local Database + $conn->Connect(false,'scott','tiger'); + + b. From tnsnames.ora + $conn->Connect(false,'scott','tiger',$tnsname); + $conn->Connect($tnsname,'scott','tiger'); + + c. Server + service name + $conn->Connect($serveraddress,'scott,'tiger',$service_name); + + d. Server + SID + $conn->connectSID = true; + $conn->Connect($serveraddress,'scott,'tiger',$SID); + + +Example TNSName: +--------------- +NATSOFT.DOMAIN = + (DESCRIPTION = + (ADDRESS_LIST = + (ADDRESS = (PROTOCOL = TCP)(HOST = kermit)(PORT = 1523)) + ) + (CONNECT_DATA = + (SERVICE_NAME = natsoft.domain) + ) + ) + + There are 3 connection modes, 0 = non-persistent, 1 = persistent, 2 = force new connection + +*/ + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename,$mode=0) + { + if($argHostname) { // added by Jorma Tuomainen + if (empty($argDatabasename)) $argDatabasename = $argHostname; + else { + if(strpos($argHostname,":")) { + $argHostinfo=explode(":",$argHostname); + $argHostname=$argHostinfo[0]; + $argHostport=$argHostinfo[1]; + } else { + $argHostport="1521"; + } + + if ($this->connectSID) { + $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname + .")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))"; + } else + $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname + .")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))"; + } + } + + //if ($argHostname) print "

    Connect: 1st argument should be left blank for $this->databaseType

    "; + if ($mode==1) { + $this->_connectionID = OCIPLogon($argUsername,$argPassword, $argDatabasename); + if ($this->_connectionID && $this->autoRollback) OCIrollback($this->_connectionID); + } else if ($mode==2) { + $this->_connectionID = OCINLogon($argUsername,$argPassword, $argDatabasename); + } else { + $this->_connectionID = OCILogon($argUsername,$argPassword, $argDatabasename); + } + if ($this->_connectionID === false) return false; + if ($this->_initdate) { + $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='".$this->NLS_DATE_FORMAT."'"); + } + + // looks like: + // Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production With the Partitioning option JServer Release 8.1.7.0.0 - Production + // $vers = OCIServerVersion($this->_connectionID); + // if (strpos($vers,'8i') !== false) $this->ansiOuter = true; + return true; + } + + function ServerInfo() + { + $arr['compat'] = $this->GetOne('select value from sys.database_compatible_level'); + $arr['description'] = @OCIServerVersion($this->_connectionID); + $arr['version'] = ADOConnection::_findvers($arr['description']); + return $arr; + } + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename,1); + } + + // returns true or false + function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename,2); + } + + function Affected_Rows() + { + return OCIRowCount($this->_stmt); + } + + // format and return date string in database date format + function DBDate($d) + { + if (empty($d) && $d !== 0) return 'null'; + + if (is_string($d)) $d = ADORecordSet::UnixDate($d); + return "TO_DATE(".adodb_date($this->fmtDate,$d).",'".$this->NLS_DATE_FORMAT."')"; + } + + + // format and return date string in database timestamp format + function DBTimeStamp($ts) + { + if (empty($ts) && $ts !== 0) return 'null'; + if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts); + return 'TO_DATE('.adodb_date($this->fmtTimeStamp,$ts).",'RRRR-MM-DD, HH:MI:SS AM')"; + } + + function RowLock($tables,$where) + { + if ($this->autoCommit) $this->BeginTrans(); + return $this->GetOne("select 1 as ignore from $tables where $where for update"); + } + + function BeginTrans() + { + if ($this->transOff) return true; + $this->transCnt += 1; + $this->autoCommit = false; + $this->_commit = OCI_DEFAULT; + return true; + } + + function CommitTrans($ok=true) + { + if ($this->transOff) return true; + if (!$ok) return $this->RollbackTrans(); + + if ($this->transCnt) $this->transCnt -= 1; + $ret = OCIcommit($this->_connectionID); + $this->_commit = OCI_COMMIT_ON_SUCCESS; + $this->autoCommit = true; + return $ret; + } + + function RollbackTrans() + { + if ($this->transOff) return true; + if ($this->transCnt) $this->transCnt -= 1; + $ret = OCIrollback($this->_connectionID); + $this->_commit = OCI_COMMIT_ON_SUCCESS; + $this->autoCommit = true; + return $ret; + } + + + function SelectDB($dbName) + { + return false; + } + + /* there seems to be a bug in the oracle extension -- always returns ORA-00000 - no error */ + function ErrorMsg() + { + $arr = @OCIerror($this->_stmt); + + if ($arr === false) { + $arr = @OCIerror($this->_connectionID); + if ($arr === false) $arr = @OCIError(); + if ($arr === false) return ''; + } + $this->_errorMsg = $arr['message']; + return $this->_errorMsg; + } + + function ErrorNo() + { + if (is_resource($this->_stmt)) + $arr = @ocierror($this->_stmt); + else { + $arr = @ocierror($this->_connectionID); + if ($arr === false) $arr = @ocierror(); + if ($arr == false) return ''; + } + return $arr['code']; + } + + // Format date column in sql string given an input format that understands Y M D + function SQLDate($fmt, $col=false) + { + if (!$col) $col = $this->sysTimeStamp; + $s = 'TO_CHAR('.$col.",'"; + + $len = strlen($fmt); + for ($i=0; $i < $len; $i++) { + $ch = $fmt[$i]; + switch($ch) { + case 'Y': + case 'y': + $s .= 'YYYY'; + break; + case 'Q': + case 'q': + $s .= 'Q'; + break; + + case 'M': + $s .= 'Mon'; + break; + + case 'm': + $s .= 'MM'; + break; + case 'D': + case 'd': + $s .= 'DD'; + break; + + case 'H': + $s.= 'HH24'; + break; + + case 'h': + $s .= 'HH'; + break; + + case 'i': + $s .= 'MI'; + break; + + case 's': + $s .= 'SS'; + break; + + case 'a': + case 'A': + $s .= 'AM'; + break; + + default: + // handle escape characters... + if ($ch == '\\') { + $i++; + $ch = substr($fmt,$i,1); + } + if (strpos('-/.:;, ',$ch) !== false) $s .= $ch; + else $s .= '"'.$ch.'"'; + + } + } + return $s. "')"; + } + + + /* + This algorithm makes use of + + a. FIRST_ROWS hint + The FIRST_ROWS hint explicitly chooses the approach to optimize response time, + that is, minimum resource usage to return the first row. Results will be returned + as soon as they are identified. + + b. Uses rownum tricks to obtain only the required rows from a given offset. + As this uses complicated sql statements, we only use this if the $offset >= 100. + This idea by Tomas V V Cox. + + This implementation does not appear to work with oracle 8.0.5 or earlier. Comment + out this function then, and the slower SelectLimit() in the base class will be used. + */ + function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$arg3=false,$secs2cache=0) + { + // seems that oracle only supports 1 hint comment in 8i + if ($this->firstrows) { + if (strpos($sql,'/*+') !== false) + $sql = str_replace('/*+ ','/*+FIRST_ROWS ',$sql); + else + $sql = preg_replace('/^[ \t\n]*select/i','SELECT /*+FIRST_ROWS*/',$sql); + } + + if ($offset < $this->selectOffsetAlg1) { + if ($nrows > 0) { + if ($offset > 0) $nrows += $offset; + //$inputarr['adodb_rownum'] = $nrows; + if ($this->databaseType == 'oci8po') { + $sql = "select * from ($sql) where rownum <= ?"; + } else { + $sql = "select * from ($sql) where rownum <= :adodb_offset"; + } + $inputarr['adodb_offset'] = $nrows; + $nrows = -1; + } + // note that $nrows = 0 still has to work ==> no rows returned + + return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$arg3,$secs2cache); + } else { + // Algorithm by Tomas V V Cox, from PEAR DB oci8.php + + // Let Oracle return the name of the columns + $q_fields = "SELECT * FROM ($sql) WHERE NULL = NULL"; + if (!$stmt = OCIParse($this->_connectionID, $q_fields)) { + return false; + } + if (is_array($inputarr)) { + foreach($inputarr as $k => $v) { + if (is_array($v)) { + if (sizeof($v) == 2) // suggested by g.giunta@libero. + OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1]); + else + OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1],$v[2]); + } else { + $len = -1; + if ($v === ' ') $len = 1; + if (isset($bindarr)) { // is prepared sql, so no need to ocibindbyname again + $bindarr[$k] = $v; + } else { // dynamic sql, so rebind every time + OCIBindByName($stmt,":$k",$inputarr[$k],$len); + } + } + } + } + + if (!OCIExecute($stmt, OCI_DEFAULT)) { + OCIFreeStatement($stmt); + return false; + } + + $ncols = OCINumCols($stmt); + for ( $i = 1; $i <= $ncols; $i++ ) { + $cols[] = '"'.OCIColumnName($stmt, $i).'"'; + } + $result = false; + + OCIFreeStatement($stmt); + $fields = implode(',', $cols); + $nrows += $offset; + $offset += 1; // in Oracle rownum starts at 1 + + if ($this->databaseType == 'oci8po') { + $sql = "SELECT $fields FROM". + "(SELECT rownum as adodb_rownum, $fields FROM". + " ($sql) WHERE rownum <= ?". + ") WHERE adodb_rownum >= ?"; + } else { + $sql = "SELECT $fields FROM". + "(SELECT rownum as adodb_rownum, $fields FROM". + " ($sql) WHERE rownum <= :adodb_nrows". + ") WHERE adodb_rownum >= :adodb_offset"; + } + $inputarr['adodb_nrows'] = $nrows; + $inputarr['adodb_offset'] = $offset; + + if ($secs2cache>0) return $this->CacheExecute($secs2cache, $sql,$inputarr,$arg3); + else return $this->Execute($sql,$inputarr,$arg3); + } + + } + + /** + * Usage: + * Store BLOBs and CLOBs + * + * Example: to store $var in a blob + * + * $conn->Execute('insert into TABLE (id,ablob) values(12,empty_blob())'); + * $conn->UpdateBlob('TABLE', 'ablob', $varHoldingBlob, 'ID=12', 'BLOB'); + * + * $blobtype supports 'BLOB' and 'CLOB', but you need to change to 'empty_clob()'. + * + * to get length of LOB: + * select DBMS_LOB.GETLENGTH(ablob) from TABLE + * + * If you are using CURSOR_SHARING = force, it appears this will case a segfault + * under oracle 8.1.7.0. Run: + * $db->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT'); + * before UpdateBlob() then... + */ + + function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') + { + switch(strtoupper($blobtype)) { + default: ADOConnection::outp("UpdateBlob: Unknown blobtype=$blobtype"); return false; + case 'BLOB': $type = OCI_B_BLOB; break; + case 'CLOB': $type = OCI_B_CLOB; break; + } + + if ($this->databaseType == 'oci8po') + $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO ?"; + else + $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO :blob"; + + $desc = OCINewDescriptor($this->_connectionID, OCI_D_LOB); + $arr['blob'] = array($desc,-1,$type); + + if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT'); + $commit = $this->autoCommit; + if ($commit) $this->BeginTrans(); + $rs = ADODB_oci8::Execute($sql,$arr); + if ($rez = !empty($rs)) $desc->save($val); + $desc->free(); + if ($commit) $this->CommitTrans(); + if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=FORCE'); + + if ($rez) $rs->Close(); + return $rez; + } + + /** + * Usage: store file pointed to by $var in a blob + */ + function UpdateBlobFile($table,$column,$val,$where,$blobtype='BLOB') + { + switch(strtoupper($blobtype)) { + default: ADOConnection::outp( "UpdateBlob: Unknown blobtype=$blobtype"); return false; + case 'BLOB': $type = OCI_B_BLOB; break; + case 'CLOB': $type = OCI_B_CLOB; break; + } + + if ($this->databaseType == 'oci8po') + $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO ?"; + else + $sql = "UPDATE $table set $column=EMPTY_{$blobtype}() WHERE $where RETURNING $column INTO :blob"; + + $desc = OCINewDescriptor($this->_connectionID, OCI_D_LOB); + $arr['blob'] = array($desc,-1,$type); + + $this->BeginTrans(); + $rs = ADODB_oci8::Execute($sql,$arr); + if ($rez = !empty($rs)) $desc->savefile($val); + $desc->free(); + $this->CommitTrans(); + + if ($rez) $rs->Close(); + return $rez; + } + + /* + Example of usage: + + $stmt = $this->Prepare('insert into emp (empno, ename) values (:empno, :ename)'); + */ + function Prepare($sql) + { + static $BINDNUM = 0; + + $stmt = OCIParse($this->_connectionID,$sql); + + if (!$stmt) return $sql; // error in statement, let Execute() handle the error + + $BINDNUM += 1; + + if (@OCIStatementType($stmt) == 'BEGIN') { + return array($sql,$stmt,0,$BINDNUM,OCINewCursor($this->_connectionID)); + } + + return array($sql,$stmt,0,$BINDNUM); + } + + /* + Call an oracle stored procedure and return a cursor variable. + Convert the cursor variable into a recordset. + Concept by Robert Tuttle robert@ud.com + + Example: + Note: we return a cursor variable in :RS2 + $rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:RS2); END;",'RS2'); + + $rs = $db->ExecuteCursor( + "BEGIN :RS2 = adodb.getdata(:VAR1); END;", + 'RS2', + array('VAR1' => 'Mr Bean')); + + */ + function &ExecuteCursor($sql,$cursorName='rs',$params=false) + { + $stmt = ADODB_oci8::Prepare($sql); + + if (is_array($stmt) && sizeof($stmt) >= 5) { + $this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR); + if ($params) { + reset($params); + while (list($k,$v) = each($params)) { + $this->Parameter($stmt,$params[$k], $k); + } + } + } + return $this->Execute($stmt); + } + + /* + Bind a variable -- very, very fast for executing repeated statements in oracle. + Better than using + for ($i = 0; $i < $max; $i++) { + $p1 = ?; $p2 = ?; $p3 = ?; + $this->Execute("insert into table (col0, col1, col2) values (:0, :1, :2)", + array($p1,$p2,$p3)); + } + + Usage: + $stmt = $DB->Prepare("insert into table (col0, col1, col2) values (:0, :1, :2)"); + $DB->Bind($stmt, $p1); + $DB->Bind($stmt, $p2); + $DB->Bind($stmt, $p3); + for ($i = 0; $i < $max; $i++) { + $p1 = ?; $p2 = ?; $p3 = ?; + $DB->Execute($stmt); + } + + Some timings: + ** Test table has 3 cols, and 1 index. Test to insert 1000 records + Time 0.6081s (1644.60 inserts/sec) with direct OCIParse/OCIExecute + Time 0.6341s (1577.16 inserts/sec) with ADOdb Prepare/Bind/Execute + Time 1.5533s ( 643.77 inserts/sec) with pure SQL using Execute + + Now if PHP only had batch/bulk updating like Java or PL/SQL... + + Note that the order of parameters differs from OCIBindByName, + because we default the names to :0, :1, :2 + */ + function Bind(&$stmt,&$var,$size=4000,$type=false,$name=false) + { + if (!is_array($stmt)) return false; + + if (($type == OCI_B_CURSOR) && sizeof($stmt) >= 5) { + return OCIBindByName($stmt[1],":".$name,$stmt[4],$size,$type); + } + + if ($name == false) { + if ($type !== false) $rez = OCIBindByName($stmt[1],":".$name,$var,$size,$type); + else $rez = OCIBindByName($stmt[1],":".$stmt[2],$var,$size); // +1 byte for null terminator + $stmt[2] += 1; + } else { + if ($type !== false) $rez = OCIBindByName($stmt[1],":".$name,$var,$size,$type); + else $rez = OCIBindByName($stmt[1],":".$name,$var,$size); // +1 byte for null terminator + } + + return $rez; + } + + /* + Usage: + $stmt = $db->Prepare('select * from table where id =:myid and group=:group'); + $db->Parameter($stmt,$id,'myid'); + $db->Parameter($stmt,$group,'group'); + $db->Execute($stmt); + + @param $stmt Statement returned by Prepare() or PrepareSP(). + @param $var PHP variable to bind to + @param $name Name of stored procedure variable name to bind to. + @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8. + @param [$maxLen] Holds an maximum length of the variable. + @param [$type] The data type of $var. Legal values depend on driver. + + See OCIBindByName documentation at php.net. + */ + function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false) + { + if ($this->debug) { + ADOConnection::outp( "Parameter(\$stmt, \$php_var='$var', \$name='$name');"); + } + return $this->Bind($stmt,$var,$maxLen,$type,$name); + } + + /* + returns query ID if successful, otherwise false + this version supports: + + 1. $db->execute('select * from table'); + + 2. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)'); + $db->execute($prepared_statement, array(1,2,3)); + + 3. $db->execute('insert into table (a,b,c) values (:a,:b,:c)',array('a'=>1,'b'=>2,'c'=>3)); + + 4. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)'); + $db->$bind($stmt,1); $db->bind($stmt,2); $db->bind($stmt,3); + $db->execute($stmt); + */ + function _query($sql,$inputarr) + { + if (is_array($sql)) { // is prepared sql + $stmt = $sql[1]; + + // we try to bind to permanent array, so that OCIBindByName is persistent + // and carried out once only - note that max array element size is 4000 chars + if (is_array($inputarr)) { + $bindpos = $sql[3]; + if (isset($this->_bind[$bindpos])) { + // all tied up already + $bindarr = &$this->_bind[$bindpos]; + } else { + // one statement to bind them all + $bindarr = array(); + foreach($inputarr as $k => $v) { + $bindarr[$k] = $v; + OCIBindByName($stmt,":$k",$bindarr[$k],4000); + } + $this->_bind[$bindpos] = &$bindarr; + } + } + } else + $stmt=@OCIParse($this->_connectionID,$sql); + + $this->_stmt = $stmt; + if (!$stmt) return false; + + if (defined('ADODB_PREFETCH_ROWS')) @OCISetPrefetch($stmt,ADODB_PREFETCH_ROWS); + + if (is_array($inputarr)) { + foreach($inputarr as $k => $v) { + if (is_array($v)) { + if (sizeof($v) == 2) // suggested by g.giunta@libero. + OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1]); + else + OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1],$v[2]); + } else { + $len = -1; + if ($v === ' ') $len = 1; + if (isset($bindarr)) { // is prepared sql, so no need to ocibindbyname again + $bindarr[$k] = $v; + } else { // dynamic sql, so rebind every time + OCIBindByName($stmt,":$k",$inputarr[$k],$len); + } + } + } + } + + if (OCIExecute($stmt,$this->_commit)) { + + switch (@OCIStatementType($stmt)) { + case "SELECT" : + return $stmt; + + case "BEGIN" : + if (isset($sql[4])) { + // jlim + $cursor = $sql[4]; + // jlim + if (is_resource($cursor)) { + OCIExecute($cursor); + return $cursor; + } + return $stmt; + } else { + if (!is_array($sql) && is_resource($stmt)) { + OCIFreeStatement($stmt); + return true; + } + return $stmt; + } + break; + default : + // ociclose? + return true; + } + } + return false; + } + + // returns true or false + function _close() + { + if (!$this->autoCommit) OCIRollback($this->_connectionID); + OCILogoff($this->_connectionID); + $this->_stmt = false; + $this->_connectionID = false; + } + + function MetaPrimaryKeys($table, $owner=false,$internalKey=false) + { + if ($internalKey) return array('ROWID'); + + // tested with oracle 8.1.7 + $table = strtoupper($table); + if ($owner) { + $owner_clause = "AND ((a.OWNER = b.OWNER) AND (a.OWNER = UPPER('$owner')))"; + } else $owner_clause = ''; + + $sql = " +SELECT /*+ RULE */ distinct b.column_name + FROM ALL_CONSTRAINTS a + , ALL_CONS_COLUMNS b + WHERE ( UPPER(b.table_name) = ('$table')) + AND (UPPER(a.table_name) = ('$table') and a.constraint_type = 'P') + $owner_clause + AND (a.constraint_name = b.constraint_name)"; + + $rs = $this->Execute($sql); + if ($rs && !$rs->EOF) { + $arr =& $rs->GetArray(); + $a = array(); + foreach($arr as $v) { + $a[] = $v[0]; + } + return $a; + } + else return false; + } + + + + function CharMax() + { + return 4000; + } + + function TextMax() + { + return 4000; + } + + /** + * Quotes a string. + * An example is $db->qstr("Don't bother",magic_quotes_runtime()); + * + * @param s the string to quote + * @param [magic_quotes] if $s is GET/POST var, set to get_magic_quotes_gpc(). + * This undoes the stupidity of magic quotes for GPC. + * + * @return quoted string to be sent back to database + */ + function qstr($s,$magic_quotes=false) + { + $nofixquotes=false; + + + if ($this->noNullStrings && strlen($s)==0)$s = ' '; + if (!$magic_quotes) { + if ($this->replaceQuote[0] == '\\'){ + $s = str_replace('\\','\\\\',$s); + } + return "'".str_replace("'",$this->replaceQuote,$s)."'"; + } + + // undo magic quotes for " + $s = str_replace('\\"','"',$s); + + if ($this->replaceQuote == "\\'") // ' already quoted, no need to change anything + return "'$s'"; + else {// change \' to '' for sybase/mssql + $s = str_replace('\\\\','\\',$s); + return "'".str_replace("\\'",$this->replaceQuote,$s)."'"; + } + } + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordset_oci8 extends ADORecordSet { + + var $databaseType = 'oci8'; + var $bind=false; + var $_fieldobjs; + //var $_arr = false; + + function ADORecordset_oci8($queryID,$mode=false) + { + if ($mode === false) { + global $ADODB_FETCH_MODE; + $mode = $ADODB_FETCH_MODE; + } + switch ($mode) + { + default: + case ADODB_FETCH_NUM: $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break; + case ADODB_FETCH_ASSOC:$this->fetchMode = OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break; + case ADODB_FETCH_DEFAULT: + case ADODB_FETCH_BOTH:$this->fetchMode = OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break; + } + $this->_queryID = $queryID; + } + + + function Init() + { + if ($this->_inited) return; + + $this->_inited = true; + + if ($this->_queryID) { + + $this->_currentRow = 0; + @$this->_initrs(); + $this->EOF = !$this->_fetch(); + if (!is_array($this->fields)) { + $this->_numOfRows = 0; + $this->fields = array(); + } + } else { + $this->fields = array(); + $this->_numOfRows = 0; + $this->_numOfFields = 0; + $this->EOF = true; + } + } + + function _initrs() + { + $this->_numOfRows = -1; + $this->_numOfFields = OCInumcols($this->_queryID); + if ($this->_numOfFields>0) { + $this->_fieldobjs = array(); + $max = $this->_numOfFields; + for ($i=0;$i<$max; $i++) $this->_fieldobjs[] = $this->_FetchField($i); + } + } + + /* Returns: an object containing field information. + Get column information in the Recordset object. fetchField() can be used in order to obtain information about + fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by + fetchField() is retrieved. */ + + function &_FetchField($fieldOffset = -1) + { + $fld = new ADOFieldObject; + $fieldOffset += 1; + $fld->name =OCIcolumnname($this->_queryID, $fieldOffset); + $fld->type = OCIcolumntype($this->_queryID, $fieldOffset); + $fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset); + if ($fld->type == 'NUMBER') { + //$p = OCIColumnPrecision($this->_queryID, $fieldOffset); + $sc = OCIColumnScale($this->_queryID, $fieldOffset); + if ($sc == 0) $fld->type = 'INT'; + } + return $fld; + } + + /* For some reason, OCIcolumnname fails when called after _initrs() so we cache it */ + function &FetchField($fieldOffset = -1) + { + return $this->_fieldobjs[$fieldOffset]; + } + + + // 10% speedup to move MoveNext to child class + function MoveNext() + { + //global $ADODB_EXTENSION;if ($ADODB_EXTENSION) return @adodb_movenext($this); + + if ($this->EOF) return false; + + $this->_currentRow++; + if(@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) + return true; + $this->EOF = true; + + return false; + } + + /* Optimize SelectLimit() by using OCIFetch() instead of OCIFetchInto() */ + function &GetArrayLimit($nrows,$offset=-1) + { + if ($offset <= 0) return $this->GetArray($nrows); + for ($i=1; $i < $offset; $i++) + if (!@OCIFetch($this->_queryID)) return array(); + + if (!@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) return array(); + $results = array(); + $cnt = 0; + while (!$this->EOF && $nrows != $cnt) { + $results[$cnt++] = $this->fields; + $this->MoveNext(); + } + + return $results; + } + + + /* Use associative array to get fields array */ + function Fields($colname) + { + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + + return $this->fields[$this->bind[strtoupper($colname)]]; + } + + + + function _seek($row) + { + return false; + } + + function _fetch() + { + return @OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode); + } + + /* close() only needs to be called if you are worried about using too much memory while your script + is running. All associated result memory for the specified result identifier will automatically be freed. */ + + function _close() + { + OCIFreeStatement($this->_queryID); + $this->_queryID = false; + } + + function MetaType($t,$len=-1) + { + if (is_object($t)) { + $fieldobj = $t; + $t = $fieldobj->type; + $len = $fieldobj->max_length; + } + switch (strtoupper($t)) { + case 'VARCHAR': + case 'VARCHAR2': + case 'CHAR': + case 'VARBINARY': + case 'BINARY': + case 'NCHAR': + case 'NVARCHAR': + case 'NVARCHAR2': + if (isset($this) && $len <= $this->blobSize) return 'C'; + + case 'NCLOB': + case 'LONG': + case 'LONG VARCHAR': + case 'CLOB'; + return 'X'; + + case 'LONG RAW': + case 'LONG VARBINARY': + case 'BLOB': + return 'B'; + + case 'DATE': + return 'D'; + + //case 'T': return 'T'; + + case 'INT': + case 'SMALLINT': + case 'INTEGER': + return 'I'; + + default: return 'N'; + } + } +} +?> \ No newline at end of file Index: trunk/kernel/admin/include/backup.php =================================================================== diff -u --- trunk/kernel/admin/include/backup.php (revision 0) +++ trunk/kernel/admin/include/backup.php (revision 13) @@ -0,0 +1,48 @@ + Index: trunk/themes/default/main/list_favorites.tpl =================================================================== diff -u --- trunk/themes/default/main/list_favorites.tpl (revision 0) +++ trunk/themes/default/main/list_favorites.tpl (revision 13) @@ -0,0 +1,19 @@ + + + + + +

    +
    + + + + + + +

    + + + + +
    \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/toolbar/button.flash.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_catalog.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-odbc_oracle.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-odbc_oracle.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-odbc_oracle.inc.php (revision 13) @@ -0,0 +1,104 @@ +metaTablesSQL) { + $rs = $this->Execute($this->metaTablesSQL); + if ($rs === false) return false; + $arr = $rs->GetArray(); + $arr2 = array(); + for ($i=0; $i < sizeof($arr); $i++) { + $arr2[] = $arr[$i][0]; + } + $rs->Close(); + return $arr2; + } + return false; + } + + function &MetaColumns($table) + { + if (!empty($this->metaColumnsSQL)) { + + $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table))); + if ($rs === false) return false; + + $retarr = array(); + while (!$rs->EOF) { //print_r($rs->fields); + $fld = new ADODBFieldObject(); + $fld->name = $rs->fields[0]; + $fld->type = $rs->fields[1]; + $fld->max_length = $rs->fields[2]; + $retarr[strtoupper($fld->name)] = $fld; + + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + return false; + } + + // returns true or false + function _connect($argDSN, $argUsername, $argPassword, $argDatabasename) + { + global $php_errormsg; + + $php_errormsg = ''; + $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,SQL_CUR_USE_ODBC ); + $this->_errorMsg = $php_errormsg; + + $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'"); + //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); + return $this->_connectionID != false; + } + // returns true or false + function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename) + { + global $php_errormsg; + $php_errormsg = ''; + $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,SQL_CUR_USE_ODBC ); + $this->_errorMsg = $php_errormsg; + + $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'"); + //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); + return $this->_connectionID != false; + } +} + +class ADORecordSet_odbc_oracle extends ADORecordSet_odbc { + + var $databaseType = 'odbc_oracle'; + + function ADORecordSet_odbc_oracle($id) + { + return $this->ADORecordSet_odbc($id); + } +} +?> \ No newline at end of file Index: trunk/themes/default/profile/view_profile.tpl =================================================================== diff -u --- trunk/themes/default/profile/view_profile.tpl (revision 0) +++ trunk/themes/default/profile/view_profile.tpl (revision 13) @@ -0,0 +1,27 @@ + + + + + + + + +


    + + + + + + + + + + + + + +
     
     "> + "> +  
    +
    + Index: trunk/admin/images/smicon4.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/theme_templates.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/theme_templates.php (revision 0) +++ trunk/kernel/admin/include/toolbar/theme_templates.php (revision 13) @@ -0,0 +1,40 @@ + + + + +END; +?> \ No newline at end of file Index: trunk/admin/icons/icon46_conf_regional.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_usertogroup2_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/top_squares.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_image.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_review.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/blush.gif =================================================================== diff -u Binary files differ Index: trunk/compat/str_split.php =================================================================== diff -u --- trunk/compat/str_split.php (revision 0) +++ trunk/compat/str_split.php (revision 13) @@ -0,0 +1,53 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: str_split.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace str_split() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.str_split + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('str_split')) +{ + function str_split ($string, $split_length = 1) + { + if (!is_numeric($split_length)) { + trigger_error('str_split() expects parameter 2 to be long, ' . gettype($split_length) . ' given', E_USER_WARNING); + return false; + } + + if ($split_length < 1) { + trigger_error('str_split() The the length of each segment must be greater then zero', E_USER_WARNING); + return false; + } + + preg_match_all('/.{1,' . $split_length . '}/s', $string, $matches); + return $matches[0]; + } +} + +?> \ No newline at end of file Index: trunk/admin/tree/ftv2mnode.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-odbc.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-odbc.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-odbc.inc.php (revision 13) @@ -0,0 +1,660 @@ +_haserrorfunctions = ADODB_PHPVER >= 0x4050; + $this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200; + } + + function ServerInfo() + { + + if (!empty($this->host) && ADODB_PHPVER >= 0x4300) { + $dsn = strtoupper($this->host); + $first = true; + $found = false; + + if (!function_exists('odbc_data_source')) return false; + + while(true) { + + $rez = odbc_data_source($this->_connectionID, + $first ? SQL_FETCH_FIRST : SQL_FETCH_NEXT); + $first = false; + if (!is_array($rez)) break; + if (strtoupper($rez['server']) == $dsn) { + $found = true; + break; + } + } + if (!$found) return ADOConnection::ServerInfo(); + if (!isset($rez['version'])) $rez['version'] = ''; + return $rez; + } else { + return ADOConnection::ServerInfo(); + } + } + + function ErrorMsg() + { + if ($this->_haserrorfunctions) { + if (empty($this->_connectionID)) return @odbc_errormsg(); + return @odbc_errormsg($this->_connectionID); + } else return ADOConnection::ErrorMsg(); + } + + function CreateSequence($seqname='adodbseq',$start=1) + { + if (empty($this->_genSeqSQL)) return false; + $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname)); + if (!$ok) return false; + $start -= 1; + return $this->Execute("insert into $seqname values($start)"); + } + + var $_dropSeqSQL = 'drop table %s'; + function DropSequence($seqname) + { + if (empty($this->_dropSeqSQL)) return false; + return $this->Execute(sprintf($this->_dropSeqSQL,$seqname)); + } + + /* + This algorithm is not very efficient, but works even if table locking + is not available. + + Will return false if unable to generate an ID after $MAXLOOPS attempts. + */ + function GenID($seq='adodbseq',$start=1) + { + // if you have to modify the parameter below, your database is overloaded, + // or you need to implement generation of id's yourself! + $MAXLOOPS = 100; + //$this->debug=1; + while (--$MAXLOOPS>=0) { + $num = $this->GetOne("select id from $seq"); + if ($num === false) { + $this->Execute(sprintf($this->_genSeqSQL ,$seq)); + $start -= 1; + $num = '0'; + $ok = $this->Execute("insert into $seq values($start)"); + if (!$ok) return false; + } + $this->Execute("update $seq set id=id+1 where id=$num"); + + if ($this->affected_rows() > 0) { + $num += 1; + $this->genID = $num; + return $num; + } + } + if ($fn = $this->raiseErrorFn) { + $fn($this->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num); + } + return false; + } + + function ErrorNo() + { + if ($this->_haserrorfunctions) { + if (empty($this->_connectionID)) $e = @odbc_error(); + else $e = @odbc_error($this->_connectionID); + + // bug in 4.0.6, error number can be corrupted string (should be 6 digits) + // so we check and patch + if (strlen($e)<=2) return 0; + return $e; + } else return ADOConnection::ErrorNo(); + } + + + // returns true or false + function _connect($argDSN, $argUsername, $argPassword, $argDatabasename) + { + global $php_errormsg; + if ($this->debug && $argDatabasename) { + ADOConnection::outp("For odbc Connect(), $argDatabasename is not used. Place dsn in 1st parameter."); + } + $php_errormsg = ''; + if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword); + else $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,$this->curmode); + $this->_errorMsg = $php_errormsg; + if (isset($this->connectStmt)) $this->Execute($this->connectStmt); + + //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); + return $this->_connectionID != false; + } + + // returns true or false + function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename) + { + global $php_errormsg; + $php_errormsg = ''; + if ($this->debug && $argDatabasename) { + ADOConnection::outp("For odbc PConnect(), $argDatabasename is not used. Place dsn in 1st parameter."); + } + // print "dsn=$argDSN u=$argUsername p=$argPassword
    "; flush(); + if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword); + else $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,$this->curmode); + + $this->_errorMsg = $php_errormsg; + if ($this->_connectionID && $this->autoRollback) @odbc_rollback($this->_connectionID); + if (isset($this->connectStmt)) $this->Execute($this->connectStmt); + + return $this->_connectionID != false; + } + + function BeginTrans() + { + if (!$this->hasTransactions) return false; + if ($this->transOff) return true; + $this->transCnt += 1; + $this->_autocommit = false; + return odbc_autocommit($this->_connectionID,false); + } + + function CommitTrans($ok=true) + { + if ($this->transOff) return true; + if (!$ok) return $this->RollbackTrans(); + if ($this->transCnt) $this->transCnt -= 1; + $this->_autocommit = true; + $ret = odbc_commit($this->_connectionID); + odbc_autocommit($this->_connectionID,true); + return $ret; + } + + function RollbackTrans() + { + if ($this->transOff) return true; + if ($this->transCnt) $this->transCnt -= 1; + $this->_autocommit = true; + $ret = odbc_rollback($this->_connectionID); + odbc_autocommit($this->_connectionID,true); + return $ret; + } + + function MetaPrimaryKeys($table) + { + global $ADODB_FETCH_MODE; + + $savem = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + $qid = @odbc_primarykeys($this->_connectionID,'','',$table); + + if (!$qid) { + $ADODB_FETCH_MODE = $savem; + return false; + } + $rs = new ADORecordSet_odbc($qid); + $ADODB_FETCH_MODE = $savem; + + if (!$rs) return false; + $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change; + + $arr =& $rs->GetArray(); + $rs->Close(); + //print_r($arr); + $arr2 = array(); + for ($i=0; $i < sizeof($arr); $i++) { + if ($arr[$i][3]) $arr2[] = $arr[$i][3]; + } + return $arr2; + } + + function &MetaTables() + { + global $ADODB_FETCH_MODE; + + $savem = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + $qid = odbc_tables($this->_connectionID); + + $rs = new ADORecordSet_odbc($qid); + + $ADODB_FETCH_MODE = $savem; + if (!$rs) return false; + + $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change; + + //print_r($rs); + $arr =& $rs->GetArray(); + + $rs->Close(); + $arr2 = array(); + for ($i=0; $i < sizeof($arr); $i++) { + if ($arr[$i][2]) $arr2[] = $arr[$i][2]; + } + return $arr2; + } + +/* +/ SQL data type codes / +#define SQL_UNKNOWN_TYPE 0 +#define SQL_CHAR 1 +#define SQL_NUMERIC 2 +#define SQL_DECIMAL 3 +#define SQL_INTEGER 4 +#define SQL_SMALLINT 5 +#define SQL_FLOAT 6 +#define SQL_REAL 7 +#define SQL_DOUBLE 8 +#if (ODBCVER >= 0x0300) +#define SQL_DATETIME 9 +#endif +#define SQL_VARCHAR 12 + +/ One-parameter shortcuts for date/time data types / +#if (ODBCVER >= 0x0300) +#define SQL_TYPE_DATE 91 +#define SQL_TYPE_TIME 92 +#define SQL_TYPE_TIMESTAMP 93 + +#define SQL_UNICODE (-95) +#define SQL_UNICODE_VARCHAR (-96) +#define SQL_UNICODE_LONGVARCHAR (-97) +*/ + function ODBCTypes($t) + { + switch ((integer)$t) { + case 1: + case 12: + case 0: + case -95: + case -96: + return 'C'; + case -97: + case -1: //text + return 'X'; + case -4: //image + return 'B'; + + case 91: + case 11: + return 'D'; + + case 92: + case 93: + case 9: return 'T'; + case 4: + case 5: + case -6: + return 'I'; + + case -11: // uniqidentifier + return 'R'; + case -7: //bit + return 'L'; + + default: + return 'N'; + } + } + + function &MetaColumns($table) + { + global $ADODB_FETCH_MODE; + + $table = strtoupper($table); + + $savem = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + + if (false) { // after testing, confirmed that the following does not work becoz of a bug + $qid2 = odbc_tables($this->_connectionID); + $rs = new ADORecordSet_odbc($qid2); + $ADODB_FETCH_MODE = $savem; + if (!$rs) return false; + $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change; + $rs->_fetch(); + + while (!$rs->EOF) { + if ($table == strtoupper($rs->fields[2])) { + $q = $rs->fields[0]; + $o = $rs->fields[1]; + break; + } + $rs->MoveNext(); + } + $rs->Close(); + + $qid = odbc_columns($this->_connectionID,$q,$o,strtoupper($table),'%'); + } else switch ($this->databaseType) { + case 'access': + case 'vfp': + case 'db2': + $qid = odbc_columns($this->_connectionID); + break; + + default: + $qid = @odbc_columns($this->_connectionID,'%','%',strtoupper($table),'%'); + if (empty($qid)) $qid = odbc_columns($this->_connectionID); + break; + } + if (empty($qid)) return false; + + $rs = new ADORecordSet_odbc($qid); + $ADODB_FETCH_MODE = $savem; + + if (!$rs) return false; + + //print_r($rs); + $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change; + $rs->_fetch(); + $retarr = array(); + + /* + $rs->fields indices + 0 TABLE_QUALIFIER + 1 TABLE_SCHEM + 2 TABLE_NAME + 3 COLUMN_NAME + 4 DATA_TYPE + 5 TYPE_NAME + 6 PRECISION + 7 LENGTH + 8 SCALE + 9 RADIX + 10 NULLABLE + 11 REMARKS + */ + while (!$rs->EOF) { + //print_r($rs->fields); + if (strtoupper($rs->fields[2]) == $table) { + $fld = new ADOFieldObject(); + $fld->name = $rs->fields[3]; + $fld->type = $this->ODBCTypes($rs->fields[4]); + + // ref: http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraccgen/html/msdn_odk.asp + // access uses precision to store length for char/varchar + if ($fld->type == 'C' or $fld->type == 'X') { + if ($this->databaseType == 'access') + $fld->max_length = $rs->fields[6]; + else if ($rs->fields[4] <= -95) // UNICODE + $fld->max_length = $rs->fields[7]/2; + else + $fld->max_length = $rs->fields[7]; + } else + $fld->max_length = $rs->fields[7]; + $fld->not_null = !empty($rs->fields[10]); + $fld->scale = $rs->fields[8]; + $retarr[strtoupper($fld->name)] = $fld; + } else if (sizeof($retarr)>0) + break; + $rs->MoveNext(); + } + $rs->Close(); //-- crashes 4.03pl1 -- why? + + return $retarr; + } + + function Prepare($sql) + { + if (! $this->_bindInputArray) return $sql; // no binding + $stmt = odbc_prepare($this->_connectionID,$sql); + if (!$stmt) { + // print "Prepare Error for ($sql) ".$this->ErrorMsg()."
    "; + return $sql; + } + return array($sql,$stmt,false); + } + + /* returns queryID or false */ + function _query($sql,$inputarr=false) + { + GLOBAL $php_errormsg; + $php_errormsg = ''; + $this->_error = ''; + + if ($inputarr) { + if (is_array($sql)) { + $stmtid = $sql[1]; + } else { + $stmtid = odbc_prepare($this->_connectionID,$sql); + + if ($stmtid == false) { + $this->_errorMsg = $php_errormsg; + return false; + } + } + if (! odbc_execute($stmtid,$inputarr)) { + //@odbc_free_result($stmtid); + return false; + } + + } else if (is_array($sql)) { + $stmtid = $sql[1]; + if (!odbc_execute($stmtid)) { + //@odbc_free_result($stmtid); + return false; + } + } else + $stmtid = odbc_exec($this->_connectionID,$sql); + + $this->_lastAffectedRows = 0; + if ($stmtid) { + if (@odbc_num_fields($stmtid) == 0) { + $this->_lastAffectedRows = odbc_num_rows($stmtid); + $stmtid = true; + } else { + $this->_lastAffectedRows = 0; + odbc_binmode($stmtid,$this->binmode); + odbc_longreadlen($stmtid,$this->maxblobsize); + } + } + + $this->_errorMsg = $php_errormsg; + return $stmtid; + } + + /* + Insert a null into the blob field of the table first. + Then use UpdateBlob to store the blob. + + Usage: + + $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); + $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1'); + */ + function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') + { + return $this->Execute("UPDATE $table SET $column=? WHERE $where",array($val)) != false; + } + + // returns true or false + function _close() + { + $ret = @odbc_close($this->_connectionID); + $this->_connectionID = false; + return $ret; + } + + function _affectedrows() + { + return $this->_lastAffectedRows; + } + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_odbc extends ADORecordSet { + + var $bind = false; + var $databaseType = "odbc"; + var $dataProvider = "odbc"; + var $useFetchArray; + var $_has_stupid_odbc_fetch_api_change; + + function ADORecordSet_odbc($id,$mode=false) + { + if ($mode === false) { + global $ADODB_FETCH_MODE; + $mode = $ADODB_FETCH_MODE; + } + $this->fetchMode = $mode; + + $this->_queryID = $id; + + // the following is required for mysql odbc driver in 4.3.1 -- why? + $this->EOF = false; + $this->_currentRow = -1; + //$this->ADORecordSet($id); + } + + + // returns the field object + function &FetchField($fieldOffset = -1) + { + + $off=$fieldOffset+1; // offsets begin at 1 + + $o= new ADOFieldObject(); + $o->name = @odbc_field_name($this->_queryID,$off); + $o->type = @odbc_field_type($this->_queryID,$off); + $o->max_length = @odbc_field_len($this->_queryID,$off); + if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name); + else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name); + return $o; + } + + /* Use associative array to get fields array */ + function Fields($colname) + { + if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname]; + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + + return $this->fields[$this->bind[strtoupper($colname)]]; + } + + + function _initrs() + { + global $ADODB_COUNTRECS; + $this->_numOfRows = ($ADODB_COUNTRECS) ? @odbc_num_rows($this->_queryID) : -1; + $this->_numOfFields = @odbc_num_fields($this->_queryID); + // some silly drivers such as db2 as/400 and intersystems cache return _numOfRows = 0 + if ($this->_numOfRows == 0) $this->_numOfRows = -1; + //$this->useFetchArray = $this->connection->useFetchArray; + $this->_has_stupid_odbc_fetch_api_change = ADODB_PHPVER >= 0x4200; + } + + function _seek($row) + { + return false; + } + + // speed up SelectLimit() by switching to ADODB_FETCH_NUM as ADODB_FETCH_ASSOC is emulated + function &GetArrayLimit($nrows,$offset=-1) + { + if ($offset <= 0) return $this->GetArray($nrows); + $savem = $this->fetchMode; + $this->fetchMode = ADODB_FETCH_NUM; + $this->Move($offset); + $this->fetchMode = $savem; + + if ($this->fetchMode & ADODB_FETCH_ASSOC) { + $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); + } + + $results = array(); + $cnt = 0; + while (!$this->EOF && $nrows != $cnt) { + $results[$cnt++] = $this->fields; + $this->MoveNext(); + } + + return $results; + } + + + function MoveNext() + { + if ($this->_numOfRows != 0 && !$this->EOF) { + $this->_currentRow++; + $row = 0; + if ($this->_has_stupid_odbc_fetch_api_change) + $rez = @odbc_fetch_into($this->_queryID,$this->fields); + else + $rez = @odbc_fetch_into($this->_queryID,$row,$this->fields); + if ($rez) { + if ($this->fetchMode & ADODB_FETCH_ASSOC) { + $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); + } + return true; + } + } + $this->fields = false; + $this->EOF = true; + return false; + } + + function _fetch() + { + $row = 0; + if ($this->_has_stupid_odbc_fetch_api_change) + $rez = @odbc_fetch_into($this->_queryID,$this->fields,$row); + else + $rez = @odbc_fetch_into($this->_queryID,$row,$this->fields); + + if ($rez) { + if ($this->fetchMode & ADODB_FETCH_ASSOC) { + $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); + } + return true; + } + $this->fields = false; + return false; + } + + function _close() + { + return @odbc_free_result($this->_queryID); + } + +} + +?> Index: trunk/themes/default/img/ic_test.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ed_list_bullet.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/index/right.tpl =================================================================== diff -u --- trunk/themes/default/index/right.tpl (revision 0) +++ trunk/themes/default/index/right.tpl (revision 13) @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: trunk/admin/cat_select.php =================================================================== diff -u --- trunk/admin/cat_select.php (revision 0) +++ trunk/admin/cat_select.php (revision 13) @@ -0,0 +1,385 @@ +
    "; + +$pathtoroot=""; +if(!strlen($pathtoroot)) +{ + $path=dirname(realpath($_SERVER['SCRIPT_FILENAME'])); + if(strlen($path)) + { + /* determine the OS type for path parsing */ + $pos = strpos($path,":"); + if ($pos === false) + { + $gOS_TYPE="unix"; + $pathchar = "/"; + } + else + { + $gOS_TYPE="win"; + $pathchar="\\"; + } + $p = $path.$pathchar; + /*Start looking for the root flag file */ + while(!strlen($pathtoroot) && strlen($p)) + { + $sub = substr($p,strlen($pathchar)*-1); + if($sub==$pathchar) + { + $filename = $p."root.flg"; + } + else + $filename = $p.$pathchar."root.flg"; + if(file_exists($filename)) + { + $pathtoroot = $p; + } + else + { + $parent = realpath($p.$pathchar."..".$pathchar); + if($parent!=$p) + { + $p = $parent; + } + else + $p = ""; + } + } + if(!strlen($pathtoroot)) + $pathtoroot = ".".$pathchar; + } + else + { + $pathtoroot = ".".$pathchar; + } +} + +$sub = substr($pathtoroot,strlen($pathchar)*-1); +if($sub!=$pathchar) +{ + $pathtoroot = $pathtoroot.$pathchar; +} + +require_once($pathtoroot."kernel/startup.php"); + +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; + +$adminURL = $rootURL.$admin; +$cssURL = $adminURL."/include"; +$imagesURL = $adminURL."/images"; +$browseURL = $adminURL."/browse"; + +$destform = $_GET["destform"]; +$destfield = $_GET["destfield"]; + +RegisterEnv("destform",$destform); +RegisterEnv("destfield",$destfield); +RegisterEnv("source",$_GET["source"]); + +$envar = "env=" . BuildEnv(); + +$m_var_list_update["cat"] = 0; +$homeURL = $_SERVER["PHP_SELF"]."?".$envar; + +if((int)$_GLOBALS["debuglevel"]) + echo $homeURL."
    \n"; +unset($m_var_list_update["cat"]); + +if($objCatList->CurrentCategoryID()>0) +{ + $c = $objCatList->CurrentCat(); + $upURL = $c->Admin_Parent_Link(); +} +else + $upURL = $_SERVER["PHP_SELF"]."?".$envar; + + + +//admin only util + +$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."/browse/toolbar.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot.$value."admin/include/parser.php"; + if(file_exists($path)) + { + //echo ""; + @include_once($path); + } +} + +//Set Section +$section = 'in-portal:catselect'; + +//Set Environment Variable + +//echo $objCatList->ItemsOnClipboard()." Categories on the clipboard
    \n"; +//echo $objTopicList->ItemsOnClipboard()." Topics on the clipboard
    \n"; +//echo $objLinkList->ItemsOnClipboard()." Links on the clipboard
    \n"; +//echo $objArticleList->ItemsOnClipboard()." Articles on the clipboard
    \n"; + +$SearchType = $objSession->GetVariable("SearchType"); +if(!strlen($SearchType)) + $SearchType = "Categories"; +$SearchLabel = "la_SearchLabel"; + +/* page header */ +print << + + In-portal + + +END; + + require_once($pathtoroot.$admin."/include/mainscript.php"); + +print << + + + + + + +END; +int_SectionHeader(); +?> +
    + + + + + + +
    +
    + " ImagePath=""> + " ImagePath=""> + "> + + " ImagePath=""> + " ImagePath=""> + "> + " ImagePath=""> +
    +
    + + + + + + + +
    + + +
    " NAME="admin_search" ID="admin_search">">"> + + + + +
     /icon16_search.gif" alt="" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" src="/arrow16.gif" onmouseover="this.src='/icon16_search_f2.gif'" onmouseout="this.src='/icon16_search.gif'" style="cursor:hand" width="22" width="22"><?php echo admin_language(" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" src="/arrow16.gif" onmouseover="this.src='/arrow16_f2.gif'" onmouseout="this.src='/arrow16.gif'" style="cursor:hand"> + /icon16_search_reset.gif" alt="" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" onmouseover="this.src='/icon16_search_reset_f2.gif'" onmouseout="this.src='/icon16_search_reset.gif'" style="cursor:hand" width="22" width="22">  +
    +
    + +
    +
    + + +QueryOrderByClause(TRUE,TRUE,TRUE); + $objCatList->Clear(); + if($SearchType=="categories" || $SearchType="all") + { + $list = $objSession->GetVariable("SearchWord"); + $SearchQuery = $objCatList->AdminSearchWhereClause($list); + if(strlen($SearchQuery)) + { + $SearchQuery = " (".$SearchQuery.") "; + if(strlen($CatScopeClause)) + $SearchQuery .= " AND ".$CatScopeClause; + $objCatList->LoadCategories($SearchQuery.$CategoryFilter,$OrderBy); + } + else + $objCatList->LoadCategories("ParentId=".$objCatList->CurrentCategoryID()." ".$CategoryFilter,$OrderBy); + } + else + $objCatList->LoadCategories("ParentId=".$objCatList->CurrentCategoryID()." ".$CategoryFilter,$OrderBy); +?> + + + + + + + +
    + + + + + +
    + : (QueryItemCount; ?>)    
    +
     
    + +
    + +
    +
    + +
    +
    + + CurrentCategoryID(),"cat_select_element.tpl"); ?> +
    +
    +
    + +
    +
    + + + + +
    +
    + + + + Index: trunk/admin/logs/summary.php =================================================================== diff -u --- trunk/admin/logs/summary.php (revision 0) +++ trunk/admin/logs/summary.php (revision 13) @@ -0,0 +1,220 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//admin only util + +$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:log_summary'; + +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +//Display header + +$objListToolBar = new clsToolBar(); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass","ListChecks"); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("log_refresh", "la_ToolTip_Refresh","#","swap('log_refresh','toolbar/tool_refresh_f2.gif');", + "swap('log_refresh', 'toolbar/tool_refresh.gif');","window.location.reload(true);", + "tool_refresh.gif", TRUE, TRUE); + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("user_print", "la_ToolTip_Print","#","swap('user_print','toolbar/tool_print_f2.gif');", + "swap('user_print', 'toolbar/tool_print.gif');","window.print();","tool_print.gif"); + +$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();"); + +$objSummary = new clsStatList(); + +$order = $objConfig->Get("Summary_SortOrder"); +$SearchWords = $objSession->GetVariable("SummarySearchWord"); + +$where = 'AdminSummary = 2'; + +$orderBy = trim($objConfig->Get("Summary_SortField")." ".$objConfig->Get("Summary_SortOrder")); + +$objListView = new clsListView($objListToolBar); +$objSummary->Page = $objListView->GetPage(); // $objSession->GetVariable("Page_Summary"); + +//$objSummary->debuglevel = 1; + +$objSummary->ProcessList($where, $orderBy, $SearchWords ? false : true); + +// filter items by $SearchWords varible + +$i = 0; +if($SearchWords) +{ + $bad_ids = Array(); + if( $objSummary->NumItems() > 0 ) $id_field = $objSummary->Items[0]->IdField(); + while($i < $objSummary->NumItems() ) + { + if( !$objSummary->ItemLike($i, $SearchWords) ) + { + $bad_ids[] = $objSummary->Items[$i]->Get( $objSummary->Items[$i]->IdField() ); + $objSummary->DeleteItem($i--); + } + $i++; + } + + $where = sprintf('%s AND (%s NOT IN (%s))', $where, $id_field, implode(',',$bad_ids)); + $objSummary->ProcessList($where, $orderBy, true); +} + +$itemcount = TableCount(GetTablePrefix()."StatItem", $where,0); + + +$objListView->SetListItems($objSummary); + +$objListView->IdField = "StatItemId"; +$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl"; + +$objListView->ColumnHeaders->Add("Module",admin_language("la_prompt_Module"),1,0,$order,"width=\"20%\"","Summary_SortField","Summary_SortOrder","Module"); +$objListView->ColumnHeaders->Add("ListLabel",admin_language("la_prompt_Parameter"),1,0,$order,"width=\"20%\"","Summary_SortField","Summary_SortOrder","ListLabel"); +$objListView->ColumnHeaders->Add("Value",admin_language("la_prompt_Value"),1,0,$order,"width=\"30%\"","Summary_SortField","Summary_SortOrder","Value"); +$objListView->ColumnHeaders->SetSort($objConfig->Get("Summary_SortField"),$order); + +$objListView->PrintToolBar = FALSE; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_summary_search"; +$objListView->CurrentPageVar = "Page_Summary"; +$objListView->PerPageVar = "Perpage_StatItem"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->TotalItemCount = $itemcount; + +//$objListView->RefreshPageVar(); + + $objListView->ConfigureViewMenu("Summary_SortField","Summary_SortOrder","Module", + "",0,0); + +$title = admin_language("la_Showing_Stats")." (".$itemcount.")"; +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
    +PrintList(); ?> + +
    + + +
    + + + + +
    +
    + + +
    + + + + \ No newline at end of file Index: trunk/kernel/parser.php =================================================================== diff -u --- trunk/kernel/parser.php (revision 0) +++ trunk/kernel/parser.php (revision 13) @@ -0,0 +1,3351 @@ +";print_r($pieces);echo ""; + $m_var_list["cat"] = $pieces[0]; + $m_var_list["p"] = $pieces[1]; + $objCatList->Page = $m_var_list["p"]; + + $m_var_list["lang"] = $pieces[2]; + $m_var_list["theme"] = $pieces[3]; + } + else + { + $m_var_list["cat"]=0; + $m_var_list["p"] = 1; + $m_var_list["lang"] = $objLanguages->GetPrimary(); + $m_var_list["theme"]= $objThemes->GetPrimaryTheme(); + } +} + +function m_BuildEnv() +{ + global $m_var_list, $m_var_list_update, $objLanguages; + + $str = ":m"; + + if( is_array($m_var_list_update) ) + foreach($m_var_list_update as $m_var => $m_value) + if($m_value == '0') $m_var_list_update[$m_var] = ''; + + $str .= m_GetVar('cat'); + if( isset($m_var_list_update['cat']) ) unset($m_var_list_update['cat']); + $str .= '-'.m_GetVar('p'); + $str .= '-'.m_GetVar('lang'); + $str .= '-'.m_GetVar('theme'); + + return $str; +} + +function m_GetVar($name) +{ + // get variable from template variable's list + global $m_var_list, $m_var_list_update; + return isset($m_var_list_update[$name]) ? $m_var_list_update[$name] : $m_var_list[$name]; +} + +function &LoadRelatedItems(&$Relations,&$RelatedItems,$ResourceId) +{ + global $objItemTypes; + + if(!is_object($Relations)) + { + $Relations = new clsRelationshipList(); + } + //$Relations->debuglevel = 2; + if ($ResourceId != '') { + $sql = sprintf("SELECT RelationshipId, Type, Enabled, Priority, + IF(TargetId = %1\$s, TargetId, SourceId) AS SourceId, + IF(TargetId = %1\$s, SourceId, TargetId) AS TargetId, + IF(TargetId = %1\$s, TargetType, SourceType) AS SourceType, + IF(TargetId = %1\$s, SourceType, TargetType) AS TargetType + FROM %%s", $ResourceId); + + $where = "((SourceId=$ResourceId) OR (TargetId=$ResourceId AND Type=1)) AND Enabled=1"; + $Relations->LoadRelated($where,"",$sql); + $ids = array(); + if($Relations->NumItems()>0) + { + foreach($Relations->Items as $r) + { + if($r->Get("SourceId")==$ResourceId) + { + $ids[$r->Get("TargetType")][] = $r->Get("TargetId"); + } + if($r->Get("TargetId")==$ResourceId && $r->Get("Type")==1) + { + $ids[$r->Get("SourceType")][] = $ResourceId; + } + } + foreach($ids as $ItemType=>$idlist) + { + $Item =& $objItemTypes->GetItem($ItemType); + $table = GetTablePrefix().$Item->Get("SourceTable"); + if($ItemType!=1) + { + $cattable = GetTablePrefix()."CategoryItems"; + $sql = "SELECT *,CategoryId FROM $table INNER JOIN $cattable ON "; + $sql .=" ($table.ResourceId=$cattable.ItemResourceId) WHERE $table.Status=1 AND PrimaryCat=1 "; + $sql .=" AND ResourceId IN (".implode(",",$ids[$ItemType]).")"; + } + else + { + $sql = "SELECT *,CategoryId FROM $table "; + $sql .="WHERE $table.Status=1 "; + $sql .=" AND ResourceId IN (".implode(",",$ids[$ItemType]).")"; + } + // echo $sql."
    \n"; + $RelatedItems->Query_Item($sql,-1,-1,$ItemType); + } + } + } +} + + +/* + @description: Inserts the html from a remote source + @attrib: _url:: Remote URL to include + @attrib: _StartPos:: Numeric start point of text to include, or string match + @attrib: _EndPos:: Numeric end point of text to include, or string match + @example: +*/ +function m_insert_url($attribs=array()) +{ + global $pathtoroot; + + $url = $attribs["_url"]; + $StartPos = $attribs["_startpos"]; + $EndPos = $attribs["_endpos"]; + + $socket = new Socket($url,0,NULL); + $txt = $socket->socket_read_all(); + $lines = explode("\n",$txt); + $txt = substr($txt,strpos($txt,"<")); + $tmp = strtolower($txt); + $bodypos = strpos($tmp,"0) + { + $head = substr($txt,0,$bodypos-1); + $body = substr($txt,$bodypos); + if(substr($tmp,-7)=="") + $body = substr($body,0,-7); + } + else + $body = $txt; + if(strlen($body)) + { + if(strlen($StartPos)) + { + if(!is_numeric($StartPos)) + { + $start = strpos($body,$StartPos); + } + else + $start = (int)$StartPos; + } + else + $start = 0; + if(strlen($EndPos)) + { + if(!is_numeric($EndPos)) + { + $end = strpos($body,$EndPos,$start) + strlen($EndPos); + } + else + $end = (int)$EndPos; + } + else + $end = NULL; + $o = substr($body,$start,$end-$start); + } + return $o; +} + +/* + @description: Displays a template depending on the login status of the user + @attrib: _logintemplate:tpl: template to display when the user is NOT logged in + @attrib: _LoggedinTemplate:tpl: template to display when the user is logged in + @example: +*/ +function m_loginbox($attribs = array()) +{ + global $var_list, $objSession, $objUsers, $objTemplate; + + $userid = $objSession->Get("PortalUserId"); + $groupid = $objSession->Get("GroupId"); + if ($userid == 0) + { + $t = $objTemplate->ParseTemplate($attribs["_logintemplate"]); + return $t; + } + else + { + $user =& $objUsers->GetItem($userid); + $t = $user->ParseTemplate($attribs["_loggedintemplate"]); + return $t; + } +} +/* + @description: result of suggest site action +*/ +function m_suggest_result() +{ + global $suggest_result; + + return $suggest_result; +} + +/* + @description: result of subscribe to mailing list action +*/ +function m_subscribe_result() +{ + global $SubscribeResult; + + if(strlen($SubscribeResult)) + return language($SubscribeResult); + return ""; +} + +/* + @description: email address of user subscribing to mailing list +*/ +function m_subscribe_address() +{ + global $SubscribeAddress; + + if(strlen($SubscribeAddress)) + return $SubscribeAddress; + return ""; +} + +/* + @description: Error message of subscribe to mailing list action +*/ +function m_subscribe_error() +{ + global $SubscribeError; + + if(strlen($SubscribeError)) + return language($SubscribeError); + return ""; +} + + +/* + @description: Displays a prompt for a form field + @attrib: _Form:: Form name for the field + @attrib: _Field:: Field Name + @attrib: _LangText:lang: Language var to use for field label + @attrib: _plaintext:: Plain text to use for field label (langtext is used by default if both are set) + @attrib: _Template:tpl: template used to display the field label (if not set "" is used + @attrib: _ErrorTemplate:tpl: If the field is in an error state (ie missing input) this template is used. Will default to the normal template if not set +*/ +function m_form_prompt($attribs = array()) +{ + global $FormError, $objTemplate, $objConfig; + + $form = strtolower($attribs["_form"]); + $field = strtolower($attribs["_field"]); + + if($form=="m_register" && ($field=="password" || $field=="passwordverify") && $objConfig->Get("User_Password_Auto")) + { + $o = ""; + } + else + { + $t = $attribs["_template"]; + if(!strlen($t)) + { + $t = ""; + } + $e = $attribs["_errortemplate"]; + if(!strlen($e)) + $e = $t; + if(strlen($attribs["_langtext"])) + { + $txt = language($attribs["_langtext"]); + } + else + $txt = $attribs["_plaintext"]; + + if (strtolower($field) == "dob") + { + if (isset($FormError[strtolower($form)][strtolower($field."_day")]) || isset($FormError[strtolower($form)][strtolower($field."_month")]) || isset($FormError[strtolower($form)][strtolower($field."_year")])) + $rawtext = $objTemplate->GetTemplate($e); + } + + if(isset($FormError[strtolower($form)][strtolower($field)])) + { + $rawtext = $objTemplate->GetTemplate($e); + } + else + $rawtext = $objTemplate->GetTemplate($t); + if(is_object($rawtext)) + { + $src = $rawtext->source; + $o = str_replace("",$txt,$src); + } + } + return $o; +} + +/* + @description: Returns text if system is configured to use auto-generated passwords + @attrib:_LangText:lang:Language tag to return + @attrib:_PlainText::Plain text to return (_LangText takes precedece) + @attrib:_Value:bool:Auto Password setting value to match +*/ +function m_autopassword($attribs = array()) +{ + global $objConfig; + if($attribs["_value"]=="true" || $attribs["_value"]==1) + { + $IsAuto = $objConfig->Get("User_Password_Auto"); + } + else + { + $IsAuto = !$objConfig->Get("User_Password_Auto"); + } + + if($IsAuto) + { + if(strlen($attribs["_langtext"])) + { + $ret = language($attribs["_langtext"]); + } + else + $ret = $attribs["_plaintext"]; + if(!$ret) + return "true"; + } + return $ret; +} + +/* + @description: checks if field specified is equals to value specified + @attrib: _Form:: Form name for the field + @attrib: _Field:: Field Name + @attrib: _Value:: Field value to compare to + @example: true +*/ +function m_field_equals($attribs = array()) +{ + global $FormValues; + //print_pre($attribs); + $form = $attribs["_form"]; + $field = $attribs["_field"]; + if(isset($_POST[$field])) + { + $value = $_POST[$field]; + } + else + $value = $FormValues[$form][$field]; + //echo "POST_VALUE: [$value] vs USER_VALUE: [".$attribs['_value']."]
    "; + return $value == $attribs['_value'] ? 1 : ''; +} + +/* + @description: creates an INPUT tag for a form field. All extra attributes are passed to the INPUT tag + @attrib: _Form:: Form name for the field + @attrib: _Field:: Field Name + @attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting + @example: +*/ +function m_form_input($attribs = array()) +{ + global $FormValues, $objConfig; + + $html_attribs = ExtraAttributes($attribs); + $form = $attribs["_form"]; + $field = strtolower($attribs["_field"]); + if(isset($_POST[$field])) + { + $value = $_POST[$field]; + } + else + $value = $FormValues[$form][$field]; + // echo $form.".".$field."=".$value."
    \n"; + if($form=="m_register" && ($field=="password" || $field=="passwordverify") && $objConfig->Get("User_Password_Auto")) + { + $ret = ""; + } + else + { + $ret = ""; + if($attribs["_required"]) + $ret .= ""; + if($attribs["_custom"]) + $ret .= ""; + } + return $ret; +} + +/* + @description: creates an INPUT tag (type checkbox) for a form field. All extra attributes are passed to the INPUT tag + @attrib: _Form:: Form name for the field + @attrib: _Field:: Field Name + @attrib: _Value:bool: If true, the radio button is CHECKED + @attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting + @attrib: _Custom:bool: If set, handled as a custom field + @example: +*/ +function m_form_checkbox($attribs = array()) +{ + global $FormValues, $objConfig; + + $html_attribs = ExtraAttributes($attribs); + $form = $attribs["_form"]; + $field = strtolower($attribs["_field"]); + if(isset($_POST[$field])) + { + $value = (int)$_POST[$field]; + if($value==1) + $checked = " CHECKED"; + } + else + { + $value = (int)$FormValues[$form][$field]; + if($value==1) + $checked=" CHECKED"; + } + //echo $form.".".$field."=".$value."
    \n"; + $ret = ""; + if($attribs["_required"]) + $ret .= ""; + if($attribs["_custom"]) + $ret .= ""; + + return $ret; +} + +/* + @description: creates an INPUT tag (type radio) for a form field. All extra attributes are passed to the INPUT tag + @attrib: _Form:: Form name for the field + @attrib: _Field:: Field Name + @attrib: _Value:: Value assigned to radio button. If the form field value matches this attribute, the radio button is CHECKED + @attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting + @attrib: _Custom:bool: If set, handled as a custom field + @example: +*/ +function m_form_radio($attribs = array()) +{ + global $FormValues, $objConfig; + + $html_attribs = ExtraAttributes($attribs); + $form = $attribs["_form"]; + $field = strtolower($attribs["_field"]); + $val = $attribs["_value"]; + if(isset($_POST[$field])) + { + $value = (int)$_POST[$field]; + if($value==1) + $checked = " CHECKED"; + } + else + { + $value = (int)$FormValues[$form][$field]; + if($value==$val) + $checked=" CHECKED"; + } + //echo $form.".".$field."=".$value."
    \n"; + $ret = ""; + if($attribs["_required"]) + $ret .= ""; + if($attribs["_custom"]) + $ret .= ""; + + return $ret; +} +/* + @description: returns the value for a form field. This may be defaulted by the system or set by a previus submit (as in an error condition) + @attrib: _Form:: Form name for the field + @attrib: _Field:: Field Name + @example: +*/ +function m_form_value($attribs = array()) +{ + global $FormValues; + + $form = $attribs["_form"]; + $field = strtolower($attribs["_field"]); + + if(isset($_POST[$field])) + { + $value = stripslashes($_POST[$field]); + } + else + $value = stripslashes($FormValues[$form][$field]); + //echo "
    "; print_r($FormValues); echo "
    "; + return $value; +} + +/* + @description: creates an form OPTION tag for a form SELECT tag. + All extra attributes are passed to the OPTION tag. + @attrib: _Form:: Form name for the field + @attrib: _Field:: Field Name + @attrib: _Value:: Value to use for this option (ie the value attribute) If the current value of the select + field is the same as this attribute, then this option will be set SELECTED. + @attrib: _langtext:lang: language tag to display for this option in the SELECT dropdown + @attrib: _plaintext:: plain text to display for this option in the SELECT dropdown (if _langtext is set, it is used instead of _plaintext) + @example: $txt"; + + return $o; +} + +/* + @description: creates an form TEXTAREA field. All extra attributes are passed to the TEXTAREA tag + @attrib: _Form:: Form name for the field + @attrib: _Field:: Field Name + @attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting + @attrib: _Custom:bool: If set, handled as a custom field + @example: +*/ +function m_form_textarea($attribs = array()) +{ + global $FormValues; + $html_attribs = ExtraAttributes($attribs); + $field = $attribs["_field"]; + $form = $attribs["_form"]; + if(isset($_POST[$field])) + { + $value = stripslashes($_POST[$field]); + } + else + $value = stripslashes($FormValues[$attribs["_form"]][$field]); + $ret = ""; + if($attribs["_required"]) + $ret .= ""; + if($attribs["_custom"]) + $ret .= ""; + return $ret; +} + +/* + @description: creates an form field to upload images. (INPUT type=file) All extra attributes are passed to the INPUT tag + @attrib: _Form:: Form name for the field + @attrib: _Field:: Field Name + @attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting + @attrib: _ImageTypes:: Comma-separated list of file extensions allowed + @attrib: _Thumbnail:bool: If true, image is treated as a thumbnail + @attrib: _ImageName:: System name of image being uploaded + @attrib: _MaxSize:int: Maximum size of image to upload, or 0 to allow all +*/ +function m_form_imageupload($attribs = array()) +{ + $html_attribs = ExtraAttributes($attribs); + $field = $attribs["_field"]; + $form = $attribs["_form"]; + $TypesAllowed = $attribs["_imagetypes"]; + $isthumb = (int)$attribs["_thumbnail"]; + $imgname = $attribs["_imagename"]; + $maxsize = $attribs["_maxsize"]; + + $ret = ""; + $ret .= ""; + $ret .= ""; + $ret .= ""; + $ret .= ""; + if($attribs["_required"]) + $ret .= ""; + return $ret; +} + +/* + @description: Returns the error text for a form field, or nothing if no error exists for the field + @attrib: _Form:: Form name for the field + @attrib: _Field:: Field Name +*/ +function m_form_error($attribs = array()) +{ + global $FormError; + + $form = $attribs["_form"]; + $field = $attribs["_field"]; + + return $FormError[$form][$field]; +} + +/** + @description: Provides a simple solution for displaying a language flag when a form has an error. Generic and limited to 1 language vairable. + @attrib: _Form:: Form name for the field +*/ +function m_form_has_errors($attribs = array()) +{ + // shows specified template once if form has error(-s) + global $FormError; + $f = $attribs["_form"]; + + $ret = is_array($FormError[$f]); + if(!$ret) return ''; + return isset($attribs["_asif"]) ? true : language('lu_errors_on_form'); +} + +/** + @description: Lists form errors for all fields in a form + @attrib: _Form:: Form name for the field + @attrib: _ItemTemplate:tpl: Template used to display each form error (if not set, "" is used) +*/ +function m_list_form_errors($attribs = array()) +{ + global $FormError, $content_set, $objTemplate; + + $t = $attribs["_itemtemplate"]; + if(!strlen($t)) + $t = ""; + $f = $attribs["_form"]; + $o = ""; + $rawtext = $objTemplate->GetTemplate($t,true); + $src = $rawtext->source; + //echo $f."
    "; + //echo $t."
    "; + //echo "
    "; print_r($FormError); echo "
    "; + if(is_array($FormError[$f])) + { + foreach($FormError[$f] as $e) + { + $o .= str_replace("",$e,$src); + } + } + if(!strlen($o)) + $content_set = 0; + return $o; +} + +function m_form_load_values($FormName,$IdValue) +{ + global $FormValues, $objUsers, $objSession, $objConfig; + + switch($FormName) + { + case "m_acctinfo": + $u =& $objUsers->GetItem($IdValue); + $FormValues[$FormName]["username"] = $u->Get("Login"); + //$FormValues[$FormName]["password"] = $u->Get("Password"); + //$FormValues[$FormName]["passwordverify"] = $u->Get("Password"); + + $FormValues[$FormName]["password"] = ""; + $FormValues[$FormName]["passwordverify"] = ""; + + $FormValues[$FormName]["firstname"] = $u->Get("FirstName"); + $FormValues[$FormName]["lastname"] = $u->Get("LastName"); + $FormValues[$FormName]["email"] = $u->Get("Email"); + $FormValues[$FormName]["phone"] = $u->Get("Phone"); + $FormValues[$FormName]["street"] = $u->Get("Street"); + $FormValues[$FormName]["city"] = $u->Get("City"); + $FormValues[$FormName]["state"] = $u->Get("State"); + $FormValues[$FormName]["zip"] = $u->Get("Zip"); + $FormValues[$FormName]["country"] = $u->Get("Country"); + +// $FormValues[$FormName]["dob"] = LangDate($u->Get("dob")); + $FormValues[$FormName]["dob_day"] = date("d", $u->Get("dob")); + $FormValues[$FormName]["dob_year"] = date("Y", $u->Get("dob")); + $FormValues[$FormName]["dob_month"] = date("m", $u->Get("dob")); + + $u->LoadCustomFields(); + if(is_array($u->CustomFields->Items)) + { + foreach($u->CustomFields->Items as $f) + { + $FormValues[$FormName][$f->Get("FieldName")] = $f->Get("Value"); + } + } + break; + case "m_profile": + $u =& $objUsers->GetItem($IdValue); + if(is_object($u)) + { + $FormValues[$FormName]["pp_firstname"] = $objSession->GetPersistantVariable("pp_firstname"); + $FormValues[$FormName]["pp_lastname"] = $objSession->GetPersistantVariable("pp_lastname"); + $FormValues[$FormName]["pp_dob"] = $objSession->GetPersistantVariable("pp_dob"); + $FormValues[$FormName]["pp_email"] = $objSession->GetPersistantVariable("pp_email"); + $FormValues[$FormName]["pp_phone"] = $objSession->GetPersistantVariable("pp_phone"); + $FormValues[$FormName]["pp_street"] = $objSession->GetPersistantVariable("pp_street"); + $FormValues[$FormName]["pp_city"] = $objSession->GetPersistantVariable("pp_city"); + $FormValues[$FormName]["pp_state"] = $objSession->GetPersistantVariable("pp_state"); + $FormValues[$FormName]["pp_zip"] = $objSession->GetPersistantVariable("pp_zip"); + $FormValues[$FormName]["pp_country"] = $objSession->GetPersistantVariable("pp_country"); + } + break; + case "m_simplesearch": + $FormValues[$FormName]["keywords"] = $objSession->GetVariable("Search_Keywords"); + break; + case "m_simple_subsearch": + $FormValues[$FormName]["keywords"] = $objSession->GetVariable("Search_Keywords"); + break; + + } +} + +/* + @description: Generates the ACTTION property for a FORM tag used by In-Portal + @attrib: _Template:tpl: If set, this is the template the form submits to (default is the current template) + @attrib: _Form:: The form name
    Possible Values: +
      +
    • login: user login +
    • logout: user logout +
    • forgotpw: Form to prompt the user for forgotten password information +
    • forgotpw_confirm: confirmation form for forgotpw +
    • suggest: form to suggest the site to a friend +
    • suggest_confirm: form to confirm suggestion of the site to a friend +
    • m_subscribe: form to subscribe to the mailing list +
    • subscribe_confirm: form to confirm subscription to the mailing list +
    • m_unsubscribe: form to unsubscribe from the mailing list +
    • unsubscribe_confirm: form to confirm un-subscription from the mailing list +
    • m_acctinfo: user account information +
    • m_profile: system-level profile information +
    • m_register: New User registration form +
    • m_addcat: Suggest Category form +
    • m_addcat_confirm: Confirmation for add category +
    • m_simplesearch: Perform a simple search +
    • m_simple_subsearch: Search within results +
    • m_adv_searchtype: Form to select type of advanced search +
    • m_adv_subsearch: Advanced Search +
    • error_access: form displayed on the access denied template +
    • error_template: Form displayed on the template error page +
    • m_set_theme: Form displayed for theme selection +
    + @attrib: _SubscribeTemplate:tpl: The destination template with "m_subscribe", "subscribe_confirm", "unsubscribe_confirm" _Form actions. Can be reused in other scenarios as programmed. + @attrib: _UnSubscribeTemplate:tpl: The destination template for "m_subscribe" _Form action. Can be reused in other scenarios as programmed. + @attrib: _ConfirmTemplate:tpl: The destination template for "m_unsubscribe", "suggest" _Form actions. Can be reused in other scenarios as programmed. + @attrib: _DestTemplate:tpl: The destination template for "suggest_confirm", "suggest" _Form actions. Can be reused in other scenarios as programmed. + @attrib: _ErrorTemplate:tpl: The destination template extensively used in most of _Form actions in case of error. + @attrib: _Referer:bool: The destination template will be taken from referer page we can from. + + @example:
    "> +*/ +function m_form_action($attribs = array()) +{ + global $var_list, $var_list_update, $m_var_list_update, $objSession, $objConfig, $objCatList; + + $target_template = $attribs["_template"]; + if(strlen($target_template)) + { + $var_list_update["t"] = $target_template; + } + else + $var_list_update["t"] = $var_list["t"]; + + $ret = ""; + $form = strtolower($attribs["_form"]); + switch($form) + { + case "login": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_login"; + if($attribs["_successtemplate"]) + { + $ret .= "&dest=".$attribs["_successtemplate"]; + } + else + if(strlen($var_list["dest"])) + $ret .= "&dest=".$var_list["dest"]; + } + break; + case "logout": + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_logout"; + break; + case "forgotpw": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + if(strlen($attribs["_errortemplate"])) + { + $err = $attribs["_errortemplate"]; + } + else + $err = $var_list["t"]; + $ret = GetIndexURL()."?env=".BuildEnv()."&Action=m_forgotpw&error=$err"; + } + break; + case "forgotpw_confirm": + $ret = GetIndexURL()."?env=".BuildEnv(); + break; + case "suggest": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_suggest_email"; + if(strlen($attribs["_confirmtemplate"])>0) + { + $ret .= "&Confirm=".$attribs["_confirmtemplate"]; + } + if(strlen($Dest)) + { + $ret .= "&DestTemplate=$Dest"; + } + else + { + if(strlen($attribs["_confirmtemplate"])>0) + $ret .="&DestTemplate=".$var_list["t"]; + } + + if(strlen($attribs["_errortemplate"])>0) + { + $ret .= "&Error=".$attribs["_errortemplate"]; + } + } + break; + case "suggest_confirm": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + if(strlen($_GET["DestTemplate"])) + { + $var_list_update["t"] = $_GET["DestTemplate"]; + } + else + $var_list_update["t"] = "index"; + + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + break; + case "m_subscribe": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_subscribe_confirm"; + if(strlen($attribs["_subscribetemplate"])) + { + $ret .="&Subscribe=".$attribs["_subscribetemplate"]; + } + + if(strlen($attribs["_unsubscribetemplate"])>0) + { + $ret .= "&Unsubscribe=".$attribs["_unsubscribetemplate"]; + } + if(strlen($attribs["_errortemplate"])>0) + { + $ret .= "&Error=".$attribs["_errortemplate"]; + } + } + break; + + case "subscribe_confirm": + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_subscribe"; + if($attribs["_subscribetemplate"]) + $ret .= "&Subscribe=".$attribs["_subscribetemplate"]; + break; + case "unsubscribe_confirm": + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_unsubscribe"; + if($attribs["_subscribetemplate"]) + $ret .= "&Subscribe=".$attribs["_subscribetemplate"]; + break; + case "m_unsubscribe": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_unsubscribe"; + if(strlen($attribs["_confirmtemplate"])>0) + { + $ret .= "&Confirm=".$attribs["_confirmtemplate"]; + } + if(strlen($Dest)) + { + $ret .= "&DestTemplate=$Dest"; + } + else + { + if(strlen($attribs["_confirmtemplate"])>0) + $ret .="&DestTemplate=".$var_list["t"]; + } + } + + if(strlen($attribs["_confirmtemplate"])>0) + { + $ret .="&ErrorTemplate=".$attribs["_confirmtemplate"]; + } + + + break; + case "m_unsubscribe_confirm": + $ret = GetIndexURL()."?env=" . BuildEnv(); + break; + case "m_acctinfo": + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_acctinfo&UserId=".$objSession->Get("PortalUserId"); + m_form_load_values($form, $objSession->Get("PortalUserId")); + break; + case "m_profile": + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_profile&UserId=".$objSession->Get("PortalUserId"); + m_form_load_values($form,$objSession->Get("PortalUserId")); + break; + + case "m_set_theme": + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_set_theme"; + break; + + case "m_register": + + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_register"; + + switch ($objConfig->Get("User_Allow_New")) + { + case "1": + if(strlen($attribs["_confirmtemplate"]) && $objConfig->Get("User_Password_Auto")) + $_dest = "&dest=".$attribs["_confirmtemplate"]; + else + $_dest = "&dest=".$attribs["_logintemplate"]; + break; + + case "2": + if(strlen($attribs["_notallowedtemplate"])) + $_dest = "&dest=".$attribs["_notallowedtemplate"]; + break; + + case "3": + if(strlen($attribs["_pendingtemplate"])) + $_dest = "&dest=".$attribs["_pendingtemplate"]; + break; + } + + if (strlen($_dest)) + $ret .= $_dest; + } + break; + + case "register_confirm": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + break; + case "m_addcat": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $action = "m_add_cat"; + if ($objSession->HasCatPermission("CATEGORY.ADD.PENDING")) + { + if(strlen($attribs["_confirmpending"])) + { + $ConfirmTemplate = $attribs["_confirmpending"]; + } + else + $ConfirmTemplate = $attribs["_confirm"]; + $action="m_add_cat_confirm"; + } + + if ($objSession->HasCatPermission("CATEGORY.ADD")) + { + $ConfirmTemplate = $attribs["_confirm"]; + $action="m_add_cat_confirm"; + } + + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=$action"; + if(strlen($ConfirmTemplate)) + $ret .= "&Confirm=$ConfirmTemplate"; + + if (strlen($attribs["_mod_finishtemplate"])) { + + $CurrentCat = $objCatList->CurrentCategoryID(); + if((int)$CurrentCat>0) + { + $c = $objCatList->GetCategory($CurrentCat); + + //will prefix the template with module template root path depending on category + $ids = $c->GetParentIds(); + $tpath = GetModuleArray("template"); + $roots = GetModuleArray("rootcat"); + + // get template path of module, by searching for moudle name + // in this categories first parent category + // and then using found moudle name as a key for module template paths array + $path = $tpath[array_search ($ids[0], $roots)]; + $t = $path . $attribs["_mod_finishtemplate"]; + } + else { + $t = $attribs["_mod_finishtemplate"]; //Just in case + } + } + else { + $t = $attribs["_finishtemplate"]; + } + + $ret .="&DestTemplate=".$t; + } + break; + case "m_addcat_confirm": + $target_template = $_GET["DestTemplate"]; + if(strlen($target_template)) + { + $var_list_update["t"] = $target_template; + } + else + $var_list_update["t"] = $var_list["t"]; + $ret = GetIndexURL()."?env=".BuildEnv(); + break; + case "m_simplesearch": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_simple_search"; + + if(strlen($attribs["_errortemplate"])) + $ret.= "&Error=".$attribs["_errortemplate"]; + + m_form_load_values($form, 0); + } + break; + case "m_simple_subsearch": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_simple_subsearch"; + m_form_load_values($form,0); + } + break; + case "m_adv_search_type": + if(!$objSession->SessionEnabled()) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_advsearch_type"; + m_form_load_values($form,0); + } + break; + case "m_adv_search": + $SearchType = $_GET["type"]; + if(!is_numeric($SearchType)) + $SearchType = $_POST["itemtype"]; + if(!$objSession->SessionEnabled() && !strlen($SearchType)) + { + $var_list_update["t"] = "error_session"; + $ret = GetIndexURL()."?env=" . BuildEnv(); + } + else + { + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=m_adv_search&type=$SearchType"; + m_form_load_values($form,0); + } + break; + + case "error_access": + $target_template = $_GET["DestTemplate"]; + if(!strlen($target_template)) + $target_template="login"; + $var_list_update["t"] = $target_template; + + $ret = GetIndexURL()."?env=" . BuildEnv(); + break; + + case "error_template": + + $target_template = $_GET["DestTemplate"]; + + if($attribs["_referer"] == 1) + { + $target_template = "_referer_"; + } + elseif (!strlen($target_template)) + { + $target_template = "index"; + } + + $var_list_update["t"] = $target_template; + +// $m_var_list_update["cat"]=0; + + $ret = GetIndexURL()."?env=".BuildEnv(); + + break; + + } + return $ret; +} + +/* + @description: creates a URL to allow the user to log out. Accepts the same attributes as m_template_link + +*/ +function m_logout_link($attribs) +{ + $ret = m_template_link($attribs)."&Action=m_logout"; + return $ret; +} + +/* + @description: returns a URL to the current theme + @attrib: _page:: Additional address to be added to the end of the theme URL +*/ +function m_theme_url($attribs=array()) +{ + global $objConfig,$objSession, $objThemes, $CurrentTheme; + + if(!is_object($CurrentTheme)) + $CurrentTheme = $objThemes->GetItem($m_var_list["theme"]); + + $theme_url = "http://". ThisDomain().$objConfig->Get("Site_Path")."themes/".$CurrentTheme->Get("Name")."/"; + if($attribs["_page"]) { + if ($attribs["_page"] != 'current') { + $theme_url .= $attribs["_page"]; + } + else { + $theme_url = "http://".ThisDomain().$objConfig->Get("Site_Path")."index.php?env=".BuildEnv(); + } + } + return $theme_url; +} + +/* + @description: returns a URL to the current theme +*/ +function m_current_page_url($attribs=array()) +{ + global $objConfig,$objSession; + + $theme_url = "http://".ThisDomain().$objConfig->Get("Site_Path")."index.php?env=".BuildEnv(); + + return $theme_url; +} + +/* + @description: returns a URL to the current theme + @attrib: _fullpath:bool: Append the title with the full path of the current category + @attrib: _currentcategory:bool: Append the title with the current category + @attrib: _catfield:: If _currentcategory is used, this attribute determines which category field to use (Name, Description, etc) Defaults to Name +*/ +function m_page_title($attibs = array()) +{ + global $objConfig, $objCatList; + + $ret = $objConfig->Get("Site_Name"); + if($attibs["_fullpath"] || $attribs["_currentcategory"]) + { + $CurrentCat = $objCatList->CurrentCategoryID(); + if((int)$CurrentCat>0) + { + $c = $objCatList->GetCategory($CurrentCat); + if($attribs["_fullpath"]) + { + $path = $c->Get("CachedNavbar"); + + if(strlen($path)) + $ret .= " - ".$path; + } + else + { + if($attribs["_currentcategory"]) + { + $f = $attribs["_catfield"]; + if(!strlen($f)) + $f = "Name"; + $ret .= " - ".$c->Get($f); + } + } + } + } + return $ret; +} + +/* + @description: list all active themes + @attrib: _ItemTemplate:tpl: Template to display each theme in the list +*/ +function m_list_themes($attribs=array()) +{ + global $objThemes; + + $t = $attribs["_itemtemplate"]; + if(strlen($t)) + { + $objThemes->Clear(); + $objThemes->LoadThemes("Enabled=1","PrimaryTheme DESC"); + + foreach($objThemes->Items as $theme) + { + $o .= $theme->ParseTemplate($t); + } + } + return $o; +} + +/* + @description: display text based on the user's language + @attrib: _Phrase:lang: label to replace with language-specific text + @example: +*/ +function m_language($attribs) +{ + global $objSession, $objLanguages, $ForceLanguage; + + $phrase = $attribs["_phrase"]; + $LangId = (int)$ForceLanguage; + if(strlen($phrase)) + { + $lang = $attribs["_language"]; + if(strlen($lang)) + { + $l = $objLanguages->GetItemByField("PackName",$lang); + if(is_object($l)) + { + $LangId = $l->Get("LanguageId"); + } + } + return language($phrase,$LangId); + } + else + return ""; +} + +/* + @description: Creates a URL used to set the current language for a user + @attrib: _language:: Language to set (this value should be the language Pack Name) +*/ +function m_setlang_link($attribs) +{ + global $m_var_list_update, $objSession,$objLanguages; + + $lang = $attribs["_language"]; + if(strlen($lang)) + { + $l = $objLanguages->GetItemByField("PackName",$lang); + if(is_object($l)) + $LangId = $l->Get("LanguageId"); + } + else + $LangId=$objSession->Get("Language"); + if($LangId) + { + $m_var_list_update["lang"] = $LangId; + $ret = GetIndexURL()."?env=".BuildEnv(); + unset($m_var_list_update["lang"]); + } + else + $ret = ""; + return $ret; +} + +/* + @description: list all active languages + @attrib: _ItemTemplate:tpl: Template to display each language in the list +*/ +function m_list_languages($attribs) +{ + global $objLanguages, $content_set; + + $sql = "SELECT * FROM ".GetTablePrefix()."Language WHERE Enabled=1"; + $objLanguages->Clear(); + $objLanguages->Query_Item($sql); + + if($objLanguages->NumItems()>0) + { + foreach($objLanguages->Items as $l) + $o .= $l->ParseTemplate($attribs["_itemtemplate"]); + } + else + $content_set=0; + return $o; +} + +/* + @description: returns the date format for a language + @attrib: _lang:: Pack Name of language to use. The current language is used if this is not set +*/ +function m_lang_dateformat($attribs=array()) +{ + global $objLanguages, $objSession; + + $lang = $attribs["_lang"]; + if(!strlen($lang)) + { + $LangId = $objSession->Get("Language"); + $l = $objLanguages->GetItem($LangId); + } + else + { + $l = $objLanguages->GetItemByField("PackName",$lang); + } + $fmt = GetDateFormat($LangId); + $fmt = GetStdFormat($fmt); + + return $fmt; +} + +/* + @description: returns a language field value + @attrib: _Field:: Language field to return + @attrib: _lang:: Pack Name of language to use. The current language is used if this is not set +*/ +function m_lang_field($attribs = array()) +{ + global $objLanguages, $objSession; + + if(!strlen($attribs["_field"])) + return ""; + $lang = $attribs["_lang"]; + if(!strlen($lang)) + { + $LangId = $objSession->Get("Language"); + $l = $objLanguages->GetItem($LangId); + } + else + { + $l = $objLanguages->GetItemByField("PackName",$lang); + } + if(is_object($l)) + { + //$ret = $l->Get($attribs["_field"]); + $e = new clsHtmlTag(); + $e->name=$l->TagPrefix; + $e->attributes=$attribs; + $ret = $l->ParseObject($e); + } + return $ret; +} + +/* + @description: Creates a URL used to set the current theme for a user + @attrib: _theme:: Name of Theme to set. The template selected in the new them is always "index" +*/ +function m_settheme_link($attribs) +{ + global $m_var_list_update, $objSession, $objThemes, $CurrentTheme; + + $ThemeName = $attribs["_theme"]; + + if(strlen($ThemeName)) + { + $t = $objThemes->GetItemByField("Name",$ThemeName); + if(is_object($t)) + { + $Id = $t->Get("ThemeId"); + } + else + $Id = 0; + } + else + { + $t = $CurrentTheme; + $Id = 0; + } + $m_var_list_update["theme"] = $Id; + $ret = GetIndexURL()."?env=".BuildEnv(); + unset($m_var_list_update["theme"]); + return $ret; +} + + +function m_init_cats($attribs = array()) +{ + // save current & previous category (used in pagination) + global $objSession, $objCatList; + global $var_list; + //echo "SID_INIT: ".$var_list["sid"].'(COOKIE_SID: '.$_COOKIE["sid"].')
    '; + $objSession->SetVariable('prev_category', $objSession->GetVariable('last_category') ); + $objSession->SetVariable('last_category', $objCatList->CurrentCategoryID() ); + + //$last_cat = $objSession->GetVariable('last_category'); + //$prev_cat = $objSession->GetVariable('prev_category'); + //echo "Last CAT: [$last_cat]
    "; + //echo "Prev CAT: [$prev_cat]
    "; +} + +/* + @description: List all subcategories a user is allowed to view + @attrib: _columns:int: Numver of columns to display the categories in (defaults to 1) + @attrib: _maxlistcount:int: Maximum number of categories to list + @attrib: _FirstItemTemplate:tpl: Template used for the first category listed + @attrib: _LastItemTemplate:tpl: Template used for the last category listed + @attrib: _ItemTemplate:tpl: default template used for category list items + @attrib: _NoTable:bool: If set to 1, the categories will not be listed in a table. If a table is used, all HTML attributes are passed to the TABLE tag + @example: +*/ +function m_list_cats($attribs = array()) +{ + global $var_list, $objConfig, $objSession, $objCatList, $var_list_update, $content_set, $objSystemCache; + + $CachedList = GetTagCache("kernel","m_list_cats",$attribs,m_BuildEnv()); + if(strlen($CachedList)) + { + return $CachedList; + } + $cols = $attribs["_columns"]; + if($cols<1) + $cols =1; + $CategoryId = $attribs["_catid"]; + if(!is_numeric($CategoryId)) + $CategoryId = $objCatList->CurrentCategoryID(); + + $cat_count = (int)$attribs["_maxlistcount"]; + /* validation */ + if(strlen($attribs["_itemtemplate"])==0) + { + if($attribs["dataexists"]) + $content_set = 0; + return ""; + } + + $GroupList = $objSession->Get("GroupList"); + if(strlen($GroupList)) + { + $Groups = explode(",",$GroupList); + } + $acl_where = ""; + if(@count($Groups)>0 && is_array($Groups)) + { + $acl_where = array(); + for($i=0;$iClear(); + $OrderBy = $objCatList->QueryOrderByClause(TRUE,TRUE,TRUE); + $objCatList->LoadCategories("ParentId=$CategoryId AND Status=1",$OrderBy); + if ($objCatList->NumItems() == 0) + { + if($attribs["_dataexists"]) + $content_set = 0; + return ""; + } + + $html_attr = ExtraAttributes($attribs); + + $o=""; + $notable = $attribs["_notable"]; + + $count=0; + $row=0; + $var_list_update["t"] = $var_list["t"]; + + if(!$notable) + { + $per_row = ceil($objCatList->NumItems()/$cols); + $o = ""; + $o .= ""; + $o .= "\n
    "; + $CatCount = $objCatList->NumItems(); + foreach($objCatList->Items as $cat) + { + $parsed=0; + if($count==$per_row) + { + $o .= ""; + $count=0; + } + if($row==0 && strlen($attribs["_firstitemtemplate"])) + { + $o.= $cat->ParseTemplate($attribs["_firstitemtemplate"]); + $parsed=1; + } + if($row==$CatCount-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0) + { + $o .= $cat->ParseTemplate($attribs["_lastitemtemplate"]); + $parsed=1; + } + if(!$parsed) + $o.= $cat->ParseTemplate($attribs["_itemtemplate"]); + $count++; + $row++; + } + if($count != $per_row) + $o .= "
    \n"; + } + else + { + $CatCount = $objCatList->NumItems(); + foreach($objCatList->Items as $cat) + { + if($cat->Get("ParentId")==$CategoryId) + { + if($row==0 && strlen($attribs["_firstitemtemplate"])) + { + $o.= $cat->ParseTemplate($attribs["_firstitemtemplate"]); + $parsed=1; + } + if($row==$CatCount-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0) + { + $o .= $cat->ParseTemplate($attribs["_lastitemtemplate"]); + $parsed=1; + } + if(!$parsed) + $o .= $cat->ParseTemplate($attribs["_itemtemplate"]); + + $row++; + $i++; + $count++; + if($count>=$cat_count && $cat_count>0) + break; + } + } + } + unset($var_list_update["t"]); + SaveTagCache("kernel","m_list_cats",$attribs,m_BuildEnv(),$o); + return $o; +} + +function LoadCatSearchResults($attribs) +{ + global $objSession, $objPermissions, $objCatList, $objSearchCats, $objConfig, $CountVal; + + $GroupList = $objSession->Get("GroupList"); + if(strlen($GroupList)) + $Groups = explode(",",$GroupList); + $acl_where = ""; + if(@count($Groups)>0 && is_array($Groups)) + { + $acl_where = array(); + for($i=0;$iGetPermId("CATEGORY.VIEW"); + $ctable = $objCatList->SourceTable; + $stable = $objSession->GetSearchTable(); // $objSearchCats->SourceTable; + $ptable = GetTablePrefix()."PermCache"; + $sql = "SELECT * FROM $stable INNER JOIN $ctable ON ($stable.ItemId=$ctable.CategoryId) "; + $sql .= "INNER JOIN $ptable ON ($ctable.CategoryId=$ptable.CategoryId) "; + $sql .="WHERE ItemType=1 AND Status=1 AND $acl_where AND PermId=$CAT_VIEW ORDER BY EdPick DESC,Relevance DESC "; + $objSearchCats->Page = $m_var_list["p"]; + if($objSearchCats->Page<1) + $objSearchCats->Page=1; + + if(is_numeric($objConfig->Get($objSearchCats->PerPageVar))) + { + $Start = ($objSearchCats->Page-1)*$objConfig->Get($objSearchCats->PerPageVar); + $limit = "LIMIT ".$Start.",".$objConfig->Get($objSearchCats->PerPageVar); + } + else + $limit = NULL; + + if(strlen($limit)) + $sql .= $limit; + + // echo "TEST:
    $sql
    \n"; + $objSearchCats->Query_Item($sql); + $where = "ItemType=1"; + + if(is_numeric($CountVal[1])) + { + $objSearchCats->QueryItemCount = $CountVal[1]; + } + else + { + $objSearchCats->QueryItemCount = QueryCount($sql); + $CountVal[1]= $objSearchCats->QueryItemCount; + } +} + +/* + @description: Used in conjuction with m_search_list_cats. This function generates a navigation link which is + used to switch from a short list to a longer list. The page number is not changed. + If this tag is called before the list tag, this function will load the category list. + Generally, it is good practice to duplicate all attributes set for m_search_list_cats. + Any extra HTML attributes are passed to the anchor tag + @attrib: _Template:tpl: Template to link to + @attrib: _text:lang: language tag to include as text for the anchor tag + @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence + if both are included. + @attrib: _image:: URL to an image to include inside the anchor tag. +*/ +function m_search_cat_more($attribs = array()) +{ + global $objSearchCats, $objConfig, $m_var_list_update; + + $html_attribs = ExtraAttributes($attribs); + $DestTemplate = $attribs["_template"]; + + if($attribs["_shortlist"]) + $objSearchList->PerPageVar = "Perpage_Category_Short"; + if($objSearchCats->NumItems()==0) + { + LoadCatSearchResults($attribs); + } + $max = $objConfig->Get($objSearchList->PerPageVar); + $val = $objSearchCats->QueryItemCount; + if($val > $max) + { + if($attribs["_root"]) + $attribs["_category"]=0; + + $m_var_list_update["p"]=1; + $url = m_template_link($attribs); + unset($m_var_list_update["p"]); + $o = ""; + $text = $attribs["_text"]; + if(!strlen($text)) + { + $text = $attribs["_plaintext"]; + if(!strlen($text)) + { + } + $o .= $text.""; + } + else + $o .= language($text); + if(strlen($attribs["_image"])) + { + $o .= ""; + } + $o .= ""; + } + return $o; +} +/* + @description: Used in conjuction with m_search_list_cats. This function generates the page navigation + for the list. If this tag is called before the list tag, this function will load + the category list. Generally, it is good practice to duplicate all attributes set for + m_search_list_cats. + @attrib: _PagesToList:int: Number of pages to list (default is 10) + @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages + listed, this text will not be included (resulting in an empty output) +*/ +function m_search_cat_pagenav($attribs = array()) +{ + global $objSearchCats, $objConfig, $objCatList, $objSession; + + $DestTemplate = $attribs["_template"]; + $PagesToList = $attribs["_pagestolist"]; + if(!is_numeric($PagesToList)) + $PagesToList = 10; + + $CatId = $attribs["_catid"]; + if(!is_numeric($CatId)) + $CatId = $objCatList->CurrentCategoryID(); + + $objSearchCats->PerPageVar = "Perpage_Category"; + if($attribs["_shortlist"]) + $objSearchCats->PerPageVar = "Perpage_Category_Short"; + if($objSearchCats->NumItems()==0) + { + LoadCatSearchResults($attribs); + } + $o = $objSearchCats->GetPageLinkList($DestTemplate); + if(strlen($o) && strlen($attribs["_label"])) + $o = language($attribs["_label"]).$o; + return $o; +} + +/* + @description: List all categories matched in a search + @attrib: _columns:int: Numver of columns to display the categories in (defaults to 1) + @attrib: _maxlistcount:int: Maximum number of categories to list + @attrib: _ShortList:bool: If set, the Perpage_Category_Short setting is used instead of Perpage_Category + @attrib: _FirstItemTemplate:tpl: Template used for the first category listed + @attrib: _LastItemTemplate:tpl: Template used for the last category listed + @attrib: _ItemTemplate:tpl: default template used for category list items + @attrib: _NoTable:bool: If set to 1, the categories will not be listed in a table. If a table is used, all HTML attributes are passed to the TABLE tag + @example: +*/ +function m_search_list_cats($attribs = array()) +{ + global $var_list, $objConfig, $objSession, $objCatList, $var_list_update, $content_set, + $objSearchCats, $objPermissions, $m_var_list; + + if(!is_object($objSearchCats)) + { + $objSearchCats = new clsCatList(); + $objSearchCats->SourceTable="ses_".$objSession->GetSessionKey()."_Search"; + $objSearchCats->Clear(); + } + $objSearchCats->PerPageVar = "Perpage_Category"; + if($attribs["_shortlist"]) + { + $objSearchCats->Page=1; + $m_var_list["p"] = 1; + $objSearchCats->PerPageVar = "Perpage_Category_Short"; + } + if($objSearchCats->NumItems()==0) + { + LoadCatSearchResults($attribs); + //echo "Cat count: ". $objSearchCats->QueryItemCount; + $ret = 0; + if ($_POST['keywords']) { + foreach ($objSearchCats->Items as $cat) { + + if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($_POST['keywords'])) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($_POST['keywords']))) { + $ret++; + } + } + } + else { + $ret = $objSearchCats->QueryItemCount; + } + if ($ret == 0) //if ($objSearchCats->NumItems() == 0) + { + $content_set = 0; + return language("lu_no_categories"); + } + } + + $html_attr = ExtraAttributes($attribs); + $cols = $attribs["_columns"]; + if($cols<1) + $cols =1; + $cat_count = (int)$attribs["_maxlistcount"]; + /* validation */ + if(strlen($attribs["_itemtemplate"])==0) + { + $content_set = 0; + return "ERROR -1"; + } + + $o=""; + $notable = $attribs["_notable"]; + + $count=0; + $row=0; + $var_list_update["t"] = $var_list["t"]; + + if(!$notable) + { + $per_row = ceil($objCatList->NumItems()/$cols); + $o = ""; + $o .= ""; + $o .= "\n
    "; + foreach($objSearchCats->Items as $cat) + { + $parsed=0; + if($count==$per_row) + { + $o .= ""; + $count=0; + } + if($row==0 && strlen($attribs["_firstitemtemplate"])) + { + $o.= $cat->ParseTemplate($attribs["_firstitemtemplate"]); + $parsed=1; + } + if($row==$objSearchCats->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0) + { + $o .= $cat->ParseTemplate($attribs["_lastitemtemplate"]); + $parsed=1; + } + if(!$parsed) + $o.= $cat->ParseTemplate($attribs["_itemtemplate"]); + $count++; + } + if($count != $per_row) + $o .= "
    \n"; + } + else + { + //echo "
    "; print_r($objSearchCats->Items); echo "
    "; + foreach($objSearchCats->Items as $cat) + { + $cat->Keywords = GetKeywords($objSession->GetVariable("Search_Keywords")); + $keywords = $objSession->GetVariable("Search_Keywords"); + + //echo "
    "; print_r($objSession->GetVariable("Search_Keywords")); echo "
    "; + //echo $_POST['keywords']."
    "; + //echo $cat->Data['Name']."
    "; + + if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($keywords))) { + if($row==0 && strlen($attribs["_firstitemtemplate"])) + { + $o.= $cat->ParseTemplate($attribs["_firstitemtemplate"]); + $parsed=1; + } + if($row==$objSearchCats->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0) + { + $o .= $cat->ParseTemplate($attribs["_lastitemtemplate"]); + $parsed=1; + } + if(!$parsed) + $o.= $cat->ParseTemplate($attribs["_itemtemplate"]); + $row++; + $i++; + $count++; + } + } + } + unset($var_list_update["t"]); + return $o; +} + +/* + @description: Parse a template based on the current advanced search type + @attrib:_TypeSelect:tpl:Template to parse if no item type has been selected + @attrib:_ItemSelect:tpl:Template to parse if an item type has been selected to search +*/ +function m_advsearch_include($attribs) +{ + global $objTemplate; + + $TypeSelectTemplate = $attribs["_typeselect"]; + $ItemTemplate = $attribs["_itemselect"]; + if((strlen($_GET["type"])>0 || $_POST["itemtype"]>0) && ($_GET["Action"]=="m_advsearch_type" || $_GET["Action"]=="m_adv_search")) + { + $o = $objTemplate->ParseTemplate($ItemTemplate); + } + else + $o = $objTemplate->ParseTemplate($TypeSelectTemplate); + return $o; +} + +/* + @description: Returns the name of the item type currently being advanced searched + @attrib::_plaintext:bool:If set, simply returns the name of the item if not, builds a language tag (lu_searchtitle_[name]) +*/ +function m_advsearch_type($attribs) +{ + global $objItemTypes; + + if($_GET["Action"]=="m_advsearch_type") + { + $ItemType = $_POST["itemtype"]; + } + elseif($_GET["Action"]=="m_adv_search") + $ItemType = $_GET["type"]; + + $o = ""; + if((int)$ItemType>0) + { + $Item = $objItemTypes->GetItem($ItemType); + if(is_object($Item)) + { + $name = strtolower($Item->Get("ItemName")); + if($attribs["_plaintext"]) + { + $o .= $name; + } + else + $o = language("lu_searchtitle_".strtolower($name)); + } + } + return $o; +} + +/* + @description: Lists advanced search fields for the selected item type + @attrib: _FirstItemTemplate:tpl: Template used for the first field listed + @attrib: _LastItemTemplate:tpl: Template used for the last field listed + @attrib: _AltLastItemTemplate:tpl: Altername Template used for the last field listed + @attrib: _ItemTemplate:tpl: default template used for field list items + @attrib: _AltTemplate:tpl: Alternate template used for field list items +*/ +function m_advsearch_fields($attribs) +{ + global $objItemTypes, $objTemplate, $objSearchConfig; + + if(!is_object($objSearchConfig)) + $objSearchConfig = new clsSearchConfigList(); + + if($_GET["Action"]=="m_advsearch_type") + { + $ItemType = $_POST["itemtype"]; + } + elseif($_GET["Action"]=="m_adv_search") + $ItemType = $_GET["type"]; + + $o = ""; + if((int)$ItemType>0) + { + $Item = $objItemTypes->GetItem($ItemType); + if(is_object($Item)) + { + $name = strtolower($Item->Get("ItemName")); + + $table = $Item->Get("SourceTable"); + $sql = "SELECT * FROM ".$objSearchConfig->SourceTable." WHERE TableName='$table' AND AdvancedSearch=1 ORDER BY DisplayOrder"; + $objSearchConfig->Query_Item($sql); + $row=0; + if(is_array($objSearchConfig->Items)) + { + $ItemCount = count($objSearchConfig->Items); + foreach($objSearchConfig->Items as $s) + { + $even = (($row+1) % 2 == 0); + $parsed=0; + if($row==0 && strlen($attribs["_firstitemtemplate"])) + { + $o .= $s->ParseTemplate($attribs["_firstitemtemplate"]); + $parsed=1; + } + if($row==$ItemCount-1 && $even && !$parsed && strlen($attribs["_altlastitemtemplate"])>0) + { + $o .= $s->ParseTemplate($attribs["_altlastitemtemplate"]); + $parsed=1; + } + if($row==$ItemCount-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0) + { + $o .= $s->ParseTemplate($attribs["_lastitemtemplate"]); + $parsed=1; + } + if(!$parsed) + { + if($even && strlen($attribs["_altitemtemplate"])>0) + { + $o .= $s->ParseTemplate($attribs["_altitemtemplate"]); + } + else + $o .= $s->ParseTemplate($attribs["_itemtemplate"]); + } + $row++; + + } + } + } + } + return $o; +} + +/* + @description: create a link to a template based on attributes passed into the tag. All extra HTML attributes + are passed to the anchor tag created. + @attrib: _Template:tpl: Template to link to. Just the template name is listed here. (ex: use "index" instead if "inlink/index") + @attrib: _Module:: Module being linked to (ie In-Bulletin or In-News or In-Link) + @attrib: _perm:: A list of permissions to check. If the user has any of the the permissions in the list, + the link will be generated. (If the _DeniedTemplate attribute is set, this template is used + and the link is created.) + @attrib: _DeniedTemplate:tpl: This template is used if the user does not have a permission listed in the _perm + attribute. If this attirbute is not included and the user does not have access, + nothing is returned. (The link is not created.) + @attrib: _Root:bool: If set, the current category is set to the module's root category + @attrib: _text:lang: language tag to include as text for the anchor tag + @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence + if both are included. + @attrib: _image:: URL to an image to include inside the anchor tag. + @attrib: _image_actions:: Image events. +*/ +function m_module_link($attribs = array()) +{ + global $objCatList, $objSession; + + $permission = $attribs["_perm"]; + $o = ""; + $tpath = GetModuleArray("template"); + if(strlen($permission)) + { + $perms = explode(",",$permission); + $hasperm = FALSE; + for($x=0;$xHasCatPermission($perms[$x])) + { + $hasperm = TRUE; + break; + } + } + } + else + $hasperm = TRUE; + if(!$hasperm && strlen($attribs["_deniedtemplate"])>0) + { + $hasperm = TRUE; + $attribs["_template"]=$attribs["_deniedtemplate"]; + } + if($hasperm) + { + $module = $attribs["_module"]; + if(ModuleEnabled($module)) + { + $t = $tpath[$attribs["_module"]]; + $t .= $attribs["_template"]; + $attribs["_template"] = $t; + $html_attr = ExtraAttributes($attribs); + if($attribs["_root"]) + { + $func = ModuleTagPrefix($module)."_root_link"; + if(function_exists($func)) + { + $url = $func($attribs); + } + else + $url = m_template_link($attribs); + } + else + $url = m_template_link($attribs); + $o = " "; + $text = $attribs["_text"]; + if(!strlen($text)) + { + $text = $attribs["_plaintext"]; + if(!strlen($text)) + { + if(strlen($attribs["_image"])) + { + $text = ""; + } + } + $o .= $text.""; + } + else + $o .= language($text).""; + } + else + { + $o = ""; + } + } + return $o; +} +/* + @description: create a link to a template based on attributes passed into the tag. All extra HTML attributes + are passed to the anchor tag created. + @attrib: _Template:tpl: Template to link to. Just the template name is listed here. (ex: use "index" instead if "inlink/index") + @attrib: _perm:: A list of permissions to check. If the user has any of the the permissions in the list, + the link will be generated. (If the _DeniedTemplate attribute is set, this template is used + and the link is created.) + @attrib: _DeniedTemplate:tpl: This template is used if the user does not have a permission listed in the _perm + attribute. If this attirbute is not included and the user does not have access, + nothing is returned. (The link is not created.) + @attrib: _text:lang: language tag to include as text for the anchor tag + @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence + if both are included. + @attrib: _image:: URL to an image to include inside the anchor tag. +*/ +function m_permission_link($attribs = array()) +{ + global $objCatList, $objSession; + + $permission = $attribs["_perm"]; + $o = ""; + if(strlen($permission)) + { + $perms = explode(",",$permission); + $hasperm = FALSE; + for($x=0;$xHasCatPermission($perms[$x])) + { + $hasperm = TRUE; + break; + } + } + } + else + $hasperm = TRUE; + if(!$hasperm && strlen($attribs["_deniedtemplate"])>0) + { + $hasperm = TRUE; + $attribs["_template"]=$attribs["_deniedtemplate"]; + } + if($hasperm) + { + $url = m_template_link($attribs); + $o = " "; + $text = $attribs["_text"]; + if(!strlen($text)) + { + $text = $attribs["_plaintext"]; + if(!strlen($text)) + { + if(strlen($attribs["_image"])) + { + $text = ""; + } + } + $o .= $text.""; + } + else + $o .= language($text).""; + } + else + { + $o = ""; + } + + return $o; +} + +/* + @description: Create a link to a template. + @attrib: _Template:tpl: Template to link to (ex: "inbulletin/post_list") + @attrib: _Query:str: Extra query sring to be added to link URL (ex: "&test=test") + @attrib: _Category:int: Set the current category to this ID. If not set, the current category is unchanged + @attrib: _anchor:: If included, a local anchor (#) is added. (ex: _anchor="top" results in ) + @attrib: _Secure:bool:If set, creates an https URL + @attrib: _Root:bool:If set, gets module root category id + @attrib: _Module:str:Module Name + @attrib: _Unsecure:bool: Is set, creates an insecure full url (http://...) + @example: "> +*/ +function m_template_link($attribs = array()) +{ + global $var_list, $var_list_update, $m_var_list_update, $objCatList; + + $template = $attribs["_template"]; + + $query = trim($attribs["_query"]); + $query = !ereg("^&", $query)? "&$query" : $query; + + if(!strlen($template)) + $template = $var_list["t"]; + $cat = $attribs["_category"]; + $var_list_update["t"] = $template; + + if(strlen($cat)) + { + if($cat=="NULL") + { + $m_var_list_update["cat"]=0; + } + else + { + $m_var_list_update["cat"] = $cat; + } + } + + if($attribs["_secure"]) + { + $ret = GetIndexURL(1)."?env=".BuildEnv().$query; + } + elseif($attribs["_unsecure"]) + { + $ret = GetIndexURL(2)."?env=".BuildEnv().$query; + } + else + $ret = GetIndexURL()."?env=".BuildEnv().$query; + + if(strlen($attribs["_anchor"])) + $ret .= "#".$attribs["_anchor"]; + unset($var_list_update["t"]); + if(strlen($cat)) + unset($m_var_list_update["cat"]); + return $ret; +} + +/* + @description: create a link to a template based on user permissions. All extra HTML attributes are passed to the anchor tag created. + @attrib: _Template:tpl: Template to link to if the user has access + @attrib: _DeniedTemplate:tpl: This template is used if the user does not have a permission listed in the _perm + attribute. If this attirbute is not included and the user does not have access, + the "login" template is used. + @attrib: _perm:: A list of permissions to check. If the user has any of the the permissions in the list, + the link will be generated. (If the _DeniedTemplate attribute is set, this template is used + and the link is created.) + @attrib: _System:bool: Set this attribute if one of the permissions in the list is a system permission (ie: LOGIN) + @attrib: _Category:int: Set the current category to this ID. If not set, the current category is unchanged + @example: "> +*/ +function m_access_template_link($attribs = array(), $Permission="") +{ + global $var_list, $var_list_update, $m_var_list_update, $objCatList, $objSession; + + $cat = $attribs["_category"]; + if(strlen($cat)) + { + if($cat=="NULL") + $cat = 0; + } + else + $cat = $objCatList->CurrentCategoryID(); + + if(!strlen($Permission)) + { + $Permission = strtoupper($attribs["_perm"]); + } + + $o = ""; + $hasperm = FALSE; + if(strlen($Permission)) + { + $perms = explode(",",$Permission); + + for($x=0;$xHasCatPermission(trim($perms[$x]),$cat)) + { + $hasperm = TRUE; + break; + } + } + + if(!$hasperm && $attribs["_system"]) + { + for($x=0;$xHasSystemPermission(trim($perms[$x]))) + { + $hasperm = TRUE; + break; + } + } + } + } + $access = $attribs["_template"]; + $denied = $attribs["_deniedtemplate"]; + if(!strlen($denied)) + $denied = "login"; + + $m_var_list_update["cat"] = $cat; + if($hasperm) + { + $template = $access; + if(!strlen($template)) + $template = $var_list["t"]; + $var_list_update["t"] = $template; + } + else + { + $template = $denied; + if(!strlen($template)) + $template = $var_list["t"]; + if($template == "login") + { + $dest = $access; + } + $var_list_update["t"] = $template; + } + + $ret = GetIndexURL()."?env=".BuildEnv(); + unset($var_list_update["t"]); + if(strlen($dest)) + $ret .= "&dest=$dest"; + return $ret; +} + +/* + @description: returns a text based on user permissions. Text from inside of the tag will be returned if text attributes are not specified and user has permissions to category, or if _NoPerm attribute set to 1 and user doesn't have permissions. Otherwise entire section will be excluded. + @attrib: _Text:lang: Template to link to if the user has access + @attrib: _PlainText:: This template is used if the user does not have a permission listed in the _perm attribute. If this attirbute is not included and the user does not have access, the "login" template is used. + @attrib: _DenyText:lang: Template to link to if the user has access + @attrib: _PlainDenyText:: This exact text is used if the user does not have a permission listed in the _perm attribute and _DenyText attribute is not set. + @attrib: _perm:: A list of permissions to check. If the user has any of the the permissions in the list, the link will be generated. + @attrib: _System:bool: Set this attribute if one of the permissions in the list is a system permission (ie: LOGIN) + @attrib: _Category:int: Set the current category to this ID. If not set, the current category is unchanged + @attrib: _MatchAllPerms:int: Checks for all listed Permissions to be TRUE. Note: this attribute is rarely used. + @attrib: _NoPerm:int: The whole tag will return inner text if user has no permissions and attribute set to 1. Default value is 0. + @example: Some HTML here! +*/ +function m_perm_text($attribs = array()) +{ + global $var_list, $var_list_update, $m_var_list_update, $objCatList, $objSession; + + $cat = $attribs["_category"]; + if(strlen($cat)) + { + if($cat=="NULL") + $cat = 0; + } + else + $cat = $objCatList->CurrentCategoryID(); + + if(!strlen($Permission)) + { + $Permission = strtoupper($attribs["_perm"]); + } + + $o = ""; + $hasperm = FALSE; + + $count = 0; + + if(strlen($Permission)) + { + $perms = explode(",",$Permission); + + for($x=0;$xHasCatPermission($perms[$x],$cat)) + { + $hasperm = TRUE; + $_AllPermsCount[$count] = 1; +// break; + } + + $count++; + } + + if(!$hasperm && $attribs["_system"]) + { + for($x=0; $xHasSystemPermission($perms[$x])) + { + $hasperm = TRUE; + $_AllPermsCount[$count] = 1; +// break; + } + + $count++; + } + } + } + + if ((int)$attribs["_matchallperms"]) + { + if (count($_AllPermsCount) != array_sum($_AllPermsCount)) + $hasperm = FALSE; + } + + $text = $attribs["_text"]; + $plaintext = $attribs["_plaintext"]; + $denytext = $attribs["_denytext"]; + $plaindenytext = $attribs["_plaindenytext"]; + $nopermissions_status = (int)$attribs["_noperm"]? 1 : 0; + + if(!strlen($denied)) + $denied = "login"; + + if (!$nopermissions_status) + { + if ($hasperm) + { + if (strlen($text) || strlen($plaintext)) + $ret = strlen($text)? language($text) : $plaintext; + else + $ret = "1"; + } + else + $ret = strlen($denytext)? language($denytext) : $plaindenytext; + } + elseif (!$hasperm) + { + $ret = "1"; + } + + return $ret; +} + + +/* + @description: Returns the error string associated with a permission +*/ +function m_permission_error($attribs = array()) +{ + global $objPermissions; + + $ret = ""; + $perm = strtoupper($_GET["error"]); + if(strlen($perm)) + { + $ado = GetADODBConnection(); + $sql = "SELECT * FROM ".GetTablePrefix()."PermissionConfig WHERE PermissionName ='$perm'"; + $rs = $ado->Execute($sql); + if($rs && !$rs->EOF) + { + $data = $rs->fields; + $error_tag = $data["ErrorMessage"]; + } + else + $error_tag = "lu_unknown_error"; + $ret = language($error_tag); + } + return $ret; +} + +/* + @description: Returns the error text encountered when parsing templates +*/ +function m_template_error($attribs = array()) +{ + global $objTemplate; + + $ret = ""; + if($objTemplate->ErrorNo<0) + { + $ret = $objTemplate->ErrorStr; + } + return $ret; +} + +/* + @description: Creates a category navigation bar + @attrib: _Template:tpl: template to use for navigation links + @attrib: _RootTemplate:bool: If set, this template is linked to for the root category + @attrib: _LinkCurrent:bool: If set, the last (current) category is linked. Otherwise the current category is simply displayed + @attrib: _Separator:: text to display between levels of the navigation bar + @attrib: _Root:: Root category configuration variable to use. (ex: Link for In-Link's root category) If not set, the system root is used + @example: +*/ +function m_navbar($attribs = array()) +{ + global $m_var_list_update, $var_list, $objCatList, $objConfig, $objModules; + + $separator = GetElem($attribs, '_separator'); + if(!$separator) $separator = " > "; + + $admin = (int)GetElem($attribs, 'admin'); + + $t = GetElem($attribs, '_template'); + $LinkLeafNode = GetElem($attribs, '_linkcurrent'); + $catid = (int)GetElem($attribs, '_catid'); + + if( GetElem($attribs, '_root') ) + { + $var = GetElem($attribs, '_root')."_Root"; + $Root = (int)$objConfig->Get($var); + } + else + $Root = 0; + + $RootTemplate = GetElem($attribs, '_roottemplate') ? GetElem($attribs, '_roottemplate') : ''; + $Module = GetElem($attribs, '_module'); + $ModuleRootTemplate = ''; + if($Module) + { + $ModuleRootCat = $objModules->GetModuleRoot($Module); + if($ModuleRootCat>0) + { + $modkey = "_moduleroottemplate"; + $ModuleRootTemplate = GetElem($attribs, $modkey); + } + else + $ModuleRootTemplate=""; + } + else + $ModuleRootCat = 0; + + if(!$catid) + $catid = $objCatList->CurrentCategoryID(); + + $ret = $objCatList->cat_navbar($admin, $catid, $t, $separator,$LinkLeafNode,$Root,$RootTemplate,$ModuleRootCat,$ModuleRootTemplate); + return $ret; +} + +/* + @description: Parse a category field and return the value + @attrib: _Field:: Category field to parse + @attrib: _CatId:int: Category ID to parse (uses current category if not set) + @attrib: _StripHTML:bool: if set, all HTML is removed from the output +*/ +function m_category_field($attribs) +{ + global $objCatList; + + $ret = ""; + $catid = (int)$attribs["_catid"]; + $field = $attribs["_field"]; + if(!$catid) + $catid = $objCatList->CurrentCategoryID(); + + if(strlen($field)) + { + $cat =& $objCatList->GetCategory($catid); + if(is_object($cat)) + { + $element = new clsHtmlTag(); + $element->name=$cat->TagPrefix; + $element->attributes = $attribs; + $ret = $cat->ParseObject($element); + } + } + if($attribs["_striphtml"]) + $ret = strip_tags($ret); + return $ret; +} + +/* + @description: returns the date of the last modification to a category + @attrib: _Part:: part of the date to display + @attrib: _Local:bool: If set, only subcategories of the current category is checked + @example: +*/ +function m_category_modified($attribs) +{ + global $objConfig, $objCatList; + + $ado = GetADODBConnection(); + + if($attribs["_local"] && $objCatList->CurrentCategoryID() != 0) + { + $c =& $objCatList->GetItem($objCatList->CurrentCategoryID()); + $catlist = $c->GetSubCatIds(); + + $catwhere = "CategoryId IN (".explode(",",$catlist).")"; + $sql = "SELECT MAX(Modified) as ModDate,MAX(CreatedOn) as NewDate FROM ".GetTablePrefix()."Category "; + $sql .= "INNER JOIN ".GetTablePrefix()."CategoryItems ON (".GetTablePrefix()."Category.ResourceId=".GetTablePrefix()."CategoryItems.ItemResourceId) "; + $sql .= "WHERE $catwhere LIMIT 1"; + } + else + $sql = "SELECT MAX(Modified) as ModDate FROM ".GetTablePrefix()."Category LIMIT 1"; + $rs = $ado->Execute($sql); + if($rs && ! $rs->EOF) + { + $mod = $rs->fields["ModDate"]; + if($mod) + { + $part = strtolower($attribs["_part"]); + if(strlen($part)) + { + $ret = ExtractDatePart($part,$mod); + } + else + { + $ret = LangDate($mod); + } + } + } + return $ret; +} + +/* + @description: creates LINK tags to include all module style sheets + @attrib: _Modules:: Accepts a comma-separated list of modules to include (ie: "In-Link, In-News, In-Bulletin") + @attrib: _*css:none: Each module may set a custom-named stylesheet. For example, for In-Link the attribute would be _In-Linkcss="..". + If a module does not have a *css attribute, the default (style.css) is assumed. + @example: +*/ +function m_module_stylesheets($attribs) +{ + global $TemplateRoot; + + $IncludeList = explode(",",trim($attribs["_modules"])); + $tpath = GetModuleArray("template"); + for($inc=0;$inc\n"; + } + return $ret; +} + +/* + @description: lists items related to a category + @attrib:CatId:int: Category ID of category, or current category if not set + @attrib:_ListItem: Comma-separated list of item types (ie: Link, Topic, Category, News) The items are listed in the order this list provides, then by priority. + Each item should have its own template passed in as an attribute (_{ItemType}Template) +*/ +function m_related_items($attribs) +{ + global $objItemTypes, $objCatList, $content_set; + static $Related; + + global $CatRelations; + + $cat = $attribs["_catid"]; + if(!is_numeric($cat)) + { + $cat = $objCatList->CurrentCategoryID(); + } + $c =& $objCatList->GetCategory($cat); + $data_sent=0; + if(is_object($c)) + { + $ResourceId = $c->Get("ResourceId"); + $IncludeList = explode(",",trim(strtolower($attribs["_listitems"]))); + $o = ""; + + if(!is_object($CatRelations)) + { + $CatRelations = new clsMultiTypeList(); + LoadRelatedItems($Related, $CatRelations,$c->Get("ResourceId")); + } + + if($CatRelations->NumItems()>0) + { + for($inc=0;$incGetTypeByName($item_type); + if(is_object($objType)) + { + foreach($CatRelations->Items as $item) + { + if(is_object($item)) + { + if(strtolower($objType->Get("ItemName")) == strtolower($item_type) && $item->type==$objType->Get("ItemType")) + { + if(strlen($item->BasePermissionName)) + { + $perm = $item->BasePermissionName.".VIEW"; + $haspem = $objSession->HasCatPermission($perm,$item->Get("CategoryId")); + } + else + $hasperm = 1; + + if($hasperm) + { + $data_sent =1; + $classname = $objType->Get("ClassName"); + if(strlen($classname)) + { + $l = new $classname; + $l->Data = $item->Data; + $o .= $l->ParseTemplate($t); + } + } + } + } + $item = NULL; + } + } + else + echo $item_type." not found
    \n"; + } + } + if($data_sent) + { + return $o; + } + else + { + $content_set=0; + return ""; + } + } + else + { + $content_set = 0; + return ""; + } + } + else + { + $content_set = 0; + return ""; + } +} + +/* + @description: Returns the number of items related to the current category + @attrib:_CatId:int: If set, this is the category ID to use, otherwise the current category is used + @attrib:_ItemType::Name of item to count. If not set, all related items are counted +*/ +function m_related_count($attribs) +{ + global $objItemTypes, $objCatList, $content_set; + + $cat = $attribs["_catid"]; + + if(!is_numeric($cat)) + { + $cat = $objCatList->CurrentCategoryID(); + } + $c =& $objCatList->GetCategory($cat); + $data_sent=0; + //echo "Category: $cat
    ";  print_r($c); echo " 
    "; + if(is_object($c)) + { + $ResourceId = $c->Get("ResourceId"); + if(!is_object($CatRelations)) + { + $CatRelations = new clsMultiTypeList(); + LoadRelatedItems($Related, $CatRelations, $c->Get("ResourceId")); + } + + $item_type = $attribs["_itemtype"]; + if(strlen($item_type)) + { + $objType = $objItemTypes->GetTypeByName($item_type); + if(is_object($objType)) + { + $TargetType = $objType->Get("ItemType"); + } + else + $TargetType=""; + } + + if($CatRelations->NumItems()>0) + { + for($x=0;$x<$CatRelations->NumItems();$x++) + { + $a = $CatRelations->GetItemByIndex($x); + if($a->type == $TargetType || !strlen($TargetType)) + { + $count++; + } + } + } + } + return $count; +} + +/* + @description: Returns the MetaKeywords field for a category, or the system MetaKeywords value + if the category doesn't have a value for MetaKeywords + @attrib: _CatId:int: Category to use (The current category is used by default) +*/ +function m_meta_keywords($attribs = array()) +{ + global $objCatList, $objConfig; + $catid = (int)$attribs["_catid"]; + if(!$catid) + { + $catid = $objCatList->CurrentCategoryID(); + } + if($catid) + { + $c = $objCatList->GetItem($catid); + $keywords = $c->Get("MetaKeywords"); + } + if(!strlen($keywords)) + { + $keywords = $objConfig->Get("MetaKeywords"); + } + return $keywords; +} + +/* + @description: Returns the MetaDescription field for a category, or the system MetaDescription value + if the category doesn't have a value for MetaDescription + @attrib: _CatId:int: Category to use (The current category is used by default) +*/ +function m_meta_description($attribs = array()) +{ + global $objCatList, $objConfig; + + $catid = (int)$attribs["_catid"]; + if(!$catid) + { + $catid = $objCatList->CurrentCategoryID(); + } + if($catid) + { + $c = $objCatList->GetItem($catid); + $desc = $c->Get("MetaDescription"); + } + if(!strlen($desc)) + { + $desc = $objConfig->Get("MetaDescription"); + } + return $desc; +} + +/* + @description: return the number of items in the database + @attrib: _ItemType:: Name of item to count + @attrib: _ListType:: Type of item to count (ie: favorites, editor's pick, etc) + @attrib: _CategoryCount:int: Limit scope to the current category + @attrib: _SubCats:bool: Count items in all subcategories (_CategoryCount must be set) + @attrib: _Today:bool: Count items added today + @attrib: _GroupOnly:bool: Only count items the current user can view + @attrib: _NoCache:bool: Count without using cache +*/ +function m_itemcount($attribs = array()) +{ + global $objItemTypes, $objCatList, $objSession, $objCountCache; + + $Bit_None = 0; + $Bit_Today = 1; + $Bit_Owner = 2; + $Bit_Global = 4; + $Bit_SubCats=8; + + if($attribs["_categorycount"]) + { + $evar = m_BuildEnv(); + } + else + $evar = ""; + + $cat = $attribs["_catid"]; + if(!is_numeric($cat)) + { + $cat = $objCatList->CurrentCategoryID(); + } + + if((int)$cat>0) + $c = $objCatList->GetCategory($cat); + + if(is_numeric($attribs["_itemtype"])) + { + $item = $objItemTypes->GetItem($attribs["_itemtype"]); + } + else + $item = $objItemTypes->GetTypeByName($attribs["_itemtype"]); + + $DoUpdate=0; + + //echo "
    "; print_r($item); echo "
    "; + + $ExtraId=""; + + if(is_object($item)) + { + if($item->Get("ItemType")==1) /* counting categories */ + { + $ret = $objCatList->CountCategories($attribs); + } + else + { + $ListVar =& GetItemCollection($attribs["_itemtype"]); + if(is_object($ListVar)) + { + $ret = $ListVar->PerformItemCount($attribs); + } + } + } + else + $ret = 0; + + return $ret; +} + +/* + @description: Parse a User field and return the value + @attrib: _Field:: User field to parse + @attrib: _UserId:int: Category ID to parse (uses current user if not set) +*/ +function m_user_field($attribs) +{ + global $objUsers, $objSession; + + $o = ""; + $userid = $attribs["_userid"]; + if(!is_numeric($userid) || $userid=="0") + $userid = $objSession->Get("PortalUserId"); + + if($userid) + { + $u =& $objUsers->GetItem($userid); + if(is_object($u)) + { + $element = new clsHtmlTag(); + $element->name = $u->TagPrefix; + $element->attributes = $attribs; + $o = $u->ParseObject($element); + } + } + return $o; +} + +/* + @description: Parses a user template + @attrib:_Template:tpl: Template to parse + @attrib:_UserId:int: User ID to parse. If not set, the current user is used +*/ +function m_user_detail($attribs = array()) +{ + global $objTemplate, $objUsers, $objSession; + + $tname = $attribs["_template"]; + $UserId = (int)$attribs["_userid"]; + if(!$UserId) + { + $UserId=$objSession->Get("PortalUserId"); + } + if($UserId>0) + { + $u = $objUsers->GetUser($UserId); + $o = $u->ParseTemplate($tname); + } + else + { + $u = new clsPortalUser(NULL); + $o = $u->ParseTemplate($tname); + } + + return $o; +} + +/* + @description: returns a user field from the current profile being viewed + @example: +*/ +function m_user_profile_field($attribs = array()) +{ + if((int)$_GET["UserId"]) + { + $attribs["_userid"] = $_GET["UserId"]; + } + + $ret = m_user_field($attribs); + +/* if ($ret == '') { + $ret = admin_language("lu_Guest"); + }*/ + + return $ret; +} + +/* + @description: Parses a user profile template + @attrib:_Template:tpl: Template to parse + @attrib:_UserId:int: User ID to parse. If not set, the current user is used +*/ +function m_user_profile_detail($attribs) +{ + if((int)$_GET["UserId"]) + { + $attribs["_userid"] = $_GET["UserId"]; + } + $ret = m_user_detail($attribs); + return $ret; +} + +/* + @description: Lists all user profile fields the user has indicated to be public + @attrib: _ItemTemplate:tpl: Template used to list each field + @example: +*/ +function m_user_profile($attribs = array()) +{ + global $objTemplate, $objUsers; + + $tname = $attribs["_itemtemplate"]; + $t = $objTemplate->GetTemplate($tname); + if(is_object($t)) + { + $html = $t->source; + } + + $userid = $_GET["UserId"]; + $o = ""; + + if((int)$userid>0) + { + $u = $objUsers->GetItem($userid); + $vars = $u->GetAllPersistantVars(); + foreach($vars as $field=>$value) + { + if(substr($field,0,3)=="pp_") + { + if($value==1) + { + $src = $html; + $src = str_replace("","",$src); + $src = str_replace("lu_profile_field","lu_".$field,$src); + $o .= $u->ParseTemplateText($src); + } + } + + } + } + + return $o; +} + +/* + @description: List users the current user has marked as 'friend' + @attrib: _Status:: Determines which online status to list, either "online" or "offline". + @attrib: _ItemTemplate:tpl: Template used to parse list items +*/ +function m_list_friends($attribs = array()) +{ + global $objUsers, $objSession; + + global $online_friends; + + $ado = GetADODBConnection(); + + $status = strtolower($attribs["_status"]); + + $logedin_user = $objSession->Get("PortalUserId"); + $u =& $objUsers->GetUser($logedin_user); + + //echo "
    "; print_r($u); echo "
    "; + if(!isset($online_friends) || $status=="online") + { + $ftable = GetTablePrefix()."Favorites"; + $stable = GetTablePrefix()."UserSession"; + $ptable = GetTablePrefix()."PortalUser"; + if(isset($online_friends)) + { + foreach($online_friends as $id=>$name) + { + $u =& $objUsers->GetUser($id); + $o .= $u->ParseTemplate($attribs["_itemtemplate"]); + } + } + else + { + $sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId,$stable.PortalUserId FROM $ftable "; + $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) INNER JOIN $stable ON "; + $sql .= "($ptable.PortalUserId=$stable.PortalUserId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId']; + //echo $sql; + $rs = $ado->Execute($sql); + while($rs && ! $rs->EOF) + { + $u =& $objUsers->GetItem($rs->fields["PortalUserId"]); + if($status=="online") + { + $o .= $u->ParseTemplate($attribs["_itemtemplate"]); + } + $online_friends[]=$rs->fields["PortalUserId"]; + if(ADODB_EXTENSION>0) + { + adodb_movenext($rs); + } + else + $rs->MoveNext(); + } + } + } + + if($status=="offline") + { + $ftable = GetTablePrefix()."Favorites"; + $stable = GetTablePrefix()."UserSession"; + $ptable = GetTablePrefix()."PortalUser"; + + $sessql = "SELECT DISTINCT(PortalUserId) FROM $stable"; + if(count($online_friends)>0) + { + $sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId FROM $ftable "; + $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND "; + $sql .= " $ptable.PortalUserId NOT IN (".implode(",",$online_friends).") AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId']; + } + else + { + $sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId FROM $ftable "; + $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId']; + } + + //echo $sql; + $rs = $ado->Execute($sql); + while($rs && ! $rs->EOF) + { + $u = $objUsers->GetItem($rs->fields["PortalUserId"]); + $o .= $u->ParseTemplate($attribs["_itemtemplate"]); + if(ADODB_EXTENSION>0) + { + adodb_movenext($rs); + } + else + $rs->MoveNext(); + } + } + $t = $attribs["_itemtemplate"]; + return $o; +} + +/* + @description: Returns the number of users the current user has marked as 'friend' + @attrib: _Status:: Determines which online status to count, either "online" or "offline". +*/ +function m_friend_count($attribs=array()) +{ + global $objUsers, $objSession; + + global $online_friends; + + $ado = GetADODBConnection(); + + $logedin_user = $objSession->Get("PortalUserId"); + $u =& $objUsers->GetUser($logedin_user); + + $status = strtolower($attribs["_status"]); + if(!isset($online_friends) || $status=="online") + { + $ftable = GetTablePrefix()."Favorites"; + $stable = GetTablePrefix()."UserSession"; + $ptable = GetTablePrefix()."PortalUser"; + if(isset($online_friends) && $status="online") + { + return count($online_friends); + } + else + { + $online_friends = array(); + $sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId,$stable.PortalUserId FROM $ftable "; + $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) INNER JOIN $stable ON "; + $sql .= "($ptable.PortalUserId=$stable.PortalUserId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId']; + //echo $sql."
    \n"; + $rs = $ado->Execute($sql); + while($rs && ! $rs->EOF) + { + $online_friends[$rs->fields["PortalUserId"]]=$rs->fields["PortalUserId"]; + if(ADODB_EXTENSION>0) + { + adodb_movenext($rs); + } + else + $rs->MoveNext(); + } + if($status=="online") + return count($online_friends); + } + } + + if($status=="offline") + { + $ftable = GetTablePrefix()."Favorites"; + $stable = GetTablePrefix()."UserSession"; + $ptable = GetTablePrefix()."PortalUser"; + + $sessql = "SELECT DISTINCT(PortalUserId) FROM $stable"; + + if(count($online_friends)>0) + { + $sql = "SELECT count($ftable.ResourceId) as ItemCount FROM $ftable "; + $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND "; + $sql .= " $ptable.PortalUserId NOT IN (".implode(",",$online_friends).") AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId']; + } + else + { + $sql = "SELECT count($ftable.ResourceId) as ItemCount FROM $ftable "; + $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId']; + } + $rs = $ado->Execute($sql); + return $rs->fields["ItemCount"]; + } +} + +/* + @description: Returns the number of users the current user has marked as 'friend' today +*/ +function m_friend_count_today($attribs) +{ + global $objSession; + + $logedin_user = $objSession->Get("PortalUserId"); + + $ret =0; + $ado = GetADODBConnection(); + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $sql = "SELECT count(*) as c FROM ".GetTablePrefix()."Favorites WHERE ItemTypeId=6 and PortalUserId=".$objSession->Get("PortalUserId")." AND Modified>$today"; + $rs = $ado->Execute($sql); + if($rs && !$rs->EOF) + $ret = $rs->fields["c"]; + return $ret; +} + +/* + @description: Returns the number of items in a search result + + @Example: () +*/ +function m_search_item_count($attribs) +{ + global $objItemTypes, $objCatList, $objSession, $CountVal; + + if(!is_array($CountVal)) + $CountVal=array(); + $item = $objItemTypes->GetTypeByName($attribs["_itemtype"]); + if(is_object($item)) + { + $val = $CountVal[$item->Get("ItemType")]; + if(is_numeric($val)) + return $val; + $where = "ItemType=".$item->Get("ItemType"); + $table = $objSession->GetSearchTable(); + $ret = TableCount($table,$where,0); + $CountVal[$item->Get("ItemType")]=(int)$ret; + } + + + return $ret; +} +/* + @description: Returns the number of categories in a search result + @Example: () +*/ +function m_search_cat_count($attribs = array()) +{ + global $objItemTypes, $objCatList, $objSession, $CountVal, $objSearchCats; + + + if(!is_object($objSearchCats)) + { + $objSearchCats = new clsCatList(); + $objSearchCats->SourceTable = $objSession->GetSearchTable(); + $objSearchCats->Clear(); + } + + LoadCatSearchResults($attribs); + //echo "
    "; print_r($objSearchCats->Items); echo "
    "; + $ret = 0; + $keywords = $objSession->GetVariable("Search_Keywords"); + + if ($keywords) { + foreach ($objSearchCats->Items as $cat) { + + if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($keywords))) { + $ret++; + } + } + } + else { + $ret = $objSearchCats->QueryItemCount; + } + + //echo $ret; + //$objSearchCats->QueryItemCount = $ret; + + return $ret; +} + +/* + @description: Returns super global variable by type and name + @attrib: _Name:: Name of variable + @attrib: _Type:: Type super global variable
    Possible Values: +
      +
    • get: $_GET super variable +
    • post: $_POST super variable +
    • cookie: $_COOKIE super variable +
    • env: $_ENV super variable +
    • server: $_SERVER super variable +
    • session: $_SESSION super variable +
    + @Example: +*/ +function m_get_var($attribs = array()) +{ + global $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_SERVER, $_SESSION; + + $type = strtolower($attribs['_type']); + $name = $attribs['_name']; + + switch ($type) + { + case "get": + $vars = $_GET; + break; + case "cookie": + $vars = $_COOKIE; + break; + case "files": + $vars = $_FILES; + break; + case "server": + $vars = $_SERVER; + break; + case "session": + $vars = $_SESSION; + break; + case "env": + $vars = $_ENV; + break; + case "post": + $vars = $_POST; + break; + default : + $vars = $_POST; + break; + } + $ret = $vars[$name]; + + return $ret; +} + +/* + @description: Returns number of users currently on-line + @attrib: _LastActive:: Last user/session activity in seconds + @attrib: _OwnCount:bool: Count user's own session +*/ +function m_users_online($attribs = array()) +{ + global $objSession; + + $LastActive = (int)($attribs['_lastactive']); + $OwnCount = (int)($attribs['_owncount']); + + if ($LastActive && !is_null($LastActive)) + $sql_add = " AND LastAccessed>".(time()-$LastActive); + + if (!$OwnCount || is_null($OwnCount)) + $sql_add.= " AND SessionKey!='".$objSession->GetSessionKey()."'"; + + $ado = GetADODBConnection(); + $sql = "SELECT COUNT(*) AS Counter FROM ".GetTablePrefix()."UserSession WHERE Status=1".$sql_add; + $rs = $ado->Execute($sql); + $ret = ($rs && !$rs->EOF)? $rs->fields["Counter"] : 0; + + return $ret; +} + +?> Index: trunk/admin/textedit/toolbar/link.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_mypreferences46.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/site.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/site.php (revision 0) +++ trunk/kernel/admin/include/toolbar/site.php (revision 13) @@ -0,0 +1,75 @@ + + + + +END; + +?> Index: trunk/admin/images/toolbar/tool_validate_restart_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/_docs/toolbarcustomization.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/_docs/toolbarcustomization.html (revision 0) +++ trunk/admin/editor/FCKeditor/_docs/toolbarcustomization.html (revision 13) @@ -0,0 +1,149 @@ + + + + FCKeditor - Toolbar Customization + + + +

    Toolbar Customization +
    (Revised: 03/08/2003) +
    +
    + The FCKeditor toolbar can be easily customized. You can easily define what + toolbar options are available and even create your custom actions. All you have + to do is configure the fck_config.js file toolbar sets.
    +
    +
    + Configuration File +
    +
    + The file js/fck_config.js holds all configurations and user + customizations for the editor. Here you can define all available toolbar sets + and its definitions. Use the �ToolbarSets � configuration + option to do that.
    +
    + A toolbar set is a group of toolbar items that can be used by a FCKeditor + instance. The editor package comes with 3 sample toolbar sets: Default, + Accessibility and Basic. You can modify or add as many toolbar sets as you + want. +
    +
    + Let�s take a look at the �ToolbarSets� configuration option:

    +
      config.ToolbarSets["ToolBarSetName"] = [        // Toolbar Name
    +      ['Item 1','Item 2','-','Item 3','Item n'],  // 1st Band
    +      ['Item 4','-','Item 5','Item 6','Item n']   // 2nd Band
    +  ] ;
    +
    + As you can see you can add as many toolbar bands as you want. Use a minus (-) + to create a separator.
    +
    + The toolbar items, in the same way, are defined in the js/fck_toolbaritems.js + file. Until the actual version of the editor, these are the available items + names:
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Cut    Bold    Undo
    CopyItalicRedo
    PasteUnderlineInsertOrderedList
    SelectAllStrikeThroughInsertUnorderedList
    RemoveFormatSubscriptFontStyle
    LinkSuperscriptFontFormat
    UnlinkJustifyLeftFont
    ImageJustifyCenterFontSize
    TableJustifyRightTextColor
    RuleJustifyFullBGColor
    SpecialCharOutdentEditSource
    AboutIndent
    +
    +
    + Using the Toolbar Set +
    +
    + All language integration functions allow the developer to set what toolbar set + to use for each FCKeditor instance.
    +
    + In Javascript call the CreateFCKeditor function to create an editor instance + passing the desired ToolbarSet name as a parameter. The function syntax is: +
      CreateFCKEditor(instanceName, width, height, toolbarSetName, initialValue) ;
    + This is a sample that uses �MyToolbar� as the toolbar set to be loaded:
    +
      <SCRIPT language="javascript">
    +  <!--
    +      CreateFCKEditor('MyEditor','100%',150,'MyToolbar','This is a <B>sample</B>.') ;
    +  -->
    +  </SCRIPT>
    + If toolbarSetName is null, the "Default" toolbar set is loaded. + + Index: trunk/admin/editor/FCKeditor/_docs/imagedialog.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/_docs/imagedialog.html (revision 0) +++ trunk/admin/editor/FCKeditor/_docs/imagedialog.html (revision 13) @@ -0,0 +1,71 @@ + + + + FCKeditor - Image Dialog + + + +Image Dialog Options
    (Revised: 04/10/2003)

    + The new image dialog box has been implemented. There are two new useful options + that this document will discuss: image file upload and image repository + browsing.

    +
    + Image File Upload +

    + The editor doesn�t manage the effective file upload system. It is limited to + the editing system. But it can talk to a user custom file upload system. In + this way, the end user (developer) can control and decide what is the better + solution for it�s needs. Someone will save it on the file system. Other in the + database. And another developer need to perform some image manipulations after + the upload is completed. The preferred language is another big problem. So we + let you decide what is the better way to manage it.
    +
    + In any case, some sample working solutions can be found at /FCKeditor_dir/_filemanager/upload. + Attention: all these samples use the folder �/UserImages/� of + your web site to save the uploaded files. So be sure that you have the right + security rights set.
    +
    +
    + If you want to implement your custom one pay attention to these instructions:
    + The posted file is named �FCKeditor_File �. So use this name to + process the request.
    + After you have processed the file, write in the browser something like this:
    +
    +    <SCRIPT language=javascript>
    +        window.opener.setImage('" + sFileURL + "') ;
    +        window.close() ;
    +    </SCRIPT>
    +
    + + This will set the new image in the image dialog box and close your custom page.
    +
    + You can set the desired upload page in the fck_config.js file. + Other upload options are also set there.
    +
    + Only JPG, GIF and PNG +files are allowed.

    Warning: the Image Upload feature is not working over +IE 5.0 (FCKeditor version + 0.9.4 beta).

    +
    + Image Repository Browsing +

    + Like the image upload process, the editor doesn�t manage files on the server. But + in the same way you can define a custom web page to do that work. You can find + some samples at /FCKeditor_dir/_filemanager/browse .
    +
    + If you want to implement your custom browser pay attention to these + instructions:
    + After the user selected the file, write in the browser something like this: +
    +    <SCRIPT language=javascript>
    +        window.setImage('" + sFileURL + "') ;
    +        window.close() ;
    +    </SCRIPT>
    +
    + This will set the new image in the image dialog box and close your custom page.
    +
    + You can set the desired browsing page in the fck_config.js file. Other image +browser options are also set +there. + + Index: trunk/themes/default/img/ed_format_underline.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_usersearch.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_sessions_log.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/tongue.gif =================================================================== diff -u Binary files differ Index: trunk/admin/templates/user_element.tpl =================================================================== diff -u --- trunk/admin/templates/user_element.tpl (revision 0) +++ trunk/admin/templates/user_element.tpl (revision 13) @@ -0,0 +1,8 @@ +
    + + ,
    + + + + + + + +

    + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_new_relation_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_tool_export.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/dialog/fck_selcolor.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/dialog/fck_selcolor.html (revision 0) +++ trunk/admin/editor/FCKeditor/dialog/fck_selcolor.html (revision 13) @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + Highlight: +
    +
    + Selected: +
    + +
    + + Index: trunk/admin/images/toolbar/tool_copy_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/browse/common.js =================================================================== diff -u --- trunk/admin/browse/common.js (revision 0) +++ trunk/admin/browse/common.js (revision 13) @@ -0,0 +1,21 @@ +function flip(val){ + if (val == 0) + return 1; + else + return 0; +} +function config_val (field, val2){ + //alert('Setting ' + field + ' to ' + val2); + document.viewmenu.Action.value = "m_SetVariable"; + document.viewmenu.fieldname.value = field; + document.viewmenu.varvalue.value = val2; + document.viewmenu.submit(); +} + +function session_val(field, val2){ + //alert('Setting ' + field + ' to ' + val2); + document.viewmenu.Action.value = "m_SetSessionVariable"; + document.viewmenu.fieldname.value = field; + document.viewmenu.varvalue.value = val2; + document.viewmenu.submit(); +} Index: trunk/admin/images/toolbar/tool_primary_language_f3.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/socket.php =================================================================== diff -u --- trunk/kernel/include/socket.php (revision 0) +++ trunk/kernel/include/socket.php (revision 13) @@ -0,0 +1,262 @@ +_URL = $URL; + $this->_socket_LinkId = $LinkId; + $this->_socket_LinkValidationId = $LinkValId; + + // parse and prepare url + if (!$this->prepare_url($this->_URL)) + { + $this->_socket_status = SOCKET_URL_ERROR; + return void; + } + + $this->_socket_blocking_status = $objConfig->Get("SocketBlockingMode")? TRUE : FALSE; +// echo "BLOCKING MODE ".$this->_socket_blocking_status; + + + // open new socket connection + // $this->socket_connect($this->_socket); + } + + ## Prepare URL + function prepare_url($url) + { + // preg_match("|^([^:]+)://([^:/]+)(:[\d]+)*(.*)|", $url, $url_data); + if(!ereg("^http://",$url) && !ereg("^https://",$url) || ereg("^ftp://",$url)) + $url = "http://".$url; + + $url_data = parse_url($url); + + $this->_url_host = $url_data['host']; + $this->_url_query = $url_data['query']; + $this->_url_path = empty($url_data['path'])? "/" : $url_data['path']; + $this->_url_user = $url_data['user']; + $this->_url_password = $url_data['pass']; + + if (empty($url_data['schema']) || ($url_data['schema'] == "http")) + { + $this->_url_port = 80; + $this->_url_method = HTTP_version; + } + elseif ($url_data['schema'] == "https") + { + $this->_url_port = 443; + $this->_url_method = HTTPS_version; + } + + $ret = (strlen($this->_url_host) && strlen($this->_url_path) && strlen($this->_url_port))? TRUE : FALSE; + + return $ret; + } + + ## Prepare URL REQUEST + function prepare_url_request() + { + if (strlen(trim($this->_url_query))) + $request_path = $this->_url_path."?".$this->_url_query; + else + $request_path = $this->_url_path; + + $headers = HTTP_method." ".$request_path." ".$this->_url_method."\r\nHost: ".$this->_url_host."\r\nConnection: Close\r\n"; + if(!empty($this->agent)) + $headers.= "User-Agent: ".$this->agent."\r\n"; + /* + if(!empty($this->_url_host) && !isset($this->rawheaders['Host'])) + $headers.= "Host: ".$this->_url_host."\r\n"; + */ + if(!empty($this->accept)) + $headers.= "Accept: ".$this->accept."\r\n"; + if(!empty($this->referer)) + $headers.= "Referer: ".$this->referer."\r\n"; + + if(!empty($this->rawheaders)) + { + if(!is_array($this->rawheaders)) + $this->rawheaders = (array)$this->rawheaders; + while(list($headerKey,$headerVal) = each($this->rawheaders)) + { + $headers.= $headerKey.": ".$headerVal."\r\n"; + } + } + + if(!empty($this->_url_user) || !empty($this->_url_password)) + $headers.= "Authorization: Basic ".base64_encode($this->_url_user.":" . $this->_url_password)."\r\n"; + + $headers.= "\r\n"; + + if (!empty($headers)) + $this->_socket_request_line = $headers; + + return void; + } + + ## Open connection to server through socket + function socket_connect(&$fp) + { + $fp = @fsockopen($this->_url_host, $this->_url_port, $errno, $errstr, SOCKET_STREAM_TIMEOUT); + $this->_socket_status = $fp? SOCKET_OPENED : SOCKET_OPEN_ERROR; + + if ($this->_socket_status == SOCKET_OPENED) + $this->_socket_set_blocking($this->_socket, $this->_socket_blocking_status); + return void; + } + + ## Close opened connection + function socket_disconnect() + { + if ($this->_socket) + $this->_socket = @fclose($this->_socket); + $this->_socket_status = SOCKET_CLOSED; + + return void; + } + + ## Set socket connection type (blocking/non-blocking:deafult) + function _socket_set_blocking(&$fp, $status) + { + @set_socket_blocking($fp, $status); + return void; + } + + function socket_read_all() + { + if ($this->_socket_status != SOCKET_URL_ERROR) + { + $this->socket_connect($this->_socket); + if ($this->_socket_status == SOCKET_OPENED) + { + // Prepare URL request + $this->prepare_url_request(); + + // Write to socket + $this->_socket_status = SOCKET_WRITE; + if (!$this->socket_write($this->_socket_request_line)) + { + $ret = ""; + } + + // Read from socket + $this->_socket_status = SOCKET_READ; + $start_time = getmicrotime(); + + while(!feof($this->_socket)) + { + $this->socket_read(FALSE); + $elapsed = getmicrotime() - $start_time; + if($elapsed > 10000) + { + $ret = ""; + break; + } + } + $ret = $this->_socket_output; + } + } + return $ret; + } + + ## Read from socket + function socket_read($NewLine = TRUE) + { + $data = @fread($this->_socket, MaxLinelen); + + if (strlen($data)) + { + $this->_socket_output_last_line = $data; + $this->_socket_output.= $data; + if($NewLine) + $this->_socket_output .= "\n"; + } + else + $this->_socket_output_last_line = FALSE; + + $this->_socket_read_status = !strlen($data)? FALSE : TRUE; + + return $this->_socket_output_last_line; + } + + ## Write to socket + function socket_write($data) + { + $ret = @fwrite($this->_socket, $data, strlen($data)); + $this->_socket_write_status = $ret; + return $ret; + } + + ## Parse Output + function parse_output($line, $type = 1) + { + if ($type == 1) // To get the page status + { + if(eregi("HTTP/1.(.) ([0-9]*) (.*)", $line, $parts)) + { + + $result = ($parts[2] < "400")? 1 : 0; + $this->_socket_return_code = $parts[2]; + $this->_socket_status = SOCKET_COMPLETED; + $this->_validation_status = $result? TRUE : FALSE; + } + } + elseif ($type == 2) // To get the entire page + { + + } + + return void; + } + +} +?> \ No newline at end of file Index: trunk/admin/icons/icon24_conf_themes.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/.xvpics/icon16_search_dropdown.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_headmiddle.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/images/tab_right.gif =================================================================== diff -u Binary files differ Index: trunk/admin/backup/restore4.php =================================================================== diff -u --- trunk/admin/backup/restore4.php (revision 0) +++ trunk/admin/backup/restore4.php (revision 13) @@ -0,0 +1,136 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$adminURL = $rootURL.$admin; +$localURL=$rootURL."kernel/"; +$imagesURL = $rootURL."admin/images"; +//admin only util +$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"); + + +$error = $objSession->GetVariable("restore_error"); +$objSession->SetVariable("restore_error",""); +$success=0; +$success=$objSession->GetVariable("restore_success"); +$objSession->SetVariable("restore_success",0); + +$section = "in-portal:restore"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); + +if (true) +{ + if(true) + { + + $var="?env=".BuildEnv()."&en=$en_prev"; + $link=$adminURL."/backup/restore1.php".$var; + + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + + if(true) + { + $MouseOver=""; + $MouseOut=""; + $onClick=""; + $link="#"; + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),"#","","","","tool_next_f3.gif"); + } + int_header($objCatToolBar,NULL,$title); +} +?> + +"> + + + + > + + + + + > + + + + + + +
    + +
    + + + + +
    + Index: trunk/admin/editor/FCKeditor/images/smiley/fun/sors.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/editgroup_permissions.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/editgroup_permissions.php (revision 0) +++ trunk/kernel/admin/include/toolbar/editgroup_permissions.php (revision 13) @@ -0,0 +1,41 @@ + + + + +END; +?> Index: trunk/admin/users/adduser_groups.php =================================================================== diff -u --- trunk/admin/users/adduser_groups.php (revision 0) +++ trunk/admin/users/adduser_groups.php (revision 13) @@ -0,0 +1,323 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} +unset($objEditItems); +$objEditItems = new clsUserManager(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); +$objEditItems->EnablePaging = FALSE; +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); + +$c = $objEditItems->GetItemByIndex($en); + +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_edit_user"; + +/* -------------------------------------- Section configuration ------------------------------------------- */ +$section = 'in-portal:edituser_groups'; +$sec = $objSections->GetSection($section); +$envar = "env=" . BuildEnv() . "&en=$en"; + +$SortFieldVar = "UserGroup_SortOrder"; +$SortOrderVar = "UserGroup_SortOrder"; +$DefaultSortField = "Name"; +$PerPageVar = "Perpage_Groups"; +$CurrentPageVar = "Page_Groups"; +$CurrentFilterVar = "Group_View"; + +$ListForm = "edituser"; +$CheckClass = "GroupChecks"; +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_User")." '".$c->Get("Login")."' - ".prompt_language("la_tab_Groups"); + +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$objListToolBar = new clsToolBar(); +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); + +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','UserEditStatus','".$admin."/users/user_list.php',1);","tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','UserEditStatus','".admin."/users/user_list.php',2);","tool_cancel.gif"); + +if($itemcount == 1) $objListToolBar->Add("divider"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/adduser_groups.php"; + $StatusField = "UserEditStatus"; + $form = "edituser"; + MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevUser','la_NextUser'); + $objListToolBar->Add("divider"); +} + +$listImages = array(); + +$objListToolBar->Add("new_group", "la_ToolTip_AddToGroup","","swap('new_group','toolbar/tool_usertogroup_f2.gif');", + "swap('new_group', 'toolbar/tool_usertogroup.gif');", + "OpenGroupSelector('$envar&source=adduser_groups&UserId=".$c->Get("PortalUserId")."&destform=group&destfield=grouplist');", + "tool_usertogroup.gif"); + +$objListToolBar->Add("user_del","la_ToolTip_DeleteFromGroup","#", "if (GroupChecks.itemChecked()) swap('user_del','toolbar/tool_delete_f2.gif');", + "if (GroupChecks.itemChecked()) swap('user_del', 'toolbar/tool_delete.gif');","if (GroupChecks.itemChecked()) GroupChecks.check_submit('adduser_groups', 'm_user_removegroup');", + "tool_delete.gif",FALSE,TRUE); +$listImages[] = "GroupChecks.addImage('user_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("user_print", "la_ToolTip_Print","#","swap('user_print','toolbar/tool_print_f2.gif');", + "swap('user_print', 'toolbar/tool_print.gif');","window.print();","tool_print.gif"); + +$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); + +$order = $objConfig->Get($SortOrderVar); + +$GroupList = $c->GetGroupList(); +$objGroups->Clear(); +/* ----------------------------------------- Set the View Filter ---------------------------------------- */ +/* bit place holders for category view menu */ +$Bit_Pending=4; +$Bit_Disabled=2; +$Bit_Valid=1; +$Bit_All = 7; + +$FilterLabels = array(); + +$FilterLabels[0] = admin_language("la_Text_Enabled"); +$FilterLabels[1] = admin_language("la_Text_Disabled"); +$FilterLabels[2] = admin_language("la_Text_Pending"); + +/* determine current view menu settings */ +$GroupView = $objConfig->Get($CurrentFilterVar); + +if(!is_numeric($GroupView)) +{ + $GroupView = $Bit_All; //Set all bits ON + $GroupFilter = ""; +} +else +{ + if($GroupView & $Bit_Valid) + $Status[] = 1; + + if($GroupView & $Bit_Disabled) + $Status[] = 0; + + if($GroupView & $Bit_Pending) + $Status[] = 2; + + if(count($Status)>0) + { + $GroupFilter = "Status IN (".implode(",",$Status).")"; + } + else + $GroupFilter = "Status = -1"; +} + + +$order = $objConfig->Get($SortOrderVar); +$SearchWords = $objSession->GetVariable("GroupSearchWord"); +if(strlen($SearchWords)) +{ + $where = " AND Personal=0 AND ". $objGroups->AdminSearchWhereClause($SearchWords); +} +else + $where = " AND Personal=0 "; + +if(strlen($GroupFilter)) + $where .= " AND $GroupFilter "; + +/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/ +$orderBy = trim($objConfig->Get($SortFieldVar)." ".$order); +if(strlen($orderBy)) + $orderBy = " ORDER BY ".$orderBy; +$sql = "SELECT g.GroupId as GroupId, g.name as GroupName, count(u.PortalUserId) as UserCount FROM ".GetTablePrefix()."PortalGroup as g "; +$sql .="INNER JOIN ".GetTablePrefix()."UserGroup as u ON g.GroupId=u.GroupId WHERE u.PortalUserId=".$c->Get("PortalUserId")." $where GROUP BY g.name".$orderBy; + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + +$objGroups->Query_Item($sql); + +/* ---------------------------------------- Configure the list view ---------------------------------------- */ +$objListView = new clsListView($objListToolBar,$objGroups); +$objListView->IdField = "GroupId"; + +$objListView->ColumnHeaders->Add("GroupName", admin_language("la_prompt_GroupName"),1,0,$order,"width=\"50%\"",$SortFieldVar,$SortOrderVar,"GroupName"); +$objListView->ColumnHeaders->Add("UserCount",admin_language("la_prompt_UserCount"),1,0,$order,"width=\"50%\"",$SortFieldVar,$SortOrderVar,"UserCount"); +$objListView->ColumnHeaders->SetSort($objConfig->Get("Group_SortField"),$order); + +$objListView->PrintToolBar = FALSE; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_group_search"; +$objListView->CurrentPageVar = $CurrentPageVar; +$objListView->PerPageVar = $PerPageVar; +$objListView->CheckboxName = "itemlist[]"; +$objListView->TotalItemCount = $itemcount; + + $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, + $CurrentFilterVar,$GroupView,$Bit_All); + + foreach($FilterLabels as $Bit=>$Label) + { + $objListView->AddViewMenuFilter($Label,$Bit); + } + +$objListToolBar->AddToInitScript("fwLoadMenus();"); + +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
    +PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */ + $objListView->SliceItems(); + print $objListView->PrintList(); +?> + +"> +
    +
    + > + + + + + +
    +
    "> + + + "> +
    + +
    " name="viewmenu"> + + + + +
    +
    + + +
    + + + + + Index: trunk/admin/editor/FCKeditor/lang/en.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/en.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/en.js (revision 13) @@ -0,0 +1,198 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * en.js: English support. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Cut" ; +lang["Copy"] = "Copy" ; +lang["Paste"] = "Paste" ; +lang["PasteText"] = "Paste as plain text" ; +lang["PasteWord"] = "Paste from Word" ; +lang["Find"] = "Find" ; +lang["SelectAll"] = "Select All" ; +lang["RemoveFormat"] = "Remove Format" ; +lang["InsertLink"] = "Insert/Edit Link" ; +lang["RemoveLink"] = "Remove Link" ; +lang["InsertImage"] = "Insert/Edit Image" ; +lang["InsertTable"] = "Insert/Edit Table" ; +lang["InsertLine"] = "Insert Horizontal Line" ; +lang["InsertSpecialChar"] = "Insert Special Character" ; +lang["InsertSmiley"] = "Insert Smiley" ; +lang["About"] = "About FCKeditor" ; + +lang["Bold"] = "Bold" ; +lang["Italic"] = "Italic" ; +lang["Underline"] = "Underline" ; +lang["StrikeThrough"] = "Strike Through" ; +lang["Subscript"] = "Subscript" ; +lang["Superscript"] = "Superscript" ; +lang["LeftJustify"] = "Left Justify" ; +lang["CenterJustify"] = "Center Justify" ; +lang["RightJustify"] = "Right Justify" ; +lang["BlockJustify"] = "Block Justify" ; +lang["DecreaseIndent"] = "Decrease Indent" ; +lang["IncreaseIndent"] = "Increase Indent" ; +lang["Undo"] = "Undo" ; +lang["Redo"] = "Redo" ; +lang["NumberedList"] = "Numbered List" ; +lang["BulettedList"] = "Buletted List" ; + +lang["ShowTableBorders"] = "Show Table Borders" ; +lang["ShowDetails"] = "Show Details" ; + +lang["FontStyle"] = "Style" ; +lang["FontFormat"] = "Format" ; +lang["Font"] = "Font" ; +lang["FontSize"] = "Size" ; +lang["TextColor"] = "Text Color" ; +lang["BGColor"] = "Background Color" ; +lang["Source"] = "Source" ; + +// Context Menu + +lang["EditLink"] = "Edit Link" ; +lang["InsertRow"] = "Insert Row" ; +lang["DeleteRows"] = "Delete Rows" ; +lang["InsertColumn"] = "Insert Column" ; +lang["DeleteColumns"] = "Delete Columns" ; +lang["InsertCell"] = "Insert Cell" ; +lang["DeleteCells"] = "Delete Cells" ; +lang["MergeCells"] = "Merge Cells" ; +lang["SplitCell"] = "Split Cell" ; +lang["CellProperties"] = "Cell Properties" ; +lang["TableProperties"] = "Table Properties" ; +lang["ImageProperties"] = "Image Properties" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Processing XHTML. Please wait..." ; +lang["Done"] = "Done" ; +lang["PasteWordConfirm"] = "The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?" ; +lang["NotCompatiblePaste"] = "This command is available for Internet Explorer version 5.5 or more. Do you want to paste without cleaning?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Cancel" ; +lang["DlgBtnClose"] = "Close" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Insert Image" ; +lang["DlgImgTitleEdit"] = "Edit Image" ; +lang["DlgImgBtnUpload"] = "Send it to the Server" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Upload" ; +lang["DlgImgBtnBrowse"] = "Browse Server" ; +lang["DlgImgAlt"] = "Alternative Text" ; +lang["DlgImgWidth"] = "Width" ; +lang["DlgImgHeight"] = "Height" ; +lang["DlgImgLockRatio"] = "Lock Ratio" ; +lang["DlgBtnResetSize"] = "Reset Size" ; +lang["DlgImgBorder"] = "Border" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Align" ; +lang["DlgImgAlignLeft"] = "Left" ; +lang["DlgImgAlignAbsBottom"] = "Abs Bottom" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Middle" ; +lang["DlgImgAlignBaseline"] = "Baseline" ; +lang["DlgImgAlignBottom"] = "Bottom" ; +lang["DlgImgAlignMiddle"] = "Middle" ; +lang["DlgImgAlignRight"] = "Right" ; +lang["DlgImgAlignTextTop"] = "Text Top" ; +lang["DlgImgAlignTop"] = "Top" ; +lang["DlgImgPreview"] = "Preview" ; +lang["DlgImgMsgWrongExt"] = "Sorry, only the following file types uploads are allowed:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgImgAlertSelect"] = "Please select an image to upload." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; // NEW +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Upload" ; +lang["DlgLnkTarget"] = "Target" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "New Window (_blank)" ; +lang["DlgLnkTargetParent"] = "Parent Window (_parent)" ; +lang["DlgLnkTargetSelf"] = "Same Window (_self)" ; +lang["DlgLnkTargetTop"] = "Topmost Window (_top)" ; +lang["DlgLnkTitle"] = "Title" ; +lang["DlgLnkBtnUpload"] = "Send it to the Server" ; +lang["DlgLnkBtnBrowse"] = "Browse Server" ; +lang["DlgLnkMsgWrongExtA"] = "Sorry, only the following file types uploads are allowed:\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgLnkMsgWrongExtD"] = "Sorry, the following file types uploads are not allowed:\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperation canceled." ; + +// Color Dialog +lang["DlgColorTitle"] = "Select Color" ; +lang["DlgColorBtnClear"] = "Clear" ; +lang["DlgColorHighlight"] = "Highlight" ; +lang["DlgColorSelected"] = "Selected" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Insert a Smiley" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Insert Special Character" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Insert Table" ; +lang["DlgTableTitleEdit"] = "Edit Table" ; +lang["DlgTableRows"] = "Rows" ; +lang["DlgTableColumns"] = "Columns" ; +lang["DlgTableBorder"] = "Border size" ; +lang["DlgTableAlign"] = "Alignment" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Left" ; +lang["DlgTableAlignCenter"] = "Center" ; +lang["DlgTableAlignRight"] = "Right" ; +lang["DlgTableWidth"] = "Width" ; +lang["DlgTableWidthPx"] = "pixels" ; +lang["DlgTableWidthPc"] = "percent" ; +lang["DlgTableHeight"] = "Height" ; +lang["DlgTableCellSpace"] = "Cell spacing" ; +lang["DlgTableCellPad"] = "Cell padding" ; +lang["DlgTableCaption"] = "Caption" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Cell Properties" ; +lang["DlgCellWidth"] = "Width" ; +lang["DlgCellWidthPx"] = "pixels" ; +lang["DlgCellWidthPc"] = "percent" ; +lang["DlgCellHeight"] = "Height" ; +lang["DlgCellWordWrap"] = "Word Wrap" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Yes" ; +lang["DlgCellWordWrapNo"] = "No" ; +lang["DlgCellHorAlign"] = "Horizontal Alignment" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Left" ; +lang["DlgCellHorAlignCenter"] = "Center" ; +lang["DlgCellHorAlignRight"] = "Right" ; +lang["DlgCellVerAlign"] = "Vertical Alignment" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Top" ; +lang["DlgCellVerAlignMiddle"] = "Middle" ; +lang["DlgCellVerAlignBottom"] = "Bottom" ; +lang["DlgCellVerAlignBaseline"] = "Baseline" ; +lang["DlgCellRowSpan"] = "Rows Span" ; +lang["DlgCellCollSpan"] = "Columns Span" ; +lang["DlgCellBackColor"] = "Background Color" ; +lang["DlgCellBorderColor"] = "Border Color" ; +lang["DlgCellBtnSelect"] = "Select..." ; + +// About Dialog +lang["DlgAboutVersion"] = "version" ; +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "For further information go to" ; \ No newline at end of file Index: trunk/themes/default/profile/view_profile_field.tpl =================================================================== diff -u --- trunk/themes/default/profile/view_profile_field.tpl (revision 0) +++ trunk/themes/default/profile/view_profile_field.tpl (revision 13) @@ -0,0 +1,6 @@ + + + +   + + Index: trunk/compat/fprintf.php =================================================================== diff -u --- trunk/compat/fprintf.php (revision 0) +++ trunk/compat/fprintf.php (revision 13) @@ -0,0 +1,56 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: fprintf.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace fprintf() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.fprintf + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('fprintf')) +{ + function fprintf () { + $args = func_get_args(); + + if (count($args) < 2) { + trigger_error ('Wrong parameter count for fprintf()', E_USER_WARNING); + return null; + } + + $resource_handle = array_shift($args); + $format = array_shift($args); + + if (!is_resource($resource_handle)) { + trigger_error ('fprintf(): supplied argument is not a valid stream resource', E_USER_WARNING); + return false; + } + + return fwrite($resource_handle, vsprintf($format, $args)); + } +} + +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/dialog/fck_smiley.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/dialog/fck_smiley.html (revision 0) +++ trunk/admin/editor/FCKeditor/dialog/fck_smiley.html (revision 13) @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + +
    + + +
    +
    + + + + +
    +   +
    +
    + +
    + + + Index: trunk/themes/default/catindex_relcats.tpl =================================================================== diff -u --- trunk/themes/default/catindex_relcats.tpl (revision 0) +++ trunk/themes/default/catindex_relcats.tpl (revision 13) @@ -0,0 +1,42 @@ + +
    + + + + +

    + + + +
    + + + + + + + + +

    + + + + + + + + + + +
    +

    ()

    +


    + + +
    + + +

    + + + Index: trunk/admin/include/multiedit_buttons.php =================================================================== diff -u --- trunk/admin/include/multiedit_buttons.php (revision 0) +++ trunk/admin/include/multiedit_buttons.php (revision 13) @@ -0,0 +1,3 @@ + \ No newline at end of file Index: trunk/admin/icons/icon46_catalog.gif =================================================================== diff -u Binary files differ Index: trunk/compat/html_entity_decode.php =================================================================== diff -u --- trunk/compat/html_entity_decode.php (revision 0) +++ trunk/compat/html_entity_decode.php (revision 13) @@ -0,0 +1,74 @@ + | +// | Aidan Lister | +// +----------------------------------------------------------------------+ +// +// $Id: html_entity_decode.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +if (!defined('ENT_NOQUOTES')) { + define('ENT_NOQUOTES', 0); +} + +if (!defined('ENT_COMPAT')) { + define('ENT_COMPAT', 2); +} + +if (!defined('ENT_QUOTES')) { + define('ENT_QUOTES', 3); +} + + +/** + * Replace html_entity_decode() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.html_entity_decode + * @author David Irvine + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.3.0 + * @internal Setting the charset will not do anything + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('html_entity_decode')) +{ + function html_entity_decode ($string, $quote_style = ENT_COMPAT, $charset = null) + { + if (!is_int($quote_style)) { + trigger_error('html_entity_decode() expects parameter 2 to be long, ' . gettype($quote_style) . ' given', E_USER_WARNING); + return null; + } + + $trans_tbl = get_html_translation_table(HTML_ENTITIES); + $trans_tbl = array_flip($trans_tbl); + + // Add single quote to translation table; + $trans_tbl['''] = '\''; + + // Not translating double quotes + if ($quote_style & ENT_NOQUOTES) { + // Remove double quote from translation table + unset($trans_tbl['"']); + } + + return strtr($string, $trans_tbl); + } +} +?> \ No newline at end of file Index: trunk/themes/default/access_denied.tpl =================================================================== diff -u --- trunk/themes/default/access_denied.tpl (revision 0) +++ trunk/themes/default/access_denied.tpl (revision 13) @@ -0,0 +1,6 @@ + +
    + +

    +" class="button" onClick="javascript:history.back();"> + Index: trunk/admin/images/check.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.copy.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_cat_hot.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/relevance/rel_5.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_theme_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_tool_export.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/js/fck_actions.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_actions.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_actions.js (revision 13) @@ -0,0 +1,353 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_actions.js: Actions called by the toolbar. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +function SetFocus() +{ + if (BrowserInfo.IsIE55OrMore) + objContent.DOM.focus() ; + else + objContent.focus() ; +} + +function decCommand(cmdId, cmdExecOpt, url) +{ + var status = objContent.QueryStatus(cmdId) ; + + if ( status != DECMDF_DISABLED && status != DECMDF_NOTSUPPORTED ) + { + if (cmdExecOpt == null) cmdExecOpt = OLECMDEXECOPT_DODEFAULT ; + objContent.ExecCommand(cmdId, cmdExecOpt, url) ; + } + SetFocus() ; +} + +function docCommand(command) +{ + objContent.DOM.execCommand(command) ; + SetFocus(); +} + +function doStyle(command) +{ + var oSelection = objContent.DOM.selection ; + var oTextRange = oSelection.createRange() ; + + if (oSelection.type == "Text") + { + decCommand(DECMD_REMOVEFORMAT); + if (!FCKFormatBlockNames) loadFormatBlockNames() ; + doFormatBlock( FCKFormatBlockNames[0] ); // This value is loaded at CheckFontFormat() + + var oFont = document.createElement("FONT") ; + oFont.innerHTML = oTextRange.htmlText ; + + var oParent = oTextRange.parentElement() ; + var oFirstChild = oFont.firstChild ; + + if (oFirstChild.nodeType == 1 && oFirstChild.outerHTML == oFont.innerHTML && + (oFirstChild.tagName == "SPAN" + || oFirstChild.tagName == "FONT" + || oFirstChild.tagName == "P" + || oFirstChild.tagName == "DIV")) + { + oParent.className = command.value ; + } + else + { + oFont.className = command.value ; + oTextRange.pasteHTML( oFont.outerHTML ) ; + } + } + else if (oSelection.type == "Control" && oTextRange.length == 1) + { + var oControl = oTextRange.item(0) ; + oControl.className = command.value ; + } + + command.selectedIndex = 0 ; + + SetFocus(); +} + +function doFormatBlock(combo) +{ + if (combo.value == null || combo.value == "") + { + if (!FCKFormatBlockNames) loadFormatBlockNames() ; + objContent.ExecCommand(DECMD_SETBLOCKFMT, OLECMDEXECOPT_DODEFAULT, FCKFormatBlockNames[0]); + } + else + objContent.ExecCommand(DECMD_SETBLOCKFMT, OLECMDEXECOPT_DODEFAULT, combo.value); + + SetFocus(); +} + +function doFontName(combo) +{ + if (combo.value == null || combo.value == "") + { + // TODO: Remove font name attribute. + } + else + objContent.ExecCommand(DECMD_SETFONTNAME, OLECMDEXECOPT_DODEFAULT, combo.value); + + SetFocus(); +} + +function doFontSize(combo) +{ + if (combo.value == null || combo.value == "") + { + // TODO: Remove font size attribute (Now it works with size 3. Will it work forever?) + objContent.ExecCommand(DECMD_SETFONTSIZE, OLECMDEXECOPT_DODEFAULT, 3); + } + else + objContent.ExecCommand(DECMD_SETFONTSIZE, OLECMDEXECOPT_DODEFAULT, parseInt(combo.value)); + + SetFocus(); +} + +function dialogImage() +{ + var html = FCKShowDialog("dialog/fck_image.html", window, 400, 380); + // The response is the IMG tag HTML + if (html) insertHtml(html) ; + SetFocus() ; +} + +function dialogTable(searchParentTable) +{ + if (searchParentTable) + { + var oRange = objContent.DOM.selection.createRange() ; + var oParent = oRange.parentElement() ; + + while (oParent && oParent.nodeName != "TABLE") + { + oParent = oParent.parentNode ; + } + + if (oParent && oParent.nodeName == "TABLE") + { + var oControlRange = objContent.DOM.body.createControlRange(); + oControlRange.add( oParent ) ; + oControlRange.select() ; + } + else + return ; + } + + FCKShowDialog("dialog/fck_table.html", window, 350, 210); + SetFocus() ; +} + +function dialogTableCell() +{ + FCKShowDialog("dialog/fck_tablecell.html", window, 500, 220); + SetFocus() ; +} + +function dialogLink() +{ + if (checkDecCommand(DECMD_HYPERLINK) != OLE_TRISTATE_GRAY) + { + FCKShowDialog("dialog/fck_link.html", window, 400, 190); + SetFocus() ; + } +} + +// insertHtml(): Insert HTML at the current document position. +function insertHtml(html) +{ + if (objContent.DOM.selection.type.toLowerCase() != "none") + objContent.DOM.selection.clear() ; + objContent.DOM.selection.createRange().pasteHTML(html) ; + SetFocus() ; +} + +function foreColor() +{ + var color = FCKShowDialog("dialog/fck_selcolor.html", window, 370, 240); + if (color) objContent.ExecCommand(DECMD_SETFORECOLOR,OLECMDEXECOPT_DODEFAULT, color) ; + SetFocus(); +} + +function backColor() +{ + var color = FCKShowDialog("dialog/fck_selcolor.html", window, 370, 240); + if (color) objContent.ExecCommand(DECMD_SETBACKCOLOR,OLECMDEXECOPT_DODEFAULT, color) ; + SetFocus(); +} + +function insertSpecialChar() +{ + var html = FCKShowDialog("dialog/fck_specialchar.html", window, 400, 250); + if (html) insertHtml(html) ; + SetFocus() ; +} + +function insertSmiley() +{ + var html = FCKShowDialog("dialog/fck_smiley.html", window, config.SmileyWindowWidth, config.SmileyWindowHeight) ; + if (html) insertHtml(html) ; + SetFocus() ; +} + +function FCKShowDialog(pagePath, args, width, height) +{ + return showModalDialog(pagePath, args, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no"); +} + +function about() +{ + FCKShowDialog("dialog/fck_about.html", window, 460, 290); +} + +function pastePlainText() +{ + var sText = HTMLEncode( clipboardData.getData("Text") ) ; + sText = sText.replace(/\n/g,'
    ') ; + insertHtml(sText) ; +} + +function pasteFromWord() +{ + if (BrowserInfo.IsIE55OrMore) + cleanAndPaste( GetClipboardHTML() ) ; + else if ( confirm( lang["NotCompatiblePaste"] ) ) + decCommand(DECMD_PASTE) ; +} + +function cleanAndPaste( html ) +{ + // Remove all SPAN tags + html = html.replace(/<\/?SPAN[^>]*>/gi, "" ); + // Remove Class attributes + html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ; + // Remove Style attributes + html = html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ; + // Remove Lang attributes + html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ; + // Remove XML elements and declarations + html = html.replace(/<\\?\?xml[^>]*>/gi, "") ; + // Remove Tags with XML namespace declarations: + html = html.replace(/<\/?\w+:[^>]*>/gi, "") ; + // Replace the   + html = html.replace(/ /, " " ); + // Transform

    to

    + var re = new RegExp("(]*>.*?)(<\/P>)","gi") ; // Different because of a IE 5.0 error + html = html.replace( re, "" ) ; + + insertHtml( html ) ; +} + +function GetClipboardHTML() +{ + var oDiv = document.getElementById("divTemp") + oDiv.innerHTML = "" ; + + var oTextRange = document.body.createTextRange() ; + oTextRange.moveToElementText(oDiv) ; + oTextRange.execCommand("Paste") ; + + var sData = oDiv.innerHTML ; + oDiv.innerHTML = "" ; + + return sData ; +} + +function HTMLEncode(text) +{ + text = text.replace(/&/g, "&") ; + text = text.replace(/"/g, """) ; + text = text.replace(//g, ">") ; + text = text.replace(/'/g, "’") ; + + return text ; +} + +function showTableBorders() +{ + objContent.ShowBorders = !objContent.ShowBorders ; + SetFocus() ; +} + +function showDetails() +{ + objContent.ShowDetails = !objContent.ShowDetails ; + SetFocus() ; +} + +var FCKFormatBlockNames ; + +function loadFormatBlockNames() +{ + var oNamesParm = new ActiveXObject("DEGetBlockFmtNamesParam.DEGetBlockFmtNamesParam") ; + objContent.ExecCommand(DECMD_GETBLOCKFMTNAMES, OLECMDEXECOPT_DODEFAULT, oNamesParm); + var vbNamesArray = new VBArray(oNamesParm.Names) ; + + FCKFormatBlockNames = vbNamesArray.toArray() ; +} + +function doZoom( sizeCombo ) +{ + if (sizeCombo.value != null || sizeCombo.value != "") + objContent.DOM.body.runtimeStyle.zoom = sizeCombo.value + "%" ; +} + +function insertList( type ) +{ + var oDoc = objContent.DOM ; + if ( !config.UseBROnCarriageReturn || oDoc.queryCommandState( 'InsertOrderedList' ) || oDoc.queryCommandState( 'InsertUnorderedList' ) ) + { + if ( type == 'ul' ) + decCommand( DECMD_UNORDERLIST ) ; + else + decCommand( DECMD_ORDERLIST ) ; + } + else + { + insertHtml('<' + type + '>
  • .
  • ') ; + + var oLI = oDoc.getElementById( '____tempLI' ) ; + oLI.removeAttribute("id") ; + + var oRange = oDoc.selection.createRange() ; + oRange.moveToElementText( oLI ) ; + oRange.findText( '.' ) ; + oRange.select() ; + oDoc.selection.clear() ; + } +} + +//function to perform spell check +function SpellCheck() +{ + try { + var tmpis = new ActiveXObject( "ieSpell.ieSpellExtension" ) ; + tmpis.CheckAllLinkedDocuments( objContent ); + } + catch(exception) { + if( exception.number == -2146827859 ) + { + if ( confirm( "Spell checker not installed. Do you want to download it now?" ) ) + window.open( config.SpellCheckerDownloadUrl , "SpellCheckerDownload" ); + } + else + alert("Error Loading ieSpell: Exception " + exception.number); + } +} \ No newline at end of file Index: trunk/admin/images/toolbar/tool_cut_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_language_var_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_conf_themes.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/ru.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/ru.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/ru.js (revision 13) @@ -0,0 +1,202 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * ru.js: Russian support. + * + * Authors: + * Alexander Slesarenko (avsbox@mail.ru) + */ + +// Toolbar Items and Context Menu + +lang["Save"] = "Сохранить" ; +lang["Reload"] = "Обновить" ; +lang["Cut"] = "Вырезать" ; +lang["Copy"] = "Копировать" ; +lang["Paste"] = "Вставить" ; +lang["PasteText"] = "Вставить как текст" ; +lang["PasteWord"] = "Вставить из Word" ; +lang["Find"] = "Найти" ; +lang["SelectAll"] = "Выделить все" ; +lang["RemoveFormat"] = "Удалить формат" ; +lang["InsertLink"] = "Создать/Редактировать гиперссылку" ; +lang["RemoveLink"] = "Удалить гиперссылку" ; +lang["InsertImage"] = "Вставить/Редактировать рисунок" ; +lang["InsertTable"] = "Вставить/Редактировать таблицу" ; +lang["InsertLine"] = "Вставить горизонтальную линию" ; +lang["InsertSpecialChar"] = "Вставить специальный символ" ; +lang["InsertSmiley"] = "Вставить рожицу" ; +lang["About"] = "О редакторе FCKeditor" ; + +lang["Bold"] = "Полужирный" ; +lang["Italic"] = "Курсив" ; +lang["Underline"] = "Подчеркнутый" ; +lang["StrikeThrough"] = "Зачеркнутый" ; +lang["Subscript"] = "Нижний индекс" ; +lang["Superscript"] = "Верхний индекс" ; +lang["LeftJustify"] = "По левому краю" ; +lang["CenterJustify"] = "По центру" ; +lang["RightJustify"] = "По правому краю" ; +lang["BlockJustify"] = "По ширине" ; +lang["DecreaseIndent"] = "Уменьшить отступ" ; +lang["IncreaseIndent"] = "Увеличить отступ" ; +lang["Undo"] = "Отменить" ; +lang["Redo"] = "Вернуть" ; +lang["NumberedList"] = "Нумерованный список" ; +lang["BulettedList"] = "Маркированный список" ; + +lang["ShowTableBorders"] = "Границы таблиц" ; +lang["ShowDetails"] = "Специальные знаки" ; + +lang["FontStyle"] = "Стиль" ; +lang["FontFormat"] = "Формат" ; +lang["Font"] = "Шрифт" ; +lang["FontSize"] = "Размер" ; +lang["TextColor"] = "Цвет текста" ; +lang["BGColor"] = "Цвет фона" ; +lang["Source"] = "Разметка" ; + +// Context Menu + +lang["EditLink"] = "Изменить гиперссылку" ; +lang["InsertRow"] = "Добавить строку" ; +lang["DeleteRows"] = "Удалить строки" ; +lang["InsertColumn"] = "Добавить столбец" ; +lang["DeleteColumns"] = "Удалить столбцы" ; +lang["InsertCell"] = "Добавить ячейку" ; +lang["DeleteCells"] = "Удалить ячейки" ; +lang["MergeCells"] = "Объединить ячейки" ; +lang["SplitCell"] = "Разбить ячейки" ; +lang["CellProperties"] = "Свойства ячейки" ; +lang["TableProperties"] = "Свойства таблицы" ; +lang["ImageProperties"] = "Свойства рисунка" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Обработка XHTML. Пожалуйста подождите..." ; +lang["Done"] = "Готово" ; +lang["PasteWordConfirm"] = "Вставляемый текст похож на текст из Word. Выполнить чистку HTML разметки перед вставкой?" ; +lang["NotCompatiblePaste"] = "Команда доступна для Internet Explorer версии 5.5 или выше. Выполнить вставку без очистки?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Отмена" ; +lang["DlgBtnClose"] = "Закрыть" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Вставка рисунка" ; +lang["DlgImgTitleEdit"] = "Свойства рисунка" ; +lang["DlgImgBtnUpload"] = "Отправить на сервер" ; +lang["DlgImgURL"] = "Гиперссылка" ; +lang["DlgImgUpload"] = "Файл рисунка" ; +lang["DlgImgImageName"] = "Имя рисунка" ; +lang["DlgImgBtnBrowse"] = "Выбрать..." ; +lang["DlgImgAlt"] = "Альтернативный текст" ; +lang["DlgImgWidth"] = "Width" ; +lang["DlgImgHeight"] = "Height" ; +lang["DlgImgLockRatio"] = "Сохранять пропорцию" ; +lang["DlgBtnResetSize"] = "Переустановить размер" ; +lang["DlgImgBorder"] = "Border" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Align" ; +lang["DlgImgAlignLeft"] = "Left" ; +lang["DlgImgAlignAbsBottom"] = "Abs Bottom" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Middle" ; +lang["DlgImgAlignBaseline"] = "Baseline" ; +lang["DlgImgAlignBottom"] = "Bottom" ; +lang["DlgImgAlignMiddle"] = "Middle" ; +lang["DlgImgAlignRight"] = "Right" ; +lang["DlgImgAlignTextTop"] = "Text Top" ; +lang["DlgImgAlignTop"] = "Top" ; +lang["DlgImgPreview"] = "Просмотр" ; +lang["DlgImgMsgWrongExt"] = "Допустима загрузка файлов следующих типов:\n\n" + config.ImageUploadAllowedExtensions + "\n\nОперация отменена." ; +lang["DlgImgAlertSelect"] = "Please select an image to upload." ; // TODO + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; // NEW +lang["DlgLinkTitleInsert"] = "Создание гиперссылки" ; +lang["DlgLinkTitleEdit"] = "Свойства гиперссылки" ; +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Файл" ; +lang["DlgLnkTarget"] = "Target" ; +lang["DlgLnkTargetNotSet"] = "<Не задан>" ; +lang["DlgLnkTargetBlank"] = "Новое окно (_blank)" ; +lang["DlgLnkTargetParent"] = "Родительское (_parent)" ; +lang["DlgLnkTargetSelf"] = "Текущее (_self)" ; +lang["DlgLnkTargetTop"] = "Самое верхнее (_top)" ; +lang["DlgLnkTitle"] = "Название" ; +lang["DlgLnkBtnUpload"] = "Отправить на сервер" ; +lang["DlgLnkBtnBrowse"] = "Выбрать..." ; +lang["DlgLnkMsgWrongExtA"] = "Допустима загрузка файлов следующих типов:\n\n" + config.LinkUploadAllowedExtensions + "\n\nОперация отменена." ; +lang["DlgLnkMsgWrongExtD"] = "Загрузка файлов следующих типов недопустима:\n\n" + config.LinkUploadDeniedExtensions + "\n\nОперация отменена." ; + +// Color Dialog +lang["DlgColorTitle"] = "Выбор цвета" ; +lang["DlgColorBtnClear"] = "Очистить" ; +lang["DlgColorHighlight"] = "Пример" ; +lang["DlgColorSelected"] = "Выбранный" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Вставка смайлов" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Специальные символы" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Вставка таблицы" ; +lang["DlgTableTitleEdit"] = "Свойства таблицы" ; +lang["DlgTableRows"] = "Строки" ; +lang["DlgTableColumns"] = "Столбцы" ; +lang["DlgTableBorder"] = "Размер границы" ; +lang["DlgTableAlign"] = "Выравнивание" ; +lang["DlgTableAlignNotSet"] = "<Не задано>" ; +lang["DlgTableAlignLeft"] = "Влево" ; +lang["DlgTableAlignCenter"] = "По центру" ; +lang["DlgTableAlignRight"] = "Вправо" ; +lang["DlgTableWidth"] = "Ширина" ; +lang["DlgTableWidthPx"] = "пикселы" ; +lang["DlgTableWidthPc"] = "проценты" ; +lang["DlgTableHeight"] = "Высота" ; +lang["DlgTableCellSpace"] = "Между ячейками" ; +lang["DlgTableCellPad"] = "Поля ячеек" ; +lang["DlgTableCaption"] = "Заголовок" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Свойства ячейки" ; +lang["DlgCellWidth"] = "Ширина" ; +lang["DlgCellWidthPx"] = "пикселы" ; +lang["DlgCellWidthPc"] = "проценты" ; +lang["DlgCellHeight"] = "Высота" ; +lang["DlgCellWordWrap"] = "Перенос слов" ; +lang["DlgCellWordWrapNotSet"] = "<Не задан>" ; +lang["DlgCellWordWrapYes"] = "Да" ; +lang["DlgCellWordWrapNo"] = "Нет" ; +lang["DlgCellHorAlign"] = "Гориз. выравнивание" ; +lang["DlgCellHorAlignNotSet"] = "<Не задано>" ; +lang["DlgCellHorAlignLeft"] = "Влево" ; +lang["DlgCellHorAlignCenter"] = "По центру" ; +lang["DlgCellHorAlignRight"] = "Вправо" ; +lang["DlgCellVerAlign"] = "Верт. выравнивание" ; +lang["DlgCellVerAlignNotSet"] = "<Не задано>" ; +lang["DlgCellVerAlignTop"] = "Вверх" ; +lang["DlgCellVerAlignMiddle"] = "По центру" ; +lang["DlgCellVerAlignBottom"] = "Вниз" ; +lang["DlgCellVerAlignBaseline"] = "Baseline" ; +lang["DlgCellRowSpan"] = "Между строками" ; +lang["DlgCellCollSpan"] = "Между столбцами" ; +lang["DlgCellBackColor"] = "Цвет фона" ; +lang["DlgCellBorderColor"] = "Цвет границы" ; +lang["DlgCellBtnSelect"] = "Выбрать..." ; + +// About Dialog +lang["DlgAboutVersion"] = "version" ; +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "For further information go to" ; \ No newline at end of file Index: trunk/admin/icons/icon24_conf_security.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_tool_export.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_upcat_f3.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/summary/root.php =================================================================== diff -u --- trunk/kernel/admin/include/summary/root.php (revision 0) +++ trunk/kernel/admin/include/summary/root.php (revision 13) @@ -0,0 +1,184 @@ +CountPending(); + +if( isset($objTopicList) && is_object($objTopicList) ) $PendingTopics = (int)@$objTopicList->CountPending(); +if( isset($objTopicList) && is_object($objArticleList) ) $PendingNews = (int)@$objArticleList->CountPending(); + +$PendingLinks = (int)@$objLinkList->CountPending(); +$PendingCats = (int)@$objCatList->CountPending(); + +$PendingTotal = $PendingUsers + $PendingTopics+$PendingNews+$PendingLinks+$PendingCats; + +$date_str = adodb_date("F j, Y"); + + +print << +
    +
    + + + + + +
    Overview$date_str 
    +
    +
    +
    + + + "; + } + else if ($percent < 60) + { + echo ""; + } + else if ($percent == 100) + { + echo ""; + } + else + { + echo ""; + } + } + flush(); +?> +
    + +END; + +$template = ""; +$objStats = new clsStatList(); +$objStats->Query_Item("SELECT * FROM ".GetTablePrefix()."StatItem WHERE AdminSummary=1"); +$ItemCount = $objStats->NumItems(); + +$ItemsPerCol = ceil($ItemCount / 2); +$i = 0; +$col = 1; +$o = ""; +while($i<$ItemsPerCol) +{ + $s = $objStats->GetItemByIndex($i); + + $o .= $s->ParseTemplateText($template); + $i++; +} + +print $o; + +print << + + + + + + + Index: trunk/themes/default/misc/right_actionbox.tpl =================================================================== diff -u --- trunk/themes/default/misc/right_actionbox.tpl (revision 0) +++ trunk/themes/default/misc/right_actionbox.tpl (revision 13) @@ -0,0 +1,75 @@ + +
    + +END; +$o = ""; +while($i<$ItemCount) +{ + $s = $objStats->GetItemByIndex($i); + + $o .= $s->ParseTemplateText($template); + $i++; +} + +print $o; + +print << + + +
    + + + + + + +
    +
    +
    + + + + + +
    $lang_PendingItems ($PendingTotal)
    +
    + +
    + +END; +?> \ No newline at end of file Index: trunk/admin/images/toolbar/tool_validate_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/relevance/rel_10.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_help.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_import_language_f2.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-sybase.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-sybase.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-sybase.inc.php (revision 13) @@ -0,0 +1,316 @@ +GetOne('select @@identity'); + } + // might require begintrans -- committrans + function _affectedrows() + { + return $this->GetOne('select @@rowcount'); + } + + + function BeginTrans() + { + + if ($this->transOff) return true; + $this->transCnt += 1; + + $this->Execute('BEGIN TRAN'); + return true; + } + + function CommitTrans($ok=true) + { + if ($this->transOff) return true; + + if (!$ok) return $this->RollbackTrans(); + + $this->transCnt -= 1; + $this->Execute('COMMIT TRAN'); + return true; + } + + function RollbackTrans() + { + if ($this->transOff) return true; + $this->transCnt -= 1; + $this->Execute('ROLLBACK TRAN'); + return true; + } + + // http://www.isug.com/Sybase_FAQ/ASE/section6.1.html#6.1.4 + function RowLock($tables,$where) + { + if (!$this->_hastrans) $this->BeginTrans(); + $tables = str_replace(',',' HOLDLOCK,',$tables); + return $this->GetOne("select top 1 null as ignore from $tables HOLDLOCK where $where"); + + } + + function SelectDB($dbName) { + $this->databaseName = $dbName; + if ($this->_connectionID) { + return @sybase_select_db($dbName); + } + else return false; + } + + /* Returns: the last error message from previous database operation + Note: This function is NOT available for Microsoft SQL Server. */ + + function ErrorMsg() { + $this->_errorMsg = sybase_get_last_message(); + return $this->_errorMsg; + } + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = sybase_pconnect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + // returns query ID if successful, otherwise false + function _query($sql,$inputarr) + { + global $ADODB_COUNTRECS; + + if ($ADODB_COUNTRECS == false && ADODB_PHPVER >= 0x4300) + return sybase_unbuffered_query($sql,$this->_connectionID); + else + return sybase_query($sql,$this->_connectionID); + } + + // See http://www.isug.com/Sybase_FAQ/ASE/section6.2.html#6.2.12 + function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$arg3=false,$secs2cache=0) + { + if ($secs2cache > 0) // we do not cache rowcount, so we have to load entire recordset + return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$arg3,$secs2cache); + + $cnt = ($nrows > 0) ? $nrows : 0; + if ($offset > 0 && $cnt) $cnt += $offset; + + $this->Execute("set rowcount $cnt"); + $rs = &ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$arg3,$secs2cache); + $this->Execute("set rowcount 0"); + + return $rs; + } + + // returns true or false + function _close() + { + return @sybase_close($this->_connectionID); + } + + function UnixDate($v) + { + return ADORecordSet_array_sybase::UnixDate($v); + } + + function UnixTimeStamp($v) + { + return ADORecordSet_array_sybase::UnixTimeStamp($v); + } +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ +global $ADODB_sybase_mths; +$ADODB_sybase_mths = array( + 'JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6, + 'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12); + +class ADORecordset_sybase extends ADORecordSet { + + var $databaseType = "sybase"; + var $canSeek = true; + // _mths works only in non-localised system + var $_mths = array('JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12); + + function ADORecordset_sybase($id,$mode=false) + { + if ($mode === false) { + global $ADODB_FETCH_MODE; + $mode = $ADODB_FETCH_MODE; + } + if (!$mode) $this->fetchMode = ADODB_FETCH_ASSOC; + else $this->fetchMode = $mode; + return $this->ADORecordSet($id,$mode); + } + + /* Returns: an object containing field information. + Get column information in the Recordset object. fetchField() can be used in order to obtain information about + fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by + fetchField() is retrieved. */ + function &FetchField($fieldOffset = -1) + { + if ($fieldOffset != -1) { + $o = @sybase_fetch_field($this->_queryID, $fieldOffset); + } + else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */ + $o = @sybase_fetch_field($this->_queryID); + } + // older versions of PHP did not support type, only numeric + if ($o && !isset($o->type)) $o->type = ($o->numeric) ? 'float' : 'varchar'; + return $o; + } + + function _initrs() + { + global $ADODB_COUNTRECS; + $this->_numOfRows = ($ADODB_COUNTRECS)? @sybase_num_rows($this->_queryID):-1; + $this->_numOfFields = @sybase_num_fields($this->_queryID); + } + + function _seek($row) + { + return @sybase_data_seek($this->_queryID, $row); + } + + function _fetch($ignore_fields=false) + { + if ($this->fetchMode == ADODB_FETCH_NUM) { + $this->fields = @sybase_fetch_row($this->_queryID); + } else if ($this->fetchMode == ADODB_FETCH_ASSOC) { + $this->fields = @sybase_fetch_row($this->_queryID); + if (is_array($this->fields)) { + $this->fields = $this->GetRowAssoc(ADODB_CASE_ASSOC); + return true; + } + return false; + } else { + $this->fields = @sybase_fetch_array($this->_queryID); + } + if ( is_array($this->fields)) { + return true; + } + + return false; + } + + /* close() only needs to be called if you are worried about using too much memory while your script + is running. All associated result memory for the specified result identifier will automatically be freed. */ + function _close() { + return @sybase_free_result($this->_queryID); + } + + // sybase/mssql uses a default date like Dec 30 2000 12:00AM + function UnixDate($v) + { + return ADORecordSet_array_sybase::UnixDate($v); + } + + function UnixTimeStamp($v) + { + return ADORecordSet_array_sybase::UnixTimeStamp($v); + } +} + +class ADORecordSet_array_sybase extends ADORecordSet_array { + function ADORecordSet_array_sybase($id=-1) + { + $this->ADORecordSet_array($id); + } + + // sybase/mssql uses a default date like Dec 30 2000 12:00AM + function UnixDate($v) + { + global $ADODB_sybase_mths; + + //Dec 30 2000 12:00AM + if (!ereg( "([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})" + ,$v, $rr)) return parent::UnixDate($v); + + if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0; + + $themth = substr(strtoupper($rr[1]),0,3); + $themth = $ADODB_sybase_mths[$themth]; + if ($themth <= 0) return false; + // h-m-s-MM-DD-YY + return mktime(0,0,0,$themth,$rr[2],$rr[3]); + } + + function UnixTimeStamp($v) + { + global $ADODB_sybase_mths; + //11.02.2001 Toni Tunkkari toni.tunkkari@finebyte.com + //Changed [0-9] to [0-9 ] in day conversion + if (!ereg( "([A-Za-z]{3})[-/\. ]([0-9 ]{1,2})[-/\. ]([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})" + ,$v, $rr)) return parent::UnixTimeStamp($v); + if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0; + + $themth = substr(strtoupper($rr[1]),0,3); + $themth = $ADODB_sybase_mths[$themth]; + if ($themth <= 0) return false; + + switch (strtoupper($rr[6])) { + case 'P': + if ($rr[4]<12) $rr[4] += 12; + break; + case 'A': + if ($rr[4]==12) $rr[4] = 0; + break; + default: + break; + } + // h-m-s-MM-DD-YY + return mktime($rr[4],$rr[5],0,$themth,$rr[2],$rr[3]); + } +} +?> Index: trunk/admin/icons/icon46_conf_themes.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_reset_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_modules.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/misc/form_prompt_error.tpl =================================================================== diff -u --- trunk/themes/default/misc/form_prompt_error.tpl (revision 0) +++ trunk/themes/default/misc/form_prompt_error.tpl (revision 13) @@ -0,0 +1 @@ + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/gele.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_edit_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/jesors.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_stop.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/register/register_dob.tpl =================================================================== diff -u --- trunk/themes/default/register/register_dob.tpl (revision 0) +++ trunk/themes/default/register/register_dob.tpl (revision 13) @@ -0,0 +1,151 @@ + + + + + + + + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/lang/it.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/it.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/it.js (revision 13) @@ -0,0 +1,197 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * it.js: Italian support. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Taglia" ; +lang["Copy"] = "Copia" ; +lang["Paste"] = "Incolla" ; +lang["PasteText"] = "Incolla come testo semplice" ; +lang["PasteWord"] = "Incolla da Word" ; +lang["Find"] = "Cerca" ; +lang["SelectAll"] = "Seleziona tutto" ; +lang["RemoveFormat"] = "Rimuovi formattazione" ; +lang["InsertLink"] = "Inserisci/Modifica Link" ; +lang["RemoveLink"] = "Rimuovi Link" ; +lang["InsertImage"] = "Inserisci/Modifica immagine" ; +lang["InsertTable"] = "Inserisci/Modifica tabella" ; +lang["InsertLine"] = "Inserisci linea orizzontale" ; +lang["InsertSpecialChar"] = "Inserisci carattere speciale" ; +lang["InsertSmiley"] = "Inserisci emoticon" ; +lang["About"] = "Informazioni su FCKeditor" ; + +lang["Bold"] = "Grassetto" ; +lang["Italic"] = "Corsivo" ; +lang["Underline"] = "Sottolinea" ; +lang["StrikeThrough"] = "Barrato" ; +lang["Subscript"] = "Pedice" ; +lang["Superscript"] = "Apice" ; +lang["LeftJustify"] = "Allinea a sinistra" ; +lang["CenterJustify"] = "Centra" ; +lang["RightJustify"] = "Allinea a destra" ; +lang["BlockJustify"] = "Giustifica" ; +lang["DecreaseIndent"] = "Aumenta rientro" ; +lang["IncreaseIndent"] = "Riduci rientro" ; +lang["Undo"] = "Annulla" ; +lang["Redo"] = "Ripeti" ; +lang["NumberedList"] = "Elenco numerato" ; +lang["BulettedList"] = "Elenco puntato" ; + +lang["ShowTableBorders"] = "Mostra i bordi delle tabelle" ; +lang["ShowDetails"] = "Mostra dettagli" ; + +lang["FontStyle"] = "Stile" ; +lang["FontFormat"] = "Formato" ; +lang["Font"] = "Font" ; +lang["FontSize"] = "Dimensione" ; +lang["TextColor"] = "Colore del testo" ; +lang["BGColor"] = "Colore dello sfondo" ; +lang["Source"] = "Sorgente" ; + +// Context Menu + +lang["EditLink"] = "Modifica link" ; +lang["InsertRow"] = "Aggiungi righa" ; +lang["DeleteRows"] = "Elimina righa" ; +lang["InsertColumn"] = "Aggiungi colonna" ; +lang["DeleteColumns"] = "Elimina colonna" ; +lang["InsertCell"] = "Aggiungi cella" ; +lang["DeleteCells"] = "Elimina cella" ; +lang["MergeCells"] = "Unisci celle" ; +lang["SplitCell"] = "Dividi cella" ; +lang["CellProperties"] = "Proprietà della cella" ; +lang["TableProperties"] = "Proprietà della tabella" ; +lang["ImageProperties"] = "Proprietà dell'immagine" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Elaborazione del XHTML. Attendere prego..." ; +lang["Done"] = "Completata" ; +lang["PasteWordConfirm"] = "Il testo da incollare sembra provenire da Word. Desidera pulirlo prima di incollare?" ; +lang["NotCompatiblePaste"] = "Questa funzione è disponibile soltanto sui browser Internet Explorer versione 5.5 in poi. Desidera incollare il testo senza pulirlo?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Annulla" ; +lang["DlgBtnClose"] = "Chiudi" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Inserisci immagine" ; +lang["DlgImgTitleEdit"] = "Modifica immagine" ; +lang["DlgImgBtnUpload"] = "Invia al server" ; +lang["DlgImgURL"] = "Indirizzo (URL)" ; +lang["DlgImgUpload"] = "Upload" ; +lang["DlgImgBtnBrowse"] = "Cerca sul server" ; +lang["DlgImgAlt"] = "Testo alternativo" ; +lang["DlgImgWidth"] = "Larghezza" ; +lang["DlgImgHeight"] = "Altezza" ; +lang["DlgImgLockRatio"] = "Blocca proporzioni" ; +lang["DlgBtnResetSize"] = "Reimposta dimensioni" ; +lang["DlgImgBorder"] = "Bordo" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Allineamento" ; +lang["DlgImgAlignLeft"] = "Sinistra" ; +lang["DlgImgAlignAbsBottom"] = "Abs in basso" ; +lang["DlgImgAlignAbsMiddle"] = "Abs in mezzo" ; +lang["DlgImgAlignBaseline"] = "Linea base" ; +lang["DlgImgAlignBottom"] = "In basso" ; +lang["DlgImgAlignMiddle"] = "In mezzo" ; +lang["DlgImgAlignRight"] = "Destra" ; +lang["DlgImgAlignTextTop"] = "Top testo" ; +lang["DlgImgAlignTop"] = "In alto" ; +lang["DlgImgPreview"] = "Anteprima" ; +lang["DlgImgMsgWrongExt"] = "Sono consentiti soltanto i seguenti tipi di file:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperazione annullata." ; +lang["DlgImgAlertSelect"] = "Selezionare il file da fare upload." ; + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; +lang["DlgLnkURL"] = "Indirizzo (URL)" ; +lang["DlgLnkUpload"] = "Upload" ; +lang["DlgLnkTarget"] = "Destinazione" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Nuova finestra (_blank)" ; +lang["DlgLnkTargetParent"] = "Finestra padre (_parent)" ; +lang["DlgLnkTargetSelf"] = "Stessa finestra (_self)" ; +lang["DlgLnkTargetTop"] = "Finestra superiore (_top)" ; +lang["DlgLnkTitle"] = "Titolo" ; +lang["DlgLnkBtnUpload"] = "Invia al server" ; +lang["DlgLnkBtnBrowse"] = "Cerca sul server" ; +lang["DlgLnkMsgWrongExtA"] = "Sono consentiti soltanto i seguenti tipi di file:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperazione annullata." ; +lang["DlgLnkMsgWrongExtD"] = "Non sono consentiti i seguenti tipi di file:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperazione annullata." ; + +// Color Dialog +lang["DlgColorTitle"] = "Seleziona il colore" ; +lang["DlgColorBtnClear"] = "Pulisci" ; +lang["DlgColorHighlight"] = "Attivo" ; +lang["DlgColorSelected"] = "Selezionato" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Inserisci emoticon" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Inserisci carattere speciale" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Inserisci tabella" ; +lang["DlgTableTitleEdit"] = "Modifica tabella" ; +lang["DlgTableRows"] = "Righe" ; +lang["DlgTableColumns"] = "Colonne" ; +lang["DlgTableBorder"] = "Bordo" ; +lang["DlgTableAlign"] = "Allineamento" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Sinistra" ; +lang["DlgTableAlignCenter"] = "Centrato" ; +lang["DlgTableAlignRight"] = "Destra" ; +lang["DlgTableWidth"] = "Larghezza" ; +lang["DlgTableHeight"] = "Altezza" ; +lang["DlgTableCellSpace"] = "Spazio celle" ; +lang["DlgTableCellPad"] = "Margini celle" ; +lang["DlgTableCaption"] = "Etichetta" ; +lang["DlgTableWidthPx"] = "pixels" ; +lang["DlgTableWidthPc"] = "percento" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Proprietà della cella" ; +lang["DlgCellWidth"] = "Larghezza" ; +lang["DlgCellWidthPx"] = "pixels" ; +lang["DlgCellWidthPc"] = "percento" ; +lang["DlgCellHeight"] = "Altezza" ; +lang["DlgCellWordWrap"] = "Vai a capo" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Sì" ; +lang["DlgCellWordWrapNo"] = "No" ; +lang["DlgCellHorAlign"] = "Allineamento orizzontale" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Sinistra" ; +lang["DlgCellHorAlignCenter"] = "Centrato" ; +lang["DlgCellHorAlignRight"] = "Destra" ; +lang["DlgCellVerAlign"] = "Allineamento verticale" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Sopra" ; +lang["DlgCellVerAlignMiddle"] = "In mezzo" ; +lang["DlgCellVerAlignBottom"] = "Sotto" ; +lang["DlgCellVerAlignBaseline"] = "Linea base" ; +lang["DlgCellRowSpan"] = "Row span" ; +lang["DlgCellCollSpan"] = "Coll span" ; +lang["DlgCellBackColor"] = "Colore di sfondo" ; +lang["DlgCellBorderColor"] = "Colore del bordo" ; +lang["DlgCellBtnSelect"] = "Seleziona..." ; + +// About Dialog +lang["DlgAboutVersion"] = "versione" ; +lang["DlgAboutLicense"] = "Rilasciato sotto la licensa GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "Per maggiori informazioni visitare" ; \ No newline at end of file Index: trunk/admin/include/subitems/navboxes.js =================================================================== diff -u --- trunk/admin/include/subitems/navboxes.js (revision 0) +++ trunk/admin/include/subitems/navboxes.js (revision 13) @@ -0,0 +1,249 @@ +var boxIDs = new Array(); +var boxClassName = "boxContainer" +var yShift = -21; +var clExt = "_cl"; +var exExt = "_ex"; +var dbClassName = "dBody"; +var diClassName = "dragImage"; +var diSrc = ""; +var maxZIndex = 1000; +var dImgs = new Array(); +function initBoxes(sortSequence, invisibleSequence) +{ + if (sortSequence) sortSequence = sortSequence.split(","); + if (invisibleSequence) invisibleSequence = invisibleSequence.split(","); + + var DIVs = document.getElementsByTagName("DIV"); + for (var i = 0; i < DIVs.length; i++) + if (DIVs[i].getAttribute("isBox")) + { + boxIDs[boxIDs.length] = DIVs[i].id; + DIVs[i].className = boxClassName; + + var header, body; + var iDIVs = DIVs[i].getElementsByTagName("DIV") + + for (var j = 0; j < iDIVs.length; j++) + switch (iDIVs[j].getAttribute("func")) + { + case "header" : header = iDIVs[j]; break; + case "body" : body = iDIVs[j]; break; + } + + if (!header || !body) continue; + + + DIVs[i].header = header; + DIVs[i].body = body; + + DIVs[i].header.onclick = ceBox; + DIVs[i].header.box = DIVs[i]; + iIMGs = header.getElementsByTagName("IMG"); + + var dragImg = document.createElement("IMG"); + dragImg.className = diClassName; + dragImg.container = DIVs[i]; + dImgs[dImgs.length] = dragImg; + + if (document.all) + { + dragImg.onmousedown = function() + { + if (event) this.cY = event.y; + this.container.style.zIndex = maxZIndex++; + this.container.style.height = this.container.offsetHeight; + this.wasDragged = false; + } + + dragImg.ondragstart = function() + { + var value = this.container.setH + event.y - this.cY; + this.container.style.top = value; + this.container.setH = value; + this.wasDragged = true; + } + + dragImg.onmouseup = function() + { + if (!this.wasDragged) + { + this.container.style.height = 0; + this.container.style.zIndex = 0; + return; + } + var boxTops = new Array(); + var newBS = new Array(); + for (var i = 0; i < boxIDs.length; i++) + { + var box = document.getElementById(boxIDs[i]); + box.cTop = getWndY(box); + boxTops[boxTops.length] = box.cTop; + } + + for (var i = 0; i < boxTops.length; i++) + for (var j = i + 1; j < boxTops.length; j++) + if (boxTops[i] > boxTops[j]) + { + var tmpItem = boxTops[i]; + boxTops[i] = boxTops[j]; + boxTops[j] = tmpItem; + } + + + for (var i = 0; i < boxTops.length; i++) + for (var j = 0; j < boxIDs.length; j++) + { + var box = document.getElementById(boxIDs[j]); + if (box.cTop == boxTops[i]) + { + newBS[newBS.length] = boxIDs[j]; + + var tmpArray = new Array(); // splice for IE5.0 + for (var k = 0; k < boxIDs.length; k++) + if (k != j) tmpArray[tmpArray.length] = boxIDs[k]; + + boxIDs = tmpArray; + j--; + } + } + + boxIDs = newBS; + sortBySequence(boxIDs) + + } + + } + DIVs[i].header.appendChild(dragImg); + + var icon; + for (var j = 0; j < iIMGs.length; j++) + if (iIMGs[j].getAttribute("isEI")) + { + icon = iIMGs[j]; + break; + } + if (!icon) continue; + + icon.collapseSrc = icon.src.substr(0, icon.src.lastIndexOf("_")) + clExt + icon.src.substr(icon.src.lastIndexOf("."), icon.src.length); + icon.expandSrc = icon.src.substr(0, icon.src.lastIndexOf("_")) + exExt + icon.src.substr(icon.src.lastIndexOf("."), icon.src.length); + + nbPreloadImage(icon.collapseSrc); nbPreloadImage(icon.expandSrc); + + DIVs[i].header.icon = icon; + var dBody = document.createElement("DIV"); + dBody.className = dbClassName; + dBody.style.display = "none"; + DIVs[i].appendChild(dBody); + DIVs[i].dBody = dBody; + } + sortBySequence((sortSequence) ? sortSequence : boxIDs); + if (invisibleSequence) + for (var i = 0; i < invisibleSequence.length; i++) + { + var box = document.getElementById(invisibleSequence[i]); + if (!box) continue; + box.header.onclick(); + } + setTimeout("dImgsMD()", 0) +} + +function dImgsMD() +{ + if (document.all) + for (var i = 0; i < dImgs.length; i++) + if (dImgs[i].onmousedown) dImgs[i].onmousedown() + + for (var i = 0; i < boxIDs.length; i++) + { + var box = document.getElementById(boxIDs[i]); + box.style.zIndex = 0; + } + +} + +function ceBox() +{ + var cVisible = (this.box.body.style.display != "none"); + cVisible = !cVisible; + this.box.body.style.display = (cVisible) ? "" : "none"; + this.icon.src = (cVisible) ? this.icon.collapseSrc : this.icon.expandSrc; + this.box.dBody.style.display = (cVisible) ? "none" : ""; + + fireStatusChange(); +} + +function sortBySequence(s, fireEvent) +{ + var boxes = new Array(); + var pNode; + for (var i = 0; i < boxIDs.length; i++) + { + var box = document.getElementById(boxIDs[i]); + box.cH = getWndY(box); + box.style.top = 0; + pNode = box.parentNode; + box = box.parentNode.removeChild(box); + boxes[boxes.length] = box; + } + + for (var i = 0; i < s.length; i++) + { + var insertBox; + for (var j = 0; j < boxes.length; j++) + if (boxes[j].id == s[i]) + { + insertBox = boxes[j]; + break; + } + if (!insertBox) continue; + pNode.appendChild(insertBox); + insertBox.style.top = i * yShift; + insertBox.setH = i * yShift; + insertBox.style.zIndex = 0; + } + + if (fireEvent) fireStatusChange(); +} + +/* post client status*/ +var updateScriptName = "about:request.php"; +function fireStatusChange() +{ + if (!document.all) return; + var statusUpdater = document.getElementById("statusUpdaterFrame"); + + if (statusUpdater) + statusUpdater.parentNode.removeChild(statusUpdater); + + var statusUpdater = document.createElement("IFRAME"); + var invisible = new Array(); + statusUpdater.style.display = "none"; + + for (var i = 0; i < boxIDs.length; i++) + if (document.all[boxIDs[i]].body.style.display == "none") + invisible[invisible.length] = boxIDs[i]; + + statusUpdater.setAttribute("id", "statusUpdaterFrame"); + document.body.appendChild(statusUpdater); + document.all.statusUpdaterFrame.setAttribute("src", updateScriptName + "?" + "sort=" + boxIDs.join(",") + "invisible=" + invisible.join(",")); + document.all.statusUpdaterFrame.outerHTML = document.all.statusUpdaterFrame.outerHTML; //#IE5.0 functionality +} +/* utilities */ +var nbPreloadImages = new Array(); +function nbPreloadImage(src){var img = new Image(); img.src = src; nbPreloadImages[nbPreloadImages.length] = img} + + +function getWndC(object, c) +{ + pos = 0; + while (object != null) + { + pos += (c == "y") ? object.offsetTop : object.offsetLeft; + object = object.offsetParent; + } + return pos; +} + +function getWndX(object) {return getWndC(object, "x")} +function getWndY(object) {return getWndC(object, "y")} + Index: trunk/admin/images/itemicons/icon16_user_denied.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/logo_bg_in-link.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_user_pending.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-sqlanywhere.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-sqlanywhere.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-sqlanywhere.inc.php (revision 13) @@ -0,0 +1,166 @@ +create_blobvar($blobVarName); + + b) load blob var from file. $filename must be complete path + + $dbcon->load_blobvar_from_file($blobVarName, $filename); + + c) Use the $blobVarName in SQL insert or update statement in the values + clause: + + $recordSet = $dbconn->Execute('INSERT INTO tabname (idcol, blobcol) ' + . + 'VALUES (\'test\', ' . $blobVarName . ')'); + + instead of loading blob from a file, you can also load from + an unformatted (raw) blob variable: + $dbcon->load_blobvar_from_var($blobVarName, $varName); + + d) drop blob variable on db server to free up resources: + $dbconn->drop_blobvar($blobVarName); + + Sybase_SQLAnywhere data driver. Requires ODBC. + +*/ + +if (!defined('_ADODB_ODBC_LAYER')) { + include(ADODB_DIR."/drivers/adodb-odbc.inc.php"); +} + +if (!defined('ADODB_SYBASE_SQLANYWHERE')){ + + define('ADODB_SYBASE_SQLANYWHERE',1); + + class ADODB_sqlanywhere extends ADODB_odbc { + var $databaseType = "sqlanywhere"; + var $hasInsertID = true; + + function ADODB_sqlanywhere() + { + $this->ADODB_odbc(); + } + + function _insertid() { + return $this->GetOne('select @@identity'); + } + + function create_blobvar($blobVarName) { + $this->Execute("create variable $blobVarName long binary"); + return; + } + + function drop_blobvar($blobVarName) { + $this->Execute("drop variable $blobVarName"); + return; + } + + function load_blobvar_from_file($blobVarName, $filename) { + $chunk_size = 1000; + + $fd = fopen ($filename, "rb"); + + $integer_chunks = (integer)filesize($filename) / $chunk_size; + $modulus = filesize($filename) % $chunk_size; + if ($modulus != 0){ + $integer_chunks += 1; + } + + for($loop=1;$loop<=$integer_chunks;$loop++){ + $contents = fread ($fd, $chunk_size); + $contents = bin2hex($contents); + + $hexstring = ''; + + for($loop2=0;$loop2qstr($hexstring); + + $this->Execute("set $blobVarName = $blobVarName || " . $hexstring); + } + + fclose ($fd); + return; + } + + function load_blobvar_from_var($blobVarName, &$varName) { + $chunk_size = 1000; + + $integer_chunks = (integer)strlen($varName) / $chunk_size; + $modulus = strlen($varName) % $chunk_size; + if ($modulus != 0){ + $integer_chunks += 1; + } + + for($loop=1;$loop<=$integer_chunks;$loop++){ + $contents = substr ($varName, (($loop - 1) * $chunk_size), $chunk_size); + $contents = bin2hex($contents); + + $hexstring = ''; + + for($loop2=0;$loop2qstr($hexstring); + + $this->Execute("set $blobVarName = $blobVarName || " . $hexstring); + } + + return; + } + + /* + Insert a null into the blob field of the table first. + Then use UpdateBlob to store the blob. + + Usage: + + $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); + $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1'); + */ + function UpdateBlob($table,$column,&$val,$where,$blobtype='BLOB') + { + $blobVarName = 'hold_blob'; + $this->create_blobvar($blobVarName); + $this->load_blobvar_from_var($blobVarName, $val); + $this->Execute("UPDATE $table SET $column=$blobVarName WHERE $where"); + $this->drop_blobvar($blobVarName); + return true; + } + }; //class + + class ADORecordSet_sqlanywhere extends ADORecordSet_odbc { + + var $databaseType = "sqlanywhere"; + + function ADORecordSet_sqlanywhere($id,$mode=false) + { + $this->ADORecordSet_odbc($id,$mode); + } + + + }; //class + + +} //define +?> Index: trunk/admin/images/smicon3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/double0smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/Leftover/icon24_search.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_conf_general.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_head_toplinks.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/itemdb.php =================================================================== diff -u --- trunk/kernel/include/itemdb.php (revision 0) +++ trunk/kernel/include/itemdb.php (revision 13) @@ -0,0 +1,548 @@ +adodbConnection = GetADODBConnection(); + $this->tablename=""; + $this->NoResourceId=0; + $this->debuglevel=0; + } + + // ============================================================================================ + function GetFormatter($field) + { + return $this->HasFormatter($field) ? $this->Formatters[$field] : false; + } + + function SetFormatter($field, $type, $params) + { + // by Alex + // all params after 2nd are formmater type specific + $this->Formatters[$field]['type'] = $type; + switch($type) + { + case FT_OPTION: + $this->Formatters[$field]['options'] = $params; + break; + } + } + /* + function FormatFields() + { + // format item in list data before printing + + foreach($this->Formatters as $field => $formatter) + $this->Data[$field] = $this->FormatField($field); + } + */ + function FormatField($field) + { + // formats single field if it has formatter + if( $this->HasFormatter($field) ) + { + $fmt = $this->Formatters[$field]; + switch($fmt['type']) + { + case FT_OPTION: + return $fmt['options'][ $this->Data[$field] ]; + break; + } + } + else + return $this->Get($field); + } + + function HasFormatter($field) + { + // checks if formatter is set for field + return isset($this->Formatters[$field]) ? 1 : 0; + } + // ============================================================================================ + + function UnsetIdField() + { + $f = $this->IdField(); + unset($this->Data[$f]); + unset($this->m_dirtyFieldsMap[$f]); + } + + function UnsetField($field) + { + unset($this->Data[$field]); + unset($this->m_dirtyFieldsMap[$field]); + } + + function IdField() + { + if(!strlen($this->id_field)) + { + return $this->tablename."Id"; + } + else + return $this->id_field; + } + + function UniqueId() + { + return $this->Get($this->IdField()); + } + + function SetUniqueId($value) + { + $var = $this->IdField(); + $this->Set($var, $value); + } + + function SetModified($UserId=NULL) + { + global $objSession; + + $keys = array_keys($this->Data); + if(in_array("Modified",$keys)) + { + $this->Set("Modified",adodb_date("U")); + } + if(in_array("ModifiedById",$keys)) + { + if(!$UserId) + $UserId = $objSession->Get("PortalUserId"); + $this->Set("ModifiedById",$UserId); + } + } + + function PrintVars() + { + echo '
    '.print_r($this->Data, true).'
    '; + } + +// ================================================================= + function GetFormatted($name) + { + // get formatted field value + return $this->FormatField($name); + } + + function Get($name) + { + // get un-formatted field value + //if( !isset($this->Data[$name]) ) print_pre( debug_backtrace() ); + return $this->HasField($name) ? $this->Data[$name] : ''; + } +// ================================================================= + + function HasField($name) + { + // checks if field exists in item + return isset($this->Data[$name]) ? 1 : 0; + } + + function Set($name, $value) + { + //echo "Setting Field $name: = [$value]
    "; + if( is_array($name) ) + { + for ($i=0; $i < sizeof($name); $i++) + { + $var = "m_" . $name[$i]; + if( !$this->HasField($name[$i]) || ($this->Data[$name[$i]] != $value[$i])) + { + $this->Data[$name[$i]] = $value[$i]; + $this->m_dirtyFieldsMap[$name[$i]] = $value[$i]; + } + } + } + else + { + $var = "m_" . $name; + if( !$this->HasField($name) || $this->Data[$name] != $value ) + { + $this->Data[$name] = $value; + $this->m_dirtyFieldsMap[$name] = $value; + } + } + } + + function Dirty($list=NULL) + { + if($list==NULL) + { + foreach($this->Data as $field => $value) + { + $this->m_dirtyFieldsMap[$field] = $value; + } + } + else + { + foreach($list as $field) + { + $this->m_dirtyFieldsMap[$field] = $this->Data[$field]; + } + } + } + + function Clean($list=NULL) + { + if($list == NULL) + { + unset($this->m_dirtyFieldsMap); + $this->m_dirtyFieldsMap=array(); + } + else + { + foreach($list as $value) + { + $varname = "m_" . $value; + unset($this->m_dirtyFieldsMap[$value]); + } + } + } + + function SetDebugLevel($value) + { + $this->debuglevel = $value; + } + + function SetFromArray($data, $dirty = false) + { + if(is_array($data)) + { + $this->Data = $data; + if($dirty) $this->m_dirtyFieldsMap = $data; + } + } + + function GetData() + { + return $this->Data; + } + + function SetData($data, $dirty = false) + { + $this->SetFromArray($data, $dirty); + } + + function Delete() + { + global $Errors; + + if($this->Get($this->IdField())==0) + { + $Errors->AddError("error.AppError",NULL,'Internal error: Delete requires set id',"",get_class($this),"Delete"); + return false; + } + + + $sql = sprintf('DELETE FROM %s WHERE %s = %s', $this->tablename, $this->IdField(), + $this->UniqueId()); + if($this->debuglevel>0) + echo $sql."
    "; + if ($this->adodbConnection->Execute($sql) === false) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Delete"); + return false; + } + return true; + } + + function Update($UpdatedBy=NULL) + { + global $Errors, $objSession; + + if(count($this->m_dirtyFieldsMap) == 0) + return true; + + $this->SetModified($UpdatedBy); + $sql = "UPDATE ".$this->tablename ." SET "; + $first = 1; + + foreach ($this->m_dirtyFieldsMap as $key => $value) + { + if(!is_numeric($key) && $key != $this->IdField()) + { + if($first) + { + $sql = sprintf("%s %s=%s",$sql,$key,$this->adodbConnection->qstr(stripslashes($value))); + $first = 0; + } + else + { + $sql = sprintf("%s, %s=%s",$sql,$key,$this->adodbConnection->qstr(stripslashes($value))); + } + } + if (!($value == '' && ($this->Data[$key] == 'NULL' || $this->Data[$key] == '0' || $this->Data[$key] == ''))) { + if ($key != 'Modified') { + $objSession->SetVariable("HasChanges", 1); + } + } + } + + $sql = sprintf("%s WHERE %s = '%s'",$sql, $this->IdField(), $this->UniqueId()); + + if($this->debuglevel>0) + echo $sql."
    "; + if ($this->adodbConnection->Execute($sql) === false) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Update"); + return false; + } + +/* if ($this->adodbConnection->Affected_Rows() > 0) { + $objSession->SetVariable("HasChanges", 1); + }*/ + + return true; + } + + function ReplaceID($new_id) + { + // replace item's id, because Update method + // is too dummy to do this autommatically + // USED in temporary table editing stuff + $db =& $this->adodbConnection; + $sql = "UPDATE %1\$s SET `%2\$s` = %3\$s WHERE `%2\$s` = %4\$s"; + $sql = sprintf($sql, $this->tablename, $this->IdField(), $new_id, (int)$this->UniqueId() ); + if($this->debuglevel > 0) echo $sql.'
    '; + $db->Execute($sql); + } + + function CreateSQL() + { + global $Errors; + + $sql = "INSERT INTO ".$this->tablename." ("; + $first = 1; + foreach ($this->Data as $key => $value) + { + if($first) + { + $sql = sprintf("%s %s",$sql,$key); + $first = 0; + } + else + { + $sql = sprintf("%s, %s",$sql,$key); + } + } + $sql = sprintf('%s ) VALUES (',$sql); + $first = 1; + foreach ($this->Data as $key => $value) + { + if($first) + { + $sql = sprintf("%s %s",$sql,$this->adodbConnection->qstr(stripslashes($value))); + $first = 0; + } + else + { + $sql = sprintf("%s, %s",$sql,$this->adodbConnection->qstr(stripslashes($value))); + } + } + $sql = sprintf('%s)',$sql); + + return $sql; + } + + function Create() + { + global $Errors, $objSession; + + if($this->debuglevel) echo "Creating Item: ".get_class($this)."
    "; + if($this->NoResourceId!=1 && (int)$this->Get("ResourceId")==0) + { + $this->Set("ResourceId", GetNextResourceId()); + } + $sql = $this->CreateSql(); + + if($this->debuglevel>0) + echo $sql."
    \n"; + + if ($this->adodbConnection->Execute($sql) === false) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Create"); + return false; + } + + $this->SetUniqueId($this->adodbConnection->Insert_ID()); + + + if ($this->adodbConnection->Affected_Rows() > 0) { + $objSession->SetVariable("HasChanges", 1); + } + + return true; + } + + function Increment($field) + { + global $Errors; + + $sql = "Update ".$this->tablename." set $field=$field+1 where ".$this->IdField()."=" . $this->UniqueId(); + if($this->debuglevel>0) + echo $sql."
    "; + $result = $this->adodbConnection->Execute($sql); + if ($result === false) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Increment"); + return false; + } + $this->Set($field,$this->Get($field)+1); + } + + function Decrement($field) + { + global $Errors; + + $sql = "Update ".$this->tablename." set $field=$field-1 where ".$this->IdField()."=" . $this->UniqueId(); + if($this->debuglevel>0) + echo $sql; + $result = $this->adodbConnection->Execute($sql); + if ($result === false) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Decrement"); + return false; + } + $this->Set($field,$this->Get($field)-1); + } + + function GetFieldList($UseLoadedData=FALSE) + { + if(count($this->Data) && $UseLoadedData==TRUE) + { + $res = array_keys($this->Data); + } + else + { + $res = $this->adodbConnection->MetaColumnNames($this->tablename); + } + return $res; + } + + function UsingTempTable() + { + global $objSession; + + $temp = $objSession->GetEditTable($this->tablename); + $p = GetTablePrefix()."ses"; + $t = substr($temp,0,strlen($p)); + $ThisTable = substr($this->tablename,0,strlen($p)); + if($t==$ThisTable) + { + return TRUE; + } + else + return FALSE; + } + + function LoadFromDatabase($Id, $IdField = null) // custom IdField by Alex + { + global $objSession,$Errors; + + if(!isset($Id)) + { + $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase"); + return false; + } + + // --------- multiple ids allowed: begin ----------------- + $id_field = isset($IdField) ? $IdField : $this->IdField(); + if( !is_array($id_field) ) $id_field = Array($id_field); + if( !is_array($Id) ) $Id = Array($Id); + + $i = 0; $id_count = count($id_field); + $conditions = Array(); + while($i < $id_count) + { + $conditions[] = "(`".$id_field[$i]."` = '".$Id[$i]."')"; + $i++; + } + $sql = sprintf('SELECT * FROM %s WHERE %s', $this->tablename, implode(' AND ', $conditions) ); + // --------- multiple ids allowed: end -------------------- + if($this->debuglevel) echo "Load SQL: $sql
    "; + $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; + if($this->debuglevel) print_pre($data); + if(is_array($data)) + $this->SetFromArray($data); + $this->Clean(); + return TRUE; + } + + function FieldExists($field) + { + $res = array_key_exists($field,$this->Data); + return $res; + } + + function ValueExists($Field,$Value) + { + $sql = "SELECT $Field FROM ".$this->tablename." WHERE $Field='$Value'"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + return TRUE; + } + else + return FALSE; + } + + function FieldMax($Field) + { + $sql = "SELECT Max($Field) as m FROM ".$this->tablename; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $ret = $rs->fields["m"]; + } + else + $ret = 0; + } + + function FieldMin($Field) + { + $sql = "SELECT Min($Field) as m FROM ".$this->tablename; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $ret = $rs->fields["m"]; + } + else + $ret = 0; + } + + function TableExists($table = null) + { + // checks if table specified in item exists in db + $db =& $this->adodbConnection; + $sql = "SHOW TABLES LIKE '%s'"; + if($table == null) $table = $this->tablename; + $rs = $db->Execute( sprintf($sql, $table) ); + + if( $rs->RecordCount() == 1 ) // table exists in normal case + return 1; + else // check if table exists in lowercase + $rs = $db->Execute( sprintf($sql, strtolower($table) ) ); + + return ($rs->RecordCount() == 1) ? 1 : 0; + } + +} +?> Index: trunk/themes/default/my_info/myinfo_dob.tpl =================================================================== diff -u --- trunk/themes/default/my_info/myinfo_dob.tpl (revision 0) +++ trunk/themes/default/my_info/myinfo_dob.tpl (revision 13) @@ -0,0 +1,151 @@ + + + + + + + + \ No newline at end of file Index: trunk/themes/default/img/bgr_path_full.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/dialog/fck_specialchar.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/dialog/fck_specialchar.html (revision 0) +++ trunk/admin/editor/FCKeditor/dialog/fck_specialchar.html (revision 13) @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + +
    + + +
    +
    + + + + +
     
    +
    + +
    + + + Index: trunk/admin/import/inlinkimport4.php =================================================================== diff -u --- trunk/admin/import/inlinkimport4.php (revision 0) +++ trunk/admin/import/inlinkimport4.php (revision 13) @@ -0,0 +1,211 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//admin only util +$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"); +//Set Section +$section = "in-portal:inlink_inport"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +$formaction = $adminURL."/import/import.php?".$envar; +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$formaction = "import.php?".$envar; + +//check if the previous input is correct +if( $_POST["Action"]=="checkconn") +{ + $objSession->SetVariable("import_inlink_sql_type",$_POST["inlink_sql_type"]); + $objSession->SetVariable("import_inlink_server",$_POST["inlink_server"]); + $objSession->SetVariable("import_inlink_db",$_POST["inlink_db"]); + $objSession->SetVariable("import_inlink_user",$_POST["inlink_user"]); + $objSession->SetVariable("import_inlink_pass",$_POST["inlink_pass"]); + + $objSession->SetVariable("error_importing",""); + + $inlink_sql_type=$objSession->GetVariable("import_inlink_sql_type"); + $inlink_server=$objSession->GetVariable("import_inlink_server"); + $inlink_db=$objSession->GetVariable("import_inlink_db"); + $inlink_user=$objSession->GetVariable("import_inlink_user"); + $inlink_pass=$objSession->GetVariable("import_inlink_pass"); + + + $linkconn = ADONewConnection($inlink_sql_type); + + if(!$linkconn->PConnect($inlink_server, $inlink_user, $inlink_pass, $inlink_db) || $inlink_server =="" || $inlink_db=="") + { + // echo "Database connection failed. DB Type: $sql_type, DB Server: $inlink_server, DB User: $inlink_user, DB Name: $inlink_db"; //fatal; + $objSession->SetVariable("error_importing","Error: The connection to the DB failed please check your settings"); + header("Location:inlinkimport3.php?".$envar); + //$linkconn->ErrorMsg(); + } + unset($linkconn); +} +//if it is not then we redirect the user back to the page with a message of what went wrong. + +if (true) +{ + + if(true) + { + + $var="?env=".BuildEnv()."&en=$en_prev"; + $link=$adminURL."/import/inlinkimport3.php".$var; + + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + + if(true) + { + $var="?env=".BuildEnv()."&en=$en_next"; + $link=$adminURL."/import/inlinkimport4.php".$var; + + $onClick="if(document.inlinkimport4.user_admin.value=='' || document.inlinkimport4.user_regular.value=='' || document.inlinkimport4.init_cat.value=='' || document.inlinkimport4.link_image.value =='') alert('Please fill in all of the fields'); else import_submit('inlinkimport4','$formaction','');"; + + $link="#"; + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next.gif"); + } + + $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 4"; + + int_header($objCatToolBar,NULL,$title); +} +?> + + +"> + + > + + + + > + + + + > + + + + > + + + + + + + + +
    + GetVariable("user_admin_names"); ?> + + + + + +
    + GetVariable("user_regular_names"); ?> + + + + + +
    + GetVariable("categoryid"); + if($catid>0) + { + $c = $objCatList->GetItemByField("ResourceId",$catid); + $path = prompt_language($objConfig->Get("Root_Name")). ">".$c->GetCachedNavBar(); + } + else + $path = prompt_language($objConfig->Get("Root_Name")); + ?> + + + + + + + + +
    + +
    +
    + Index: trunk/admin/images/button_back.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_frontend_mail.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/icon24_link_cat.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_newfolder.gif =================================================================== diff -u Binary files differ Index: trunk/root.flg =================================================================== diff -u --- trunk/root.flg (revision 0) +++ trunk/root.flg (revision 13) @@ -0,0 +1 @@ \ No newline at end of file Index: trunk/admin/images/toolbar/tool_validate_restart_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_cat_pending.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/mailing_list/confirm_subscribe.tpl =================================================================== diff -u --- trunk/themes/default/mailing_list/confirm_subscribe.tpl (revision 0) +++ trunk/themes/default/mailing_list/confirm_subscribe.tpl (revision 13) @@ -0,0 +1,113 @@ + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + + +

    +
    + + "> + + + + + + + + + + + + + + + + + + + + + +



     
    +

    + +




    +
    + " class="button"> + " class="button"> + +
    +
    + + +

    +
    + + + Index: trunk/admin/icons/icon46_usergroups.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/lang_select/lang_menu_element.tpl =================================================================== diff -u --- trunk/themes/default/lang_select/lang_menu_element.tpl (revision 0) +++ trunk/themes/default/lang_select/lang_menu_element.tpl (revision 13) @@ -0,0 +1,6 @@ +
    " width="18" height="12" alt="" />
    ">
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + +
    |
     


    +
    + + + + + + + + + + + + + + + + +






    +
     

    + + + + + + + + + + + + + + +





    +


    + \ No newline at end of file Index: trunk/themes/default/error_template.tpl =================================================================== diff -u --- trunk/themes/default/error_template.tpl (revision 0) +++ trunk/themes/default/error_template.tpl (revision 13) @@ -0,0 +1,127 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

      + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + +
    + + + + + + + + +

    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +



      +
    +

    + +

    +




      +
    " /> + " class="button"> +
    +
    + +
    +

    +

    +
    + + + Index: trunk/themes/default/img/pic_myprofile.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/category/addcategory_permissions.php =================================================================== diff -u --- trunk/admin/category/addcategory_permissions.php (revision 0) +++ trunk/admin/category/addcategory_permissions.php (revision 13) @@ -0,0 +1,273 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditItems); + +$objEditItems = new clsCatList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Category"); + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); +if(isset($_GET["en"])) +{ + $c = $objEditItems->GetItemByIndex($en); +} + +if(!is_object($c)) +{ + $c = new clsCategory($m_var_list["cat"]); + $c->Set("CategoryId",$m_var_list["cat"]); +} +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} + +$action = "m_edit_category"; + +/* -------------------------------------- Section configuration ------------------------------------------- */ +$envar = "env=" . BuildEnv() . "&en=$en"; +$section = 'in-portal:editcategory_permissions'; + +$sec =& $objSections->GetSection($section); +if($c->Get("CategoryId")==0) +{ + $sec->Set("left",NULL); + $sec->Set("right",NULL); + +} +if($c->Get("CategoryId")!=0) +{ + $title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Category")." '".$c->Get("Name")."' - ".admin_language("la_tab_Permissions"); +} +else + $title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Root")." ".admin_language("la_Text_Category")." - ".admin_language("la_tab_Permissions"); + +$SortFieldVar = "GroupPerm_SortField"; +$SortOrderVar = "GroupPerm_SortOrder"; +$DefaultSortField = "FullName"; +$PerPageVar = "Perpage_Grouplist"; +$CurrentPageVar = "Page_Grouplist"; +$CurrentFilterVar = "CatImg_View"; + +$ListForm = "permlistform"; +$CheckClass = "PermChecks"; +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$saveURL = $admin."/category/category_maint.php"; +$objListToolBar = new clsToolBar(); +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','CatEditStatus','$saveURL',1);","tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','CatEditStatus','".$admin."/browse.php',2);","tool_cancel.gif"); +if($itemcount == 1) $objListToolBar->Add("divider"); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/category/addcategory_permissions.php"; + $StatusField = "CatEditStatus"; + $form = "category"; + MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevCategory','la_NextCategory'); + $objListToolBar->Add("divider"); +} + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("new_perm", "la_ToolTip_New_Permission","#","swap('new_perm','toolbar/tool_new_permission_f2.gif');", + "swap('new_perm', 'toolbar/tool_new_permission.gif');", + "OpenGroupSelector('$envar&source=addcategory_permissions&CatId=".$c->Get("CategoryId")."&destform=popup&destfield=itemlist');", + "tool_new_permission.gif"); + +$objListToolBar->Add("perm_edit","Edit","#", "if (PermChecks.itemChecked()) swap('perm_edit','toolbar/tool_edit_f2.gif');", + "if (PermChecks.itemChecked()) swap('perm_edit', 'toolbar/tool_edit.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addpermission_modules', '');", + "tool_edit.gif",TRUE,TRUE); +$listImages[] = "PermChecks.addImage('perm_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +$objListToolBar->Add("perm_del","Delete","#", "if (PermChecks.itemChecked()) swap('perm_del','toolbar/tool_delete_f2.gif');", + "if (PermChecks.itemChecked()) swap('perm_del', 'toolbar/tool_delete.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_permissions', 'm_perm_delete_group');", + "tool_delete.gif",FALSE,TRUE); +$listImages[] = "PermChecks.addImage('perm_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->Add("divider"); +$objListToolBar->AddToInitScript($listImages); + +/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/ +$objGroupList = new clsGroupList(); +$order = $objConfig->Get("Group_SortOrder"); +$objGroupList->Clear(); + +$sql = "SELECT ResourceId, g.name as Name, ELT(g.Personal+1,'Group ','User ') as UserGroup FROM ".GetTablePrefix()."Permissions as p "; +$sql .="LEFT JOIN ".GetTablePrefix()."PortalGroup as g ON p.GroupId=g.GroupId WHERE p.CatId=".$c->Get("CategoryId")." GROUP BY Name"; +//$sql = "SELECT GroupId, count(*) as PermCount FROM ".GetTablePrefix()."Permissions WHERE CatId=".$c->Get("CategoryId")." GROUP BY GroupId"; +$objGroupList->Query_Item($sql); + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + +/* ---------------------------------------- Configure the list view ---------------------------------------- */ +$objListView = new clsListView($objListToolBar,$objGroupList); +$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%\"",$SortFieldVar,$SortOrderVar,"Name"); +$objListView->ColumnHeaders->Add("UserGroup",admin_language("la_Colheader_GroupType"),1,0,$order,"width=\"30%\"",$SortFieldVar,$SortOrderVar,"UserGroup"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar),$order); + +$objListView->PrintToolBar = FALSE; +$objListView->CurrentPageVar = $CurrentPageVar; +$objListView->PerPageVar = $PerPageVar; +$objListView->CheckboxName = "itemlist[]"; + +int_header($objListToolBar,NULL,$title); +if ($objSession->GetVariable("HasChanges") == 1) { +?> + + + + +
    + +
    + +
    +PrintList(); +?> + +"> +
    +
    + + +
    + + + +
    " name="viewmenu"> + + + + +
    + + + + + Index: trunk/themes/default/img/arr_more_sm.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_products.gif =================================================================== diff -u Binary files differ Index: trunk/admin/browse/checkboxes_new.js =================================================================== diff -u --- trunk/admin/browse/checkboxes_new.js (revision 0) +++ trunk/admin/browse/checkboxes_new.js (revision 13) @@ -0,0 +1,671 @@ +var animationTimeout = 500;//ms + +var focusType = ""; +var tabIDs = new Array(); +var tabSelection = new Array(); +var LastCheckedItem = null; +var enableContextMenus= true; +var doubleClickAction = "edit"; +var CurrentTab = new String(""); +var PasteButton = false; +var start_tab = null; +var selcount = 0; + +var _single_select = false; + +function initCheckBoxes(selChangedHandler) +{ + //theMainScript.InitGrids(); + //return; + + //set single_select to true to turn on radio-buttons select mode + if (typeof(single_select) != 'undefined') _single_select = single_select; + + var checkBoxContainers = document.body.getElementsByTagName("DIV"); + for (var i = 0; i < checkBoxContainers.length; i++) + if (checkBoxContainers[i].getAttribute("isTab")) + { + if(tabIDs.length ==0) + start_tab = checkBoxContainers[i].id; + + tabIDs[tabIDs.length] = checkBoxContainers[i].id + + tabSelection[checkBoxContainers[i].id] = 0; + } + + tabSelection['categories'] = 0; + + categoriesTab = document.getElementById('categories'); + var catInputs = categoriesTab.getElementsByTagName("INPUT"); + for (var i = 0; i < catInputs.length; i++) + catInputs.checked = false; + if (categoriesTab) + categoriesTab.active = true; + + var unique_id = 1; + for (var i = 0; i < checkBoxContainers.length; i++) { + if (checkBoxContainers[i].getAttribute("inportalType")) + { + var inputs = checkBoxContainers[i].getElementsByTagName("INPUT"); + var checkBox; + for (var j = 0; j < inputs.length; j++) + if (inputs[j].type == "checkbox") + { + checkBox = inputs[j]; + if (_single_select) { + + if (document.all) { + unique_id++; + + checkBox.outerHTML = ''; + checkBox = document.getElementById('swapped_to_radio_'+unique_id); + + } + else { + radio = document.createElement('input'); + radio.type = 'radio'; + radio.name = checkBox.name; + radio.value = checkBox.value; + radio.checked = true; + radio.ItemType = checkBox.getAttribute('ItemType'); + checkBox.parentNode.replaceChild(radio, checkBox); + checkBox = radio; + } + } + break; + } + checkBox.inportalType = checkBoxContainers[i].getAttribute("inportalType"); + checkBox.onclick = checkBoxClick; + checkBox.container = checkBoxContainers[i]; + + var selNode = (checkBox.container.getAttribute("inportalType") == "categories") ? checkBox.container.parentNode : checkBox.container.parentNode.parentNode; + + selNode.chB = checkBox; + + document.body.onclick = function(e) + { + //alert('body click'); + var srcElement = (document.all) ? event.srcElement : e.target; + if (!srcElement) return; + if (srcElement.onclick || srcElement.onmousedown || srcElement.onmouseup) return; + if (selcount == 0) { + unselectAll('categories') + if (activeTab) unselectAll(activeTab.id) + } + else { + selcount = 0; + } + } + + if(enableContextMenus==true) + { + selNode.oncontextmenu = function(e) + { +// alert('menu'); +// unselectAll('categories') +// if (activeTab) unselectAll(activeTab.id) + if (!this.chB.checked) + { + unselectAll('categories') + if (activeTab) unselectAll(activeTab.id) + this.chB.checked = true; + this.chB.onclick(); + } + var evt = (!document.all) ? e : event; if (evt) + { + evt.cancelBubble = true; + evt.returnValue = false; + } + showContextMenu(evt); + return false; + } + } + selNode.style.cursor = 'default'; +// document.onselectstart = function(){return false;} + selNode.ondblclick = function(e) + { + unselectAll('categories') + if (activeTab) unselectAll(activeTab.id) + + this.chB.checked = (!this.chB.checked); + this.chB.onclick(); + this.action = doubleClickAction; + actionHandler(this); + + var evt = (!document.all) ? e : event; if (evt) + { + evt.cancelBubble = true; + evt.returnValue = false; + return false; + } + } + + selNode.onclick = function(e) + { + //alert('onclick of selNode'); + var evt = (!document.all) ? e : event; + if (!evt) return; + if (evt) + { + evt.cancelBubble = true; +// evt.returnValue = false; + } +// alert('d') + if (_single_select || (!evt.ctrlKey && !evt.shiftKey)) + { + //alert('unselectAll'); + unselectAll('categories') + if (activeTab) unselectAll(activeTab.id) + if (this.chB.checked == true) return + //alert('setting '+this.chB.name+' '+this.chB.value+' checked = true'); + this.chB.checked = true; + //alert('calling onclick'); + this.chB.onclick(); + return; + } + + if (document.all) document.selection.empty() + else + { + var selection = window.getSelection(); + } + if (evt.shiftKey) + { + + var container = (this.chB.inportalType == "categories") ? document.getElementById("categories") : activeTab; + var inputs = container.getElementsByTagName("INPUT"); + var checkboxes = new Array(); + + for (var i = 0; i < inputs.length; i++) + if ((inputs[i].type == "checkbox" || inputs[i].type == "radio") && inputs[i].container) checkboxes[checkboxes.length] = inputs[i]; + + + var cIndex; var maxIndex = 0; maxLcp = 0; + for (var i = 0; i < checkboxes.length; i++) + { + if (checkboxes[i] == this.chB) cIndex = i; + if (checkboxes[i].lcp > maxLcp) + { + maxIndex = i; + maxLcp = checkboxes[i].lcp; + } +// checkboxes[i].onclick(); + + } + checkboxes[maxIndex].onclick(); + for (var i = 0; i < checkboxes.length; i++) + selectContainer(checkboxes[i], (i <= cIndex && i >= maxIndex && maxIndex <= cIndex || i >= cIndex && i <= maxIndex && maxIndex > cIndex) ) + +//selectContainer(checkBox, value, doNotFireSelectionEvent) + return; + } +// alert(evt.srcElement) + + this.chB.checked = (!this.chB.checked); + this.chB.onclick(); + + return false; + } + + checkBox.checked = false; +// checkBoxContainers[i].className = (checkBox.checked) ? "selectedContainer" : "unselectedContainer"; + selectContainer(checkBox, checkBox.checked, true) + if (checkBox.checked) + tabSelection[checkBox.inportalType]++; + + } + } + tabChanged(); + selectionChanged(); + + initTabsForAnimation(); +} +function clear_checkboxes(){ + //alert('clear checkboxes'); + var inputs = document.body.getElementsByTagName("INPUT"); + for (var j = 0; j < inputs.length; j++) + if ((inputs[j].type == "checkbox") && (inputs[j].inportalType)) + { + inputs[j].checked = false; + } +} + +var lcp = 1; +function checkBoxClick(e) +{ + //alert('click '+this.checked + ' inptype: ' + this.inportalType); + this.lcp = lcp++; + + if (_single_select) { + ch = this.checked; + this.checked = false; + unselectAll('categories') + if (activeTab) unselectAll(activeTab.id) + this.checked = ch; + } + + if (this.inportalType == "categories") + { + if (activeTab) unselectAll(activeTab.id) + } + else unselectAll("categories"); + + + + selectContainer(this, this.checked); + if (this.checked) + { + tabSelection[this.inportalType]++ + LastCheckedItem = this; + } + else + { + tabSelection[this.inportalType]--; + LastCheckedItem = null; + } + updateStatus(); + var evt = (typeof(document.all) == 'undefined') ? e : event; + if (!evt) return; + evt.cancelBubble = true; +// evt.returnValue = false; + return; + +} + +function toggleTab(tabId, atm) +{ + var tab = document.getElementById(tabId); + if (!tab) return; + for (var i = 0; i < tabIDs.length; i++) + { + if (tabIDs[i] != tabId) + { + inactiveTab = document.getElementById(tabIDs[i]); + if(inactiveTab.getAttribute("isTab")) + { + unselectAll(tabIDs[i]); + if (inactiveTab.style.display != "none") + { + inactiveTab.style.top = inactiveTab.pTop - inactiveTab.oHeight; + inactiveTab.pY = -inactiveTab.oHeight; + } + inactiveTab.style.display = "none"; + inactiveTab.active = false; + } + } + } + tab.style.display = ""; + tab.active = true; + if(toolbar) toolbar.setTab(tabId); + activeTab = tab; + tabChanged(); + showTab(atm); + CurrentTab = activeTab.tabTitle; +} + +var collapseTab; + +function showTab(atm) +{ + var container = (activeTab) ? activeTab : collapseTab; + if (!container) return; + var scrollJumpA = scrollJump; + if (!container.startTime) + { + container.startTime = new Date(); + + } + else + { + var cDate = new Date(); + if (cDate - container.startTime >= animationTimeout) scrollJumpA = container.oHeight; + } + var sj = (atm) ? container.oHeight :scrollJumpA; + container.pY += (container.active) ? sj : -sj; + if (container.pY > container.pTop) container.pY = container.pTop; + if (container.pY < -container.oHeight) container.pY = -container.oHeight; + + container.style.top = container.pY; + + if ((container.pY != container.pTop && container.active) || (container.pY != -container.oHeight && !container.active)) + setTimeout("showTab()", 0) + + else + { + unselectAll(container.id); + if (container.active) + { + var devider = document.getElementById("tabsDevider"); + devider.style.display = "none"; + theMainScript.SetCookie('active_tab', container.id); + theMainScript.SetCookie('tabs_on',1); + } + else + { + container.style.top = container.pTop - container.oHeight; + container.style.display = "none"; + theMainScript.SetCookie('tabs_on',0); + } + container.startTime = null; + } +} + + + +function toggleCategories(instant) +{ + var tab = document.getElementById("categories"); + tab.active = (!tab.active); + if(tab.active) + CurrentTab = 'Categories'; + var devider = document.getElementById("categoriesDevider"); + if (!tab.active) devider.style.display = ""; + + toolbar.showButton('new_cat', tab.active) + unselectAll("categories"); + tabChanged(); + + var container = document.getElementById("firstContainer"); + + if (!container.pY) container.pY = 0; + if (!container.pTop && container.pTop != 0) container.pTop = -1; + showCategories(instant); +} + +var scrollJump = 8; +function showCategories(instant) +{ + var container = document.getElementById("firstContainer"); + var categories = document.getElementById("categories"); + var scrollJumpA = scrollJump; + + scrollJumpA = (instant) ? container.offsetHeight : scrollJumpA; + + if (!categories.startTime) + { + categories.startTime = new Date(); + + } + else + { + var cDate = new Date(); + if (cDate - categories.startTime >= animationTimeout) scrollJumpA = categories.offsetHeight; + //ert(animationTimeout); + } + (categories.active) ? container.pY += scrollJumpA : container.pY -= scrollJumpA; + if (container.pY < container.pTop - categories.offsetHeight) + container.pY = container.pTop - categories.offsetHeight; + + if (container.pY > container.pTop) + container.pY = container.pTop; + + container.style.top = container.pY; + if (((Math.abs(container.pY) <= categories.offsetHeight + container.pTop) && (!categories.active)) || ((container.pY < container.pTop) && (categories.active))) + setTimeout("showCategories()", 0) + else + { + unselectAll("categories"); + if (categories.active) //shown categories + { + var devider = document.getElementById("categoriesDevider"); + //devider.style.display = "none"; + theMainScript.SetCookie('cats_tab_on', 1); + } + else { //hidden categories + theMainScript.SetCookie('cats_tab_on', 0); + } + categories.startTime = null; + } +} + +/* +function toggleCategories() +{ + var tab = document.getElementById("categories"); + var devider = document.getElementById("categoriesDevider"); + devider.style.display = (tab.style.display == "none") ? "" : "none"; + +// tab.style.display = (tab.style.display == "none") ? "" : "none"; + + tab.active = (tab.style.display != "none"); + toolbar.showButton('new_cat', tab.active) + unselectAll("categories"); + tabChanged(); + + var container = document.getElementById("firstContainer"); + + if (!container.pY) container.pY = 0; + showCategories(); +} + +function showCategories() +{ + var container = document.getElementById("firstContainer"); + var categories = document.getElementById("categories"); + container.style.top = (categories.active) ? container.pY++ : container.pY--; + if (((Math.abs(container.pY) < categories.offsetHeight) && (!categories.active)) || ((container.pY < 0) && (categories.active))) + setTimeout("showCategories()", 10) + else + unselectAll("categories"); +} +*/ + +function selectAllC(tabId) +{ + if (tabId != 'categories') { + unselectAll('categories'); + } + else { + unselectAll('links'); + unselectAll('news'); + unselectAll('topics'); + } + selcount = 0; + changeSelection(tabId, 0); +} + +function unselectAll(tabId) +{ + selcount = 0; + changeSelection(tabId, 1); + LastCheckedItem = null; +} + +function invert(tabId) +{ + if (tabId != 'categories') { + unselectAll('categories'); + } + else { + unselectAll('links'); + unselectAll('news'); + unselectAll('topics'); + } + selcount = 0; + changeSelection(tabId, 2); +} + +function changeSelection(tabId, action) +{ + if (selcount == 0) { + selcount++; + //alert('change Selection'); + if(toolbar) + { + var tab = document.getElementById(tabId); + if (!tab) return; + var inputs = tab.getElementsByTagName("INPUT"); + //alert(inputs.length); + for (var j = 0; j < inputs.length; j++) { + //alert(inputs[j].type + ' ' + inputs[j].name + ' ' + inputs[j].inportalType); + if ((inputs[j].type == "checkbox" || inputs[j].type == "radio") && (inputs[j].inportalType)) + { + //alert('will do'); + switch (action) + { + case (0) : + selectContainer(inputs[j], true, true) + break; + case (1) : + selectContainer(inputs[j], false, true) + break; + default: + selectContainer(inputs[j], (!inputs[j].checked), true) + break; + } + + } + } + selectionChanged(); + } + } + else { + selcount = 0; + } +} + +function selectContainer(checkBox, value, doNotFireSelectionEvent) +{ + //alert('select cont'); + if (!checkBox) return; + if (checkBox.checked != value) + { + //alert('setting '+value); + checkBox.checked = value; + if (value) + tabSelection[checkBox.inportalType]++ + else + tabSelection[checkBox.inportalType]--; + } + var selNode = (checkBox.container.getAttribute("inportalType") == "categories") ? checkBox.container.parentNode : checkBox.container.parentNode.parentNode; + + if (!selNode.oriCN && checkBox.checked || selNode.className != "selectedContainer" && selNode.className != "unselectedContainer") + selNode.oriCN = (selNode.className) ? selNode.className : ""; + + + selNode.className = (checkBox.checked) ? "selectedContainer" : ((selNode.oriCN != "") ? selNode.oriCN : "unselectedContainer"); +// checkBox.container.className = (checkBox.checked) ? "selectedContainer" : "unselectedContainer"; + if (!doNotFireSelectionEvent) + selectionChanged(); +} + +function updateStatus() +{ + var StatusString=""; + for (var i = 0; i < tabIDs.length; i++) + StatusString+= tabIDs[i] + ": " + tabSelection[tabIDs[i]] + "; "; + + StatusString+= "categories: " + tabSelection['categories'] + "; "; + window.status = StatusString; +} + + +function selectionChanged() +{ + setTimeout('selectionChangedA()', 0) +} +var activeTab; + +function TabPasteEnabled(TabTitle) +{ + //alert('Checking '+TabTitle); + var Enable_Paste = false; + try + { + Enable_Paste = eval(TabTitle+'_Paste'); + return Enable_Paste; + } + catch (e) + { + return; + } +} + +function selectionChangedA() +{ + var categories = document.getElementById('categories'); + + + for (var i = 0; i < tabIDs.length; i++) + { + var thisTab = document.getElementById(tabIDs[i]) + if (!thisTab) continue; + if (thisTab.active) + { + activeTab = thisTab; + activeTab.title = getTabTitle(tabIDs[i]); + break; + } + } + + var numCategoriesSelected = tabSelection['categories']; + var numActiveTabSelected = (activeTab) ? tabSelection[activeTab.id] : 0; + + if(toolbar) + { + //toolbar.enableButton("edit", (numCategoriesSelected + numActiveTabSelected == 1)); + var enableMiscButtons = (numCategoriesSelected + numActiveTabSelected > 0 && numCategoriesSelected * numActiveTabSelected == 0); + var enableCurrentButton = !enableMiscButtons; + + toolbar.enableButton("editcat",enableCurrentButton); + toolbar.enableButton("edit", enableMiscButtons); + toolbar.enableButton("delete", enableMiscButtons); + toolbar.enableButton("approve", enableMiscButtons); + toolbar.enableButton("decline", enableMiscButtons); + toolbar.enableButton("cut", enableMiscButtons); + toolbar.enableButton("copy", enableMiscButtons); + toolbar.enableButton("paste", PasteButton); + toolbar.enableButton("move_up", enableMiscButtons); + toolbar.enableButton("move_down", enableMiscButtons); + } +} + +function tabChanged() +{ + if (activeTab) + { + //alert('now active: '+activeTab.id) + } + +// toggleMenu(); +} + +function getTabTitle(tabId) +{ + var tab = document.getElementById(tabId); + if (!tab) return; + return tab.getAttribute("tabTitle"); +} + +function isAnyChecked(tabId) +{ + //return theMainScript.Grids[tabId].CountSelected() > 0; + return tabSelection[tabId] > 0; +} + + +function initTabsForAnimation() +{ + var iniTop = 0; + + for (var i = 0; i < tabIDs.length; i++) + { + var tab = document.getElementById(tabIDs[i]); + if (!tab) continue; + tab.oHeight = tab.offsetHeight; + tab.style.top = -iniTop; + iniTop += tab.offsetHeight; + tab.pTop = -1; + + } + for (var i = 0; i < tabIDs.length; i++) + { + var tab = document.getElementById(tabIDs[i]); + if (!tab) continue; + tab.style.top = tab.pTop - tab.offsetHeight; + tab.pY = -tab.offsetHeight; + tab.style.visibility = "inherit"; + tab.style.display = "none"; + } + +} \ No newline at end of file Index: trunk/admin/images/arrow16_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_relation_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/user_groups.php =================================================================== diff -u --- trunk/admin/users/user_groups.php (revision 0) +++ trunk/admin/users/user_groups.php (revision 13) @@ -0,0 +1,287 @@ +Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//admin only util + +$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; + + + + +/* -------------------------------------- Section configuration ------------------------------------------- */ +$section = 'in-portal:user_groups'; +$envar = "env=" . BuildEnv(); + +$SortFieldVar = "Group_SortField"; +$SortOrderVar = "Group_SortOrder"; +$DefaultSortField = "Name"; +$PerPageVar = "Perpage_Groups"; +$CurrentPageVar = "Page_Groups"; +$CurrentFilterVar = "Group_View"; + +$ListForm = "grouplistform"; +$CheckClass = "GroupChecks"; + +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$objListToolBar = new clsToolBar(); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("new_group", "la_ToolTip_NewGroup",$adminURL."/users/addgroup.php?".$envar."&new=1","swap('new_group','toolbar/tool_new_group_f2.gif');", + "swap('new_group', 'toolbar/tool_new_group.gif');","","tool_new_group.gif"); + +$objListToolBar->Add("group_edit","la_ToolTip_Edit","#", "if (GroupChecks.itemChecked()) swap('group_edit','toolbar/tool_edit_f2.gif');", + "if (GroupChecks.itemChecked()) swap('group_edit', 'toolbar/tool_edit.gif');","if (GroupChecks.itemChecked()) GroupChecks.check_submit('addgroup', '');", + "tool_edit.gif",TRUE,TRUE); +$listImages[] = "GroupChecks.addImage('group_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +$objListToolBar->Add("group_del","la_ToolTip_Delete","#", "if (GroupChecks.itemChecked()) swap('group_del','toolbar/tool_delete_f2.gif');", + "if (GroupChecks.itemChecked()) swap('group_del', 'toolbar/tool_delete.gif');","if (GroupChecks.itemChecked()) GroupChecks.check_submit('user_groups', 'm_delete_group');", + "tool_delete.gif",FALSE,TRUE); +$listImages[] = "GroupChecks.addImage('group_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("group_mail","la_ToolTip_SendMail","#", "if (GroupChecks.itemChecked()) swap('group_mail','toolbar/tool_e-mail_f2.gif');", + "if (GroupChecks.itemChecked()) swap('group_mail', 'toolbar/tool_e-mail.gif');","if (GroupChecks.itemChecked()) openEmailPopup('','sendmail',$CheckClass);", + "tool_e-mail.gif",FALSE,TRUE); +$listImages[] = "GroupChecks.addImage('group_mail','$imagesURL/toolbar/tool_e-mail.gif','$imagesURL/toolbar/tool_e-mail_f3.gif',1); "; + +$objListToolBar->Add("user_print", "la_ToolTip_Print","#","swap('user_print','toolbar/tool_print_f2.gif');", + "swap('user_print', 'toolbar/tool_print.gif');","window.print();","tool_print.gif"); + +$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); + +/* ----------------------------------------- Set the View Filter ---------------------------------------- */ +/* bit place holders for category view menu */ +$Bit_Pending=4; +$Bit_Disabled=2; +$Bit_Valid=1; +$Bit_All = 7; + +$FilterLabels = array(); + +$FilterLabels[0] = admin_language("la_Text_Enabled"); +$FilterLabels[1] = admin_language("la_Text_Disabled"); +$FilterLabels[2] = admin_language("la_Text_Pending"); + +/* determine current view menu settings */ +$GroupView = $objConfig->Get("Group_View"); + +if(!is_numeric($GroupView)) +{ + $GroupView = $Bit_All; //Set all bits ON + $GroupFilter = ""; +} +else +{ + if($GroupView & $Bit_Valid) + $Status[] = 1; + + if($GroupView & $Bit_Disabled) + $Status[] = 0; + + if($GroupView & $Bit_Pending) + $Status[] = 2; + + if(count($Status)>0) + { + $GroupFilter = "Status IN (".implode(",",$Status).")"; + } + else + $GroupFilter = "Status = -1"; +} + + +$order = $objConfig->Get($SortOrderVar); +$SearchWords = $objSession->GetVariable("GroupSearchWord"); +if(strlen($SearchWords)) +{ + $where = " Personal=0 AND ". $objGroups->AdminSearchWhereClause($SearchWords); +} +else + $where = " Personal=0 "; + +if(strlen($GroupFilter)) + $where .= " AND $GroupFilter "; + +/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/ + +$orderBy = trim($objConfig->Get($SortFieldVar)." ".$order); +if(strlen($orderBy)) + $orderBy = " ORDER BY ".$orderBy; +$sql = "SELECT g.GroupId as GroupId, g.name as GroupName,g.name as name, count(u.PortalUserId) as UserCount FROM ".GetTablePrefix()."PortalGroup as g "; +$sql .="LEFT JOIN ".GetTablePrefix()."UserGroup as u ON g.GroupId=u.GroupId WHERE $where GROUP BY g.name".$orderBy; + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; +$GroupList = new clsGroupList(); +$GroupList->Clear(); +$GroupList->Query_Item($sql); +$itemcount = TableCount(GetTablePrefix()."PortalGroup", $where,0); +if(strlen($SearchWords)) +{ + $title = prompt_language("la_Text_Search_Results")." (".$itemcount.")"; +} +else + $title = prompt_language("la_Text_ShowingGroups")." (".$itemcount.")"; + +/* ---------------------------------------- Configure the list view ---------------------------------------- */ +$objListView = new clsListView($objListToolBar,$GroupList); +$objListView->IdField = "GroupId"; + +$objListView->ColumnHeaders->Add("GroupName", admin_language("la_prompt_GroupName"),1,0,$order,"width=\"50%\"",$SortFieldVar,$SortOrderVar,"GroupName"); +$objListView->ColumnHeaders->Add("UserCount",admin_language("la_prompt_UserCount"),1,0,$order,"width=\"50%\"",$SortFieldVar,$SortOrderVar,"UserCount"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get("Group_SortField"),$order); + +$objListView->PrintToolBar = FALSE; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_group_search"; +$objListView->CurrentPageVar = $CurrentPageVar; +$objListView->PerPageVar = $PerPageVar; +$objListView->CheckboxName = "itemlist[]"; +$objListView->TotalItemCount = $itemcount; + + $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, + $CurrentFilterVar,$GroupView,$Bit_All); + + foreach($FilterLabels as $Bit=>$Label) + { + $objListView->AddViewMenuFilter($Label,$Bit); + } + +$objListToolBar->AddToInitScript("fwLoadMenus();"); + +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
    +PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */ + $objListView->SliceItems(); + print $objListView->PrintList(); +?> + +
    + +
    + + + + +
    +
    + + +
    +
    + + +
    + + + + + Index: trunk/admin/icons/icon46_conf_security.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_refresh_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_copy_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.justifyleft.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_language_f2.gif =================================================================== diff -u Binary files differ Index: trunk/tools/taglib.php =================================================================== diff -u --- trunk/tools/taglib.php (revision 0) +++ trunk/tools/taglib.php (revision 13) @@ -0,0 +1,109 @@ +DeleteTags(); + $t = new clsTagFunction(); + $t->Set("name","include"); + $t->Set("description","insert template output into the current template"); + $t->Create(); + $t->AddAttribute("_template","tpl","Template to insert","",TRUE); + $t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE); + $t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE); + $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE); + unset($t); + + $t = new clsTagFunction(); + $t->Set("name","perm_include"); + $t->Set("description","insert template output into the current template if permissions are set"); + $t->Create(); + $t->AddAttribute("_template","tpl","Template to insert","",TRUE); + $t->AddAttribute("_noaccess","tpl","Template to insert if access is denied","",FALSE); + $t->AddAttribute("_permission","","Comma-separated list of permissions, any of which will grant access","",FALSE); + $t->AddAttribute("_module","","Used in place of the _permission attribute, this attribute verifies the module listed is enabled","",FALSE); + $t->AddAttribute("_system","bool","Must be set to true if any permissions in _permission list is a system permission","",FALSE); + $t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE); + $t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE); + $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE); + unset($t); + + $t = new clsTagFunction(); + $t->Set("name","mod_include"); + $t->Set("description","insert templates from all enabled modules. No error occurs if the template does not exist."); + $t->Create(); + $t->AddAttribute("_template","tpl","Template to insert. This template path should be relative to the module template root directory","",TRUE); + $t->AddAttribute("_modules","","Comma-separated list of modules. Defaults to all enabled modules if not set","",FALSE); + $t->AddAttribute("_supresserror","bool","Supress missing template errors","",FALSE); + $t->AddAttribute("_dataexists","bool","Only include template output if content exists (content is defined by the tags in the template)","",FALSE); + $t->AddAttribute("_nodatatemplate","tpl","Template to include if the nodataexists condition is true","",FALSE); + + //$objTagList->ParseFile($pathtoroot."kernel/parser.php"); + //$objTagList->ParseFile($pathtoroot."in-bulletin/parser.php"); + //$objTagList->ParseFile($pathtoroot."in-link/parser.php"); + //$objTagList->ParseFile($pathtoroot."in-news/parser.php"); + if(is_array($ParserFiles)) + { + foreach($ParserFiles as $file) + { + $objTagList->ParseFile($pathtoroot.$file); + } + } + if(is_array($ItemTagFiles)) + { + foreach($ItemTagFiles as $file) + { + $objTagList->ParseItemFile($pathtoroot.$file); + } + } + +} + +$objTagList->Clear(); +$objTagList->Query_Item("SELECT * FROM ".$objTagList->SourceTable); + +if($objTagList->NumItems()>0) +{ + foreach($objTagList->Items as $i) + { + $i->LoadAttribs(); + //echo " ".$i->attribs->NumItems()." Attributes
    \n"; + if(strlen($i->Get("name"))) + { + echo ""; + echo ""; + echo ""; + if($i->attribs->NumItems()>0) + { + echo "
    "; + if($i->Get("scope")!="global") + { + echo "".$i->Get("scope").".".$i->Get("name").""; + } + else + echo "".$i->Get("name").""; + echo ""; + echo $i->Get("example")."
    "; + echo "".$i->Get("description")."
    "; + echo "Attributes:
    \n"; + //echo "
    ";print_r($i->attribs->Items); echo "
    "; + echo ""; + foreach($i->attribs->Items as $a) + { + echo ""; + } + echo "
    ".$a->Get("Name")."[".$a->Get("AttrType")."] ".$a->Get("Description")."
    "; + } + echo "
    "; + } + } +} +?> Index: trunk/admin/config/addlang_email.php =================================================================== diff -u --- trunk/admin/config/addlang_email.php (revision 0) +++ trunk/admin/config/addlang_email.php (revision 13) @@ -0,0 +1,398 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +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"); + +unset($objEditItems); + +$objEditItems = new clsPhraseList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Language"); +$objEditItems->EnablePaging = FALSE; +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); + +$c = $objEditItems->GetItemByIndex($en); + +$name = $c->Get("PackName"); +$LangId = $c->Get("LanguageId"); + +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_phrase_edit"; + +/* -------------------------------------- Section configuration ------------------------------------------- */ +$envar = "env=" . BuildEnv() . "&en=$en"; +$section = 'in-portal:lang_email'; +$sec = $objSections->GetSection($section); + +$SortFieldVar = "LangEmail_LV_SortField"; +$SortOrderVar = "LangEmail_LV_SortOrder"; +$DefaultSortField = "Description"; +$PerPageVar = "Perpage_LangEmail"; +$CurrentPageVar = "Page_LangEmail"; +$CurrentFilterVar = "LangEmailEvent_View"; + +$ListForm = "language"; +$CheckClass = "EmailChecks"; + +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$objListToolBar = new clsToolBar(); +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('language','LangEditStatus','".$admin."/config/config_lang.php',1);",$imagesURL."/toolbar/tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('language','LangEditStatus','".$admin."/config/config_lang.php',2);",$imagesURL."/toolbar/tool_cancel.gif"); +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); + +if ( isset($en_prev) || isset($en_next) ) +{ + $objListToolBar->Add("divider"); + if($en_prev>-1) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + $onClick= $sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_prev"; + $link=$_SERVER["PHP_SELF"].$var; + $objListToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Theme"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + else + { + $MouseOver=""; + $MouseOut=""; + $onClick=""; + $link="#"; + $objListToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Theme"),"#","","","","tool_prev_f3.gif"); + + } + if($en_next>-1) + { + $MouseOver="swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="swap('moveright', 'toolbar/tool_next.gif');"; + $onClick=$sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_next"; + $link=$_SERVER["PHP_SELF"].$var; + $objListToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Theme"),$link,$MouseOver,$MouseOut,"","tool_next.gif"); + } + else + { + $objListToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Theme"),$link,$MouseOver,$MouseOut,"","tool_next_f3.gif"); + } + +} +$objListToolBar->Add("divider"); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick +$EditEnv = $envar."&Lang=".$c->Get("LanguageId"); + +$objListToolBar->Add("email_edit", "la_ToolTip_Edit","#","if (EmailChecks.itemChecked()) swap('email_edit','toolbar/tool_edit_f2.gif');", + "if (EmailChecks.itemChecked()) swap('email_edit', 'toolbar/tool_edit.gif');", + "if (EmailChecks.itemChecked()) EmailChecks.check_submit('email_edit', '');", + "tool_edit.gif",TRUE,TRUE); +$listImages[] = "EmailChecks.addImage('email_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +/* +$objListToolBar->Add("email_user", "la_ToolTip_Email_UserSelect","#","if (EmailChecks.itemChecked()) swap('email_user','toolbar/tool_usertogroup_f2.gif');", + "if (EmailChecks.itemChecked()) swap('email_user', 'toolbar/tool_usertogroup.gif');", + "OpenUserSelector('$envar&Selector=radio&destform=userpopup&destfield=FromUserId&IdField=PortalUserId',$LangId);", + "tool_usertogroup.gif"); + +$listImages[] = "EmailChecks.addImage('email_user','$imagesURL/toolbar/tool_usertogroup.gif','$imagesURL/toolbar/tool_usertogroup_f3.gif',1); "; +*/ +$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();"); + +/* ----------------------------------------- Set the View Filter ---------------------------------------- */ + +$ViewNormal=1; +$Bit_Disabled=2; +$Bit_Enabled=1; +$Bit_FrontOnly=4; +$Bit_All = 7; + +$FilterLabels = array(); + +$FilterLabels[0] = admin_language("la_Text_Enabled"); +$FilterLabels[1] = admin_language("la_Text_Disabled"); +$FilterLabels[2] = admin_language("la_Text_FrontOnly"); + +/* determine current view menu settings */ +$MsgView = $objConfig->Get($CurrentFilterVar); + +if(!is_numeric($MsgView)) +{ + $MsgView = $Bit_All; //Set all bits ON + $MsgFilter = ""; +} + +if($MsgView & $Bit_Disabled) + $Status[] = 0; + +if($MsgView & $Bit_Enabled) + $Status[] = 1; + + if($MsgView & $Bit_FrontOnly) + $Status[] = 2; + +if(count($Status)>0) +{ + $MsgFilter = "Enabled IN (".implode(",",$Status).")"; +} +else + $MsgFilter = "Enabled = -1"; + +/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/ + +$objEvents = new clsEventList(); +$order = trim($objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar)); + +$SearchWords = $objSession->GetVariable("LangEmailEventSearchWord"); +if(strlen($SearchWords)) +{ + $where = $objEvents->AdminSearchWhereClause($SearchWords); +} +else + $where = ""; + +$UserTable = GetTablePrefix()."PortalUser"; +$EventTable = GetTablePrefix()."Events"; +$MessageTable = GetTablePrefix()."EmailMessage"; + +$sql = "SELECT e.Description as Description, e.Module as Module, e.EventId as EventId, "; +$sql .="ELT(e.Enabled+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ', '".admin_language("la_Text_FrontOnly")." ') as EventStatus, "; +$sql .="ELT(e.Type+1,'".admin_language("la_Text_User")." ','".admin_language("la_Text_Admin")." ') as EventType, "; +$sql .="u.Login as FromUser FROM $EventTable as e LEFT JOIN $UserTable as u ON (e.FromUserId=u.PortalUserId) "; + +$FullWhere = ""; +if(strlen($where)) +{ + $FullWhere = "WHERE $where "; +} +if(strlen($MsgFilter)) +{ + if(!strlen($FullWhere)) + { + $FullWhere = "WHERE $MsgFilter "; + } + else + $FullWhere .= " AND ($MsgFilter) "; +} +$sql .= $FullWhere; + +if(strlen($objConfig->Get($SortFieldVar))) + $sql .= "ORDER BY ".$order." "; + +if(isset($_GET["lpn"])) + $objSession->SetVariable($CurrentPageVar,$_GET["lpn"]); + +$sql .= GetLimitSQL($objSession->GetVariable($CurrentPageVar),$objConfig->Get($PerPageVar)); +//echo $sql; +$objEvents->Query_Item($sql); +$itemcount = TableCount($objEvents->SourceTable, $where,0); + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + + +/* ---------------------------------------- Configure the list view ---------------------------------------- */ +$objListView = new clsListView($objListToolBar,$objEvents); +$objListView->IdField = "EventId"; + +$order = $objConfig->Get("LangEmail_LV_SortField"); + +$objListView->ColumnHeaders->Add("Description",admin_language("la_prompt_Description"),1,0,$order,"width=\"50%\"","LangEmail_LV_SortField","LangEmail_LV_SortOrder","Description"); +$objListView->ColumnHeaders->Add("Module",admin_language("la_prompt_Module"),1,0,$order,"width=\"15%\"","LangEmail_LV_SortField","LangEmail_LV_SortOrder","Module"); +$objListView->ColumnHeaders->Add("EventType",admin_language("la_prompt_Type"),1,0,$order,"width=\"10%\"","LangEmail_LV_SortField","LangEmail_LV_SortOrder","EventType"); +$objListView->ColumnHeaders->Add("EventStatus",admin_language("la_prompt_Status"),1,0,$order,"width=\"10%\"","LangEmail_LV_SortField","LangEmail_LV_SortOrder","EventStatus"); +//$objListView->ColumnHeaders->Add("FromUser",admin_language("la_prompt_FromUser"),1,0,$order,"width=\"15%\"","Email_LV_SortField","Email_LV_SortOrder","FromUser"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar)); + +$objListView->PrintToolBar = FALSE; +$objListView->checkboxes = TRUE; + +$objListView->CurrentPageVar = $CurrentPageVar; +$objListView->PerPageVar = $PerPageVar; +$objListView->CheckboxName = "itemlist[]"; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_langemailevent_search"; + +$objListView->TotalItemCount = $itemcount; + + $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, + $CurrentFilterVar,$MsgView,$Bit_All); + + foreach($FilterLabels as $Bit=>$Label) + { + $objListView->AddViewMenuFilter($Label,$Bit); + } + +for($i=0;$iItems);$i++) +{ + $e =& $objEvents->GetItemRefByIndex($i); + $e->Set("Description",prompt_language($e->Get("Description"))); +} + + +$title = prompt_language("la_Text_Configuration")." - '".$name."' ".prompt_language("la_Text_Pack")." - ".prompt_language("la_tab_EmailEvents"); + +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
    " method=POST> + + +PrintList(); +?> + + + + + + > + + + +
    +
    + + +
    " name="viewmenu"> + + + + +
    +
    + + +
    + +
    " ID="popup"> + + + + + + + +
    + +
    " ID="userpopup"> + +"> + + +
    + + + + Index: trunk/admin/images/toolbar/tool_divider.gif =================================================================== diff -u Binary files differ Index: trunk/admin/category/category_maint.php =================================================================== diff -u --- trunk/admin/category/category_maint.php (revision 0) +++ trunk/admin/category/category_maint.php (revision 13) @@ -0,0 +1,233 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +$section = "in-portal:category_maint"; + +$CatsPerLoad = 10; +$ado = GetADODBConnection(); + +if(!is_numeric($_GET["CatIndex"])) +{ + unset($objEditItems); + + $objEditItems = new clsCatList(); + $objEditItems->SourceTable = $objSession->GetEditTable("Category"); + $table = $objEditItems->SourceTable; + //echo "Dropping Table..
    \n"; + @$ado->Execute("DROP TABLE $table"); + + if($objCatList->CurrentCategoryID()>0) + { + $c = $objCatList->GetItem($objCatList->CurrentCategoryID()); + $path = $c->Get("ParentPath"); + $sql = "SELECT CategoryId,ParentPath FROM ".$objCatList->SourceTable." WHERE ParentPath LIKE '".$path."%'"; + $ado->Execute("CREATE TABLE $table ".$sql); + } + else + { + $sql = "SELECT CategoryId,ParentPath FROM ".$objCatList->SourceTable; + $objEditTable->SourceTable = $objCatList->SourceTable; + $table = $objCatList->SourceTable; + } + $NumCats = TableCount($table,"",0); +} + +// init vars +if( !isset($NumCats) ) $NumCats = 0; +if( !isset($CatIndex) ) $CatIndex = 0; +if(is_numeric($_GET["CatIndex"])) +{ + $NumCats = $_REQUEST['NumCats']; + $CatIndex = (int)$_REQUEST['CatIndex']; + $table = ($objCatList->CurrentCategoryID() > 0) ? $objSession->GetEditTable("Category") : $objCatList->SourceTable; + //echo $NumCats." Loaded
    \n"; + $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories"); + $title .= " $CatIndex / $NumCats ".prompt_language("la_Text_complete"); +} +else + $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories"); + +$sql = "SELECT * FROM $table ORDER BY ParentPath ASC LIMIT $CatIndex,$CatsPerLoad"; +$start = getmicrotime(); +//echo $sql."
    \n"; +$objCatList->Query_Item($sql); +//echo getmicrotime() - $start." QUERY ".$x."
    \n"; +$x = 0; + +foreach($objCatList->Items as $cat) +{ + // echo getmicrotime() - $start." START ".$x."
    \n"; + $cat->UpdateACL(); + // echo getmicrotime() - $start." ACL ".$x."
    \n"; + $cat->UpdateCachedPath(); + // echo getmicrotime() - $start." PATH ".$x."
    \n"; + $x++; + // echo "
    \n"; + // echo $cat->Get("ParentPath")."
    \n"; + // $cat->UpdateCacheCounts(); + // $objSystemCache->PurgeCategory($cat->Get("CategoryId")); +} + +int_header(NULL,NULL,$title); +?> + + + $CatsPerLoad) +{ + int_subsection_title(prompt_language("la_confirm_maintenance")); + $yes_url = $_SERVER['PHP_SELF'].'?env='.BuildEnv().'&CatIndex=0&NumCats='.$NumCats; + $no_url = $adminURL.'/browse.php?env='.BuildEnv(); +?> + + + + + + + + +
    + " onclick="javascript:goto_url('');" class="button"> + + " onclick="javascript:goto_url('');" class="button"> +
    + + +"; + echo "
    $percent"; + echo "%
    "; + $row2 = 100-$percent; + echo " $percent"; + echo "%
    $percent%
    $percent%"; + $row2 = 100-$percent; + echo "
    +$NumCats) + { + $target = $adminURL."/browse.php?env=".BuildEnv(); + } + else + { + $next = $CatIndex+$CatsPerLoad; + if($next > $NumCats) + { + $target = $adminURL."/browse.php?env=".BuildEnv(); + } + else + $target = $_SERVER["PHP_SELF"]."?env=".BuildEnv()."&CatIndex=".$next."&NumCats=$NumCats"; + } + + //print "$target"; + + print ""; +?> + Index: trunk/admin/tools/sql_result.php =================================================================== diff -u --- trunk/admin/tools/sql_result.php (revision 0) +++ trunk/admin/tools/sql_result.php (revision 13) @@ -0,0 +1,180 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; + +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"); + +$envar = "env=" . BuildEnv(); +$section = 'in-portal:sql_query'; +$sec = $objSections->GetSection($section); + +$parent = $objSections->GetSection($sec->Get("parent")); + +$title = admin_language("la_tab_QueryDB"); + +//$saveURL = $admin."/browse.php"; +$saveURL = $admin."/tools/sql_results.php"; +$ParentUrl = $parent->URL(); +if(strlen($ParentUrl)>0) +{ + $cancelUrl = $ParentUrl; +} +else + $cancelUrl = $_SERVER['PHP_SELF']."?".$envar; + +$action = "m_sql_query"; + +$sql_query = trim($objSession->GetVariable("LastSQLquery")); + +//$objCatToolBar = new clsToolBar(); +//$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('sqlform','$saveURL',1,'');","tool_select.gif"); +//$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('category','$cancelURL',2,'');","tool_cancel.gif"); + +int_header(NULL,NULL,$title); +?> + + + + > + + + +0) + { +?> + + > + + + +classname = "clsItemDB"; + echo ""; + } +?> +
    + + " onclick="history.go(-1);"> +
    + +
    "; + while($SqlResult && !$SqlResult->EOF) + { + $ResultObject->AddItemFromArray($SqlResult->fields,TRUE); + $SqlResult->MoveNext(); + } + $objListView = new clsListView(NULL,$ResultObject); + $fields = $SqlResult->FieldTypesArray(); + if(is_array($fields)) + { + $width = 100 / count($fields); + $width = "width=\"".$width."%\""; + + foreach($fields as $f) + { + $name = $f->name; + $objListView->ColumnHeaders->Add($name,$name,1,0,"",$width,"", "",$name); + } + } + $objListView->PrintToolBar = FALSE; + $objListView->nowrap = FALSE; + $objListView->CurrentPageVar = ""; + $objListView->PerPageVar = ""; + $objListView->checkboxes=false; + echo $objListView->ColumnHeaders->PrintColumns(); + if($ResultObject->NumItems()>0) + { + echo $objListView->PrintItems(); + } + echo "
    + \ No newline at end of file Index: trunk/admin/images/arrow16.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_language_disabled.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_relation.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_search_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_image.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_modules.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-odbc_mssql.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-odbc_mssql.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-odbc_mssql.inc.php (revision 13) @@ -0,0 +1,38 @@ +ADORecordSet_odbc($id); + } +} +?> \ No newline at end of file Index: trunk/admin/images/tab_active_right.gif =================================================================== diff -u Binary files differ Index: trunk/admin/backup/restore3.php =================================================================== diff -u --- trunk/admin/backup/restore3.php (revision 0) +++ trunk/admin/backup/restore3.php (revision 13) @@ -0,0 +1,179 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$adminURL = $rootURL.$admin; +$localURL=$rootURL."kernel/"; +$imagesURL = $rootURL."admin/images"; +//admin only util +$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."/install/install_lib.php"); + +$conn = GetAdodbConnection(); +$section = "in-portal:restore"; +int_header(NULL); +//echo "FileOffset: $FileOffset
    \n"; +if(count($_POST)) +{ + $filename = "dump".$_POST["backupdate"]."txt"; + $filename = $objConfig->Get("Backup_Path")."/".$filename; +} +else + $filename = $_GET["Filename"]; + +$FileOffset = (int)$_GET["Offset"]; +//echo "FileOffset: $FileOffset
    \n"; +if(!file_exists($filename)) +{ + echo prompt_language("la_restore_file_not_found")." : $filename"; + exit(); +} +if(!is_readable($filename)) +{ + echo prompt_language("la_restore_access_denied"); + exit(); +} + +$TotalSize = filesize($filename); + +$MaxLines = 200; + +$PageTitle = admin_language("la_text_Restore_in_progress"); +$CancelURL = $rootURL ."admin/backup/restore1.php?env=".BuildEnv(); + +stats($PageTitle,$FileOffset,$TotalSize); +//echo "FileOffset: $FileOffset
    \n"; +if($FileOffset < $TotalSize) +{ + $FileOffset = RunRestoreFile($conn,$filename,$FileOffset,$MaxLines); + if($FileOffset>-1) + { + if($FileOffset ==0) + $FileOffset = $TotalSize; + $url = $_SERVER['PHP_SELF']."?env=".BuildEnv()."&Offset=$FileOffset&Filename=$filename"; + } + else + { + switch($FileOffset) + { + case -1: + $error = prompt_language("la_restore_file_error"); + break; + case -2: + $error = prompt_language("la_restore_read_error"); + break; + default: + $error = "(".$FileOffset.") ".prompt_language("la_restore_unknown_error"); + break; + } + echo $error; + die(); + } +} +else + $url = $adminURL."/backup/restore4.php?env=".BuildEnv(); + +reload($url); +echo ""; +echo ""; + +function stats($caption,$myprogress,$totalnum) +{ + global $rootURL, $CancelURL; + + if($totalnum>0) + { + $pct=round(($myprogress/ $totalnum)*100); + } + else + $pct = 100; + $o .=""; + + echo "\n"; + $o .= int_subsection_title_ret($caption."-".$pct."%"); + $o .= "

    "; + $o .= " "; + $o .=" "; + $comp_pct = 100-$pct; + $o .= " "; + $o .= "
     
    "; + $o .= "
    "; + echo $o."\n"; + echo "
    "; +} + +function reload($url) +{ + print ""; + echo "$url "; +} +?> Index: trunk/admin/icons/icon46_list_tools.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/gr.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/gr.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/gr.js (revision 13) @@ -0,0 +1,401 @@ +��/* + + * FCKeditor - The text editor for internet + + * Copyright (C) 2003 Frederico Caldeira Knabben + + * + + * Licensed under the terms of the GNU Lesser General Public License + + * (http://www.opensource.org/licenses/lgpl-license.php) + + * + + * For further information go to http://www.fredck.com/FCKeditor/ + + * or contact fckeditor@fredck.com. + + * + + * gr.js: Greek support. + + * + + * Authors: + + * Frederico Caldeira Knabben (fckeditor@fredck.com) + + * + + * Greek translation by: + + * Spyros Barbatos (sbarbatos@becom.gr) + + * + + */ + + + +// Toolbar Items and Context Menu + + + +lang["Cut"] = "�������" ; + +lang["Copy"] = "���������" ; + +lang["Paste"] = "���������" ; + +lang["PasteText"] = "��������� (���� �������)" ; + +lang["PasteWord"] = "��������� ��� �� Word" ; + +lang["Find"] = "���������" ; + +lang["SelectAll"] = "������� ����" ; + +lang["RemoveFormat"] = "�������� ������������" ; + +lang["InsertLink"] = "��������/�������� ��������� (Link)" ; + +lang["RemoveLink"] = "�������� ��������� (Link)" ; + +lang["InsertImage"] = "��������/�������� �������" ; + +lang["InsertTable"] = "��������/�������� ������" ; + +lang["InsertLine"] = "�������� ���������� �������" ; + +lang["InsertSpecialChar"] = "�������� ������� ��������" ; + +lang["InsertSmiley"] = "�������� Smiley" ; + +lang["About"] = "���� ��� FCKeditor" ; + + + +lang["Bold"] = "������" ; + +lang["Italic"] = "������" ; + +lang["Underline"] = "�����������" ; + +lang["StrikeThrough"] = "�����������" ; + +lang["Subscript"] = "�������" ; + +lang["Superscript"] = "�������" ; + +lang["LeftJustify"] = "�������� ��������" ; + +lang["CenterJustify"] = "�������� ��� ������" ; + +lang["RightJustify"] = "�������� �����" ; + +lang["BlockJustify"] = "�������� Block" ; + +lang["DecreaseIndent"] = "������ ������" ; + +lang["IncreaseIndent"] = "������ ������" ; + +lang["Undo"] = "Undo" ; + +lang["Redo"] = "Redo" ; + +lang["NumberedList"] = "����� �� ��������" ; + +lang["BulettedList"] = "����� �� Bullets" ; + + + +lang["ShowTableBorders"] = "������� ����� ������" ; + +lang["ShowDetails"] = "������� ������������" ; + + + +lang["FontStyle"] = "Style" ; + +lang["FontFormat"] = "�����������" ; + +lang["Font"] = "�������������" ; + +lang["FontSize"] = "�������" ; + +lang["TextColor"] = "����� ���������" ; + +lang["BGColor"] = "����� ���������" ; + +lang["Source"] = "HTML �������" ; + + + +// Context Menu + + + +lang["EditLink"] = "�������� ��������� (Link)" ; + +lang["InsertRow"] = "�������� �������" ; + +lang["DeleteRows"] = "�������� �������" ; + +lang["InsertColumn"] = "�������� �������" ; + +lang["DeleteColumns"] = "�������� �������" ; + +lang["InsertCell"] = "�������� ������" ; + +lang["DeleteCells"] = "�������� ������" ; + +lang["MergeCells"] = "��������� ������" ; + +lang["SplitCell"] = "����������� ������" ; + +lang["CellProperties"] = "��������� ������" ; + +lang["TableProperties"] = "��������� ������" ; + +lang["ImageProperties"] = "��������� �������" ; + + + +// Alerts and Messages + + + +lang["ProcessingXHTML"] = "����������� XHTML. �������� ����������..." ; + +lang["Done"] = "������" ; + +lang["PasteWordConfirm"] = "�� ������� ��� ������ �� �����������, �������� ��� ���������� ��� �� Word. ������ �� ���������� ���� ����������;" ; + +lang["NotCompatiblePaste"] = "���� � ������� ����� ��������� ���� Internet Explorer ������ 5.5 � ����������. ������ �� ����� � ��������� ����� ���������;" ; + + + +// Dialogs + +lang["DlgBtnOK"] = "OK" ; + +lang["DlgBtnCancel"] = "�������" ; + +lang["DlgBtnClose"] = "��������" ; + + + +// Image Dialog + +lang["DlgImgTitleInsert"] = "�������� �������" ; + +lang["DlgImgTitleEdit"] = "�������� �������" ; + +lang["DlgImgBtnUpload"] = "�������� ���� ����������" ; + +lang["DlgImgURL"] = "URL" ; + +lang["DlgImgUpload"] = "��������" ; + +lang["DlgImgBtnBrowse"] = "������� ������� ����������" ; + +lang["DlgImgAlt"] = "����������� ������� (ALT)" ; + +lang["DlgImgWidth"] = "������" ; + +lang["DlgImgHeight"] = "����" ; + +lang["DlgImgLockRatio"] = "�������� ���������" ; + +lang["DlgBtnResetSize"] = "��������� ������� ��������" ; + +lang["DlgImgBorder"] = "���������" ; + +lang["DlgImgHSpace"] = "HSpace" ; + +lang["DlgImgVSpace"] = "VSpace" ; + +lang["DlgImgAlign"] = "Align" ; + +lang["DlgImgAlignLeft"] = "Left" ; + +lang["DlgImgAlignAbsBottom"] = "Abs Bottom" ; + +lang["DlgImgAlignAbsMiddle"] = "Abs Middle" ; + +lang["DlgImgAlignBaseline"] = "Baseline" ; + +lang["DlgImgAlignBottom"] = "Bottom" ; + +lang["DlgImgAlignMiddle"] = "Middle" ; + +lang["DlgImgAlignRight"] = "Right" ; + +lang["DlgImgAlignTextTop"] = "Text Top" ; + +lang["DlgImgAlignTop"] = "Top" ; + +lang["DlgImgPreview"] = "�������������" ; + +lang["DlgImgMsgWrongExt"] = "�������� ���� �� �������� ����� ������� ����������� �� �����������:\n\n" + config.ImageUploadAllowedExtensions + "\n\n� ������� ���������." ; + +lang["DlgImgAlertSelect"] = "Please select an image to upload." ; // TODO + + + +// Link Dialog + +lang["DlgLnkWindowTitle"] = "Link" ; // TODO + +lang["DlgLnkURL"] = "URL" ; + +lang["DlgLnkUpload"] = "��������" ; + +lang["DlgLnkTarget"] = "Target" ; + +lang["DlgLnkTargetNotSet"] = "<Not set>" ; + +lang["DlgLnkTargetBlank"] = "��� �������� (_blank)" ; + +lang["DlgLnkTargetParent"] = "������ �������� (_parent)" ; + +lang["DlgLnkTargetSelf"] = "���� �������� (_self)" ; + +lang["DlgLnkTargetTop"] = "������� �������� (_top)" ; + +lang["DlgLnkTitle"] = "������" ; + +lang["DlgLnkBtnUpload"] = "�������� ���� ����������" ; + +lang["DlgLnkBtnBrowse"] = "������� ������� ����������" ; + +lang["DlgLnkMsgWrongExtA"] = "�������� ���� �� �������� ����� ������� ����������� �� �����������:\n\n" + config.LinkUploadAllowedExtensions + "\n\n� ������� ���������." ; + +lang["DlgLnkMsgWrongExtD"] = "�������� �� �������� ����� ������� ��� ����������� �� �����������:\n\n" + config.LinkUploadDeniedExtensions + "\n\n� ������� ���������." ; + + + +// Color Dialog + +lang["DlgColorTitle"] = "������� ��������" ; + +lang["DlgColorBtnClear"] = "����������" ; + +lang["DlgColorHighlight"] = "Highlight" ; + +lang["DlgColorSelected"] = "����������" ; + + + +// Smiley Dialog + +lang["DlgSmileyTitle"] = "�������� Smiley" ; + + + +// Special Character Dialog + +lang["DlgSpecialCharTitle"] = "�������� ������� ��������" ; + + + +// Table Dialog + +lang["DlgTableTitleInsert"] = "�������� ������" ; + +lang["DlgTableTitleEdit"] = "�������� ������" ; + +lang["DlgTableRows"] = "�������" ; + +lang["DlgTableColumns"] = "�������" ; + +lang["DlgTableBorder"] = "������� ����������" ; + +lang["DlgTableAlign"] = "��������" ; + +lang["DlgTableAlignNotSet"] = "<Not set>" ; + +lang["DlgTableAlignLeft"] = "��������" ; + +lang["DlgTableAlignCenter"] = "������" ; + +lang["DlgTableAlignRight"] = "�����" ; + +lang["DlgTableWidth"] = "������" ; + +lang["DlgTableWidthPx"] = "pixels" ; + +lang["DlgTableWidthPc"] = "%" ; + +lang["DlgTableHeight"] = "����" ; + +lang["DlgTableCellSpace"] = "Cell spacing" ; + +lang["DlgTableCellPad"] = "Cell padding" ; + +lang["DlgTableCaption"] = "���������" ; + + + +// Table Cell Dialog + +lang["DlgCellTitle"] = "��������� ������" ; + +lang["DlgCellWidth"] = "������" ; + +lang["DlgCellWidthPx"] = "pixels" ; + +lang["DlgCellWidthPc"] = "%" ; + +lang["DlgCellHeight"] = "����" ; + +lang["DlgCellWordWrap"] = "Word Wrap" ; + +lang["DlgCellWordWrapNotSet"] = "<Not set>" ; + +lang["DlgCellWordWrapYes"] = "���" ; + +lang["DlgCellWordWrapNo"] = "���" ; + +lang["DlgCellHorAlign"] = "��������� ��������" ; + +lang["DlgCellHorAlignNotSet"] = "<Not set>" ; + +lang["DlgCellHorAlignLeft"] = "��������" ; + +lang["DlgCellHorAlignCenter"] = "������" ; + +lang["DlgCellHorAlignRight"] = "�����" ; + +lang["DlgCellVerAlign"] = "������ ��������" ; + +lang["DlgCellVerAlignNotSet"] = "<Not set>" ; + +lang["DlgCellVerAlignTop"] = "Top" ; + +lang["DlgCellVerAlignMiddle"] = "Middle" ; + +lang["DlgCellVerAlignBottom"] = "Bottom" ; + +lang["DlgCellVerAlignBaseline"] = "Baseline" ; + +lang["DlgCellRowSpan"] = "Rows Span" ; + +lang["DlgCellCollSpan"] = "Columns Span" ; + +lang["DlgCellBackColor"] = "����� ���������" ; + +lang["DlgCellBorderColor"] = "����� ����������" ; + +lang["DlgCellBtnSelect"] = "�������..." ; + + + +// About Dialog + +lang["DlgAboutVersion"] = "������" ; + +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; + +lang["DlgAboutInfo"] = "��� ������������ �����������, ����������� ��" ; \ No newline at end of file Index: trunk/admin/images/itemicons/icon16_cat_denied.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-time.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-time.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-time.inc.php (revision 13) @@ -0,0 +1,870 @@ + 4 digit year conversion. The maximum is billions of years in the +future, but this is a theoretical limit as the computation of that year +would take too long with the current implementation of adodb_mktime(). + +This library replaces native functions as follows: + +
    	
    +	getdate()  with  adodb_getdate()
    +	date()     with  adodb_date() 
    +	gmdate()   with  adodb_gmdate()
    +	mktime()   with  adodb_mktime()
    +	gmmktime() with  adodb_gmmktime()45
    +
    + +The parameters are identical, except that adodb_date() accepts a subset +of date()'s field formats. Mktime() will convert from local time to GMT, +and date() will convert from GMT to local time, but daylight savings is +not handled currently. + +This library is independant of the rest of ADOdb, and can be used +as standalone code. + +PERFORMANCE + +For high speed, this library uses the native date functions where +possible, and only switches to PHP code when the dates fall outside +the 32-bit signed integer range. + +GREGORIAN CORRECTION + +Pope Gregory shortened October of A.D. 1582 by ten days. Thursday, +October 4, 1582 (Julian) was followed immediately by Friday, October 15, +1582 (Gregorian). + +Since 0.06, we handle this correctly, so: + +adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582) + == 24 * 3600 (1 day) + +============================================================================= + +COPYRIGHT + +(c) 2003 John Lim and released under BSD-style license except for code by jackbbs, +which includes adodb_mktime, adodb_get_gmt_different, adodb_is_leap_year +and originally found at http://www.php.net/manual/en/function.mktime.php + +============================================================================= + +BUG REPORTS + +These should be posted to the ADOdb forums at + + http://phplens.com/lens/lensforum/topics.php?id=4 + +============================================================================= + +FUNCTION DESCRIPTIONS + + +FUNCTION adodb_getdate($date=false) + +Returns an array containing date information, as getdate(), but supports +dates greater than 1901 to 2038. + + +FUNCTION adodb_date($fmt, $timestamp = false) + +Convert a timestamp to a formatted local date. If $timestamp is not defined, the +current timestamp is used. Unlike the function date(), it supports dates +outside the 1901 to 2038 range. + +The format fields that adodb_date supports: + +
    +a - "am" or "pm" 
    +A - "AM" or "PM" 
    +d - day of the month, 2 digits with leading zeros; i.e. "01" to "31" 
    +D - day of the week, textual, 3 letters; e.g. "Fri" 
    +F - month, textual, long; e.g. "January" 
    +g - hour, 12-hour format without leading zeros; i.e. "1" to "12" 
    +G - hour, 24-hour format without leading zeros; i.e. "0" to "23" 
    +h - hour, 12-hour format; i.e. "01" to "12" 
    +H - hour, 24-hour format; i.e. "00" to "23" 
    +i - minutes; i.e. "00" to "59" 
    +j - day of the month without leading zeros; i.e. "1" to "31" 
    +l (lowercase 'L') - day of the week, textual, long; e.g. "Friday"  
    +L - boolean for whether it is a leap year; i.e. "0" or "1" 
    +m - month; i.e. "01" to "12" 
    +M - month, textual, 3 letters; e.g. "Jan" 
    +n - month without leading zeros; i.e. "1" to "12" 
    +O - Difference to Greenwich time in hours; e.g. "+0200" 
    +r - RFC 822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" 
    +s - seconds; i.e. "00" to "59" 
    +S - English ordinal suffix for the day of the month, 2 characters; 
    +   			i.e. "st", "nd", "rd" or "th" 
    +t - number of days in the given month; i.e. "28" to "31"
    +T - Timezone setting of this machine; e.g. "EST" or "MDT" 
    +U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)  
    +w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday) 
    +Y - year, 4 digits; e.g. "1999" 
    +y - year, 2 digits; e.g. "99" 
    +z - day of the year; i.e. "0" to "365" 
    +Z - timezone offset in seconds (i.e. "-43200" to "43200"). 
    +   			The offset for timezones west of UTC is always negative, 
    +			and for those east of UTC is always positive. 
    +
    + +Unsupported: +
    +B - Swatch Internet time 
    +I (capital i) - "1" if Daylight Savings Time, "0" otherwise.
    +W - ISO-8601 week number of year, weeks starting on Monday 
    +
    +
    + + +FUNCTION adodb_gmdate($fmt, $timestamp = false) + +Convert a timestamp to a formatted GMT date. If $timestamp is not defined, the +current timestamp is used. Unlike the function date(), it supports dates +outside the 1901 to 2038 range. + + +FUNCTION adodb_mktime($hr, $min, $sec, $month, $day, $year) + +Converts a local date to a unix timestamp. Unlike the function mktime(), it supports +dates outside the 1901 to 2038 range. Differs from mktime() in that all parameters +are currently compulsory. + +FUNCTION adodb_gmmktime($hr, $min, $sec, $month, $day, $year) + +Converts a gmt date to a unix timestamp. Unlike the function gmmktime(), it supports +dates outside the 1901 to 2038 range. Differs from gmmktime() in that all parameters +are currently compulsory. + +============================================================================= + +NOTES + +Useful url for generating test timestamps: + http://www.4webhelp.net/us/timestamp.php + +Possible future optimizations include + +a. Using an algorithm similar to Plauger's in "The Standard C Library" +(page 428, xttotm.c _Ttotm() function). Plauger's algorithm will not +work outside 32-bit signed range, so i decided not to implement it. + +b. Iterate over a block of years (say 12) when searching for the +correct year. + +c. Implement daylight savings, which looks awfully complicated, see + http://webexhibits.org/daylightsaving/ + + +CHANGELOG +- 3 March 2003 0.08 +Added support for 'S' adodb_date() format char. Added constant ADODB_ALLOW_NEGATIVE_TS +if you want PHP to handle negative timestamps between 1901 to 1969. + +- 27 Feb 2003 0.07 +All negative numbers handled by adodb now because of RH 7.3+ problems. +See http://bugs.php.net/bug.php?id=20048&edit=2 + +- 4 Feb 2003 0.06 +Fixed a typo, 1852 changed to 1582! This means that pre-1852 dates +are now correctly handled. + +- 29 Jan 2003 0.05 + +Leap year checking differs under Julian calendar (pre 1582). Also +leap year code optimized by checking for most common case first. + +We also handle month overflow correctly in mktime (eg month set to 13). + +Day overflow for less than one month's days is supported. + +- 28 Jan 2003 0.04 + +Gregorian correction handled. In PHP5, we might throw an error if +mktime uses invalid dates around 5-14 Oct 1582. Released with ADOdb 3.10. +Added limbo 5-14 Oct 1582 check, when we set to 15 Oct 1582. + +- 27 Jan 2003 0.03 + +Fixed some more month problems due to gmt issues. Added constant ADODB_DATE_VERSION. +Fixed calculation of days since start of year for <1970. + +- 27 Jan 2003 0.02 + +Changed _adodb_getdate() to inline leap year checking for better performance. +Fixed problem with time-zones west of GMT +0000. + +- 24 Jan 2003 0.01 + +First implementation. +*/ + + +/* Initialization */ + +/* + Version Number +*/ +define('ADODB_DATE_VERSION',0.08); + +/* + We check for Windows as only +ve ints are accepted as dates on Windows. + + Apparently this problem happens also with Linux, RH 7.3 and later! + + glibc-2.2.5-34 and greater has been changed to return -1 for dates < + 1970. This used to work. The problem exists with RedHat 7.3 and 8.0 + echo (mktime(0, 0, 0, 1, 1, 1960)); // prints -1 + + References: + http://bugs.php.net/bug.php?id=20048&edit=2 + http://lists.debian.org/debian-glibc/2002/debian-glibc-200205/msg00010.html +*/ + +if (!defined('ADODB_ALLOW_NEGATIVE_TS')) define('ADODB_NO_NEGATIVE_TS',1); + +function adodb_date_test_date($y1,$m) +{ + //print " $y1/$m "; + $t = adodb_mktime(0,0,0,$m,13,$y1); + if ("$y1-$m-13 00:00:00" != adodb_date('Y-n-d H:i:s',$t)) { + print "$y1 error
    "; + return false; + } + return true; +} +/** + Test Suite +*/ +function adodb_date_test() +{ + + error_reporting(E_ALL); + print "

    Testing adodb_date and adodb_mktime. version=".ADODB_DATE_VERSION. "

    "; + set_time_limit(0); + $fail = false; + + // This flag disables calling of PHP native functions, so we can properly test the code + if (!defined('ADODB_TEST_DATES')) define('ADODB_TEST_DATES',1); + + print "

    Testing gregorian <=> julian conversion

    "; + $t = adodb_mktime(0,0,0,10,11,1492); + //http://www.holidayorigins.com/html/columbus_day.html - Friday check + if (!(adodb_date('D Y-m-d',$t) == 'Fri 1492-10-11')) print 'Error in Columbus landing
    '; + + $t = adodb_mktime(0,0,0,2,29,1500); + if (!(adodb_date('Y-m-d',$t) == '1500-02-29')) print 'Error in julian leap years
    '; + + $t = adodb_mktime(0,0,0,2,29,1700); + if (!(adodb_date('Y-m-d',$t) == '1700-03-01')) print 'Error in gregorian leap years
    '; + + print adodb_mktime(0,0,0,10,4,1582).' '; + print adodb_mktime(0,0,0,10,15,1582); + $diff = (adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582)); + if ($diff != 3600*24) print " Error in gregorian correction = ".($diff/3600/24)." days
    "; + + print " 15 Oct 1582, Fri=".(adodb_dow(1582,10,15) == 5 ? 'Fri' : 'Error')."
    "; + print " 4 Oct 1582, Thu=".(adodb_dow(1582,10,4) == 4 ? 'Thu' : 'Error')."
    "; + + print "

    Testing overflow

    "; + + $t = adodb_mktime(0,0,0,3,33,1965); + if (!(adodb_date('Y-m-d',$t) == '1965-04-02')) print 'Error in day overflow 1
    '; + $t = adodb_mktime(0,0,0,4,33,1971); + if (!(adodb_date('Y-m-d',$t) == '1971-05-03')) print 'Error in day overflow 2
    '; + $t = adodb_mktime(0,0,0,1,60,1965); + if (!(adodb_date('Y-m-d',$t) == '1965-03-01')) print 'Error in day overflow 3 '.adodb_date('Y-m-d',$t).'
    '; + $t = adodb_mktime(0,0,0,12,32,1965); + if (!(adodb_date('Y-m-d',$t) == '1966-01-01')) print 'Error in day overflow 4 '.adodb_date('Y-m-d',$t).'
    '; + $t = adodb_mktime(0,0,0,12,63,1965); + if (!(adodb_date('Y-m-d',$t) == '1966-02-01')) print 'Error in day overflow 5 '.adodb_date('Y-m-d',$t).'
    '; + $t = adodb_mktime(0,0,0,13,3,1965); + if (!(adodb_date('Y-m-d',$t) == '1966-01-03')) print 'Error in mth overflow 1
    '; + + print "Testing 2-digit => 4-digit year conversion

    "; + if (adodb_year_digit_check(00) != 2000) print "Err 2-digit 2000
    "; + if (adodb_year_digit_check(10) != 2010) print "Err 2-digit 2010
    "; + if (adodb_year_digit_check(20) != 2020) print "Err 2-digit 2020
    "; + if (adodb_year_digit_check(30) != 2030) print "Err 2-digit 2030
    "; + if (adodb_year_digit_check(40) != 1940) print "Err 2-digit 1940
    "; + if (adodb_year_digit_check(50) != 1950) print "Err 2-digit 1950
    "; + if (adodb_year_digit_check(90) != 1990) print "Err 2-digit 1990
    "; + + // Test string formating + print "

    Testing date formating

    "; + $fmt = '\d\a\t\e T Y-m-d H:i:s a A d D F g G h H i j l L m M n O \R\F\C822 r s t U w y Y z Z 2003'; + $s1 = date($fmt,0); + $s2 = adodb_date($fmt,0); + if ($s1 != $s2) { + print " date() 0 failed
    $s1
    $s2
    "; + } + flush(); + for ($i=100; --$i > 0; ) { + + $ts = 3600.0*((rand()%60000)+(rand()%60000))+(rand()%60000); + $s1 = date($fmt,$ts); + $s2 = adodb_date($fmt,$ts); + //print "$s1
    $s2

    "; + $pos = strcmp($s1,$s2); + + if (($s1) != ($s2)) { + for ($j=0,$k=strlen($s1); $j < $k; $j++) { + if ($s1[$j] != $s2[$j]) { + print substr($s1,$j).' '; + break; + } + } + print "Error date(): $ts

     
    +  \"$s1\" (date len=".strlen($s1).")
    +  \"$s2\" (adodb_date len=".strlen($s2).")

    "; + $fail = true; + } + + $a1 = getdate($ts); + $a2 = adodb_getdate($ts); + $rez = array_diff($a1,$a2); + if (sizeof($rez)>0) { + print "Error getdate() $ts
    "; + print_r($a1); + print "
    "; + print_r($a2); + print "

    "; + $fail = true; + } + } + + // Test generation of dates outside 1901-2038 + print "

    Testing random dates between 100 and 4000

    "; + adodb_date_test_date(100,1); + for ($i=100; --$i >= 0;) { + $y1 = 100+rand(0,1970-100); + $m = rand(1,12); + adodb_date_test_date($y1,$m); + + $y1 = 3000-rand(0,3000-1970); + adodb_date_test_date($y1,$m); + } + print '

    '; + $start = 1960+rand(0,10); + $yrs = 12; + $i = 365.25*86400*($start-1970); + $offset = 36000+rand(10000,60000); + $max = 365*$yrs*86400; + $lastyear = 0; + + // we generate a timestamp, convert it to a date, and convert it back to a timestamp + // and check if the roundtrip broke the original timestamp value. + print "Testing $start to ".($start+$yrs).", or $max seconds, offset=$offset: "; + + for ($max += $i; $i < $max; $i += $offset) { + $ret = adodb_date('m,d,Y,H,i,s',$i); + $arr = explode(',',$ret); + if ($lastyear != $arr[2]) { + $lastyear = $arr[2]; + print " $lastyear "; + flush(); + } + $newi = adodb_mktime($arr[3],$arr[4],$arr[5],$arr[0],$arr[1],$arr[2]); + if ($i != $newi) { + print "Error at $i, adodb_mktime returned $newi ($ret)"; + $fail = true; + break; + } + } + + if (!$fail) print "

    Passed !

    "; + else print "

    Failed :-(

    "; +} + +/** + Returns day of week, 0 = Sunday,... 6=Saturday. + Algorithm from PEAR::Date_Calc +*/ +function adodb_dow($year, $month, $day) +{ +/* +Pope Gregory removed 10 days - October 5 to October 14 - from the year 1582 and +proclaimed that from that time onwards 3 days would be dropped from the calendar +every 400 years. + +Thursday, October 4, 1582 (Julian) was followed immediately by Friday, October 15, 1582 (Gregorian). +*/ + if ($year <= 1582) { + if ($year < 1582 || + ($year == 1582 && ($month < 10 || ($month == 10 && $day < 15)))) $greg_correction = 3; + else + $greg_correction = 0; + } else + $greg_correction = 0; + + if($month > 2) + $month -= 2; + else { + $month += 10; + $year--; + } + + $day = ( floor((13 * $month - 1) / 5) + + $day + ($year % 100) + + floor(($year % 100) / 4) + + floor(($year / 100) / 4) - 2 * + floor($year / 100) + 77); + + return (($day - 7 * floor($day / 7))) + $greg_correction; +} + + +/** + Checks for leap year, returns true if it is. No 2-digit year check. Also + handles julian calendar correctly. +*/ +function _adodb_is_leap_year($year) +{ + if ($year % 4 != 0) return false; + + if ($year % 400 == 0) { + return true; + // if gregorian calendar (>1582), century not-divisible by 400 is not leap + } else if ($year > 1582 && $year % 100 == 0 ) { + return false; + } + + return true; +} + +/** + checks for leap year, returns true if it is. Has 2-digit year check +*/ +function adodb_is_leap_year($year) +{ + return _adodb_is_leap_year(adodb_year_digit_check($year)); +} + +/** + Fix 2-digit years. Works for any century. + Assumes that if 2-digit is more than 30 years in future, then previous century. +*/ +function adodb_year_digit_check($y) +{ + if ($y < 100) { + + $yr = (integer) date("Y"); + $century = (integer) ($yr /100); + + if ($yr%100 > 50) { + $c1 = $century + 1; + $c0 = $century; + } else { + $c1 = $century; + $c0 = $century - 1; + } + $c1 *= 100; + // if 2-digit year is less than 30 years in future, set it to this century + // otherwise if more than 30 years in future, then we set 2-digit year to the prev century. + if (($y + $c1) < $yr+30) $y = $y + $c1; + else $y = $y + $c0*100; + } + return $y; +} + + +/** + get local time zone offset from GMT +*/ +function adodb_get_gmt_different() +{ +static $DIFF; + if (isset($DIFF)) return $DIFF; + + $DIFF = mktime(0,0,0,1,2,1970) - gmmktime(0,0,0,1,2,1970); + return $DIFF; +} + + +/** + Returns an array with date info. +*/ +function adodb_getdate($d=false,$fast=false) +{ + if ($d === false) return getdate(); + if (!defined('ADODB_TEST_DATES')) { + if ((abs($d) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range + if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= 0) // if windows, must be +ve integer + return @getdate($d); + } + } + return _adodb_getdate($d); +} + +/** + Low-level function that returns the getdate() array. We have a special + $fast flag, which if set to true, will return fewer array values, + and is much faster as it does not calculate dow, etc. +*/ +function _adodb_getdate($origd=false,$fast=false,$is_gmt=false) +{ + $d = $origd - ($is_gmt ? 0 : adodb_get_gmt_different()); + + $_day_power = 86400; + $_hour_power = 3600; + $_min_power = 60; + + if ($d < -12219321600) $d -= 86400*10; // if 15 Oct 1582 or earlier, gregorian correction + + $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31); + $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31); + + if ($d < 0) { + $origd = $d; + // The valid range of a 32bit signed timestamp is typically from + // Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT + for ($a = 1970 ; --$a >= 0;) { + $lastd = $d; + + if ($leaf = _adodb_is_leap_year($a)) { + $d += $_day_power * 366; + } else + $d += $_day_power * 365; + if ($d >= 0) { + $year = $a; + break; + } + } + + $secsInYear = 86400 * ($leaf ? 366 : 365) + $lastd; + + $d = $lastd; + $mtab = ($leaf) ? $_month_table_leaf : $_month_table_normal; + for ($a = 13 ; --$a > 0;) { + $lastd = $d; + $d += $mtab[$a] * $_day_power; + if ($d >= 0) { + $month = $a; + $ndays = $mtab[$a]; + break; + } + } + + $d = $lastd; + $day = $ndays + ceil(($d+1) / ($_day_power)); + + $d += ($ndays - $day+1)* $_day_power; + $hour = floor($d/$_hour_power); + + } else { + + for ($a = 1970 ;; $a++) { + $lastd = $d; + + if ($leaf = _adodb_is_leap_year($a)) { + $d -= $_day_power * 366; + } else + $d -= $_day_power * 365; + if ($d <= 0) { + $year = $a; + break; + } + } + $secsInYear = $lastd; + $d = $lastd; + $mtab = ($leaf) ? $_month_table_leaf : $_month_table_normal; + for ($a = 1 ; $a <= 12; $a++) { + $lastd = $d; + $d -= $mtab[$a] * $_day_power; + if ($d <= 0) { + $month = $a; + $ndays = $mtab[$a]; + break; + } + } + $d = $lastd; + $day = ceil(($d+1) / $_day_power); + $d = $d - ($day-1) * $_day_power; + $hour = floor($d /$_hour_power); + } + + $d -= $hour * $_hour_power; + $min = floor($d/$_min_power); + $secs = $d - $min * $_min_power; + if ($fast) { + return array( + 'seconds' => $secs, + 'minutes' => $min, + 'hours' => $hour, + 'mday' => $day, + 'mon' => $month, + 'year' => $year, + 'yday' => floor($secsInYear/$_day_power), + 'leap' => $leaf, + 'ndays' => $ndays + ); + } + + + $dow = adodb_dow($year,$month,$day); + + return array( + 'seconds' => $secs, + 'minutes' => $min, + 'hours' => $hour, + 'mday' => $day, + 'wday' => $dow, + 'mon' => $month, + 'year' => $year, + 'yday' => floor($secsInYear/$_day_power), + 'weekday' => gmdate('l',$_day_power*(3+$dow)), + 'month' => gmdate('F',mktime(0,0,0,$month,2,1971)), + 0 => $origd + ); +} + +function adodb_gmdate($fmt,$d=false) +{ + return adodb_date($fmt,$d,true); +} + + +/** + Return formatted date based on timestamp $d +*/ +function adodb_date($fmt,$d=false,$is_gmt=false) +{ + if ($d === false) return date($fmt); + if (!defined('ADODB_TEST_DATES')) { + if ((abs($d) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range + if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= 0) // if windows, must be +ve integer + return @date($fmt,$d); + } + } + $_day_power = 86400; + + $arr = _adodb_getdate($d,true,$is_gmt); + $year = $arr['year']; + $month = $arr['mon']; + $day = $arr['mday']; + $hour = $arr['hours']; + $min = $arr['minutes']; + $secs = $arr['seconds']; + + $max = strlen($fmt); + $dates = ''; + + /* + at this point, we have the following integer vars to manipulate: + $year, $month, $day, $hour, $min, $secs + */ + for ($i=0; $i < $max; $i++) { + switch($fmt[$i]) { + case 'T': $dates .= date('T');break; + // YEAR + case 'L': $dates .= $arr['leap'] ? '1' : '0'; break; + case 'r': // Thu, 21 Dec 2000 16:01:07 +0200 + + $dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))).', ' + . ($day<10?' '.$day:$day) . ' '.date('M',mktime(0,0,0,$month,2,1971)).' '.$year.' '; + + if ($hour < 10) $dates .= '0'.$hour; else $dates .= $hour; + + if ($min < 10) $dates .= ':0'.$min; else $dates .= ':'.$min; + + if ($secs < 10) $dates .= ':0'.$secs; else $dates .= ':'.$secs; + + $gmt = adodb_get_gmt_different(); + $dates .= sprintf(' %s%04d',($gmt<0)?'+':'-',abs($gmt)/36); break; + + case 'Y': $dates .= $year; break; + case 'y': $dates .= substr($year,strlen($year)-2,2); break; + // MONTH + case 'm': if ($month<10) $dates .= '0'.$month; else $dates .= $month; break; + case 'n': $dates .= $month; break; + case 'M': $dates .= date('M',mktime(0,0,0,$month,2,1971)); break; + case 'F': $dates .= date('F',mktime(0,0,0,$month,2,1971)); break; + // DAY + case 't': $dates .= $arr['ndays']; break; + case 'z': $dates .= $arr['yday']; break; + case 'w': $dates .= adodb_dow($year,$month,$day); break; + case 'l': $dates .= gmdate('l',$_day_power*(3+adodb_dow($year,$month,$day))); break; + case 'D': $dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))); break; + case 'j': $dates .= $day; break; + case 'd': if ($day<10) $dates .= '0'.$day; else $dates .= $day; break; + case 'S': + $d10 = $day % 10; + if ($d10 == 1) $dates .= 'st'; + else if ($d10 == 2) $dates .= 'nd'; + else if ($d10 == 3) $dates .= 'rd'; + else $dates .= 'th'; + break; + + // HOUR + case 'Z': + $dates .= ($is_gmt) ? 0 : -adodb_get_gmt_different(); break; + case 'O': + $gmt = ($is_gmt) ? 0 : adodb_get_gmt_different(); + $dates .= sprintf('%s%04d',($gmt<0)?'+':'-',abs($gmt)/36); break; + + case 'H': + if ($hour < 10) $dates .= '0'.$hour; + else $dates .= $hour; + break; + case 'h': + if ($hour > 12) $hh = $hour - 12; + else { + if ($hour == 0) $hh = '12'; + else $hh = $hour; + } + + if ($hh < 10) $dates .= '0'.$hh; + else $dates .= $hh; + break; + + case 'G': + $dates .= $hour; + break; + + case 'g': + if ($hour > 12) $hh = $hour - 12; + else { + if ($hour == 0) $hh = '12'; + else $hh = $hour; + } + $dates .= $hh; + break; + // MINUTES + case 'i': if ($min < 10) $dates .= '0'.$min; else $dates .= $min; break; + // SECONDS + case 'U': $dates .= $d; break; + case 's': if ($secs < 10) $dates .= '0'.$secs; else $dates .= $secs; break; + // AM/PM + // Note 00:00 to 11:59 is AM, while 12:00 to 23:59 is PM + case 'a': + if ($hour>=12) $dates .= 'pm'; + else $dates .= 'am'; + break; + case 'A': + if ($hour>=12) $dates .= 'PM'; + else $dates .= 'AM'; + break; + default: + $dates .= $fmt[$i]; break; + // ESCAPE + case "\\": + $i++; + if ($i < $max) $dates .= $fmt[$i]; + break; + } + } + return $dates; +} + +/** + Returns a timestamp given a GMT/UTC time. + Note that $is_dst is not implemented and is ignored. +*/ +function adodb_gmmktime($hr,$min,$sec,$mon,$day,$year,$is_dst=false) +{ + return adodb_mktime($hr,$min,$sec,$mon,$day,$year,$is_dst,true); +} + +/** + Return a timestamp given a local time. Originally by jackbbs. + Note that $is_dst is not implemented and is ignored. +*/ +function adodb_mktime($hr,$min,$sec,$mon,$day,$year,$is_dst=false,$is_gmt=false) +{ + if (!defined('ADODB_TEST_DATES')) { + // for windows, we don't check 1970 because with timezone differences, + // 1 Jan 1970 could generate negative timestamp, which is illegal + if (!defined('ADODB_NO_NEGATIVE_TS') || ($year >= 1971)) + if (1901 < $year && $year < 2038) + return @mktime($hr,$min,$sec,$mon,$day,$year); + } + + $gmt_different = ($is_gmt) ? 0 : adodb_get_gmt_different(); + + $hr = intval($hr); + $min = intval($min); + $sec = intval($sec); + $mon = intval($mon); + $day = intval($day); + $year = intval($year); + + + $year = adodb_year_digit_check($year); + + if ($mon > 12) { + $y = floor($mon / 12); + $year += $y; + $mon -= $y*12; + } + + $_day_power = 86400; + $_hour_power = 3600; + $_min_power = 60; + + $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31); + $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31); + + $_total_date = 0; + if ($year >= 1970) { + for ($a = 1970 ; $a <= $year; $a++) { + $leaf = _adodb_is_leap_year($a); + if ($leaf == true) { + $loop_table = $_month_table_leaf; + $_add_date = 366; + } else { + $loop_table = $_month_table_normal; + $_add_date = 365; + } + if ($a < $year) { + $_total_date += $_add_date; + } else { + for($b=1;$b<$mon;$b++) { + $_total_date += $loop_table[$b]; + } + } + } + $_total_date +=$day-1; + $ret = $_total_date * $_day_power + $hr * $_hour_power + $min * $_min_power + $sec + $gmt_different; + + } else { + for ($a = 1969 ; $a >= $year; $a--) { + $leaf = _adodb_is_leap_year($a); + if ($leaf == true) { + $loop_table = $_month_table_leaf; + $_add_date = 366; + } else { + $loop_table = $_month_table_normal; + $_add_date = 365; + } + if ($a > $year) { $_total_date += $_add_date; + } else { + for($b=12;$b>$mon;$b--) { + $_total_date += $loop_table[$b]; + } + } + } + $_total_date += $loop_table[$mon] - $day; + + $_day_time = $hr * $_hour_power + $min * $_min_power + $sec; + $_day_time = $_day_power - $_day_time; + $ret = -( $_total_date * $_day_power + $_day_time - $gmt_different); + if ($ret < -12220185600) $ret += 10*86400; // if earlier than 5 Oct 1582 - gregorian correction + else if ($ret < -12219321600) $ret = -12219321600; // if in limbo, reset to 15 Oct 1582. + } + //print " dmy=$day/$mon/$year $hr:$min:$sec => " .$ret; + return $ret; +} + +?> Index: trunk/sql.error =================================================================== diff -u --- trunk/sql.error (revision 0) +++ trunk/sql.error (revision 13) @@ -0,0 +1,904 @@ +clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clstagfunction::Create error.DatabaseError Unknown column 'scope' in 'field list' + clsItem::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 + clsattribute::Create error.DatabaseError Unknown column 'AttrType' in 'field list' + clsusersession::Validate error.fieldIsRequired + PortalUserIdclsrelationshiplist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR (TargetId= AND Type=1)) AND Enabled=1 ORDER BY Priority L + clsusersession::Validate error.fieldIsRequired + PortalUserIdclsrelationshiplist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR (TargetId= AND Type=1)) AND Enabled=1 ORDER BY Priority L + clsitemrating::Create error.DatabaseError Unknown column 'ResourceId' in 'field list' + clsusersession::Validate error.fieldIsRequired + PortalUserIdclsrelationshiplist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR (TargetId= AND Type=1)) AND Enabled=1 ORDER BY Priority L + clsrelationshiplist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR (TargetId= AND Type=1)) AND Enabled=1 ORDER BY Priority L + clsrelationshiplist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR (TargetId= AND Type=1)) AND Enabled=1 ORDER BY Priority L + clsrelationshiplist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR (TargetId= AND Type=1)) AND Enabled=1 ORDER BY Priority L + clsrelationshiplist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR (TargetId= AND Type=1)) AND Enabled=1 ORDER BY Priority L + clslinklist::Query_Item error.DatabaseError Column: 'EditorsPick' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'EditorsPick' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'EditorsPick' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'Priority' in order clause is ambiguous + clslinklist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'inp_Link.asc LIMIT 0,8' at line 1 + clslinklist::Query_Item error.DatabaseError Column: 'Priority' in order clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'Priority' in order clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CreatedOn' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'Status' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'Status' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'Status' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'Status' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'Status' in where clause is ambiguous + clsfavorite::Create error.DatabaseError Duplicate entry '798-2569' for key 2 + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clsitemrating::Create error.DatabaseError Unknown column 'ResourceId' in 'field list' + clsitemrating::Create error.DatabaseError Unknown column 'ResourceId' in 'field list' + clsfavorite::Create error.DatabaseError Duplicate entry '798-2573' for key 2 + clstopiclist::Query_Item error.DatabaseError Unknown column 'Array' in 'where clause' + clstopiclist::Query_Item error.DatabaseError Unknown column 'Array' in 'where clause' + clstopiclist::Query_Item error.DatabaseError Unknown column 'Array' in 'where clause' + clsusersession::Validate error.fieldIsRequired + PortalUserIdclsusersession::Validate error.fieldIsRequired + PortalUserIdclsusersession::Validate error.fieldIsRequired + PortalUserIdclslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError Column: 'CategoryId' in where clause is ambiguous + clslinklist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'CategoryId=6 Name asc LIMIT 0,8' at line 1 + clslinklist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'CategoryId=32 Name asc LIMIT 0,8' at line 1 + clslinklist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'CategoryId=6 Name asc LIMIT 0,8' at line 1 + clslinklist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'CategoryId=6 Name asc LIMIT 0,8' at line 1 + clslinklist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Name asc LIMIT 0,8' at line 1 + clslinklist::Query_Item error.DatabaseError Unknown column 'inp_CategoryItems.ResourceId' in 'on clause' + clscatlist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ParentPath ASC LIMIT ,30' at line 1 + clscatlist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ParentPath ASC LIMIT ,30' at line 1 + clscatlist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ParentPath ASC LIMIT ,30' at line 1 + clscatlist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ParentPath ASC LIMIT ,30' at line 1 + clscatlist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ParentPath ASC LIMIT ,30' at line 1 + clscatlist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ParentPath ASC LIMIT ,30' at line 1 + clscatlist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ParentPath ASC LIMIT ,30' at line 1 + clscatlist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ParentPath ASC LIMIT ,30' at line 1 + clscatlist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ParentPath ASC LIMIT ,30' at line 1 + clscatlist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY ParentPath ASC LIMIT ,30' at line 1 + clsrelationshiplist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR (TargetId= AND Type=1)) AND Enabled=1 ORDER BY Priority L + clslinklist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ascWHERE CategoryId=2 AND Status=1 LIMIT 0,8' at line 1 + clslinklist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ascWHERE CategoryId=2 AND Status=1 LIMIT 0,8' at line 1 + clsrelationshiplist::Query_Item error.DatabaseError You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR (TargetId= AND Type=1)) AND Enabled=1 ORDER BY Priority L + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/toolbar/button.smiley.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-fbsql.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-fbsql.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-fbsql.inc.php (revision 13) @@ -0,0 +1,262 @@ +. + Set tabs to 8. +*/ + +if (! defined("_ADODB_FBSQL_LAYER")) { + define("_ADODB_FBSQL_LAYER", 1 ); + +class ADODB_fbsql extends ADOConnection { + var $databaseType = 'fbsql'; + var $hasInsertID = true; + var $hasAffectedRows = true; + var $metaTablesSQL = "SHOW TABLES"; + var $metaColumnsSQL = "SHOW COLUMNS FROM %s"; + var $fmtTimeStamp = "'Y-m-d H:i:s'"; + var $hasLimit = false; + + function ADODB_fbsql() + { + } + + function _insertid() + { + return fbsql_insert_id($this->_connectionID); + } + + function _affectedrows() + { + return fbsql_affected_rows($this->_connectionID); + } + + function &MetaDatabases() + { + $qid = fbsql_list_dbs($this->_connectionID); + $arr = array(); + $i = 0; + $max = fbsql_num_rows($qid); + while ($i < $max) { + $arr[] = fbsql_tablename($qid,$i); + $i += 1; + } + return $arr; + } + + // returns concatenated string + function Concat() + { + $s = ""; + $arr = func_get_args(); + $first = true; + + $s = implode(',',$arr); + if (sizeof($arr) > 0) return "CONCAT($s)"; + else return ''; + } + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = fbsql_connect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = fbsql_pconnect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + function &MetaColumns($table) + { + if ($this->metaColumnsSQL) { + + $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table)); + + if ($rs === false) return false; + + $retarr = array(); + while (!$rs->EOF){ + $fld = new ADOFieldObject(); + $fld->name = $rs->fields[0]; + $fld->type = $rs->fields[1]; + + // split type into type(length): + if (preg_match("/^(.+)\((\d+)\)$/", $fld->type, $query_array)) { + $fld->type = $query_array[1]; + $fld->max_length = $query_array[2]; + } else { + $fld->max_length = -1; + } + $fld->not_null = ($rs->fields[2] != 'YES'); + $fld->primary_key = ($rs->fields[3] == 'PRI'); + $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false); + $fld->binary = (strpos($fld->type,'blob') !== false); + + $retarr[strtoupper($fld->name)] = $fld; + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + return false; + } + + // returns true or false + function SelectDB($dbName) + { + $this->databaseName = $dbName; + if ($this->_connectionID) { + return @fbsql_select_db($dbName,$this->_connectionID); + } + else return false; + } + + + // returns queryID or false + function _query($sql,$inputarr) + { + return fbsql_query("$sql;",$this->_connectionID); + } + + /* Returns: the last error message from previous database operation */ + function ErrorMsg() + { + $this->_errorMsg = @fbsql_error($this->_connectionID); + return $this->_errorMsg; + } + + /* Returns: the last error number from previous database operation */ + function ErrorNo() + { + return @fbsql_errno($this->_connectionID); + } + + // returns true or false + function _close() + { + return @fbsql_close($this->_connectionID); + } + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_fbsql extends ADORecordSet{ + + var $databaseType = "fbsql"; + var $canSeek = true; + + function ADORecordSet_fbsql($queryID,$mode=false) + { + if (!$mode) { + global $ADODB_FETCH_MODE; + $mode = $ADODB_FETCH_MODE; + } + switch ($mode) { + case ADODB_FETCH_NUM: $this->fetchMode = FBSQL_NUM; break; + default: + case ADODB_FETCH_BOTH: $this->fetchMode = FBSQL_BOTH; break; + case ADODB_FETCH_ASSOC: $this->fetchMode = FBSQL_ASSOC; break; + } + return $this->ADORecordSet($queryID); + } + + function _initrs() + { + GLOBAL $ADODB_COUNTRECS; + $this->_numOfRows = ($ADODB_COUNTRECS) ? @fbsql_num_rows($this->_queryID):-1; + $this->_numOfFields = @fbsql_num_fields($this->_queryID); + } + + + + function &FetchField($fieldOffset = -1) { + if ($fieldOffset != -1) { + $o = @fbsql_fetch_field($this->_queryID, $fieldOffset); + //$o->max_length = -1; // fbsql returns the max length less spaces -- so it is unrealiable + $f = @fbsql_field_flags($this->_queryID,$fieldOffset); + $o->binary = (strpos($f,'binary')!== false); + } + else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */ + $o = @fbsql_fetch_field($this->_queryID);// fbsql returns the max length less spaces -- so it is unrealiable + //$o->max_length = -1; + } + + return $o; + } + + function _seek($row) + { + return @fbsql_data_seek($this->_queryID,$row); + } + + function _fetch($ignore_fields=false) + { + $this->fields = @fbsql_fetch_array($this->_queryID,$this->fetchMode); + return ($this->fields == true); + } + + function _close() { + return @fbsql_free_result($this->_queryID); + } + + function MetaType($t,$len=-1,$fieldobj=false) + { + if (is_object($t)) { + $fieldobj = $t; + $t = $fieldobj->type; + $len = $fieldobj->max_length; + } + $len = -1; // fbsql max_length is not accurate + switch (strtoupper($t)) { + case 'CHARACTER': + case 'CHARACTER VARYING': + case 'BLOB': + case 'CLOB': + case 'BIT': + case 'BIT VARYING': + if ($len <= $this->blobSize) return 'C'; + + // so we have to check whether binary... + case 'IMAGE': + case 'LONGBLOB': + case 'BLOB': + case 'MEDIUMBLOB': + return !empty($fieldobj->binary) ? 'B' : 'X'; + + case 'DATE': return 'D'; + + case 'TIME': + case 'TIME WITH TIME ZONE': + case 'TIMESTAMP': + case 'TIMESTAMP WITH TIME ZONE': return 'T'; + + case 'PRIMARY_KEY': + return 'R'; + case 'INTEGER': + case 'SMALLINT': + case 'BOOLEAN': + + if (!empty($fieldobj->primary_key)) return 'R'; + else return 'I'; + + default: return 'N'; + } + } + +} //class +} // defined +?> \ No newline at end of file Index: trunk/admin/include/elements.php =================================================================== diff -u --- trunk/admin/include/elements.php (revision 0) +++ trunk/admin/include/elements.php (revision 13) @@ -0,0 +1,563 @@ + +Logout(); + header("Location: ".$adminURL."/login.php"); + die(); + //require_once($pathtoroot."admin/login.php"); + } +} + +global $admin,$pathtoroot, $objConfig; + +if(!strlen($admin)) +{ + $admin = $objConfig->Get("AdminDirectory"); + if(!strlen($admin)) + { + $admin = "admin"; + } +} + +require_once($pathtoroot.$admin."/include/sections.php"); + + +$envar = "env=" . BuildEnv(); + +/* this function loads the javascript for each module's toolbar */ +function load_module_javascript($sectionname) +{ + global $adminURL, $pathtoroot; + + echo "\n"; + echo "\n"; + echo "\n"; + + global $objConfig, $ItemTabs; + $m = GetModuleArray("admin"); + echo ""; + foreach($m as $key=>$value) + { + $path = $pathtoroot. $value."admin/include/toolbar/".$sectionname.".php"; + + if(file_exists($path)) + { + echo "\n\n"; + include_once($path); + } + else + echo "\n\n"; + } +} + +function load_module_styles() +{ + global $objConfig, $ItemTabs,$rootURL,$pathtoroot; + + $m = GetModuleArray("admin"); + echo ""; + foreach($m as $key=>$value) + { + $path = $pathtoroot.$value."admin/include/style.css"; + + if(file_exists($path)) + { + $inc = $rootURL.$value."admin/include/style.css"; + print "\n"; + } + } +} + +//*********************************** +//Page Header +function int_header($toolbar=NULL,$NavBarText=NULL,$ExtraTitle=NULL,$onLoad=NULL, $ExtraHead=NULL) +{ + global $pathtoroot; + global $pathtolocal; + global $section; + global $objSections; + global $rootURL; + global $localURL; + global $adminURL; + global $envar; + global $admin; + global $metatag; + + $style_sheet_global = $adminURL."/include/style.css"; + $style_sheet_local = $localURL."admin/include/style.css"; + + $ExtraTitle = htmlentities($ExtraTitle); + if (is_object($toolbar)) + { + if(file_exists($pathtolocal."admin/include/toolbar.php")) + require_once ($pathtolocal."admin/include/toolbar.php"); + //Aray of the preloaded elems + //$int_toolbar_preload = array(); + + print "In-portal\n"; + if(strlen($metatag)) + { + print $metatag."\n"; + } + else + { + print "\n"; + print "\n"; + } + print "\n"; + load_module_styles(); + require_once($pathtoroot.$admin."/include/mainscript.php"); + //require_once($pathtolocal."admin/include/script.js"); + print $ExtraHead; + $sectionname = explode(":", $section); + $sectionname = $sectionname[sizeof($sectionname)-1]; + load_module_javascript($sectionname); + if(is_object($toolbar)) + print $toolbar->GetInitScript(); + print "Get("CheckClass"))) + { + print $toolbar->onLoadString().">"; + } + else + print " >"; + + $menufunc = $toolbar->Get("load_menu_func"); + if (strlen($menufunc)) + { + print ""; + } + } + else + print " >"; + } + else + { + print "In-Portal "; + print ""; + print ""; + print ""; + load_module_styles(); + require_once ($pathtoroot.$admin."/include/mainscript.php"); + //require_once ($pathtolocal."admin/include/script.js"); + $sectionname = explode(":", $section); + $sectionname = $sectionname[sizeof($sectionname)-1]; + load_module_javascript($sectionname); + + + print ""; + } + + if(strlen($section)>0) + { + $objSections->SetCurrentSection($section); + $sec = $objSections->GetCurrentSection(); + if ($sec->Get("notitle") != 1) print $objSections->page_title(); + + print $objSections->page_tabs($envar); + + if ($sec->Get("nonavbar") != 1) //Section Navigatior + print $objSections->section_header($envar,$NavBarText,$ExtraTitle); + + //Toolbar if appropriate + if ( isset($sections[$section]) && ($sections[$section]['toolbar']==1) || ( is_object($toolbar) ) ) + print $toolbar->Build(); + } +}//Page Header + +function int_SectionHeader($toolbar=NULL,$onLoad=NULL,$NavBarText=NULL,$ExtraTitle=NULL) +{ + global $pathtoroot; + global $pathtolocal; + global $section, $sections; + global $objSections; + global $rootURL; + global $adminURL,$admin; + global $localURL; + global $envar; + global $b_topmargin; + if (!isset($b_topmargin)) + $b_topmargin = 8; + + $sectionname = explode(":", $section); + $sectionname = $sectionname[sizeof($sectionname)-1]; + load_module_javascript($sectionname); + if(is_object($toolbar)) + print $toolbar->GetInitScript(); + print ""; + global $b_header_addon; + + if (isset($b_header_addon)) echo $b_header_addon; + + if(strlen($section)>0) + { + $objSections->SetCurrentSection($section); + $sec = $objSections->GetCurrentSection(); + if ($sec->Get("notitle")!=1) + print $objSections->page_title(); + + print $objSections->page_tabs($envar); + + //Section Navigatior + if ($sec->Get("nonavbar")!=1) + { + if (is_null($ExtraTitle)) + $ExtraTitle = ""; + + print $objSections->section_header($envar,$NavBarText,$ExtraTitle); + + } + //Toolbar if appropriate + if( isset($sections[$section]) ) + if($sections[$section]['toolbar'] == 1 || (is_object($toolbar)) ) + print $toolbar->Build(); + } +}//Section Page Header + +//*********************************** +//SubSection Title +function int_subsection_title($caption) +{ + int_table_color(1); + print << + + $caption + +END; +} + +function int_subsection_title_install($caption) +{ + int_table_color(1); + print << + + $caption + +END; +} + +function int_subsection_title_ret($caption) +{ + int_table_color_ret(1); + $o = "$caption"; + return $o; +} + +//SubSection Title + +//*********************************** +//Table Alternating colors +function int_table_color($reset_color=0) +{ + static $colorset; + + if($reset_color) + { $colorset="table_color2"; + return; + } + + if ($colorset == "table_color1") + $colorset = "table_color2"; + else + $colorset = "table_color1"; + + print "class=\"".$colorset."\""; +}//Table Alternating colors + +//Table Alternating colors with return +function int_table_color_ret($reset_color=0) +{ + static $colorset; + + if($reset_color) + { $colorset="table_color2"; + return; + } + + if ($colorset == "table_color1") + $colorset = "table_color2"; + else + $colorset = "table_color1"; + + return "class=\"".$colorset."\""; +}//Table Alternating colors + + +//*********************************** +//Hint +function int_hint($caption) +{ + + global $imagesURL; + + print << + + + $caption + + + +END; +}//Hint + +function int_hint_red($caption) +{ + + global $imagesURL; + + print << + + + $caption + + + +END; +}//Hint + +//*********************************** +//Navigation String +function int_nav($caption) +{ + global $pathtoroot; + global $imagespath; + + print << + + $caption + + +END; +}//Navigation String + + + +//*********************************** +//Print Out Images +function int_img($img) +{ + global $images; + global $pathtoroot; + global $imagesURL; + + $src = $imagesURL."/".$images[$img]['file']; + $alt = $images[$img]['alt']; + $width = $images[$img]['width']; + $height = $images[$img]['height']; + $name = $img; + + //Set ID if needed + if ($img == 'img:tool:view') + $id = "ID=\"viewbutton\""; + + print "\"$alt\""; + +}//Print Out Images + +//*********************************** +//Page Footer +function int_footer() +{ + global $objSession; + + if($objSession->HasSystemPermission("DEBUG.INFO")) + { + //phpinfo(); + } + print << + +END; +}//Page Footer + + +function HomeEnv() +{ + global $m_var_list_update; + + $m_var_list_update["cat"]=0; + + return BuildEnv(); +} + +function UpEnv() +{ + global $m_var_list_update,$objCatList; + + $current = $objCatList->CurrentCat(); + $parent = $current->Get("ParentId"); + $m_var_list_update["cat"]=$parent; + + return BuildEnv(); +} + +function ModuleInclude($file) +{ + global $pathtoroot; + + $m = GetModuleArray(); + foreach($m as $key=>$value) + { + $path = $pathtoroot.$value.$file; + if(file_exists($path)) + { + echo ""; + @include_once($path); + } + } +} + +function MultiEditButtons(&$ToolBar,$next,$prev,$Form,$StatusField, $url,$onClick, $ExtraVar="", $prev_phrase = 'Phrase Not Passed', $next_phrase = 'Phrase Not Passed') +{ + global $adminURL; + + $ToolBar->Add("divider"); + + if($prev>-1) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + + $var="env=".BuildEnv()."&en=$prev&lpn=".$_REQUEST['lpn']; + if (strlen($ExtraVar)) + $var.= $ExtraVar; + + if ($onClick != 'LangSubmitMove') { + $link = "javascript:edit_submit('$Form','$StatusField','$url',0,'$var');"; + } + else { + $link = "javascript:$onClick('$url', '$prev')"; + } + $ToolBar->Add("moveleft",$prev_phrase,$link,$MouseOver,$MouseOut,"","toolbar/tool_prev.gif"); + } + else + { + $MouseOver=""; + $MouseOut=""; + //$onClick=""; + $link="#"; + $ToolBar->Add("moveleft",$prev_phrase,"#","","","","toolbar/tool_prev_f3.gif"); + + } + + if($next>-1) + { + $MouseOver="swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="swap('moveright', 'toolbar/tool_next.gif');"; + + $var="env=".BuildEnv()."&en=$next".( isset($_REQUEST['lpn']) ? '&lpn='.$_REQUEST['lpn'] : ''); + + if (strlen($ExtraVar)) + $var.= $ExtraVar; + + if ($onClick != 'LangSubmitMove') { + $link = "javascript:edit_submit('$Form','$StatusField','$url',0,'$var');"; + } + else { + $link = "javascript:$onClick('$url', '$next')"; + } + $ToolBar->Add("moveright",$next_phrase,$link,$MouseOver,$MouseOut,"","toolbar/tool_next.gif"); + } + else + { + $ToolBar->Add("moveright",$next_phrase,"#","","","","toolbar/tool_next_f3.gif"); + } +} + +function InsertButtons(&$ToolBar, $Buttons = Array(), $params = Array() ) +{ + foreach($Buttons as $button) + switch($button) + { + case 'save': + $ToolBar->Add( "img_save", "la_Save", "#", + "swap('img_save','toolbar/tool_select_f2.gif');", + "swap('img_save', 'toolbar/tool_select.gif');", + "edit_submit('".$params['form']."','".$params['status_field']."','".$params['url']."',1,'&lpn=".$_REQUEST['lpn']."');","tool_select.gif"); + + break; + case 'cancel': + $ToolBar->Add( "img_cancel", "la_Cancel", "#", + "swap('img_cancel','toolbar/tool_cancel_f2.gif');", + "swap('img_cancel', 'toolbar/tool_cancel.gif');", + "edit_submit('".$params['form']."','".$params['status_field']."','".$params['url']."',2,'&lpn=".$_REQUEST['lpn']."');","tool_cancel.gif"); + break; + case 'edit': + break; + case 'delete': + break; + + } + + + +} + +function GetTitle($item_phrase, $tab_phrase, $id) +{ + // gets correct caption for editing windows with tabs + //echo "In: $item_phrase, $tab_phrase, $id"; + $is_new = ($_REQUEST['new'] == 1) ? 1 : 0; + $text = $is_new ? 'la_Text_Adding' : 'la_Text_Editing'; + $text = admin_language($text).' '.admin_language($item_phrase); + + if($is_new == 0) $text .= ' #'.$id; + $text .= ' - '.admin_language($tab_phrase); + return $text; +} + +function MarkFields($form_name) +{ + // mark specified form fields as required + ?> Index: trunk/admin/editor/FCKeditor/images/smiley/msn/wink_smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_conf_general.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/restore.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/restore.php (revision 0) +++ trunk/kernel/admin/include/toolbar/restore.php (revision 13) @@ -0,0 +1,42 @@ + + + + +END; +?> \ No newline at end of file Index: trunk/kernel/admin/include/toolbar/edituser_general.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/edituser_general.php (revision 0) +++ trunk/kernel/admin/include/toolbar/edituser_general.php (revision 13) @@ -0,0 +1,5 @@ + \ No newline at end of file Index: trunk/kernel/include/item.php =================================================================== diff -u --- trunk/kernel/include/item.php (revision 0) +++ trunk/kernel/include/item.php (revision 13) @@ -0,0 +1,975 @@ +clsParsedItem(); + if($FullItem==TRUE) + { + $this->Reviews = new clsItemReviewList(); + $this->Related = new clsRelationshipList(); + } + $this->Images = new clsImageList(); + $this->CustomFields = array(); + $this->FieldClass = new clsCustomFieldList(); + } + + function ClearCacheData() + { + } + + /* item reviews */ + function &GetItemReviews($Page=1) + { + $res_id = $this->Get("ResourceId"); + $this->Reviews->itemID=$res_id; + $this->Reviews->PerPageVar = $this->ReviewPerPageVar; + $this->Reviews->Page = $Page; + $this->Reviews->GetReviewList("Status=1",$this->ReviewSortOrder); + return $this->Reviews; + } + + function ReviewCount($TodayOnly=FALSE) + { + + if(is_numeric($this->Get("CachedReviewsQty")) && !$TodayOnly) + return (int)$this->Get("CachedReviewsQty"); + + $this->Reviews->itemID=$this->Get("ResourceId"); + return (int)$this->Reviews->GetItemReviewCount($TodayOnly); + } + + function ReviewsLoaded() + { + if($this->Reviews->itemID==$this->Get("ResourceId")) + { + return $this->Reviews->ItemCount(); + } + else + return 0; + } + + function &AddReview($createdBy,$reviewText,$isPending,$ip=NULL,$ForceIP=0, $Module="") + { + $this->Reviews->itemID=$this->Get("ResourceId"); + if($ip == NULL) + $ip = $_SERVER["REMOTE_ADDR"]; + + $CreatedOn = mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y")); + $Status=1; + if($isPending) + $Status=2; + + $AutoModule = GetModuleByAction(); // determine module name by action + //echo "Auto Module: $AutoModule
    "; + + $r = $this->Reviews->AddReview($CreatedOn,$reviewText,$Status,$ip,0,$this->Get("ResourceId"),$this->type,$createdBy,0,$AutoModule); + $this->Increment("CachedReviewsQty"); + return $r; + } + + function ReviewIPExists($ip) + { + return ip_exists($ip,$this->Get("ResourceId"),$this->Reviews->SourceTable); + } + + function DeleteReview($reviewID) + { + $r = $this->Reviews->GetReview($reviewID); + if(is_object($r)) + { + $r->Delete(); + $this->Decrement("CachedReviewsQty"); + } + } + + function DeleteReviews() + { + $res_id = $this->Get("ResourceId"); + if($res_id) + { + $sql = "DELETE FROM ".GetTablePrefix()."ItemReview WHERE ResourceId=$res_id"; + $this->adodbConnection->Execute($sql); + unset($this->Reviews); + $this->Reviews = new clsItemReviewList($res_id); + } + } + + /* item custom fields */ + + function LoadCustomFields() + { + if(!$this->CustomLoaded && $this->Get("ResourceId")>0) + { + $this->FieldClass = new clsCustomFieldList(); + $this->FieldClass->Type = $this->type; + $this->FieldClass->LoadFieldsAndValues($this->Get("ResourceId")); + foreach($this->FieldClass->Items as $f) + { + $this->CustomFields[$f->Get("FieldName")] = $f->HasField('Value') ? $f->Get('Value') : ''; + } + $this->CustomLoaded = 1; + } + } + + function SetCustomField($fieldname,$value) + { + // echo "Setting CF [$fieldname] = [$value]
    "; + if(!$this->CustomLoaded) + $this->LoadCustomFields(); + $this->CustomFields[$fieldname] = $value; + } + + function SaveCustomFields() + { + //echo "Saving CFs
    "; + if(!(int)$this->Get("ResourceId")) + return TRUE; + + if(!$this->CustomLoaded) + return TRUE; + + $data = new clsCustomDataList(); + $data->LoadResource($this->Get("ResourceId")); + foreach($this->FieldClass->Items as $f) + { + $value = $this->CustomFields[$f->Get("FieldName")]; + $data->SetFieldValue($f->Get("CustomFieldId"),$this->Get("ResourceId"),$value); + } + $data->SaveData(); + unset($data); + } + + function GetCustomFieldValue($fieldname,$default="") + { + if(!$this->CustomLoaded) + $this->LoadCustomFields(); + if(isset($this->CustomFields[$fieldname])) + { + $ret = $this->CustomFields[$fieldname]; + } + else + $ret = $default; + return $ret; + } + + + function DeleteCustomData() + { + $cdata = new clsCustomDataList(); + $cdata->DeleteResource($this->Get("ResourceId")); + } + + function Delete($RecordOnly=FALSE) + { + global $objFavorites; + + if($RecordOnly==FALSE) + { + $this->DeleteReviews(); + $this->DeleteRelations(); + $this->DeleteCustomData(); + if($this->NoResourceId==0) + { + if($this->UsingTempTable()==FALSE) + { + if(is_object($this->Images)) + $this->Images->DeleteResource($this->Get("ResourceId")); + $objFavorites->DeleteItem($this->Get("ResourceId")); + } + } + } + parent::Delete(); + } + + /* item relationships */ + function GetRelatedItems() + { + global $objConfig; + + $where = "SourceId = ".$this->Get("ResourceId"); + $where .= " OR (TargetId=".$this->Get("ResourceId")." AND Type=1)"; + $orderBy = $objConfig->Get("Relation_Sortfield")." ".$objConfig->Get("Relation_Sortorder"); + $orderBy = trim($orderBy); + $this->Related->Clear(); + $res = $this->Related->LoadRelated($where,$orderBy); + return $res; + } + + function &RelationObject() + { + return $this->Related; + } + + function DeleteRelations() + { + $res_id = $this->Get("ResourceId"); + if($res_id) + { + $sql = "DELETE FROM ".GetTablePrefix()."Relationship WHERE SourceId=$res_id OR TargetId=$res_id"; + $this->adodbConnection->Execute($sql); + unset($this->Reviews); + $this->Related = new clsRelationshipList($res_id); + } + } + + + /* keyword highlighting for searches */ + + function HighlightField($field) + { + global $objConfig; + + if(/*!strlen($OpenTag) || !strlen($CloseTag) ||*/ !is_array($this->Keywords)) + { + //echo "Missing something
    \n"; + return $this->Get($field); + } + + if(strlen($this->OpenTagVar)) + $OpenTag = $objConfig->Get($this->OpenTagVar); + if(strlen($this->CloseTagVar)) + $CloseTag = $objConfig->Get($this->CloseTagVar); + + $k = array_merge($this->Keywords["required"],$this->Keywords["normal"]); + if(count($k)) + { + $result = HighlightKeywords($k, $this->Get($field), $OpenTag, $CloseTag); + } + else + { + $result = $this->Get($field); + //echo "No Keywords
    \n"; + } + return $result; + } + + function HighlightText($text) + { + global $objConfig; + + if(strlen($this->OpenTagVar)) + $OpenTag = $objConfig->Get($this->OpenTagVar); + if(strlen($this->CloseTagVar)) + $CloseTag = $objConfig->Get($this->CloseTagVar); + + if(!strlen($OpenTag) || !strlen($CloseTag) || !is_array($this->Keywords)) + return $text; + $k = array_merge($this->Keywords["required"],$this->Keywords["normal"]); + if(count($k)) + { + $result = HighlightKeywords($k,$text, $OpenTag, $CloseTag); + } + else + $result = $text; + + return $result; + } + + /* item status functions */ + + function Is($name) + { + $var = "m_" . $name; + return ( isset($this->$var) && $this->$var ) ? true : false; + } + + function IsHotItem() + { + switch($this->Get("HotItem")) + { + case ALWAYS: + return TRUE; + break; + case NEVER: + return FALSE; + break; + case AUTO: + return $this->IsHot; + break; + } + } + + function SetHotItem() + { + $this->IsHot = FALSE; + } + + function IsNewItem() + { + switch($this->Get("NewItem")) + { + case ALWAYS: + return TRUE; + break; + case NEVER: + return FALSE; + break; + case AUTO: + return $this->IsNew; + break; + } + } + + function SetNewItem() + { + $this->IsNew = FALSE; + } + + function IsPopItem() + { + switch($this->Get("PopItem")) + { + case ALWAYS: + return TRUE; + break; + case NEVER: + return FALSE; + break; + case AUTO: + return $this->IsPop; + break; + } + } + + function SetPopItem() + { + $this->IsPop = FALSE; + } + + function SetFromArray($data, $dirty = false) + { + parent::SetFromArray($data, $dirty); + if(is_array($data)) + { + if(array_key_exists("NewItem",$data)) + { + $this->SetNewItem(); + } + if(array_key_exists("HotItem",$data)) + { + $this->SetHotItem(); + } + if(array_key_exists("PopItem",$data)) + { + $this->SetPopItem(); + } + } + } + + function Validate() + { + /* skeleton*/ + return true; + } + + function LoadFromDatabase($Id, $IdField = null) // custom IdField by Alex) + { + /* skeleton */ + parent::LoadFromDatabase($Id, $IdField); + } + + + + //Changes priority + function MoveDown() + { + $this->Decrement("Priority"); + } + + function MoveUp() + { + $this->Increment("Priority"); + } + + function CheckPermission($permissionName) + { + //Check permission and if needs approval set approval + global $objSession,$objCatList; + + $perm = $this->BasePermission; + if(strlen($perm)>0) + $perm .= "."; + $perm .= $permissionName; + + //get an instance of the forum category + $cat =& $objCatList->GetCategory($this->Get("CategoryId")); + if(!is_object($cat)) + { + return FALSE; + } + else + { + return ($cat->HasPermission($perm,$objSession->Get("GroupId"))); + } + } + + function SubmitVote($voteRating, $voteNotes) + { + global $Errors; + global $REMOTE_ADDR; + + if($this->rating_ip_exists($REMOTE_ADDR)) + { +// $Errors->AddError("error.already_voted","","","",get_class($this),"SubmitVote"); + return false; + } + $vote = new clsItemRating(NULL); + $vote->Set("ItemId",$this->UniqueId()); + $vote->Set("RatingValue",$voteRating); + if(!$vote->Create()) + return false; + + $NumVotes = (int)$this->Get("CachedVotesQty"); + $CurrentRating = (int)$this->Get("CachedRating"); + + $Rating = (($NumVotes * $CurrentRating) + $voteRating)/($NumVotes+1); + $this->Set("CachedRating",$Rating); + $this->Update(); + $this->Increment("CachedVotesQty"); + } + + function rating_ip_exists($ip) + { + $count = 0; + $id = $this->Get("ResourceId"); + $sql = "SELECT count(*) as DupCount FROM ItemRating WHERE IPAddress='$ip' and ItemId=$id"; + $adodbConnection = GetADODBConnection(); + $rs = $adodbConnection->Execute($sql); + if($rs) + { + $count = $rs->fields["DupCount"]; + } + return ($count>0); + //return FALSE; + } + + function PurgeRatings() + { + global $objConfig; + + $expired=time()-86400*$objConfig->Get("Timeout_Rating"); + $query="DELETE FROM ItemRating WHERE CreatedOn<$expired"; + $this->adodbConnection->Execute($query); + } + + function GetThumbnailImage() + { + if($this->Images->NumItems()==0) + $this->Images->GetResourceImages($this->Get("ResourceId")); + return $this->Images->GetResourceThumbnail($this->Get("ResourceId")); + } + + function GetImage($number) + { + return $this->Images->GetImageByResource($this->Get("ResourceId"),$number); + } + + function GetImageByName($name) + { + if(!is_object($this->Images)) + $this->Images = new clsImageList(); + return $this->Images->GetImageByName($this->Get("ResourceId"),$name); + } + + function &GetDefaultImage() + { + return $this->Images->GetDefaultImage($this->Get("ResourceId")); + } + + function CreatePendingCopy() + { + $OrgId = $this->IdField(); + $this->Dirty(); + $this->Set("OrgId",$OrgId); + $this->UnsetIdField(); + $this->Set("ResourceId",0); + $this->Set("Status",-2); + $this->Create(); + } + + function AddFavorite($PortalUserId=NULL) + { + global $objSession, $objFavorites; + + $res = FALSE; + if($objSession->HasCatPermission("FAVORITES")) + { + if(!$PortalUserId) + $PortalUserId = $objSession->Get("PortalUserId"); + if($PortalUserId==$objSession->Get("PortalUserId") || $objSession->HasSystemPermission("ADMIN")) + { + $objFavorites->AddFavorite($PortalUserId,$this->Get("ResourceId"), $this->type); + $res = TRUE; + } + } + return $res; + } + + function DeleteFavorite($PortalUserId=NULL) + { + global $objSession, $objFavorites; + + $res = FALSE; + + if($objSession->HasCatPermission("FAVORITES")) + { + if(!$PortalUserId) + $PortalUserId = $objSession->Get("PortalUserId"); + //echo $PortalUserId." ".$objSession->Get("PortalUserId"); + if($PortalUserId==$objSession->Get("PortalUserId") || $objSession->HasSystemPermission("ADMIN")) + { + $objFavorites->DeleteFavorite($PortalUserId,$this->Get("ResourceId")); + $res = TRUE; + } + } + return $res; + } + + function IsFavorite($PortalUserId=NULL) + { + global $objSession, $objFavorites; + + $res = FALSE; + + + if($objSession->HasCatPermission("FAVORITES")) + { + if(!$PortalUserId) + $PortalUserId = $objSession->Get("PortalUserId"); + + if($PortalUserId==$objSession->Get("PortalUserId") || $objSession->HasSystemPermission("ADMIN")) + { + $i = $objFavorites->GetFavoriteObject($PortalUserId,$this->Get("ResourceId")); + + if(is_object($i)) + { + $res = TRUE; + } + else + $res = FALSE; + } + } + + return $res; + } + + function CheckBanned() + { + global $objBanList; + + $objBanList->LoadItemRules($this->type); + $found = FALSE; + $MatchedRule = 0; + foreach($objBanList->Items as $b) + { + $field = $b->Get("ItemField"); + if($this->FieldExists($field)) + { + $ThisValue = strtolower($this->Get($field)); + $TestValue = strtolower($b->Get("ItemValue")); + switch($b->Get("ItemVerb")) + { + case 0: /* any */ + $found = TRUE; + break; + case 1: /* is */ + if($ThisValue==$TestValue) + $found = TRUE; + break; + case 2: /* is not */ + if($ThisValue != $TestValue) + $found = TRUE; + break; + case 3: /* contains */ + if(strstr($ThisValue,$TestValue)) + $found = TRUE; + break; + case 4: /* not contains */ + if(!strstr($ThisValue,$TestValue)) + $found = TRUE; + break; + case 5: /* Greater Than */ + if($TestValue > $ThisValue) + $found = TRUE; + break; + case 6: /* Less Than */ + if($TestValue < $ThisValue) + $found = TRUE; + break; + case 7: /* exists */ + if(strlen($ThisValue)>0) + $found = TRUE; + break; + case 8: /* unique */ + if($this->ValueExists($field,$ThisValue)) + $found = TRUE; + break; + } + } + if($found) + { + if($b->Get("RuleType")==0) + { + $MatchedRule = $b->Get("RuleId"); + } + else + { + $MatchedRule = 0; + } + break; + } + } + return $MatchedRule; + } +} /* clsItem */ + +class clsCatItem extends clsItem +{ + function clsCatItem($FullItem=FALSE) + { + $this->clsItem($FullItem); + } + + function Delete($RecordOnly=FALSE) + { + global $objFavorites; + + parent::Delete($RecordOnly); + if($RecordOnly==FALSE) + { + $this->RemoveFromAllCategories(); + } + } + /* category membership functions */ + + function AssignPrimaryCategory($SourceTable) + { + $sql = "SELECT * FROM $SourceTable WHERE ItemResourceId=".$this->Get("ResourceId")." LIMIT 1"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $catid = $rs->fields["CategoryId"]; + $this->SetPrimaryCategory($catid,$SourceTable); + } + return $catid; + + } + + function GetPrimaryCategory($SourceTable = "") + { + if(is_numeric($this->PrimaryCat)) + return $this->PrimaryCat; + + $this->PrimaryCat=""; + if( strlen($SourceTable) == 0 ) $SourceTable = GetTablePrefix()."CategoryItems"; + $res_id = $this->HasField('ResourceId') ? $this->Get('ResourceId') : 0; + $sql = "SELECT * FROM $SourceTable WHERE ItemResourceId=".$res_id." AND PrimaryCat=1"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $this->PrimaryCat=$rs->fields["CategoryId"]; + return $this->PrimaryCat; + } + else + { + $this->AssignPrimaryCategory($SourceTable); + return $this->PrimaryCat; + } + } + + function SetPrimaryCategory($CategoryId,$SourceTable = "") + { + if(strlen($SourceTable)==0) + $SourceTable = GetTablePrefix()."CategoryItems"; + + $rs = $this->adodbConnection->Execute('SELECT * FROM '.$SourceTable.' WHERE CategoryId='.$CategoryId.' AND ItemResourceId='.$this->Get("ResourceId")); + $this->adodbConnection->Execute("UPDATE $SourceTable SET PrimaryCat=0 WHERE ItemResourceId=".$this->Get("ResourceId")); + $this->adodbConnection->Execute("UPDATE $SourceTable SET PrimaryCat=1 WHERE CategoryId=$CategoryId AND ItemResourceId=".$this->Get("ResourceId")); + + $this->PrimaryCat=$CategoryId; + } + + function CategoryMemberCount($SourceTable="") + { + if(strlen($SourceTable)==0) + $SourceTable = GetTablePrefix()."CategoryItems"; + + $sql = "SELECT count(*) as CatCount FROM $SourceTable WHERE ItemResourceId=".$this->Get("ResourceId"); + if($this->debuglevel) + echo $sql."
    \n"; + + $rs = $this->adodbConnection->Execute($sql); + $count = 0; + if($rs && !$rs->EOF) + $count = $rs->fields["CatCount"]; + return $count; + } + + function CategoryMemberList($SourceTable="") + { + $cats = array(); + if(strlen($SourceTable)==0) + $SourceTable = GetTablePrefix()."CategoryItems"; + + $sql = "SELECT * FROM $SourceTable WHERE ItemResourceId=".$this->Get("ResourceId"); + + if($this->debuglevel) + echo $sql."
    \n"; + + $rs = $this->adodbConnection->Execute($sql); + while($rs && !$rs->EOF) + { + $cats[] = $rs->fields["CategoryId"]; + $rs->MoveNext(); + } + $catlist = implode(",",$cats); + return $catlist; + } + + function AddToCategory($CatId,$SourceTable="",$PrimaryValue=NULL) + { + global $objSession, $objCatList; + + if(!$SourceTable) + $SourceTable = GetTablePrefix()."CategoryItems"; + + if($this->type>0) + { + $Primary = 0; + if(is_numeric($PrimaryValue)) + { + $Primary = $PrimaryValue; + if($Primary==1) + $this->PrimaryCat = $CatId; + } + else + { + if(!is_numeric($this->GetPrimaryCategory())) + { + $Primary =1; + $this->PrimaryCat = $CatId; + } + } + + // check if not exists + $db =& $this->adodbConnection; + $sql = sprintf('SELECT * FROM %s WHERE CategoryId = %s AND ItemResourceId = %s', $SourceTable, $CatId, $this->Get("ResourceId")); + $rs = $db->Execute($sql); + if($rs->RecordCount() == 0 ) + { + $sql = "INSERT INTO $SourceTable (CategoryId,ItemResourceId, PrimaryCat) VALUES ('$CatId','".$this->Get("ResourceId")."',$Primary)"; + if($this->debuglevel) + echo $sql."
    \n"; + $this->adodbConnection->Execute($sql); + } + + $c = $objCatList->GetCategory($CatId); + } + } + + function RemoveFromCategory($CatId,$SourceTable="",$Force=0) + { + global $objSession, $objCatList; + + if(strlen($SourceTable)==0) + $SourceTable = GetTablePrefix()."CategoryItems"; + + if($this->type>0) + { + $primary = $this->GetPrimaryCategory(); + if(($primary==$CatId && $this->CategoryMemberCount($SourceTable)>1) || ($primary != $CatId) || $Force) + { + $sql = "DELETE FROM $SourceTable WHERE CategoryId=$CatId AND ItemResourceId=".$this->Get("ResourceId"); + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql."
    \n"; + + $this->adodbConnection->Execute($sql); + $c = $objCatList->GetCategory($CatId); + $c->ClearCacheData(); + } + } + } + + function MoveToCategory($OldCatId,$NewCatId,$SourceTable="") + { + if(strlen($SourceTable)==0) + $SourceTable = GetTablePrefix()."CategoryItems"; + + $sql = "UPDATE $SourceTable SET CategoryId=$NewCatId WHERE CategoryId=$OldCatId AND ItemResourceId=".$this->Get("ResourceId"); + if($this->debuglevel) + echo $sql."
    \n"; + + $this->adodbConnection->Execute($sql); + } + + function DeleteCategoryItems($CatId,$SourceTable = "") + { + if(strlen($SourceTable)==0) + $SourceTable = GetTablePrefix()."CategoryItems"; + + $CatCount = $this->CategoryMemberCount($SourceTable); + if($CatCount>1) + { + $this->RemoveFromCategory($CatId,$SourceTable); + $this->ClearCacheData(); + } + else + { + $this->Delete(); + $sql = "DELETE FROM $SourceTable WHERE CategoryId=$CatId AND ItemResourceId=".$this->Get("ResourceId"); + if($this->debuglevel) + echo $sql."
    \n"; + + $this->adodbConnection->Execute($sql); + } + } + function RemoveFromAllCategories($SourceTable = "") + { + if(strlen($SourceTable)==0) + $SourceTable = GetTablePrefix()."CategoryItems"; + + if($this->type>0) + { + $sql = "SELECT * FROM $SourceTable WHERE ResourceId=".$this->Get("ResourceId"); + $rs = $this->adodbConnection->Execute($sql); + while ($rs && !$rs->EOF) + { + $CategoryId = $rs->fields["CategoryId"]; + $rs->MoveNext(); + } + $sql = "DELETE FROM $SourceTable WHERE ResourceId=".$this->Get("ResourceId"); + if($this->debuglevel) + echo $sql."
    \n"; + + $this->adodbConnection->Execute($sql); + } + } + + function CopyToNewResource($TargetCat = NULL,$NameField="Name") + { + global $objSession; + + $CatList = $this->CategoryMemberList(); + + $Cats = explode(",",$CatList); + //echo "Target: $TargetCat
    "; + $OldId = $this->Get("ResourceId"); + $this->UnsetIdField(); + $this->Dirty(); + if(!is_numeric($this->Get("OrgId"))) + $this->UnsetField("OrgId"); + $this->UnsetField("ResourceId"); + if(is_numeric($TargetCat) && strlen($NameField)) + { + $OldName = $this->Get($NameField); + if(substr($OldName,0,5)=="Copy ") + { + $parts = explode(" ",$OldName,4); + if($parts[2]=="of" && is_numeric($parts[1])) + { + $Name = $parts[3]; + } + else + if($parts[1]=="of") + { + $Name = $parts[2]." ".$parts[3]; + } + else + $Name = $OldName; + } + else + $Name = $OldName; + $Names = CategoryItemNameCount($TargetCat,$this->tablename,$NameField,$Name); + if(count($Names)>0) + { + $NameCount = count($Names); + $found = FALSE; + $NewName = "Copy of $Name"; + + if(!in_array("Copy of $Name",$Names)) + { + $found = TRUE; + } + else + { + for($x=2;$x<$NameCount+2;$x++) + { + + $NewName = "Copy ".$x." of ".$Name; + if(!in_array($NewName,$Names)) + { + $found = TRUE; + break; + } + + } + } + if(!$found) + { + $NameCount++; + $NewName = "Copy $NameCount of $Name"; + } + $this->Set($NameField,$NewName); + } + } + $this->Create(); + // copy relationships + $NewId = $this->Get("ResourceId"); + $reldata = new clsRelationshipList($DestCat,$this->IdField()); + $reldata->CopyToResource($OldId,$NewId); + + // copy reviews + $rdata = new clsItemReviewList(); + $rdata->CopyToItemId($OldId,$NewId); + unset($rdata); + + // copy custom fields + $cdata = new clsCustomDataList(); + $cdata->CopyResource($OldId,$NewId); + unset($cdata); + + // copy images + if(is_object($this->Images)) + $this->Images->CopyResource($OldId,$NewId); + + $this->AddToCategory($TargetCat, '', 0); // insert (but with duplicate records check) + //echo "ok"; + if(is_numeric($TargetCat)) + { + if(is_array($Cats)) + { + if(!in_array($TargetCat,$Cats)) + { + $this->AddToCategory($TargetCat, 0); // insert + } + } + $this->SetPrimaryCategory($TargetCat); // 2 updates + } + } + + + +} +?> \ No newline at end of file Index: trunk/admin/config/edit_template.php =================================================================== diff -u --- trunk/admin/config/edit_template.php (revision 0) +++ trunk/admin/config/edit_template.php (revision 13) @@ -0,0 +1,297 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +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(!$_POST['Action'] || !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
    "; + $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(is_object($theme)) +{ + $theme->GetFileList("","FilePath,FileName"); + $AllThemeFiles = $theme->Files->Items; +} + +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); +?> + +" method=POST> + +HasError() ) { ?> + style="color: red;"> + + + + + + + + + > + + + + + + > + + + + + + > + + + + + + + + > + + + > + + + > + + + > + + + +
    ERROR:ErrorMsg(); ?>
    Get("FileId"); ?>
    VALUE="Get("FileName"); ?>">
    ">
    + Item Tags: + +   + Insert Tag +   + Global Tags: + +   + Insert Tag +
    + +
    + + + + + + + +
      
    +
    + + "> + "> + "> + +
    + + + Index: trunk/admin/icons/icon24_settings_censor.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tree/tree.php =================================================================== diff -u --- trunk/admin/tree/tree.php (revision 0) +++ trunk/admin/tree/tree.php (revision 13) @@ -0,0 +1,175 @@ +Get("Site_Path"); + + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +$pathtolocal = $pathtoroot; + +$envar = "env=" . BuildEnv(); + +//include section data; create Section hash + +//main In-portal sections +//require_once ($pathtoroot."admin/include/navmenu.php"); + +//All modules +/*if(!isset($SysData)) + $SysData=new SystemConfiguration(); + +$ModuleList=$SysData->GetModuleList();*/ +//$sections = array(); + +//foreach($mod_prefix as $key => $value) +//{ +// $mod = $pathtoroot . $value . "admin/include/navmenu.php"; +// include_once($mod); +//} +include_once($pathtoroot.$admin."/include/sections.php"); + +$ServerName = $objConfig->Get("Site_Name"); +$rootLink = $adminURL."/subitems.php?env=".BuildEnv()."§ion=in-portal:root"; +?> + + +"> + + + + + + + + + + + + + + + + +
    +   + +
    + + +
    +
    + + + + + +
    + +
    + + + Index: trunk/themes/default/img/relevance/rel_4.gif =================================================================== diff -u Binary files differ Index: trunk/admin/config/addtheme_templates.php =================================================================== diff -u --- trunk/admin/config/addtheme_templates.php (revision 0) +++ trunk/admin/config/addtheme_templates.php (revision 13) @@ -0,0 +1,310 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; + +$imagesURL = $adminURL."/images"; + +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditItems); + +$objEditItems = new clsThemeList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Theme"); +$objEditItems->EnablePaging = FALSE; + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); + +$c = $objEditItems->GetItemByIndex($en); + +$ThemeId = $c->Get("ThemeId"); + +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_edit_theme_templates"; +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:theme_templates'; + +$objListToolBar = new clsToolBar(); +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('theme','ThemeEditStatus','".$admin."/config/config_theme.php',1);","tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('theme','ThemeEditStatus','".$admin."/config/config_theme.php',2);",$imagesURL."/toolbar/tool_cancel.gif"); +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass","FileChecks"); +$objListToolBar->Set("CheckForm","theme"); +//Display header + +$sec = $objSections->GetSection($section); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/config/addtheme_templates.php"; + $StatusField = "ThemeEditStatus"; + $form = "theme"; + MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick")); + $objListToolBar->Add("divider"); +} + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick +// addtemplate.php +/* +$objListToolBar->Add( "new_template", + "la_ToolTip_New_Template", + $adminURL."/config/edit_template.php?".$envar, + "swap('new_template','toolbar/tool_new_template_f2.gif');", + "swap('new_template', 'toolbar/tool_new_template.gif');", + "", + "tool_new_template.gif"); +*/ +$objListToolBar->Add( "new_template", + "la_ToolTip_New_Template", + "#", + "swap('new_template','toolbar/tool_new_template_f2.gif');", + "swap('new_template', 'toolbar/tool_new_template.gif');", + "OpenTemplateAdd($ThemeId);", + "tool_new_template.gif"); + +$objListToolBar->Add( "template_edit", + "la_ToolTip_Edit", + "#", + "if (FileChecks.itemChecked()) swap('template_edit','toolbar/tool_edit_f2.gif');", + "if (FileChecks.itemChecked()) swap('template_edit', 'toolbar/tool_edit.gif');", + "if (FileChecks.itemChecked()) OpenTemplateEdit($ThemeId);", + "tool_edit.gif", + TRUE, + TRUE); +$listImages[] = "FileChecks.addImage('template_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +$objListToolBar->Add("template_del","la_ToolTip_Delete","#", "if (FileChecks.itemChecked()) swap('template_del','toolbar/tool_delete_f2.gif');", + "if (FileChecks.itemChecked()) swap('template_del', 'toolbar/tool_delete.gif');","if (FileChecks.itemChecked()) FileChecks.check_submit('addtheme_templates', 'm_template_delete');", + "tool_delete.gif",FALSE,TRUE); +$listImages[] = "FileChecks.addImage('template_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->Add("template_preview","la_ToolTip_Preview","#", "if (FileChecks.itemChecked()) swap('template_preview','toolbar/tool_preview_template_f2.gif');", + "if (FileChecks.itemChecked()) swap('template_preview', 'toolbar/tool_preview_template.gif');", + "if (FileChecks,itemChecked()) OpenTemplatePreview();", + "tool_preview_template.gif",FALSE,TRUE); +$listImages[] = "FileChecks.addImage('template_preview','$imagesURL/toolbar/tool_preview_template.gif','$imagesURL/toolbar/tool_preview_template_f3.gif',1); "; + +$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->Add("divider"); + +$objListToolBar->AddToInitScript($listImages); + +$objListToolBar->AddToInitScript("fwLoadMenus();\n"); + +$c->VerifyTemplates(); + +$objThemeFiles = new clsThemeFileList(); + +$order = trim($objConfig->Get("Template_LV_Sortfield")." ".$objConfig->Get("Template_LV_Sortorder")); + +$SearchWords = $objSession->GetVariable("TemplateSearchWord"); +if(strlen($SearchWords)) +{ + $where = $objThemeFiles->AdminSearchWhereClause($SearchWords); +} +else + $where = ""; + +$sql = "SELECT t.*,t.Description as Description, ELT(t.FileType+1,'".admin_language("la_Text_BuiltIn")."','".admin_language("la_Text_Custom")."') as Type "; +$sql .= "FROM ".GetTablePrefix()."ThemeFiles as t WHERE t.ThemeId=".$c->Get("ThemeId")." "; + +if(strlen($where)) + $sql .= "AND ".$where." "; +if(strlen($order)) + $sql .= "ORDER BY ".$order." "; + +if(isset($_GET["lpn"])) + $objSession->SetVariable("Page_Template",$_GET["lpn"]); + +$sql .= GetLimitSQL($objSession->GetVariable("Page_Template"),$objConfig->Get("Perpage_Template")); + +$objThemeFiles->Query_Item($sql); +$ThemeDir = strtolower($c->Get("Name")).$pathchar; + +$itemcount = QueryCount($sql); + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + +$objListView = new clsListView($objListToolBar,$objThemeFiles); +$objListView->IdField = "FileId"; + +$order = $objConfig->Get("Template_LV_Sortfield"); +$objListView->ColumnHeaders->Add("FilePath",admin_language("la_prompt_Module"),1,0,$order,"width=\"30%\"","Template_LV_Sortfield","Template_LV_Sortorder","FilePath"); +$objListView->ColumnHeaders->Add("FileName",admin_language("la_prompt_Template"),1,0,$order,"width=\"30%\"","Template_LV_Sortfield","Template_LV_Sortorder","FileName"); +$objListView->ColumnHeaders->Add("Description",admin_language("la_prompt_Description"),1,0,$order,"width=\"30%\"","Template_LV_Sortfield","Template_LV_Sortorder","Description"); +$objListView->ColumnHeaders->Add("Type",admin_language("la_prompt_Type"),1,0,$order,"width=\"30%\"","Template_LV_Sortfield","Template_LV_Sortorder","Type"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get("Template_LV_Sortfield"), $objConfig->Get("Template_LV_Sortorder")); + +$objListView->PrintToolBar = FALSE; +$objListView->checkboxes = TRUE; + +$objListView->CurrentPageVar = "Page_Template"; +$objListView->PerPageVar = "Perpage_Template"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_template_file_search"; +$objListView->extra_env = "en=".(int)$en; + +$objListView->TotalItemCount = $itemcount; + +$objListView->ConfigureViewMenu("Template_LV_Sortfield","Template_LV_Sortorder","Module", + "",0,0); + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Theme")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Template"); +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
    " method=POST> + + +PrintList(); +?> + + + + + + > + + + +
    + +
    +
    + + +
    + + +
    " name="viewmenu"> + + + + +
    + + + Index: trunk/themes/default/my_info.tpl =================================================================== diff -u --- trunk/themes/default/my_info.tpl (revision 0) +++ trunk/themes/default/my_info.tpl (revision 13) @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + +

    + + + + + + +

    + "> > + "> > + + + + + + + + +
    " width="18" height="12" alt="" />
       
    + +
    +
    + + + +
    + + + + + + +


    :
    + + + + + + + + +

    + +
    + + + + +
    + + + + + +

    +

    + + + + + + + +

    + + +
    + +
    + +

    +

    + + + + Index: trunk/admin/icons/icon46_foldersearch.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_theme_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.cut.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-postgres7.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-postgres7.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-postgres7.inc.php (revision 13) @@ -0,0 +1,47 @@ += 0) ? " OFFSET $offset" : ''; + return $secs2cache ? + $this->CacheExecute($secs2cache,$sql." LIMIT $nrows$offsetStr",$inputarr,$arg3) + : + $this->Execute($sql." LIMIT $nrows$offsetStr",$inputarr,$arg3); + } +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_postgres7 extends ADORecordSet_postgres{ + + var $databaseType = "postgres7"; + + function ADORecordSet_postgres7($queryID) { + $res=$this->ADORecordSet_postgres($queryID); + return $res; + } + +} +?> Index: trunk/themes/default/mailing_list/subscribe.tpl =================================================================== diff -u --- trunk/themes/default/mailing_list/subscribe.tpl (revision 0) +++ trunk/themes/default/mailing_list/subscribe.tpl (revision 13) @@ -0,0 +1,126 @@ + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + + +

    +
    + + "> + + + + + + + + + + + + + + + + + + + + + +



     
    +

    +

    +



    +
    + " class="button"> +
    +
    + + +

    + + + + + + + + + + + + + + + +
    +
    + + + Index: trunk/admin/images/itemtabs/tab_active_l.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_usergroups.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tree/ftv2lastnode.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_upcat_f2.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/item_select.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/item_select.php (revision 0) +++ trunk/kernel/admin/include/toolbar/item_select.php (revision 13) @@ -0,0 +1,93 @@ +GetPersistantVariable("m_tab_CatTab_hide"); +print << + + + + + + +END; + +?> \ No newline at end of file Index: trunk/themes/default/my_account.tpl =================================================================== diff -u --- trunk/themes/default/my_account.tpl (revision 0) +++ trunk/themes/default/my_account.tpl (revision 13) @@ -0,0 +1,233 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + +

    + + + + + + +

    "> > + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +
    + + + +
    + + + + + + +


    :
    + + + +
    + + + + + +

    + + +
    + + + + + +

    + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +




    +


    + ">
    +
    + "> +

    +



    + ">
    +
    + "> +

    +
     


    + ">
    +
    + "> +

    +
     


    + ">
    +
    + "> +

    +
     


    + ">
    +
    + "> +

    +
     

    + + + + + + + + + + + + + +




    +





    + +
    + +

    +
    + + + + Index: trunk/themes/default/img/bgr_actbox_separ.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_permission_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/msn/lightbulb.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/zoor.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_myfavorites.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/pivottable.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/pivottable.inc.php (revision 0) +++ trunk/kernel/include/adodb/pivottable.inc.php (revision 13) @@ -0,0 +1,163 @@ +GetCol("select distinct $colfield from $tables $where order by 1"); + if (!$aggfield) $hidecnt = false; + + $sel = "$rowfields, "; + if (is_array($colfield)) { + foreach ($colfield as $k => $v) { + if (!$hidecnt) $sel .= "\n\t$aggfn(CASE WHEN $v THEN 1 ELSE 0 END) AS \"$k\", "; + if ($aggfield) + $sel .= "\n\t$aggfn(CASE WHEN $v THEN $aggfield ELSE 0 END) AS \"$sumlabel$k\", "; + } + } else { + foreach ($colarr as $v) { + if (!is_numeric($v)) $vq = $db->qstr($v); + else $vq = $v; + if (strlen($v) == 0 ) $v = 'null'; + if (!$hidecnt) $sel .= "\n\t$aggfn(CASE WHEN $colfield=$vq THEN 1 ELSE 0 END) AS \"$v\", "; + if ($aggfield) { + if ($hidecnt) $label = $v; + else $label = "{$v}_$aggfield"; + $sel .= "\n\t$aggfn(CASE WHEN $colfield=$vq THEN $aggfield ELSE 0 END) AS \"$label\", "; + } + } + } + if ($aggfield && $aggfield != '1'){ + $agg = "$aggfn($aggfield)"; + $sel .= "\n\t$agg as \"$sumlabel$aggfield\", "; + } + + if ($showcount) + $sel .= "\n\tSUM(1) as Total"; + + + $sql = "SELECT $sel \nFROM $tables $where \nGROUP BY $rowfields"; + return $sql; + } + +/* EXAMPLES USING MS NORTHWIND DATABASE */ +if (0) { + +# example1 +# +# Query the main "product" table +# Set the rows to CompanyName and QuantityPerUnit +# and the columns to the Categories +# and define the joins to link to lookup tables +# "categories" and "suppliers" +# + + $sql = PivotTableSQL( + $gDB, # adodb connection + 'products p ,categories c ,suppliers s', # tables + 'CompanyName,QuantityPerUnit', # row fields + 'CategoryName', # column fields + 'p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID' # joins/where +); + print "
    $sql";
    + $rs = $gDB->Execute($sql);
    + rs2html($rs);
    + 
    +/*
    +Generated SQL:
    +
    +SELECT CompanyName,QuantityPerUnit, 
    +	SUM(CASE WHEN CategoryName='Beverages' THEN 1 ELSE 0 END) AS "Beverages", 
    +	SUM(CASE WHEN CategoryName='Condiments' THEN 1 ELSE 0 END) AS "Condiments", 
    +	SUM(CASE WHEN CategoryName='Confections' THEN 1 ELSE 0 END) AS "Confections", 
    +	SUM(CASE WHEN CategoryName='Dairy Products' THEN 1 ELSE 0 END) AS "Dairy Products", 
    +	SUM(CASE WHEN CategoryName='Grains/Cereals' THEN 1 ELSE 0 END) AS "Grains/Cereals", 
    +	SUM(CASE WHEN CategoryName='Meat/Poultry' THEN 1 ELSE 0 END) AS "Meat/Poultry", 
    +	SUM(CASE WHEN CategoryName='Produce' THEN 1 ELSE 0 END) AS "Produce", 
    +	SUM(CASE WHEN CategoryName='Seafood' THEN 1 ELSE 0 END) AS "Seafood", 
    +	SUM(1) as Total 
    +FROM products p ,categories c ,suppliers s  WHERE p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID 
    +GROUP BY CompanyName,QuantityPerUnit
    +*/
    +//=====================================================================
    +
    +# example2
    +#
    +# Query the main "product" table
    +# Set the rows to CompanyName and QuantityPerUnit
    +# and the columns to the UnitsInStock for different ranges
    +# and define the joins to link to lookup tables 
    +# "categories" and "suppliers"
    +#
    + $sql = PivotTableSQL(
    + 	$gDB,										# adodb connection
    + 	'products p ,categories c ,suppliers s',	# tables
    +	'CompanyName,QuantityPerUnit',				# row fields
    +												# column ranges
    +array(										
    +' 0 ' => 'UnitsInStock <= 0',
    +"1 to 5" => '0 < UnitsInStock and UnitsInStock <= 5',
    +"6 to 10" => '5 < UnitsInStock and UnitsInStock <= 10',
    +"11 to 15"  => '10 < UnitsInStock and UnitsInStock <= 15',
    +"16+" =>'15 < UnitsInStock'
    +),
    +	' p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID', # joins/where
    +	'UnitsInStock', 							# sum this field
    +	'Sum'										# sum label prefix
    +);
    + print "
    $sql";
    + $rs = $gDB->Execute($sql);
    + rs2html($rs);
    + /*
    + Generated SQL:
    + 
    +SELECT CompanyName,QuantityPerUnit, 
    +	SUM(CASE WHEN UnitsInStock <= 0 THEN UnitsInStock ELSE 0 END) AS "Sum  0 ", 
    +	SUM(CASE WHEN 0 < UnitsInStock and UnitsInStock <= 5 THEN UnitsInStock ELSE 0 END) AS "Sum 1 to 5", 
    +	SUM(CASE WHEN 5 < UnitsInStock and UnitsInStock <= 10 THEN UnitsInStock ELSE 0 END) AS "Sum 6 to 10", 
    +	SUM(CASE WHEN 10 < UnitsInStock and UnitsInStock <= 15 THEN UnitsInStock ELSE 0 END) AS "Sum 11 to 15", 
    +	SUM(CASE WHEN 15 < UnitsInStock THEN UnitsInStock ELSE 0 END) AS "Sum 16+",
    +	SUM(UnitsInStock) AS "Sum UnitsInStock", 
    +	SUM(1) as Total 
    +FROM products p ,categories c ,suppliers s  WHERE  p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID 
    +GROUP BY CompanyName,QuantityPerUnit
    + */
    +}
    +?>
    \ No newline at end of file
    Index: trunk/admin/images/smicon2.gif
    ===================================================================
    diff -u
    Binary files differ
    Index: trunk/admin/images/itemtabs/tab_inactive_l.gif
    ===================================================================
    diff -u
    Binary files differ
    Index: trunk/admin/images/toolbar/tool_select_f3.gif
    ===================================================================
    diff -u
    Binary files differ
    Index: trunk/compat/str_ireplace.php
    ===================================================================
    diff -u
    --- trunk/compat/str_ireplace.php	(revision 0)
    +++ trunk/compat/str_ireplace.php	(revision 13)
    @@ -0,0 +1,119 @@
    +                                |
    +// +----------------------------------------------------------------------+
    +//
    +// $Id: str_ireplace.php,v 1.1 2004-10-26 18:22:16 kostja Exp $
    +//
    +
    +
    +/**
    + * Replace str_ireplace()
    + *
    + * @category    PHP
    + * @package     PHP_Compat
    + * @link        http://php.net/function.str_ireplace
    + * @author      Aidan Lister 
    + * @version     $Revision: 1.1 $
    + * @since       PHP 5
    + * @internal    count not by returned by reference - not possible in php4
    + * @require     PHP 4.0.1 (trigger_error)
    + */
    +if (!function_exists('str_ireplace'))
    +{
    +    function str_ireplace ($search, $replace, $subject, $count = null)
    +    {
    +        if (is_string($search) && is_array($replace)) {
    +            trigger_error('Array to string conversion', E_USER_NOTICE);
    +            $replace = (string) $replace;
    +        }
    +
    +        // If search isn't an array, make it one
    +        if (!is_array($search)) {
    +            $search = array ($search);
    +        }
    +    
    +        // If replace isn't an array, make it one, and pad it to the length of search
    +        if (!is_array($replace))
    +        {
    +            $replace_string = $replace;
    +
    +            $replace = array ();
    +            for ($i = 0, $c = count($search); $i < $c; $i++)
    +            {
    +                $replace[$i] = $replace_string;
    +            }
    +        }
    +
    +        // Check the replace array is padded to the correct length
    +        $length_replace = count($replace);
    +        $length_search = count($search);
    +        if ($length_replace < $length_search)
    +        {
    +            for ($i = $length_replace; $i < $length_search; $i++)
    +            {
    +                $replace[$i] = '';
    +            }
    +        }
    +
    +        // If subject is not an array, make it one
    +        $was_array = false;
    +        if (!is_array($subject)) {
    +            $was_array = true;
    +            $subject = array ($subject);
    +        }
    +
    +        // Loop through each subject
    +        $count = 0;
    +        foreach ($subject as $subject_key => $subject_value)
    +        {
    +            // Loop through each search
    +            foreach ($search as $search_key => $search_value)
    +            {
    +                // Split the array into segments, in between each part is our search
    +                $segments = explode(strtolower($search_value), strtolower($subject_value));
    +
    +                // The number of replacements done is the number of segments minus the first
    +                $count += count($segments) - 1;
    +                $pos = 0;
    +
    +                // Loop through each segment
    +                foreach ($segments as $segment_key => $segment_value)
    +                {
    +                    // Replace the lowercase segments with the upper case versions
    +                    $segments[$segment_key] = substr($subject_value, $pos, strlen($segment_value));
    +                    // Increase the position relative to the initial string
    +                    $pos += strlen($segment_value) + strlen($search_value);
    +                }
    +                
    +                // Put our original string back together
    +                $subject_value = implode($replace[$search_key], $segments);
    +            }
    +
    +            $result[$subject_key] = $subject_value;
    +        }
    +
    +        // Check if subject was initially a string and return it as a string
    +        if ($was_array === true) {
    +            return $result[0];
    +        }
    +
    +        // Otherwise, just return the array
    +        return $result;
    +    }
    +}
    +
    +?>
    \ No newline at end of file
    Index: trunk/themes/default/img/bgr_quick_links.jpg
    ===================================================================
    diff -u
    Binary files differ
    Index: trunk/admin/editor/FCKeditor/fckeditor_js.asp
    ===================================================================
    diff -u
    --- trunk/admin/editor/FCKeditor/fckeditor_js.asp	(revision 0)
    +++ trunk/admin/editor/FCKeditor/fckeditor_js.asp	(revision 13)
    @@ -0,0 +1,88 @@
    +<%
    +/*
    + * FCKeditor - The text editor for internet
    + * Copyright (C) 2003 Frederico Caldeira Knabben
    + *
    + * Licensed under the terms of the GNU Lesser General Public License
    + * (http://www.opensource.org/licenses/lgpl-license.php)
    + *
    + * For further information go to http://www.fredck.com/FCKeditor/ 
    + * or contact fckeditor@fredck.com.
    + *
    + * fckeditor_js.asp: ASP integration - JavaScript version.
    + *
    + * Authors:
    + *   Frederico Caldeira Knabben (fckeditor@fredck.com)
    + *   Dimiter Naydenov (dimitern@netagesolutions.com)
    + */
    +
    +	// The editor base path
    +	// You have to update it with you web site configuration
    +	FCKeditorBasePath = "/FCKeditor/";
    +
    +	function FCKeditor()
    +	{
    +		this.ToolbarSet = "";
    +		this.Value = "";
    +		this.CanUpload = "none";
    +		this.CanBrowse = "none";
    +	}
    +
    +	FCKeditor.prototype.CreateFCKeditor = function FCKeditor_CreateFCKeditor(instanceName,width,height)
    +	{
    +		var sLink;
    +		
    +		if (this.IsCompatible())
    +		{
    +			sLink = FCKeditorBasePath + "fckeditor.html?FieldName=" + instanceName;
    +
    +			if (this.ToolbarSet != "")
    +			{
    +				sLink += "&Toolbar=" + this.ToolbarSet;
    +			}
    +
    +			if (this.CanUpload != "none")
    +			{
    +				if (this.CanUpload == true)
    +				{
    +					sLink += "&Upload=true";
    +				}
    +				else
    +				{
    +					sLink += "&Upload=false";
    +				}
    +			}
    +
    +			if (this.CanBrowse != "none")
    +			{
    +				if (this.CanBrowse == true)
    +				{
    +					sLink += "&Browse=true";
    +				}
    +				else
    +				{
    +					sLink += "&Browse=false";
    +				}
    +			}
    +
    +			Response.Write("");
    +			Response.Write("");
    +		} else {
    +			Response.Write("");
    +		}
    +	}
    +	
    +	FCKeditor.prototype.IsCompatible = function FCKeditor_IsCompatible()
    +	{
    +		var sAgent = String(Request.ServerVariables("HTTP_USER_AGENT"));
    +		var iVersion;
    +
    +		if ((sAgent.indexOf("MSIE") > 0) && (sAgent.indexOf("Windows") > 0) && (sAgent.indexOf("Opera") == -1))
    +		{
    +			iVersion = parseInt(sAgent.replace(/^.*MSIE\s(\d).*$/gi,"$1"));
    +			return (iVersion >= 5);
    +		} else {
    +			return false;
    +		}
    +	}
    +%>
    \ No newline at end of file
    Index: trunk/admin/icons/icon46_settings_censor.gif
    ===================================================================
    diff -u
    Binary files differ
    Index: trunk/admin/icons/icon24_summary.gif
    ===================================================================
    diff -u
    Binary files differ
    Index: trunk/kernel/admin/include/toolbar/template_editor.php
    ===================================================================
    diff -u
    --- trunk/kernel/admin/include/toolbar/template_editor.php	(revision 0)
    +++ trunk/kernel/admin/include/toolbar/template_editor.php	(revision 13)
    @@ -0,0 +1,578 @@
    +\n";
    +
    +print "\n";	
    +
    +print <<
    +
    +
    +END;
    +?>
    \ No newline at end of file
    Index: trunk/admin/import/inlinkimport3.php
    ===================================================================
    diff -u
    --- trunk/admin/import/inlinkimport3.php	(revision 0)
    +++ trunk/admin/import/inlinkimport3.php	(revision 13)
    @@ -0,0 +1,177 @@
    +Get("Site_Path");
    +
    +$admin = $objConfig->Get("AdminDirectory");
    +if(!strlen($admin))
    +    $admin = "admin";
    +
    +$localURL=$rootURL."kernel/";
    +$adminURL=$rootURL.$admin;
    +$imagesURL = $adminURL."/images";
    +
    +//admin only util
    +$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");
    +//Set Section
    +$section = "in-portal:inlink_inport";
    +//Set Environment Variable
    +$envar = "env=" . BuildEnv();
    +
    +$formaction = $adminURL."/import/import.php?".$envar;
    + $sec = $objSections->GetSection($section);
    + $objCatToolBar = new clsToolBar();
    +
    +if (true)
    +{
    +	
    +   if(true)
    +  {
    +        $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');";
    +    $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');";
    +    $var="?env=".BuildEnv()."&en=$en_prev";
    +    $link=$adminURL."/import/inlinkimport2.php".$var;
    +    
    +    $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif");
    +  }
    +  
    +  if(true)
    +  {
    +    $MouseOver="swap('moveright','toolbar/tool_next_f2.gif');";
    +    $MouseOut="swap('moveright', 'toolbar/tool_next.gif');";
    +
    +
    +    $var="?env=".BuildEnv()."&en=$en_next";
    +    $link2=$adminURL."/import/inlinkimport4.php".$var;
    +    
    +    $onClick="document.inlinkimport3.submit(); ";
    +   
    +    $link="#";
    +    $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next.gif");
    +  }
    +  
    +  $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 3";
    +  
    +  int_header($objCatToolBar,NULL,$title);
    +}
    +?>
    +         
    +
    +	
    +
    +     > 
    +            
    +			
    +			
    +            
    +          
    +         > 
    +            
    +			
    +			
    +            
    +          
    +		> 
    +            
    +			
    +			
    +            
    +          
    +		  > 
    +		    
    +            
    +		    
    +		
    +		 > 
    +            
    +            
    +          
    +            	
    + 
    + 
    + 
    +
    +
    + + +
    + +
    + +
    + +
    + +
    + GetVariable("error_importing"); ?> +
    + \ No newline at end of file Index: trunk/kernel/include/adodb/drivers/adodb-postgres7.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-postgres7.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-postgres7.inc.php (revision 13) @@ -0,0 +1,74 @@ +ADODB_postgres64(); + } + + // the following should be compat with postgresql 7.2, + // which makes obsolete the LIMIT limit,offset syntax + function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$arg3=false,$secs2cache=0) + { + $offsetStr = ($offset >= 0) ? " OFFSET $offset" : ''; + $limitStr = ($nrows >= 0) ? " LIMIT $nrows" : ''; + return $secs2cache ? + $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr,$arg3) + : + $this->Execute($sql."$limitStr$offsetStr",$inputarr,$arg3); + } + + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_postgres7 extends ADORecordSet_postgres64{ + + var $databaseType = "postgres7"; + + function ADORecordSet_postgres7($queryID,$mode=false) + { + $this->ADORecordSet_postgres64($queryID,$mode); + } + + // 10% speedup to move MoveNext to child class + function MoveNext() + { + if (!$this->EOF) { + $this->_currentRow++; + if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) { + $this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode); + + if (is_array($this->fields)) { + if (isset($this->_blobArr)) $this->_fixblobs(); + return true; + } + } + $this->fields = false; + $this->EOF = true; + } + return false; + } + +} +?> \ No newline at end of file Index: trunk/admin/browse.php =================================================================== diff -u --- trunk/admin/browse.php (revision 0) +++ trunk/admin/browse.php (revision 13) @@ -0,0 +1,465 @@ +

    "; + +if(!strlen($pathtoroot)) +{ + $path=dirname(realpath($_SERVER['SCRIPT_FILENAME'])); + if(strlen($path)) + { + /* determine the OS type for path parsing */ + $pos = strpos($path,":"); + if ($pos === false) + { + $gOS_TYPE="unix"; + $pathchar = "/"; + } + else + { + $gOS_TYPE="win"; + $pathchar="\\"; + } + $p = $path.$pathchar; + /*Start looking for the root flag file */ + while(!strlen($pathtoroot) && strlen($p)) + { + $sub = substr($p,strlen($pathchar)*-1); + if($sub==$pathchar) + { + $filename = $p."root.flg"; + } + else + $filename = $p.$pathchar."root.flg"; + if(file_exists($filename)) + { + $pathtoroot = $p; + } + else + { + $parent = realpath($p.$pathchar."..".$pathchar); + if($parent!=$p) + { + $p = $parent; + } + else + $p = ""; + } + } + if(!strlen($pathtoroot)) + $pathtoroot = ".".$pathchar; + } + else + { + $pathtoroot = ".".$pathchar; + } +} + +$sub = substr($pathtoroot,strlen($pathchar)*-1); +if($sub!=$pathchar) +{ + $pathtoroot = $pathtoroot.$pathchar; +} +//echo $pathtoroot; + +require_once($pathtoroot."kernel/startup.php"); + +if (!admin_login()) +{ + if(!headers_sent()) + setcookie("sid"," ",time()-3600); + $objSession->Logout(); + header("Location: ".$adminURL."/login.php"); + die(); + //require_once($pathtoroot."admin/login.php"); +} + +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$browseURL = $adminURL."/browse"; +$cssURL = $adminURL."/include"; + +$indexURL = $rootURL."index.php"; + +$m_var_list_update["cat"] = 0; +$homeURL = "javascript:AdminCatNav('".$_SERVER["PHP_SELF"]."?env=".BuildEnv()."');"; +unset($m_var_list_update["cat"]); + +$envar = "env=" . BuildEnv(); + +if($objCatList->CurrentCategoryID()>0) +{ + $c = $objCatList->CurrentCat(); + $upURL = "javascript:AdminCatNav('".$c->Admin_Parent_Link()."');"; +} +else + $upURL = $_SERVER["PHP_SELF"]."?".$envar; + +//admin only util + +$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."/browse/toolbar.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot.$value."admin/include/parser.php"; + if(file_exists($path)) + { + //echo ""; + @include_once($path); + } +} +if(!$is_install) +{ + if (!admin_login()) + { + if(!headers_sent()) + setcookie("sid"," ",time()-3600); + $objSession->Logout(); + header("Location: ".$adminURL."/login.php"); + die(); + //require_once($pathtoroot."admin/login.php"); + } +} +//Set Section +$section = 'in-portal:browse'; + +//Set Environment Variable + +//echo $objCatList->ItemsOnClipboard()." Categories on the clipboard
    \n"; +//echo $objTopicList->ItemsOnClipboard()." Topics on the clipboard
    \n"; +//echo $objLinkList->ItemsOnClipboard()." Links on the clipboard
    \n"; +//echo $objArticleList->ItemsOnClipboard()." Articles on the clipboard
    \n"; + +// save last category visited +$objSession->SetVariable('prev_category', $objSession->GetVariable('last_category') ); +$objSession->SetVariable('last_category', $objCatList->CurrentCategoryID() ); + +/* // for testing +$last_cat = $objSession->GetVariable('last_category'); +$prev_cat = $objSession->GetVariable('prev_category'); +echo "Last CAT: [$last_cat]
    "; +echo "Prev CAT: [$prev_cat]
    "; +*/ +$SearchType = $objSession->GetVariable("SearchType"); +if(!strlen($SearchType)) + $SearchType = "all"; +$SearchLabel = "la_SearchLabel"; + +if( GetVar('SearchWord') !== false ) $objSession->SetVariable('admin_seach_words', GetVar('SearchWord') ); +$SearchWord = $objSession->GetVariable('admin_seach_words'); + +$objSession->SetVariable("HasChanges", 0); + +/* page header */ +print << + + In-portal + + + + +END; + + require_once($pathtoroot.$admin."/include/mainscript.php"); + +print << + if (window.opener != null) { + theMainScript.CloseAndRefreshParent(); + } + +END; + +print << + + + + + +END; +load_module_styles(); +if( !isset($list) ) $list = ''; +if(($SearchType=="categories" || $SearchType="all") && strlen($list)) +{ + int_SectionHeader(NULL,NULL,NULL,admin_language("la_Title_SearchResults")); +} +else + int_SectionHeader(); + +if($objSession->GetVariable("SearchWord") != '') { + $filter = true; +} +else { + $sessVars = $objConfig->GetSessionValues(0); + //print_pre($sessVars); + foreach ($sessVars as $key => $value) { + if (strstr($key, '_View')) { + //echo "$value
    "; + if ($value != 1) { + $filter = true; + } + } + } +} +?> +
    + + + + + + + +
    +
    + " ImagePath=""> + " ImagePath=""> + "> + " ImagePath=""> + " ImagePath=""> + +0) + print "tab=\"".$btn["Tab"]."\""; + print ">\n"; + } +?> + " ImagePath=""> + " ImagePath=""> + "> + " ImagePath=""> + " ImagePath=""> + "> + " ImagePath=""> + " ImagePath=""> + " ImagePath=""> + "> + " ImagePath=""> + " ImagePath=""> + "> + " ImagePath=""> + " ImagePath=""> +
    +
    + + + + + + + +
    + + +
    " NAME="admin_search" ID="admin_search">">"> + + + + +
     /icon16_search.gif" alt="" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" src="/arrow16.gif" onmouseover="this.src='/icon16_search_f2.gif'" onmouseout="this.src='/icon16_search.gif'" style="cursor:hand" width="22" width="22"><?php echo admin_language(" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" src="/arrow16.gif" onmouseover="this.src='/arrow16_f2.gif'" onmouseout="this.src='/arrow16.gif'" style="cursor:hand"> + /icon16_search_reset.gif" alt="" align="absMiddle" onclick="document.all.SearchWord.value = ''; this.action = this.getAttribute('action'); actionHandler(this);" onmouseover="this.src='/icon16_search_reset_f2.gif'" onmouseout="this.src='/icon16_search_reset.gif'" style="cursor:hand" width="22" width="22">  +
    +
    + +
    + + + + + +
    + +
    + +
    + +QueryOrderByClause(TRUE,TRUE,TRUE); + $objCatList->Clear(); + $IsSearch = FALSE; + if($SearchType == 'categories' || $SearchType == 'all') + { + $list = $objSession->GetVariable("SearchWord"); + $SearchQuery = $objCatList->AdminSearchWhereClause($list); + if(strlen($SearchQuery)) + { + $SearchQuery = " (".$SearchQuery.") "; + if( strlen($CatScopeClause) ) $SearchQuery .= " AND ".$CatScopeClause; + $objCatList->LoadCategories($SearchQuery.$CategoryFilter,$OrderBy); + $IsSearch = TRUE; + } + else + $objCatList->LoadCategories("ParentId=".$objCatList->CurrentCategoryID()." ".$CategoryFilter,$OrderBy); + } + else + $objCatList->LoadCategories("ParentId=".$objCatList->CurrentCategoryID()." ".$CategoryFilter, $OrderBy); + + $TotalItemCount += $objCatList->QueryItemCount; + +?> +GetAdminUserErrors(); + if(count($e)>0) + { + echo ""; + for($ex = 0; $ex"; + } + echo "
    ".prompt_language($e[$ex])."

    "; + } +?> + + + + + + + +
    + + + + + + + +
    + + + :  + + (QueryItemCount; ?>)  + + +
    +
     
    +
    +
    +
    +
    +
    + +
    +
    + + CurrentCategoryID(),$template); + ?> +
    +
    +
    + + TabRow(); + if(count($ItemTabs->Tabs)) + { + ?> +
    + +
    + $value) + { + $path = $pathtoroot.$value."admin/browse.php"; + if(file_exists($path)) + { + //echo "\n\n"; + include_once($path); + } + } + ?> +
    + + + + +
    +
    + + + + Index: trunk/admin/editor/FCKeditor/images/smiley/fun/icon26.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_relation_reciprocal_disabled.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/summary/usersbox_bg.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/my_friends/friend_offline_element.tpl =================================================================== diff -u --- trunk/themes/default/my_friends/friend_offline_element.tpl (revision 0) +++ trunk/themes/default/my_friends/friend_offline_element.tpl (revision 13) @@ -0,0 +1,10 @@ + +
    +
    +
    + "> +
    + ">
    +
    + + Index: trunk/admin/images/status_check.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_quick_links_top.jpg =================================================================== diff -u Binary files differ Index: trunk/kernel/include/statitem.php =================================================================== diff -u --- trunk/kernel/include/statitem.php (revision 0) +++ trunk/kernel/include/statitem.php (revision 13) @@ -0,0 +1,344 @@ +clsItemDB(); + $this->tablename = GetTablePrefix()."StatItem"; + $this->id_field = "StatItemId"; + $this->NoResourceId = 1; + $this->GotValue = FALSE; + + if($id) + $this->LoadFromDatabase($id); + } + + + 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); + return true; + } + + function ExecuteResetSQL() + { + $sql = $this->Get("ValueSQL"); + $sql = str_replace("<%prefix%>",GetTablePrefix(),$sql); + $this->adodbConnection->Execute($sql); + } + + function ExecuteValueSQL() + { + global $ADODB_FETCH_MODE; + + $ADODB_FETCH_MODE = 3; + $this->CurrentSQL = $this->Get("ValueSQL"); + + // 1. replace prefix to actual one + $this->CurrentSQL = str_replace("<%prefix%>", GetTablePrefix(), $this->CurrentSQL); + + // 2. replace config variable to it's value + while( ($tag = $this->FindTag()) != false ) + { + if( !array_key_exists( trim($tag), $this->TagCache ) ) + { + // unprocessed tag -> parse it to get result + $this->TagCache[ trim($tag) ] = $this->ProcessTag($tag); + } + + $tagResult = $this->TagCache[ trim($tag) ]; // return result from cache + $this->CurrentSQL = str_replace('<%'.$tag.'%>', $tagResult, $this->CurrentSQL); + } + + $values = array(); + $rs = $this->adodbConnection->Execute($this->CurrentSQL); + if($rs && !$rs->EOF) + { + $value = $rs->fields[0]; + if($this->PostFormatting) + { + switch($this->PostFormatting) + { + case 'number': // simple-specific postformatting + $value = LangNumber($value, $this->PostFormattingParams['precision']); + break; + + // extended postformatting + case 'COUNT': + $value = $rs->RecordCount(); + break; + case 'SUM': + $field_sum = 0; + $rs->MoveFirst(); + while(!$rs->EOF) + { + $field_sum += $rs->fields[ $this->PostFormattingParams['field'] ]; + $rs->MoveNext(); + } + $value = $field_sum; + if($this->PostFormattingParams['format_as'] == 'file') $value = size($value); + break; + // other type of information (not from db) + case 'SysFileSize': + $value = size( dir_size($GLOBALS['pathtoroot']) ); + break; + + default: // simple-default postformatting + $value = date($this->PostFormatting, $value); + break; + } + $this->PostFormatting = false; + $this->PostFormattingParams = Array(); + } + $this->Set("Value", $value); + } + $ADODB_FETCH_MODE = 2; + $this->GotValue=TRUE; + } + + // -- new: begin -- + function FindTag() + { + // finds tag in current sql & returns it if found, false otherwise + $tagOpen = '<%'; $tagClose = '%>'; $tagOpenLen = strlen($tagOpen); + $startPos = strpos($this->CurrentSQL, $tagOpen); + if( $startPos !== false ) + { + $endPos = strpos($this->CurrentSQL, $tagClose, $startPos); + return ($endPos > $startPos) ? substr($this->CurrentSQL, $startPos + $tagOpenLen, $endPos - $startPos - $tagOpenLen) : false; + } + return false; + } + + function ProcessTag($tag) + { + $db =& $this->adodbConnection; + $tmp_params = explode(' ', $tag); // 1st - function, 2nd .. nth - params + $tag_name = array_shift($tmp_params); + foreach($tmp_params as $param) + { + $param = explode('=', $param); + $param_value = substr($param[1], 1, strlen($param[1]) - 2); + $param_value = str_replace('+',' ', $param_value); + $tag_params[ $param[0] ] = $param_value; + } + switch($tag_name) + { + case 'm:config': // rerieves config value for specific parameter (parameter name passed) + $sql = 'SELECT VariableValue FROM '.GetTablePrefix()."ConfigurationValues WHERE VariableName = '%s'"; + return $db->GetOne( sprintf($sql, $tag_params['name']) ); + break; + + case 'm:post_format': + switch($tag_params['type']) + { + case 'date': $this->PostFormatting = GetDateFormat(); break; + case 'time': $this->PostFormatting = GetTimeFormat(); break; + case 'currency': + $this->PostFormatting = 'number'; + $this->PostFormattingParams['precision'] = $tag_params['precision']; + break; + } + return $tag_params['field']; + break; + + case 'm:custom_action': + $this->PostFormatting = $tag_params['action']; + return ($tag_params['sql'] == 'empty') ? 'SELECT 1' : $tag_params['sql']; + break; + + //m:sql_action sql="SHOW TABLES" action="COUNT" field="*" + case 'm:sql_action': + $this->PostFormatting = $tag_params['action']; + $this->PostFormattingParams = $tag_params; + return $tag_params['sql']; + break; + + case 'link:hit_count': + $type = $tag_params['type']; + $sql = 'SELECT Hits FROM '.GetTablePrefix().'Link '; + if($type == 'top') // by now only top is supported + { + $top_links_count = $this->ProcessTag('m:config name="Link_TopCount"'); // 5 - default + $sql .= 'ORDER BY Hits DESC LIMIT 0,'.$top_links_count; + + $rs = $db->Execute($sql); + if($rs->RecordCount() > 0) + { + $rs->MoveLast(); + return $rs->fields['Hits']; + } + else + return 0; + } + break; + + case 'article:hit_count': + $type = $tag_params['type']; + $sql = 'SELECT CachedRating FROM '.GetTablePrefix().'News '; + if($type == 'top') // by now only top is supported + { + $top_articles_count = $this->ProcessTag('m:config name="News_VotesToHot"'); + $min_votes = $this->ProcessTag('m:config name="News_MinVotes"'); + $sql .= 'WHERE CachedVotesQty > '.$min_votes.' ORDER BY CachedRating DESC LIMIT 0,'.$top_articles_count; + + $rs = $db->Execute($sql); + if($rs->RecordCount() > 0) + { + $rs->MoveLast(); + return $rs->fields['CachedRating']; + } + else + return 0; + } + break; + + case 'topic:hit_count': + $type = $tag_params['type']; + $sql = 'SELECT Views FROM '.GetTablePrefix().'Topic '; + if($type == 'top') // by now only top is supported + { + $top_posts_count = $this->ProcessTag('m:config name="Topic_PostsToPop"'); + $sql .= ' ORDER BY Views DESC LIMIT 0,'.$top_posts_count; + + $rs = $db->Execute($sql); + if($rs->RecordCount() > 0) + { + $rs->MoveLast(); + return $rs->fields['Views']; + } + else + return 0; + } + break; + + case 'modules:get_current': + return $this->Get('Module'); + break; + } + } + // -- new: end -- + + function GetValue() + { + if(!$this->GotValue) + $this->ExecuteValueSQL(); + return $this->Get("Value"); + } + + function ParseObject($element) + { + return $this->parsetag($element->name); + } + + function parsetag($tag) + { + if(is_object($tag)) + { + $tagname = $tag->name; + } + else + $tagname = $tag; + switch($tagname) + { + case "stats_module": + $ret = $this->Get("Module"); + break; + case "stats_label": + $ret = admin_language($this->Get("ListLabel")); + break; + case "stats_adminlabel": + $ret = admin_language($this->Get("ListLabel")); + brea; + case "stats_value": + $ret = $this->GetValue(); + break; + } + return $ret; + } +} + +class clsStatList extends clsItemCollection +{ + var $Page; + var $PerPageVar; + + function clsStatList() + { + $this->clsItemCollection(); + $this->SourceTable = GetTablePrefix()."StatItem"; + $this->classname = "clsStatItem"; + $this->Page=1; + $this->PerPageVar = "Perpage_StatItem"; + $this->AdminSearchFields = array("ListLabel", "Module", "Value"); + } + + function ProcessList($where, $orderBy, $use_limit = false) + { + // fills list with data + $this->LoadStatItems($where,$orderBy, $use_limit ); + + for($i=0; $i < $this->NumItems(); $i++) + { + $s =& $this->GetItemRefByIndex($i); + $s->Set("ListLabel",admin_language($s->Get("ListLabel"))); + } + $this->ExecuteValue(); + } + + function ExecuteValue() + { + for($i=0;$i<$this->NumItems();$i++) + { + $s =& $this->GetItemRefByIndex($i); + $s->ExecuteValueSQL(); + } + if($this->debuglevel) echo "LastSQL: ".$s->CurrentSQL.'
    '; + } + + function ExecuteResetSQL() + { + foreach($this->Items as $s) $s->ExecuteResetSQL(); + } + + function LoadStatItems($where=NULL,$orderBy, $use_limit = false) + { + global $objSession, $objConfig; + + $sql = "SELECT * FROM ".$this->SourceTable; + if(strlen(trim($where))) + $sql .= " WHERE ".$where; + if(strlen(trim($orderBy))) + $sql .= " ORDER BY ".$orderBy; + + if($use_limit) + $sql .= " ".GetLimitSQL($this->Page,$objConfig->Get($this->PerPageVar)); + + if($this->debuglevel) echo "StatGetSQL: $sql
    "; + $this->Query_Item($sql); + } +} +?> Index: trunk/admin/tree/ftv2mlastnode.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_refresh_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_myaccount.jpg =================================================================== diff -u Binary files differ Index: trunk/kernel/include/searchconfig.php =================================================================== diff -u --- trunk/kernel/include/searchconfig.php (revision 0) +++ trunk/kernel/include/searchconfig.php (revision 13) @@ -0,0 +1,425 @@ +clsParsedItem(); + $this->tablename = GetTablePrefix()."SearchConfig"; + $this->id_field = "SearchConfigId"; + $this->NoResourceId=1; + $this->TagPrefix="searchfield"; + if($id) + $this->LoadFromDatabase($id); + } + + 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 GetWhereClause($verb,$value) + { + //$value = $this->adodbConnection->qstr(stripslashes($value)); + $where = ""; + if(strlen($this->Get("ForeignField"))>0) + { + $field = $this->Get("ForeignField"); + } + else + $field = $this->Get("FieldName"); + + switch($verb) + { + case "is": + if(strlen($this->Get("IsWhere"))) + { + $where = str_replace("{Value}",$value,$this->Get("IsWhere")); + } + else + $where = $field." = ".$value; + break; + case "isnot": + if(strlen($this->Get("IsNotWhere"))) + { + $where = str_replace("{Value}",$value,$this->Get("IsNotWhere")); + } + else + $where = $field." != ".$value; + break; + case "contains": + if(strlen($this->Get("ContainsWhere"))) + { + $where = str_replace("{Value}",$value,$this->Get("ContainsWhere")); + } + else + $where = $field." LIKE '%".$value."%'"; + break; + case "notcontains": + if(strlen($this->Get("NotContainsWhere"))) + { + $where = str_replace("{Value}",$value,$this->Get("NotContainsWhere")); + } + else + $where = $field." NOT LIKE '%".$value."%'"; + break; + } + return $where; + } + + function ParseObject($element) + { + global $objConfig, $objSession, $objUsers, $objCatList, $var_list_update, $var_list, + $bb_var_list_update, $m_var_list_update,$FormValues; + + $extra_attribs = ExtraAttributes($element->attributes); + if(strtolower($element->name)==$this->TagPrefix) + { + $field = strtolower($element->attributes["_field"]); + switch($field) + { + case "name": + $ret = $this->Get("FieldName"); + break; + case "lang_name": + $ret = language($this->Get("DisplayName")); + break; + case "id": + $ret = $this->Get("SearchConfigId"); + break; + case "header": + $hdr = $this->Get("ConfigHeader"); + if(strlen($hdr)) + $ret = language($hdr); + break; + case "table": + $ret = $this->Get("TableName"); + break; + case "simple": + $ret = (int)$this->Get("SimpleSearch"); + if($ret) + { + if(strlen($element->attributes["_text"])) + $ret = language($element->attributes["_text"]); + if(strlen($element->attributes["_plaintext"])) + $ret = $element->attributes["_plaintext"]; + } + break; + case "advanced": + $ret = (int)$this->Get("AdvancedSearch"); + if($ret) + { + if(strlen($element->attributes["_text"])) + $ret = language($element->attributes["_text"]); + if(strlen($element->attributes["_plaintext"])) + $ret = $element->attributes["_plaintext"]; + } + + break; + case "verb_select": + $datatype = $this->Get("FieldType"); + switch($datatype) + { + case "text": + $fieldname = "verb[".$this->Get("FieldName")."]"; + $ret = ""; + break; + case "boolean": + $ret = ""; + break; + } + break; + case "form_input": + $datatype = $this->Get("FieldType"); + $name = $this->Get("FieldName"); + switch($datatype) + { + case "text": + $ret = ""; + break; + case "boolean": + $ret = "Get("FieldName"); + $Field = "andor[$name]"; + if($FormValues[$Field]=="1") + $checked=" checked"; + $ret = "".language("lu_and"); + $checked = ""; + if($FormValues[$Field]=="2") + $checked=" checked"; + $ret .= "".language("lu_or"); + return $ret; + } + + } + return $ret; + } +} + +class clsSearchConfigList +{ + var $Module; + var $Items; + var $SourceTable; + var $classname; + var $adodbConnection; + + function clsSearchConfigList($module=NULL) + { + $this->SourceTable = GetTablePrefix()."SearchConfig"; + $this->classname = "clsSearchConfig"; + $this->adodbConnection = GetADODBConnection(); + $this->Items = array(); + if($module) + $this->LoadModule($module); + } + + function Clear() + { + unset($this->Items); + $this->Items = array(); + } + + + function ResetModule() + { + $this->Clear(); + $sql = "UPDATE ".$this->SourceTable." SET SimpleSearch=0, AdvancedSearch=0 WHERE ModuleName='".$this->module."'"; + $this->adodbConnection->Execute($sql); + } + + function LoadModule($mod) + { + $this->Clear(); + $this->Module = $mod; + $sql = "SELECT * FROM ".$this->SourceTable." WHERE ModuleName ='$mod' ORDER BY DisplayOrder"; + + return $this->Query_Item($sql); + } + + function GetNextDisplayOrder($mod) + { + $ret = 0; + $sql = "SELECT max(DisplayOrder) as do FROM ".$this->SourceTable." WHERE ModuleName='$mod'"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + $ret = $rs->fields["do"]+1; + return $ret; + } + + function AddItemFromArray($data) + { + $class = new $this->classname; + $class->SetFromArray($data); + //foreach($data as $prop => $value) + // $class->Set($prop,$value); + array_push($this->Items,$class); + return $class; + } + + + function Query_Item($sql, $limit=NULL) + { + global $Errors; + + if(isset($limit)) + $result = $this->adodbConnection->SelectLimit($sql, $limit); + else + $result = $this->adodbConnection->Execute($sql); + + if ($result === false) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Query_Item"); + return false; + } + $this->Clear(); + while ($result && !$result->EOF) + { + $data = $result->fields; + $this->AddItemFromArray($data); + $result->MoveNext(); + } + return $this->Items; + } + + function GetItem($ID) + { + $found=FALSE; + + if(is_array($this->Items)) + { + foreach($this->Items as $i) + { + if($i->UniqueID()==$ID) + { + $found=TRUE; + break; + } + } + } + if(!$found) + { + $i = NULL; + $i = new $this->classname(); + //$i->idfield = $i->IdField(); //set the id field before we change tables + $i->tablename = $this->SourceTable; + $i->LoadFromDatabase($ID); + array_push($this->Items, $i); + } + return $i; + } + + function GetItemByName($Table,$Name) + { + $found=FALSE; + + if(is_array($this->Items)) + { + foreach($this->Items as $i) + { + if($i->Get("TableName")==$Table && $i->Get("FieldName")==$Name) + { + $found=TRUE; + break; + } + } + } + if(!$found) + { + $i = NULL; + + $rs = $this->adodbConnection->Execute("SELECT * FROM ".$this->SourceTable." WHERE Tablename='$Table' AND FieldName='$Name'"); + if($rs && !$rs->EOF) + { + $i = new $this->classname(); + //$i->idfield = $i->IdField(); //set the id field before we change tables + $i->tablename = $this->SourceTable; + $i->SetFromArray($rs->fields); + } + array_push($this->Items, $i); + } + return $i; + } + + function EditFieldSettings($FieldId,$SimpleSearch,$AdvancedSearch,$Priority) + { + $f = $this->GetItem($FieldId); + //echo "
    "; print_r($f); echo "
    "; + $f->Set("SimpleSearch",(int)$SimpleSearch); + $f->Set("AdvancedSearch",(int)$AdvancedSearch); + $f->Set("Priority",(int)$Priority); + $f->Update(); + return $f; + } + + function &AddSearchField($Table,$FieldName,$Module,$Simple,$Adv,$Description,$DisplayName,$ConfigHeader,$DisplayOrder=0, + $Priority=0,$FieldType="text",$JoinClause=NULL,$IsWhere=NULL,$IsNotWhere=NULL,$ContainsWhere=NULL,$NotContainsWhere=NULL,$CustomId=0) + { + $f = new clsSearchConfig(); + if($DisplayOrder==0) + $DisplayOrder = $this->GetNextDisplayOrder($Module); + $f->Set(Array("TableName","ModuleName","SimpleSearch","AdvancedSearch","Description","DisplayName","ConfigHeader", + "DisplayOrder","Priority","FieldType","FieldName"), + Array($Table,$Module,$Simple,$Adv,$Description,$DisplayName,$ConfigHeader,$DisplayOrder,$Priority,$FieldType,$FieldName)); + $f->Set("CustomFieldId",$CustomId); + if(strlen($JoinClause)) + $f->Set("JoinClause",$JoinClause); + if(strlen($IsWhere)) + $f->Set("IsWhere",$IsWhere); + if(strlen($IsNotWhere)) + $f->Set("IsNotWhere",$IsNotWhere); + if(strlen($ContainsWhere)) + $f->Set("ContainsWhere",$ContainsWhere); + if(strlen($NotContainsWhere)) + $f->Set("NotContainsWhere",$NotContainsWhere); + $f->Create(); + return $f; + } + + function GetHeadingList() + { + $res = array(); + foreach($this->Items as $i) + { + $header = $i->Get("ConfigHeader"); + $res[$header]=1; + } + reset($res); + return array_keys($res); + } + + function GetHeadingItems($heading) + { + $res = array(); + foreach($this->Items as $i) + { + if($i->Get("ConfigHeader")==$heading) + array_push($res,$i); + } + return $res; + } +} +?> Index: trunk/admin/modules/addmodule.php =================================================================== diff -u --- trunk/admin/modules/addmodule.php (revision 0) +++ trunk/admin/modules/addmodule.php (revision 13) @@ -0,0 +1,210 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL=$rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//admin only util + +$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:addmodule'; + +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +//Display header + + +$order = $objConfig->Get("Module_SortOrder"); + +$orderBy = trim($objConfig->Get("Module_SortField")." ".$order); +if(strlen($orderBy)) +{ + $orderBy = " ORDER BY LoadOrder,".$orderBy; +} +else + $orderBy = " ORDER BY LoadOrder"; + + + +$objModules->Clear(); +$sql = "SELECT * FROM ".GetTablePrefix()."Modules"; + +$objModules->Query_Item($sql); + +$objModList = new clsModList(); + +$path = $pathtoroot; + +$new = array(); +if ($dir = @opendir($path)) +{ + while (($file = readdir($dir)) !== false) + { + if($file !="." && $file !=".." && substr($file,0,1)!="_") + { + if(is_dir($path.$pathchar.$file)) + { + $inst_file = $path.$pathchar.$file.$pathchar.$admin."/install.php"; + if(file_exists($inst_file)) + { + if(!$objModules->ModuleInstalled($file)) + { + $new[$file] = $inst_file; + } + } + } + } + } + closedir($dir); +} + + +foreach($new as $mod => $file) +{ + $m = new clsModule(); + + unset($data); + $data = array(); + $status= admin_language("la_text_ready_to_install"); + $data["Url"] = "$status"; + $data["Name"] = $mod; + $objModList->AddItemFromArray($data); +} + +$itemcount = $objModList->NumItems(); + +$title = admin_language("la_Text_Install")." ".admin_language("la_Text_Modules")." (".$itemcount.")"; + +$objListView = new clsListView(NULL,$objModList); +$objListView->IdField = "Name"; +$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl"; + +$objListView->ColumnHeaders->Add("Name", admin_language("la_prompt_Available_Modules"),1,0,$order,"width=\"50%\"","Module_SortField","Module_SortOrder","Name"); +$objListView->ColumnHeaders->Add("Url",admin_language("la_prompt_Install_Status"),1,0,$order,"width=\"50%\"","Module_SortField","Module_SortOrder","Version"); + +$objListView->ColumnHeaders->SetSort("Name",$order); + +$objListView->PrintToolBar = FALSE; +$objListView->SearchBar = FALSE; +$objListView->checkboxes= FALSE; +$objListView->SearchAction=""; +$objListView->CurrentPageVar = "Page_Modules"; +$objListView->PerPageVar = "Perpage_Modules"; +$objListView->CheckboxName = ""; +$objListView->TotalItemCount = $itemcount; +$objListView->SelectorType="none"; + +int_header(null,NULL,$title); +?> +
    +PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */ + $objListView->SliceItems(); + print $objListView->PrintList(); +?> + +
    + +
    + + + + +
    + + + + + Index: trunk/themes/default/misc/recommend_confirm.tpl =================================================================== diff -u --- trunk/themes/default/misc/recommend_confirm.tpl (revision 0) +++ trunk/themes/default/misc/recommend_confirm.tpl (revision 13) @@ -0,0 +1,130 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + + + + +

    + +
    + + "> + + + + + + + + + + + + + + + + + + + + + +



     
    +

    +

    +



    +
    + " class="button"> +
    +
    + + +

    + + + + + + + + + + + + + + + +
    +
    + + + Index: trunk/admin/images/toolbar/tool_homecat.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_relation_reciprocal.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/blocks2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/backup/restore2.php =================================================================== diff -u --- trunk/admin/backup/restore2.php (revision 0) +++ trunk/admin/backup/restore2.php (revision 13) @@ -0,0 +1,206 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$adminURL = $rootURL.$admin; +$localURL=$rootURL."kernel/"; +$imagesURL = $rootURL."admin/images"; +//admin only util +$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"); +//Set Section + +$section = "in-portal:restore"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$formaction = $rootURL."admin/backup/restore3.php?".$envar; +$formaction = "restore3.php?".$envar; +$restoreexit = $rootURL."admin/backup/restore4.php?".$envar; +$conn = GetAdodbConnection(); + + +$totalfiles = $objSession->GetVariable("restore_files_num"); +$filepath = $objConfig->Get("Backup_Path"); + +if (true) +{ + if($en_prev>-1) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + $onClick= $sec->Get("onclick"); + $var="?env=".BuildEnv(); + $link=$PHP_SELF.$var; + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + else + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + $var="?env=".BuildEnv(); + $link=$rootURL."admin/backup/restore1.php".$var; + + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + + $MouseOver="if (document.restore2.backupdate.value) swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="if (document.restore2.backupdate.value) swap('moveright', 'toolbar/tool_next.gif');"; + $var="?env=".BuildEnv(); + + $onClick="restore_submit('restore2','$formaction');"; + $link="#"; + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif"); + +} +//$link2=$rootURL."admin/backup/restore3.php".$var; +//$onClick="document.location= '$link2';"; +//$onClick="restore_submit('restore2','$formaction');"; +//$MouseOver="swap('img_edit','toolbar/tool_edit_f2.gif');"; +//$MouseOut="swap('img_edit', 'toolbar/tool_edit.gif');"; +//$objCatToolBar->Add("img_edit","la_ToolTip_Restore","#", $MouseOver,$MouseOut,$onClick, +// "tool_edit.gif"); + +$link3=$rootURL."admin/backup/restore2.php".$var; + + +$objCatToolBar->Add("img_del","la_ToolTip_Delete","#", "swap('img_del','toolbar/tool_delete_f2.gif');", + "swap('img_del', 'toolbar/tool_delete.gif');","restore_delete();", + "tool_delete.gif"); + + +int_header($objCatToolBar,NULL,$title); + +//phpinfo(INFO_VARIABLES); + +function getDirList ($dirName) +{ + global $objSession; + $filedates = array(); + $d = dir($dirName); + + while($entry = $d->read()) + { + if ($entry != "." && $entry != "..") + { + if (!is_dir($dirName."/".$entry) && eregi("dump",$entry)) + { + $shortversion=chopchop($entry); + $filedate[]=$shortversion; + + } + } + } + $d->close(); + rsort($filedate); + + return $filedate; + +} +function chopchop ($filename) +{ + $p = pathinfo($filename); + $ext = $p["extension"]; + $filename; + $filename= ereg_replace("dump","",$filename); + $filename= ereg_replace($ext,"",$filename); + return $filename; +} + +?> + + + + + + + +
    + + +"> + $value) + { + echo ""; + $onClick = "swap('moveright', 'toolbar/tool_next.gif');"; + + echo ""; + } + +?> + + +
    "; + echo date("F j, Y, g:i a",$value)."
    + Index: trunk/index.php =================================================================== diff -u --- trunk/index.php (revision 0) +++ trunk/index.php (revision 13) @@ -0,0 +1,126 @@ +"; + echo "Please use the installation script to fix the problem.

    "; + echo "Go to installation script

    "; + flush(); + die(); +} + +ob_start(); +$FrontEnd=1; + +$indexURL="../../index.php"; //Set to relative URL from the theme directory + +/* initalize the in-portal system */ +include_once("kernel/startup.php"); + +LogEntry("System Init Complete\n"); +/* load the current front-end language set */ + +//$objLanguageCache->LoadLanguage($objSession->Get("Language"),0); + +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); + +//$secureURL = "https://".ThisDomain().$objConfig->Get("Site_Path"); +$secureURL = $rootURL; + +$html="No Template"; + +if( !$var_list['t'] ) $var_list['t'] = 'index'; + +if( !isset($CurrentTheme) ) $CurrentTheme = null; +if( !is_object($CurrentTheme) ) $CurrentTheme = $objThemes->GetItem($m_var_list["theme"]); + +if(is_object($CurrentTheme)) +{ + if(!$CurrentTheme->Get("Enabled")) + { + $CurrentTheme = $objThemes->GetItem($objThemes->GetPrimaryTheme()); + } + if((int)$CurrentTheme->Get("ThemeId")>0) + { + $timeout = $CurrentTheme->Get("CacheTimeout"); + $objLanguageCache->LoadTemplateCache($var_list["t"],$timeout,$CurrentTheme->Get("ThemeId")); + $objLanguageCache->LoadCachedVars($objSession->Get("Language")); + + LogEntry("Language Set Loaded\n"); + + $TemplateRoot = $CurrentTheme->ThemeDirectory()."/"; +// echo "Template Root: $TemplateRoot
    \n"; + + LogEntry("Parsing Templates in $TemplateRoot\n"); + $objTemplate = new clsTemplateList($TemplateRoot); + $html = $objTemplate->ParseTemplate($var_list["t"]); + } + else + { + echo "No Primary Theme Selected"; + die(); + } +} +else +{ + echo "No Primary Theme Selected\n"; + die(); +} + + + +if(is_object($objSession)) +{ + + $objSession->SetVariable("Template_Referer", $_local_t); +} +if($objTemplate->ErrorNo == -1) +{ + $html = $objTemplate->ParseTemplate("error_template"); + +} +//$html = replacePngTags($html); +LogEntry("Output Start\n"); +$html .= ""; +header("Content-length: ".strlen($html)); +header("Connection-Type: Keep-Alive"); +echo $html; + +LogEntry("Output End\n"); + +if( isset($template) && $template->ErrorNo != 0 ) +{ + print "\n(".$objTemplate->ErrorNo.") ".$objTemplate->ErrorStr."\n"; +} + +LogEntry("Output Complete\n"); +$objLanguageCache->SaveTemplateCache(); +LogEntry("Templates Cached\n"); + +//if($objSession->SessionEnabled()) +// $objSession->SaveSessionData(); +//echo "Cookie:
    "; print_r($_COOKIE); echo "

    \n"; +ob_end_flush(); +$timeend = getmicrotime(); +$diff = $timeend - $timestart; + +LogEntry("\nTotal Queries Executed: $sqlcount in $totalsql seconds\n"); +LogEntry("\nPage Execution Time: $diff seconds\n", true); +if($LogFile) + fclose($LogFile); + + +?> Index: trunk/admin/users/banuser.php =================================================================== diff -u --- trunk/admin/users/banuser.php (revision 0) +++ trunk/admin/users/banuser.php (revision 13) @@ -0,0 +1,218 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +unset($objEditItems); +$objEditItems = new clsUserManager(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); +$objEditItems->EnablePaging = FALSE; +$objCustomFields = new clsCustomFieldList(6); +$objRelList = new clsRelationshipList(); + +//Multiedit init +if ($_GET["new"] == 1) +{ + $c = new clsPortalUser(NULL); + $c->Set("CreatedOn", time()); + $c->Set("Status", 2); + $en = 0; + $action = "m_ban_user"; + $objUsers->CreateEmptyEditTable("PortalUserId"); + $objRelList->CreateEmptyEditTable("RelationshipId"); + $objCustomDataList->CreateEmptyEditTable("CustomDataId"); +} +else +{ + $en = (int)$_GET["en"]; + if (isset($_POST["itemlist"])) + { + $objUsers->CopyToEditTable("ResourceId",$_POST["itemlist"]); + } + $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); + $first=1; + foreach($objEditItems->Items as $u) + { + $objItemTypes->BuildUserItemTable($u->Get("PortalUserId"),$first); + $first=0; + } + + if(isset($_POST["itemlist"])) + { + /* make a copy of the relationship records */ + $ids = $objEditItems->GetResourceIDList(); + $objRelList->CopyToEditTable("SourceId",$ids); + $objCustomDataList->CopyToEditTable("ResourceId",$ids); + } + + $itemcount=$objEditItems->NumItems(); + $c = $objEditItems->GetItemByIndex($en); + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_ban_user"; +} + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:banuser'; +$title = prompt_language("la_Text_Ban")." ".prompt_language("la_Text_User")." '".$c->Get("Login")."'"; + +//Display header +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('edituser','UserEditStatus','".$admin."/users/user_list.php',1);","tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('edituser','UserEditStatus','".$admin."/users/user_list.php',2);","tool_cancel.gif"); + +/* +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/adduser.php"; + $StatusField = "UserEditStatus"; + $form = "edituser"; + MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick")); + $objCatToolBar->Add("divider"); +} +*/ +int_header($objCatToolBar,NULL,strip_tags($title)); +?> + + + + + + > + + + + + + > + + + + + > + + + + + > + + + + +
    + + + "> +
    + + + + "> +  
    + + + + "> +  
    + + "> + +
    + + \ No newline at end of file Index: trunk/kernel/include/adodb/adodb-errorhandler.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-errorhandler.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-errorhandler.inc.php (revision 13) @@ -0,0 +1,77 @@ +$s

    "; + trigger_error($s,ADODB_ERROR_HANDLER_TYPE); +} +?> Index: trunk/admin/config/addcustomfield.php =================================================================== diff -u --- trunk/admin/config/addcustomfield.php (revision 0) +++ trunk/admin/config/addcustomfield.php (revision 13) @@ -0,0 +1,261 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; + +$imagesURL = $adminURL."/images"; +$cssURL = $adminURL."/include"; +$browseURL = $adminURL."/browse"; + +$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."/browse/toolbar.php"); +require_once($pathtoroot.$admin."/listview/listview.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +$FieldType = (int)$_GET["DataType"]; +if($FieldType==0) + $FieldType = (int)$_POST["DataType"]; + +$objCustomFields = new clsCustomFieldList($FieldType); + +//$objEditItems->SourceTable = $objSession->GetEditTable("Images"); + +if(isset($_POST["itemlist"])) +{ + if(is_array($_POST["itemlist"])) + { + $FieldId = $_POST["itemlist"][0]; + } + else + { + $FieldId = $_POST["itemlist"]; + } + $c = $objCustomFields->GetItem($FieldId); + $action = "m_customfield_edit"; + $name = $c->Get("FieldName"); +} +else +{ + $c = new clsCustomField(); + $c->Set("Type",$DataType); + $action = "m_customfield_add"; + $name = prompt_language("la_Text_NewField"); + +} + +$section = $_GET["section"]; +if(strlen($section)==0) + $section = $_POST["section"]; + +$section_env = "section=$section&DataType=$FieldType"; +$envar = "$section_env&env=".BuildEnv(); + +$ado = GetADODBConnection(); + +/* page header */ +print << + + In-portal + + + + + + + + + + + +END; + + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_CustomField")." ".prompt_language("la_text_for")." ".prompt_language("la_Text_DataType_".$_GET["DataType"]); +$title .= " '".$name."'"; +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","submit_form('customfield','','".$admin."/config/edit_customfields.php',0,'&$section_env');",$imagesURL."/toolbar/tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","submit_form('customfield','','".$admin."/config/edit_customfields.php',-1,'&$section_env');",$imagesURL."/toolbar/tool_cancel.gif"); + +int_header($objCatToolBar,NULL,$title); +?> +
    + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + > + + + + + > + + + + + > + + + + + > + + + + + > + + + + + > + + + + + +
    Get("CustomFieldId"); ?>
    ">
    Get("FieldName"))) echo "lu_fieldcustom__".$c->Get("FieldName"); ?>: + Get("FieldName"),0); ?> +
    + + "> + "> +
    Get("OnGeneralTab")) echo "CHECKED"; ?>>
    ">
    ">
    + +
    ">
    + + +
    + + + + +
    + + Index: trunk/admin/editor/FCKeditor/lang/fr.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/fr.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/fr.js (revision 13) @@ -0,0 +1,198 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fr.js: French support. + * + * Authors: + * Hubert Garrido (webmaster@liane.net) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Couper" ; +lang["Copy"] = "Copier" ; +lang["Paste"] = "Coller" ; +lang["PasteText"] = "Coller comme texte" ; +lang["PasteWord"] = "Coller de Word" ; +lang["Find"] = "Chercher" ; +lang["SelectAll"] = "Tout sélectionner" ; +lang["RemoveFormat"] = "Supprimer Format" ; +lang["InsertLink"] = "Insérer/Modifier Lien" ; +lang["RemoveLink"] = "Supprimer Lien" ; +lang["InsertImage"] = "Insérer/Modifier Image" ; +lang["InsertTable"] = "Insérer/Modifier Tableau" ; +lang["InsertLine"] = "Insérer Ligne Horizontale" ; +lang["InsertSpecialChar"] = "Insérer Caractère Special" ; +lang["InsertSmiley"] = "Insérer Smiley" ; +lang["About"] = "A propos de FCKeditor" ; + +lang["Bold"] = "Gras" ; +lang["Italic"] = "Italique" ; +lang["Underline"] = "Souligné" ; +lang["StrikeThrough"] = "Barré" ; +lang["Subscript"] = "Indice" ; +lang["Superscript"] = "Exposant" ; +lang["LeftJustify"] = "Aligné à Gauche" ; +lang["CenterJustify"] = "Centré" ; +lang["RightJustify"] = "Aligné à Droite" ; +lang["BlockJustify"] = "Texte Justifié" ; +lang["DecreaseIndent"] = "Réduire le Retrait" ; +lang["IncreaseIndent"] = "Augmenter le Retrait" ; +lang["Undo"] = "Annuler" ; +lang["Redo"] = "Refaire" ; +lang["NumberedList"] = "Liste Numérotée" ; +lang["BulettedList"] = "Liste à puces" ; + +lang["ShowTableBorders"] = "Montrer Bordures de Tableau" ; +lang["ShowDetails"] = "Montrer Caractères Invisibles" ; + +lang["FontStyle"] = "Style" ; +lang["FontFormat"] = "Format" ; +lang["Font"] = "Police" ; +lang["FontSize"] = "Taille" ; +lang["TextColor"] = "Couleur de Texte" ; +lang["BGColor"] = "Couleur de Fond" ; +lang["Source"] = "Source" ; + +// Context Menu + +lang["EditLink"] = "Modifier Lien" ; +lang["InsertRow"] = "Insérer une Ligne" ; +lang["DeleteRows"] = "Supprimer des Lignes" ; +lang["InsertColumn"] = "Insérer une Colonne" ; +lang["DeleteColumns"] = "Supprimer des Colonnes" ; +lang["InsertCell"] = "Insérer une Cellule" ; +lang["DeleteCells"] = "Supprimer des Cellules" ; +lang["MergeCells"] = "Fusionner les Cellules" ; +lang["SplitCell"] = "Scinder les Cellules" ; +lang["CellProperties"] = "Propriétés de Cellule" ; +lang["TableProperties"] = "Propriétés de Tableau" ; +lang["ImageProperties"] = "Propriétés d'Image" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Calcul XHTML. Veuillez patienter..." ; +lang["Done"] = "Terminé" ; +lang["PasteWordConfirm"] = "Le texte a coller semble provenir de Word. Désirez-vous le nettoyer avant de coller?" ; +lang["NotCompatiblePaste"] = "Cette commande nécessite Internet Explorer version 5.5 minimum. Souhaitez-vous coller sans nettoyage?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Annuler" ; +lang["DlgBtnClose"] = "Fermer" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Insérer Image" ; +lang["DlgImgTitleEdit"] = "Modifier Image" ; +lang["DlgImgBtnUpload"] = "Envoyer au Serveur" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Upload" ; +lang["DlgImgBtnBrowse"] = "Parcourir le Serveur" ; +lang["DlgImgAlt"] = "Texte de Remplacement" ; +lang["DlgImgWidth"] = "Largeur" ; +lang["DlgImgHeight"] = "Hauteur" ; +lang["DlgImgLockRatio"] = "Garder proportions" ; +lang["DlgBtnResetSize"] = "Taille Originale" ; +lang["DlgImgBorder"] = "Bordure" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Alignement" ; +lang["DlgImgAlignLeft"] = "Gauche" ; +lang["DlgImgAlignAbsBottom"] = "Abs Bas" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Milieu" ; +lang["DlgImgAlignBaseline"] = "Bas du texte" ; +lang["DlgImgAlignBottom"] = "Bas" ; +lang["DlgImgAlignMiddle"] = "Milieu" ; +lang["DlgImgAlignRight"] = "Droite" ; +lang["DlgImgAlignTextTop"] = "Haut du texte" ; +lang["DlgImgAlignTop"] = "Haut" ; +lang["DlgImgPreview"] = "Prévisualisation" ; +lang["DlgImgMsgWrongExt"] = "Désolé, seuls les types de fichiers suivants sont permis:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgImgAlertSelect"] = "Veuillez sélectionner une image à envoyer." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Lien" ; // NEW +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Upload" ; +lang["DlgLnkTarget"] = "Destination" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Nouvelle fenêtre (_blank)" ; +lang["DlgLnkTargetParent"] = "Fenêtre Mère (_parent)" ; +lang["DlgLnkTargetSelf"] = "Même fenêtre (_self)" ; +lang["DlgLnkTargetTop"] = "Fenêtre Supérieure (_top)" ; +lang["DlgLnkTitle"] = "Titre" ; +lang["DlgLnkBtnUpload"] = "Envoyer au Serveur" ; +lang["DlgLnkBtnBrowse"] = "Parcourir le Serveur" ; +lang["DlgLnkMsgWrongExtA"] = "Désolé, seuls les types de fichiers suivants sont permis:\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgLnkMsgWrongExtD"] = "Désolé, les types de fichiers suivants sont interdits:\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperation canceled." ; + +// Color Dialog +lang["DlgColorTitle"] = "Selectionner" ; +lang["DlgColorBtnClear"] = "Effacer" ; +lang["DlgColorHighlight"] = "Highlight" ; +lang["DlgColorSelected"] = "Sélectionné" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Insérer Smiley" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Insérer Caractère Special" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Insérer Tableau" ; +lang["DlgTableTitleEdit"] = "Modifier Tableau" ; +lang["DlgTableRows"] = "Lignes" ; +lang["DlgTableColumns"] = "Colonnes" ; +lang["DlgTableBorder"] = "Bordure" ; +lang["DlgTableAlign"] = "Alignement" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Gauche" ; +lang["DlgTableAlignCenter"] = "Centré" ; +lang["DlgTableAlignRight"] = "Droite" ; +lang["DlgTableWidth"] = "Largeur" ; +lang["DlgTableWidthPx"] = "pixels" ; +lang["DlgTableWidthPc"] = "pourcentage" ; +lang["DlgTableHeight"] = "Hauteur" ; +lang["DlgTableCellSpace"] = "Espacement" ; +lang["DlgTableCellPad"] = "Contour" ; +lang["DlgTableCaption"] = "Titre" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Propriétés de cellule" ; +lang["DlgCellWidth"] = "Largeur" ; +lang["DlgCellWidthPx"] = "pixels" ; +lang["DlgCellWidthPc"] = "pourcentage" ; +lang["DlgCellHeight"] = "Hauteur" ; +lang["DlgCellWordWrap"] = "Retour à la ligne" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Oui" ; +lang["DlgCellWordWrapNo"] = "Non" ; +lang["DlgCellHorAlign"] = "Alignement Horizontal" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Gauche" ; +lang["DlgCellHorAlignCenter"] = "Centré" ; +lang["DlgCellHorAlignRight"] = "Droite" ; +lang["DlgCellVerAlign"] = "Alignement Vertical" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Haut" ; +lang["DlgCellVerAlignMiddle"] = "Milieu" ; +lang["DlgCellVerAlignBottom"] = "Bas" ; +lang["DlgCellVerAlignBaseline"] = "Bas du texte" ; +lang["DlgCellRowSpan"] = "Lignes Fusionnées" ; +lang["DlgCellCollSpan"] = "Colonnes Fusionnées" ; +lang["DlgCellBackColor"] = "Fond" ; +lang["DlgCellBorderColor"] = "Bordure" ; +lang["DlgCellBtnSelect"] = "Choisir..." ; + +// About Dialog +lang["DlgAboutVersion"] = "version" ; +lang["DlgAboutLicense"] = "License selon les termes de GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "Pour plus d'informations, aller à" ; \ No newline at end of file Index: trunk/admin/images/summary/searchbox_ex.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/spamafote.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-odbc_oracle.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-odbc_oracle.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-odbc_oracle.inc.php (revision 13) @@ -0,0 +1,112 @@ +ADODB_odbc(); + } + + function &MetaTables() + { + if ($this->metaTablesSQL) { + $rs = $this->Execute($this->metaTablesSQL); + if ($rs === false) return false; + $arr = $rs->GetArray(); + $arr2 = array(); + for ($i=0; $i < sizeof($arr); $i++) { + $arr2[] = $arr[$i][0]; + } + $rs->Close(); + return $arr2; + } + return false; + } + + function &MetaColumns($table) + { + if (!empty($this->metaColumnsSQL)) { + + $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table))); + if ($rs === false) return false; + + $retarr = array(); + while (!$rs->EOF) { //print_r($rs->fields); + $fld = new ADOFieldObject(); + $fld->name = $rs->fields[0]; + $fld->type = $rs->fields[1]; + $fld->max_length = $rs->fields[2]; + $retarr[strtoupper($fld->name)] = $fld; + + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + return false; + } + + // returns true or false + function _connect($argDSN, $argUsername, $argPassword, $argDatabasename) + { + global $php_errormsg; + + $php_errormsg = ''; + $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,SQL_CUR_USE_ODBC ); + $this->_errorMsg = $php_errormsg; + + $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'"); + //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); + return $this->_connectionID != false; + } + // returns true or false + function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename) + { + global $php_errormsg; + $php_errormsg = ''; + $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,SQL_CUR_USE_ODBC ); + $this->_errorMsg = $php_errormsg; + + $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'"); + //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); + return $this->_connectionID != false; + } +} + +class ADORecordSet_odbc_oracle extends ADORecordSet_odbc { + + var $databaseType = 'odbc_oracle'; + + function ADORecordSet_odbc_oracle($id,$mode=false) + { + return $this->ADORecordSet_odbc($id,$mode); + } +} +?> \ No newline at end of file Index: trunk/admin/icons/icon46_list_struct.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/lang/german.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/lang/chinese_big5.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/admin/include/toolbar/modules.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/modules.php (revision 0) +++ trunk/kernel/admin/include/toolbar/modules.php (revision 13) @@ -0,0 +1,34 @@ + + + + +END; + +?> Index: trunk/admin/editor/FCKeditor/images/smiley/fun/megaphone.gif =================================================================== diff -u Binary files differ Index: trunk/admin/templates/cat_search_element.tpl =================================================================== diff -u --- trunk/admin/templates/cat_search_element.tpl (revision 0) +++ trunk/admin/templates/cat_search_element.tpl (revision 13) @@ -0,0 +1,16 @@ + +
    + + + : + + + (Cats / Links 2) +
    +
    +
    + (Added 02-12-2002)
    + +
    +
    + Index: trunk/kernel/admin/include/toolbar/backup_toolbar.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/backup_toolbar.php (revision 0) +++ trunk/kernel/admin/include/toolbar/backup_toolbar.php (revision 13) @@ -0,0 +1,13 @@ + + + + +END; +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/filemanager/upload/aspx/upload.aspx =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/upload/aspx/upload.aspx (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/upload/aspx/upload.aspx (revision 13) @@ -0,0 +1,64 @@ +<%@ Page Language="C#" %> + + + + + FCKeditor - File Upload + + + + + + +
    + Upload in progress... +
    + + + Index: trunk/admin/icons/icon46_summary.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.removeformat.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/relevance/rel_3.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/my_favorites.tpl =================================================================== diff -u --- trunk/themes/default/my_favorites.tpl (revision 0) +++ trunk/themes/default/my_favorites.tpl (revision 13) @@ -0,0 +1,69 @@ + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    "> > "> > + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + +

    + +

    +
    + + + Index: trunk/admin/icons/icon24_general.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/list_arrow_up.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/devil2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_footer.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/mmm.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_cat_top.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/frontaction.php =================================================================== diff -u --- trunk/kernel/frontaction.php (revision 0) +++ trunk/kernel/frontaction.php (revision 13) @@ -0,0 +1,828 @@ +ValidSession()) + // $objSession->Logout(); + //echo $objSession->GetSessionKey()."
    \n"; + if ($objConfig->Get("CookieSessions") == 1 && $_COOKIE["CookiesTest"] != "1") { + $FormError["login"]["login_user"] = language("lu_cookies_error"); + } + else { + $MissingCount = SetMissingDataErrors("login"); + if($MissingCount==2) + { + $FormError["login"]["login_user"]= language("lu_ferror_loginboth"); + unset($FormError["login"]["login_password"]); + } + if($MissingCount==0) + { + if($_POST["login_user"]=="root") + { + $FormError["login"]["login_user"]= language("lu_access_denied"); + } + else + { + if ($objSession->Login($_POST["login_user"], md5($_POST["login_password"])) == FALSE) + { + $FormError["login"]["login_password"] = language("lu_incorrect_login"); + } + else + { + + if(!headers_sent() && ($_POST["usercookie"]==1 || $_GET["usercookie"]==1)) + { + $c = $_POST["login_user"]."|"; + $pw = $_POST["login_password"]; + if(strlen($pw)<31) + $pw = md5($pw); + + $c .= $pw; + + setcookie("login",$c,time()+2592000); + } + $dest = $_POST["dest"]; + if(!strlen($dest)) + $dest = $_GET["dest"]; + if(!strlen($dest)) + $dest = $_POST["DestTemplate"]; + if(!strlen($dest)) + $dest = $_GET["DestTemplate"]; + if(strlen($dest)) + { + $var_list["t"] = $dest; + //header("Location: ../../index.php?env=" . BuildEnv()); + } + + // echo "DEST: ".$t; die(); + } + } + } + } + break; + case "m_forgotpw": + $MissingCount = SetMissingDataErrors("forgotpw"); + if($MissingCount==0) + { + $username = $_POST["username"]; + $email = $_POST["email"]; + $found = FALSE; + if(strlen($username)) + { + $u = $objUsers->GetItemByField("Login",$username); + if(is_object($u)) + $found = ($u->Get("Login")==$username && $u->Get("Status")==1) && strlen($u->Get("Password")); + } + else if(strlen($email)) + { + $u = $objUsers->GetItemByField("Email",$email); + if(is_object($u)) + $found = ($u->Get("Email")==$email && $u->Get("Status")==1) && strlen($u->Get("Password")); + } + if($found) + { + $newpw = makepassword(); + $u->Set("Password",$newpw); + $u->Update(); + $u->SendUserEventMail("USER.PSWD",$u->Get("PortalUserId")); + $u->SendAdminEventMail("USER.PSWD"); + $u->Set("Password",md5($newpw)); + $u->Update(); + $u->Clean(); + } + else + { + if(!strlen($username) && !strlen($email)) + { + $FormError["forgotpw"]["username"] = language("lu_ferror_forgotpw_nodata"); + $MissingCount++; + } + else + { + if(strlen($username)) + $FormError["forgotpw"]["username"] = language("lu_ferror_unknown_username"); + if(strlen($email)) + $FormError["forgotpw"]["email"] = language("lu_ferror_unknown_email"); + $MissingCount++; + } + if(strlen($_GET["error"])) + $var_list["t"] = $_GET["error"]; + } + } + else + if(strlen($_GET["error"])) + $var_list["t"] = $_GET["error"]; + break; + case "m_subscribe_confirm": + $t = ""; + $SubscribeAddress = $_POST["subscribe_email"]; + if(!ValidEmail($SubscribeAddress)&& strlen($SubscribeAddress)) + { + $t = $_GET["Error"]; + $SubscribeError = "lu_invalid_emailaddress"; + } + else + { + if((int)$objConfig->Get("User_SubscriberGroup")>0) + { + $g = $objGroups->GetItem($objConfig->Get("User_SubscriberGroup")); + if(is_object($g)) + { + $email = $_POST["subscribe_email"]; + if(strlen($email)>0) + { + $u = $objUsers->GetItemByField("Email",$email); + + if(is_object($u)) + { + if($u->CheckBanned()) + { + $t = $_GET["Error"]; + $SubscribeError ="lu_subscribe_banned"; + } + else + { + if($u->IsInGroup($g->Get("GroupId"))) + { + $t = $_GET["Unsubscribe"]; + } + else + $t = $_GET["Subscribe"]; + } + } + else + $t = $_GET["Subscribe"]; + } + else + { + $t = $_GET["Error"]; + $SubscribeError ="lu_subscribe_no_address"; + } + } + else + { + $t = $_GET["Error"]; + $SubscribeError ="lu_subscribe_unknown_error"; + } + } + } + if(strlen($t)) + { + $var_list["t"] = $t; + $var_list_update["t"] = $t; + } + break; + case "m_subscribe": + //phpinfo(INFO_VARIABLES); + if($_POST["buttons"][0]==language("lu_button_yes")) + { + $SubscribeAddress = $_POST["subscribe_email"]; + if(strlen($SubscribeAddress)>0) + { + if(ValidEmail($SubscribeAddress)) + { + $GroupId = (int)$objConfig->Get("User_SubscriberGroup"); + if ($GroupId) + { + $g = $objGroups->GetItem($GroupId); + $u = $objUsers->GetItemByField("Email",$SubscribeAddress); + if(is_object($u)) + { + if(strtolower($u->Get("Email"))==strtolower($SubscribeAddress)) + { + $bExists = TRUE; + } + else + $bExists = FALSE; + } + if($bExists) + { + $g->AddUser($u->Get("PortalUserId")); + } + else + { + $u = new clsPortalUser(NULL); + $u->Set("Email",$SubscribeAddress); + $u->Set("ip",$_SERVER['REMOTE_ADDR']); + $u->Set("CreatedOn",date("U")); + $u->Set("Status",1); + if(!$u->CheckBanned()) + { + $u->Create(); + $g->AddUser($u->Get("PortalUserId"),1); + } + else + $SubscribeResult = "lu_subscribe_banned"; + } + $SubscribeResult = "lu_subscribe_success"; + $u->SendUserEventMail("USER.SUBSCRIBE",$u->Get("PortalUserId")); + $u->SendAdminEventMail("USER.SUBSCRIBE"); + if(strlen($_GET["Subscribe"])>0) + $var_list["t"] = $_GET["Subscribe"]; + } + } + else + { + $SubscribeResult = "lu_invalid_emailaddress"; + } + } + else + $SubscribeResult = "lu_subscribe_missing_address"; + } + + if(!strlen($SubscribeResult)) + $SubscribeResult = "lu_subscribe_success"; + break; + case "m_unsubscribe": + + if($_POST["buttons"][0]==language("lu_button_yes")) + { + $MissingCount = SetMissingDataErrors("m_unsubscribe"); + + if($MissingCount==0) + { + $email = $_POST["subscribe_email"]; + $u = $objUsers->GetItemByField("Email",$email); + if(is_object($u)) + { + if(strtolower($u->Get("Email"))==strtolower($email)) + { + $GroupId = (int)$objConfig->Get("User_SubscriberGroup"); + if($u->PrimaryGroup()==$GroupId) + { + $u_gorup_list = $u->GetGroupList(); + + if (count($u_gorup_list) > 1) { + $u->RemoveFromGroup($GroupId); + } + else { + $u->RemoveFromAllGroups(); + $u->Delete(); + } + } + else + { + $u->RemoveFromGroup($GroupId); + } + } + } + if(strlen($_GET["Subscribe"])>0) + $var_list["t"] = $_GET["Subscribe"]; + } + } + + break; + case "m_logout": +// $objSession->Logout(); + //unset($objSession); + //$objSession = new clsUserSession(); +// $var_list_update["t"] = "index"; +// setcookie("login","",time()-3600); + break; + case "m_register": + $MissingCount = SetMissingDataErrors("m_register"); + + if(!$objConfig->Get("User_Password_Auto")) + { + if(($_POST["password"] != $_POST["passwordverify"]) || !strlen($_POST["passwordverify"])) + { + $MissingCount++; + $FormError["m_register"]["passwordverify"] = language("lu_ferror_pswd_mismatch"); + } + } + + if(strlen($_POST["password"])>30) + { + // echo "VAR: ".$_POST["password"]; die(); + $MissingCount++; + $FormError["m_register"]["password"] = language("lu_ferror_pswd_toolong"); + } + + if (strlen($_POST['password']) < $objConfig->Get("Min_Password")) + { + $MissingCount++; + $FormError["m_register"]["password"] = language("lu_ferror_pswd_tooshort"); + } + + $u = $objUsers->GetItemByField("Login",$_POST["username"]); + + if(is_object($u)) + { + if($u->Get("Login")==$_POST["username"]) + { + $MissingCount++; + $FormError["m_register"]["username"] = language("lu_user_exists"); + } + } + + if (strlen($_POST['username']) < $objConfig->Get("Min_UserName")) + { + $MissingCount++; + $FormError["m_register"]["username"] = language("lu_ferror_username_tooshort"); + } + + if(!$MissingCount) + { + $CreatedOn = adodb_date("U"); + $GroupId = $objConfig->Get("User_NewGroup"); + $Status=0; + + /* determine the status of new users */ + switch ($objConfig->Get("User_Allow_New")) + { + case "1": + $Status=1; + break; + case "3": + $Status=2; + break; + } + + /* set Destination template */ + $var_list["t"] = strlen($_GET["dest"])? $_GET["dest"] : "index"; + + if($Status>0) + { + if($objConfig->Get("User_Password_Auto")) + { + $password = makepassword(); + } + else + $password = $_POST["password"]; + + $_POST["dob"] = $_POST["dob_month"]."/".$_POST["dob_day"]."/".$_POST["dob_year"]; + $dob = DateTimestamp($_POST["dob"],GetDateFormat()); + $ip = $_SERVER['REMOTE_ADDR']; + + $u = &$objUsers->Add_User($_POST["username"], md5($password), $_POST["email"], $CreatedOn, $_POST["firstname"], $_POST["lastname"], $Status, $_POST["phone"], $_POST["street"], $_POST["city"], $_POST["state"], $_POST["zip"], $_POST["country"], $dob, $ip, TRUE); + + if(!is_object($u)) + { + $RuleId=$u; + $r = $objBanList->GetItem($RuleId); + $err = $r->Get("ErrorTag"); + + if(strlen($err)) + { + $FormError["m_register"][$r->Get("ItemField")] = language($err); + $MissingCount++; + } + } + else + { + $u->Set("Password",$password); + $u->Clean(); + if($GroupId>0) + { + $g = $objGroups->GetItem($GroupId); + $g->AddUser($u->Get("PortalUserId"),1); + } + + $custom = $_POST["custom"]; + if(is_array($custom)) + { + for($x=0;$xSetCustomField($custom[$x],$_POST[$custom[$x]]); + } + $u->SaveCustomFields(); + } + + if($Status==1) + { + if($objConfig->Get("User_Password_Auto")) + { + $u->SendUserEventMail("USER.VALIDATE",$u->Get("PortalUserId")); + $u->SendAdminEventMail("USER.VALIDATE"); + } + else + { + $doLoginNow = true; + $u->SendUserEventMail("USER.ADD",$u->Get("PortalUserId")); + $u->SendAdminEventMail("USER.ADD"); + } + } + else + { + $u->SendUserEventMail("USER.ADD.PENDING",$u->Get("PortalUserId")); + $u->SendAdminEventMail("USER.ADD.PENDING"); + } + + if ($doLoginNow) + $objSession->Login($_POST["username"], md5($password)); + + } + } + } + break; + case "m_add_friend": + $id = $_GET["UserId"]; + $userid = $objSession->Get("PortalUserId"); + if($id!=$userid) + { + $u =& $objUsers->GetItem($id); + $u->AddFavorite($userid); + } + break; + case "m_del_friend": + $id = $_GET["UserId"]; + $userid = $objSession->Get("PortalUserId"); + $u =& $objUsers->GetItem($id); + $u->DeleteFavorite(); + break; + case "m_acctinfo": +// phpinfo(INFO_VARIABLES); + $MissingCount = SetMissingDataErrors("m_acctinfo"); + $UserId = $_GET["UserId"]; + if($UserId != $objSession->Get("PortalUserId")) + { + $MissingCount++; + $FormError["m_acctinfo"]["UserId"] = language("lu_ferror_m_profile_userid"); + } + if(strlen($_POST["password"])>0) + { + if(($_POST["password"] != $_POST["passwordverify"]) || !strlen($_POST["passwordverify"])) + { + $MissingCount++; + $FormError["m_acctinfo"]["passwordverify"] = language("lu_ferror_pswd_mismatch"); + } + + if(strlen($_POST["password"])>30) + { + // echo "VAR: ".$_POST["password"]; die(); + $MissingCount++; + $FormError["m_acctinfo"]["password"] = language("lu_ferror_pswd_toolong"); + } + + if (strlen($_POST['password']) < $objConfig->Get("Min_Password")) + { + $MissingCount++; + $FormError["m_acctinfo"]["password"] = language("lu_ferror_pswd_tooshort"); + } + } + if(!$MissingCount) + { + /* save profile */ + $u =& $objUsers->GetItem($UserId); + $status = $u->Get("Status"); + $_POST["dob"] = $_POST["dob_month"]."/".$_POST["dob_day"]."/".$_POST["dob_year"]; + $dob = DateTimestamp($_POST["dob"], GetDateFormat()); + if(strlen($_POST["password"])>0) + { + $password = md5($_POST["password"]); + } + else + $password = ""; + $objUsers->Edit_User($UserId, $_POST["username"], $password, $_POST["email"], 0, + $_POST["firstname"], $_POST["lastname"], $status, $_POST["phone"], + $_POST["street"], $_POST["city"], $_POST["state"], $_POST["zip"], + $_POST["country"], $dob); + } + break; + case "m_profile": + $userid = $objSession->Get("PortalUserId"); + if($userid>0) + { + $u = $objUsers->GetItem($userid); + foreach($_POST as $field=>$value) + { + if(substr($field,0,3)=="pp_") + { + $objSession->SetPersistantVariable($field,$value); + } + } + } + break; + case "m_set_lang": + $lang = $_GET["lang"]; + $LangId = 0; + if(strlen($lang)) + { + $l = $objLanguages->GetItemByField("PackName",$lang); + if(is_object($l)) + { + $LangId = $l->Get("LanguageId"); + } + } + if($LangId) + { + if($objSession->Get("PortalUserId")>0) + { + $objSession->SetPersistantVariable("Language",$LangId); + } + $objSession->Set("Language",$LangId); + $objSession->Update(); + $m_var_list_update["lang"] = $LangId; + $m_var_list["lang"] = $LangId; + } + break; + + case "m_set_theme": + $id = $_POST["ThemeId"]; + if(!is_numeric($id)) + $id = $_GET["ThemeId"]; + if($id) + { + $objSession->SetThemeName($id); + $var_list["t"] = "index"; + $m_var_list_update["theme"] = $id; + $m_var_list["theme"] = $id; + } + break; + + case "m_sort_cats": + $objSession->SetVariable("Category_Sortfield",$_POST["cat_field_sort"]); + $objSession->SetVariable("Category_Sortorder",$_POST["cat_sort_order"]); + break; + case "m_add_cat_confirm": +// phpinfo(INFO_VARIABLES); + $perm = 0; + $CategoryId=$objCatList->CurrentCategoryID(); + if ($objSession->HasCatPermission("CATEGORY.ADD.PENDING")) + $perm = 2; + if ($objSession->HasCatPermission("CATEGORY.ADD")) + $perm = 1; + if ($perm == 0) + { + $MissingCount++; + $FormError["m_addcat"]["name"] = language("lu_ferror_no_access"); + } + else + { + $MissingCount = SetMissingDataErrors("m_addcat"); + if(is_array($_FILES)) + { + foreach($_FILES as $field => $file) + { + $allowed = TRUE; + if(strlen($_POST["imagetypes"][$field])) + { + $types = explode(",",strtolower($_POST["imagetypes"][$field])); + if(is_array($types)) + { + if(count($types)>0) + { + $path_parts = pathinfo($file["name"]); + $ext = $path_parts["extension"]; + $allowed = in_array($ext,$types); + if(!$allowed) + { + $MissingCount++; + $FormError["m_addcat"][$field] = language("lu_ferror_wrongtype"); + } + } + } + } + $maxsize = (int)$_POST["maxsize"][$field]; + if($maxsize>0 && $allowed && $file["size"]>$maxsize) + { + $allowed = FALSE; + $MissingCount++; + $FormError["m_addcat"][$field] = language("lu_ferror_toolarge"); + } + } + } + if($MissingCount==0) + { + $CreatedOn = date("U"); + $name = $_POST["name"]; + $desc = $_POST["description"]; + $metadesc = $_POST["meta_description"]; + $keywords = $_POST["meta_keywords"]; + $parent = $objCatList->CurrentCategoryID(); + $cat =& $objCatList->Add($parent, $name, inp_escape($desc,0), $CreatedOn, + 0, $perm, 2, 2, 2, 0, $keywords,$metadesc); + $cat->UpdateCachedPath(); + $cat->Update(); + $cat->UpdateACL(); + $objCatList->UpdateMissingCacheData(); + + if(strlen($_GET["Confirm"])) + { + $var_list["t"] = $_GET["Confirm"]; + } + else + $var_list["t"] = $_GET["DestTemplate"]; + } + } + break; + case "m_front_review_add": + if($objSession->InSpamControl($_POST["ItemId"])) + { + $StatusMessage["review"] = language("la_Review_AlreadyReviewed"); + } + else + { + $objReviews = new clsItemReviewList(); + $Status = $objConfig->Get("Review_DefaultStatus"); + $CreatedOn = adodb_date("U"); + $html = (int)$objConfig->Get("Review_Html"); + $ReviewText = inp_escape($_POST["review_text"],$html); + + $r = $objReviews->AddReview($CreatedOn,$ReviewText,$Status, $IPAddress, + 0, $_POST["ItemId"], $_POST["ItemType"], $objSession->Get("PortalUserId")); + foreach($ItemTypes as $type=>$id) + { + if($id==$_POST["ItemType"]) + { + $ValName = $type."_ReviewDelay_Value"; + $IntName = $type."_ReviewDelay_Interval"; + break; + } + } + if(strlen($ValName) && strlen($IntName)) + { + $exp_secs = $objConfig->Get($ValName) * $objConfig->Get($IntName); + $objSession->AddToSpamControl($_POST["ItemId"],$exp_secs); + if(is_object($r)) + { + if($Status) + { + $StatusMessage["review"] = language("la_Review_Added"); + } + else + $StatusMessage["review"] = language("la_Review_Pending"); + } + else + $StatusMessage["review"] = language("la_Review_Error"); + } + else + $StatusMessage["error"] = language("la_ConfigError_Review"); + } + break; + case "m_suggest_email": + $cutoff = time()+(int)$objConfig->Get("Suggest_MinInterval"); + $email = $_POST["suggest_email"]; + + if (strlen($email)) + { + if(ValidEmail($email)) + { + $sql = "SELECT * FROM ".GetTablePrefix()."SuggestMail WHERE email='".inp_escape($email,0)."' and sent<".$cutoff; + $adodbConnection = GetADODBConnection(); + $rs = $adodbConnection->Execute($sql); + + $rs = false; + + if($rs && !$rs->EOF) + { + if(strlen($_GET["Error"])>0) + $var_list["t"] = $_GET["Error"]; + $suggest_result = "$email ".language("lu_already_suggested ")." ".LangDate($rs->fields["sent"]); + } + else + { + $Event =& $objMessageList->GetEmailEventObject("USER.SUGGEST"); + if(is_object($Event)) + { + if($Event->Get("Enabled")=="1") + { + $Event->Item = $this; + $Event->SendToAddress($email); + + $sql = "INSERT INTO ".GetTablePrefix()."SuggestMail (email,sent) VALUES ('".inp_escape($email,0)."','".time()."')"; + + $rs = $adodbConnection->Execute($sql); + $suggest_result=language("lu_suggest_success")." ".$email; + } + } + $e =& $objMessageList->GetEmailEventObject("USER.SUGGEST",1); + + if($e->Get("Enabled")==1) + $e->SendAdmin(); + + if(strlen($_GET["Confirm"])>0) + $var_list["t"] = $_GET["Confirm"]; + } + } + else + { + if(strlen($_GET["Error"])>0) + $var_list["t"] = $_GET["Error"]; + $suggest_result=language("lu_invalid_emailaddress"); + } + } + else + { + if(strlen($_GET["Error"])>0) + $var_list["t"] = $_GET["Error"]; + $suggest_result=language("lu_suggest_no_address"); + } + break; + case "m_simple_search": + $keywords = $_POST["keywords"]; + $type = $objItemTypes->GetTypeByName("Category"); + $objSearch = new clsSearchResults("Category","clsCategory"); + + if(strlen($keywords)) + { + $objSearchList = new clsSearchLogList(); + $objSearchList->UpdateKeyword($keywords,0); + + $objSearch->SetKeywords($keywords); + $objSearch->AddSimpleFields(); + if(is_numeric($objConfig->Get("SearchRel_Pop_category"))) + $objSearch->PctPop = ($objConfig->Get("SearchRel_Pop_category")/100); + if(is_numeric($objConfig->Get("SearchRel_Keyword_category"))) + $objSearch->PctRelevance = ($objConfig->Get("SearchRel_Keyword_category")/100); + if(is_numeric($objConfig->Get("SearchRel_Rating_article"))) + $objSearch->PctRating = ($objConfig->Get("SearchRel_Rating_category")/100); + + //echo "Searching On $keywords
    \n"; + $objSearch->PerformSearch(1,$SortOrder,TRUE); + $SearchPerformed = TRUE; + //$objSearch->SetRelevence($type->Get("ItemType"), "CategoryId"); + //echo "Finished Setting Category Relevence
    \n"; + } + else + { + if(strlen($_GET["Error"])>0) + $var_list["t"] = $_GET["Error"]; + + $MissingCount = SetMissingDataErrors("m_simplesearch"); + $MissingCount++; + $FormError["m_simplesearch"]["keywords"] = language("lu_no_keyword"); + } + break; + case "m_adv_search": + if(!is_object($objSearchConfig)) + $objSearchConfig = new clsSearchConfigList(); + switch($_GET["type"]) + { + case 1: /* category */ + $objAdvSearch = new clsAdvancedSearchResults("Category","clsCategory"); + foreach($objSearchConfig->Items as $field) + { + $fld = $field->Get("FieldName"); + + $Verb = $_POST["verb"][$field->Get("FieldName")]; + if(!strlen($Verb) && $field->Get("FieldType")=="boolean") + { + if($_POST["value"][$field->Get("FieldName")]!=-1) + { + $Value = $_POST["value"][$field->Get("FieldName")]; + $Verb = "is"; + } + } + else + { + $Value = $_POST["value"][$field->Get("FieldName")]; + } + switch( $_POST["andor"][$field->Get("FieldName")]) + { + case 1: + $Conjuction = "AND"; + break; + case 2: + $Conjuction = "OR"; + break; + default: + $Conjuction = ""; + break; + } + if(strlen($Verb)>0 && $Verb!="any") + $objAdvSearch->AddAdvancedField($field->Get("TableName"),$field->Get("FieldName"),$Verb,$Value,$Conjuction); + + } + $objAdvSearch->PerformSearch(1,NULL,TRUE); + break; + } + break; + case "m_id": + echo $Action.":".$DownloadId; + die(); + break; + case "m_simple_subsearch": + $keywords = $_POST["keywords"]; + $type = $objItemTypes->GetTypeByName("Category"); + $objSearch = new clsSearchResults("Category","clsCategory"); + if(strlen($keywords)) + { + $objSearchList = new clsSearchLogList(); + $objSearchList->UpdateKeyword($keywords,0); + + $objSearch->SetKeywords($keywords); + $objSearch->AddSimpleFields(); + if(is_numeric($objConfig->Get("SearchRel_Pop_category"))) + $objSearch->PctPop = ($objConfig->Get("SearchRel_Pop_category")/100); + if(is_numeric($objConfig->Get("SearchRel_Keyword_category"))) + $objSearch->PctRelevance = ($objConfig->Get("SearchRel_Keyword_category")/100); + if(is_numeric($objConfig->Get("SearchRel_Rating_article"))) + $objSearch->PctRating = ($objConfig->Get("SearchRel_Rating_category")/100); + + $SearchResultIdList = $objSearch->Result_IdList(); + if(count($SearchResultIdList)>0) + { + $objSearch->PerformSearch(1,$SortOrder,TRUE,$SearchResultIdList); + //$objSearch->SetRelevence($type->Get("ItemType"), "CategoryId"); + } + $SearchPerformed = TRUE; + } + else { + $MissingCount = SetMissingDataErrors("m_simplesearch"); + $MissingCount++; + $FormError["m_simplesearch"]["keywords"] = language("lu_no_keyword"); + } + break; + } +?> Index: trunk/themes/default/lang_select/lang_menu.tpl =================================================================== diff -u --- trunk/themes/default/lang_select/lang_menu.tpl (revision 0) +++ trunk/themes/default/lang_select/lang_menu.tpl (revision 13) @@ -0,0 +1,17 @@ +
    + + + + + + + + +
    <inp:m_language _Phrase=" border=0>
    + + +
    +
    +
    + + Index: trunk/kernel/include/adodb/toexport.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/toexport.inc.php (revision 0) +++ trunk/kernel/include/adodb/toexport.inc.php (revision 13) @@ -0,0 +1,130 @@ +FieldTypesArray(); + foreach($fieldTypes as $o) { + + $v = $o->name; + if ($escquote) $v = str_replace($quote,$escquotequote,$v); + $v = strip_tags(str_replace("\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))); + $elements[] = $v; + + } + $s .= implode($sep, $elements).$NEWLINE; + } + $hasNumIndex = isset($rs->fields[0]); + + $line = 0; + $max = $rs->FieldCount(); + + while (!$rs->EOF) { + $elements = array(); + $i = 0; + + if ($hasNumIndex) { + for ($j=0; $j < $max; $j++) { + $v = trim($rs->fields[$j]); + if ($escquote) $v = str_replace($quote,$escquotequote,$v); + $v = strip_tags(str_replace("\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))); + + if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote"; + else $elements[] = $v; + } + } else { // ASSOCIATIVE ARRAY + foreach($rs->fields as $v) { + if ($escquote) $v = str_replace($quote,$escquotequote,trim($v)); + $v = strip_tags(str_replace("\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))); + + if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote"; + else $elements[] = $v; + } + } + $s .= implode($sep, $elements).$NEWLINE; + $rs->MoveNext(); + $line += 1; + if ($fp && ($line % $BUFLINES) == 0) { + if ($fp === true) echo $s; + else fwrite($fp,$s); + $s = ''; + } + } + + if ($fp) { + if ($fp === true) echo $s; + else fwrite($fp,$s); + $s = ''; + } + + return $s; +} +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/lang/de.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/de.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/de.js (revision 13) @@ -0,0 +1,196 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * de.js: German support. + * + * Authors: + * Hendrik Kramer (HK@lwd.de) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Ausschneiden" ; +lang["Copy"] = "Kopieren" ; +lang["Paste"] = "Einfügen" ; +lang["PasteText"] = "Einfügen als unformatierten Text" ; +lang["PasteWord"] = "Einfügen aus Word" ; +lang["Find"] = "Suchen" ; +lang["SelectAll"] = "Alles markieren" ; +lang["RemoveFormat"] = "Format entfernen" ; +lang["InsertLink"] = "Link einfügen/bearbeiten" ; +lang["RemoveLink"] = "Link entfernen" ; +lang["InsertImage"] = "Bild einfügen/bearbeiten" ; +lang["InsertTable"] = "Tabelle einfügen/bearbeiten" ; +lang["InsertLine"] = "Horizontale Linie einfügen" ; +lang["InsertSpecialChar"] = "Sonderzeichen einfügen" ; +lang["InsertSmiley"] = "Smiley einfügen" ; +lang["About"] = "Über FCKeditor" ; +lang["Bold"] = "Fett (STRG+B)" ; +lang["Italic"] = "Kursiv (STRG+I)" ; +lang["Underline"] = "Unterstrichen (STRG+U)" ; +lang["StrikeThrough"] = "Durchgestrichen" ; +lang["Subscript"] = "Tiefgestellt" ; +lang["Superscript"] = "Hochgestellt" ; +lang["LeftJustify"] = "Linksbündig" ; +lang["CenterJustify"] = "Zentriert" ; +lang["RightJustify"] = "Rechtsbündig" ; +lang["BlockJustify"] = "Blocksatz" ; +lang["DecreaseIndent"] = "Einzug verkleinern" ; +lang["IncreaseIndent"] = "Einzug vergrößern" ; +lang["Undo"] = "Rückgängig (STRG+Z)" ; +lang["Redo"] = "Wiederherstellen (STRG+Y)" ; +lang["NumberedList"] = "Nummerierung" ; +lang["BulettedList"] = "Aufzählungszeichen" ; + +lang["ShowTableBorders"] = "Tabelle mit Gitternetzlinien anzeigen" ; +lang["ShowDetails"] = "Details anzeigen" ; + +lang["FontStyle"] = "Style" ; +lang["FontFormat"] = "Format" ; +lang["Font"] = "Schriftart" ; +lang["FontSize"] = "Größe" ; +lang["TextColor"] = "Textfarbe" ; +lang["BGColor"] = "Hintergrundfarbe" ; +lang["Source"] = "HTML" ; + +// Context Menu + +lang["EditLink"] = "Link bearbeiten" ; +lang["InsertRow"] = "Zeile einfügen" ; +lang["DeleteRows"] = "Zeilen entfernen" ; +lang["InsertColumn"] = "Spalte einfügen" ; +lang["DeleteColumns"] = "Spalten entfernen" ; +lang["InsertCell"] = "Zelle einfügen" ; +lang["DeleteCells"] = "Zelle entfernen" ; +lang["MergeCells"] = "Zellen verbinden" ; +lang["SplitCell"] = "Zelle aufteilen" ; +lang["CellProperties"] = "Zelleigenschaften" ; +lang["TableProperties"] = "Tabelleneigenschaften" ; +lang["ImageProperties"] = "Grafik formatieren" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Bearbeite XHTML. Bitte warten..." ; +lang["Done"] = "Fertig" ; +lang["PasteWordConfirm"] = "Der einzufügende Text scheint aus Microsoft Word zu stammen. Möchten Sie ihn vor dem Einfügen bereinigen lassen?" ; +lang["NotCompatiblePaste"] = "Dieser Befehl ist nur für den Internet Explorer Version 5.5 oder höher verfügbar. Möchten Sie den Text ohne vorherige Bereinigung einfügen?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Abbrechen" ; +lang["DlgBtnClose"] = "Schließen" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Bild einfügen" ; +lang["DlgImgTitleEdit"] = "Bild bearbeiten" ; +lang["DlgImgBtnUpload"] = "Zum Server senden" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Upload" ; +lang["DlgImgBtnBrowse"] = "Server durchsuchen" ; +lang["DlgImgAlt"] = "Alternativer Text" ; +lang["DlgImgWidth"] = "Breite" ; +lang["DlgImgHeight"] = "Höhe" ; +lang["DlgImgLockRatio"] = "Verhältnis beibehalten" ; +lang["DlgBtnResetSize"] = "Größe zurücksetzen" ; +lang["DlgImgBorder"] = "Rahmen" ; +lang["DlgImgHSpace"] = "Horiz. Abstand" ; +lang["DlgImgVSpace"] = "Vert. Abstand" ; +lang["DlgImgAlign"] = "Ausrichtung" ; +lang["DlgImgAlignLeft"] = "Links" ; +lang["DlgImgAlignAbsBottom"] = "Absolut unten" ; +lang["DlgImgAlignAbsMiddle"] = "Absolut mittig" ; +lang["DlgImgAlignBaseline"] = "Grundlinie" ; +lang["DlgImgAlignBottom"] = "Unten" ; +lang["DlgImgAlignMiddle"] = "Mittig" ; +lang["DlgImgAlignRight"] = "Rechts" ; +lang["DlgImgAlignTextTop"] = "Text Oben" ; +lang["DlgImgAlignTop"] = "Oben" ; +lang["DlgImgPreview"] = "Vorschau" ; +lang["DlgImgMsgWrongExt"] = "Es sind leider nur folgende Dateitypen erlaubt:\n\n" + config.ImageUploadAllowedExtensions + "\n\nBefehl abgebrochen." ; +lang["DlgImgAlertSelect"] = "Bitte wählen Sie ein bereitzustellendes Bild aus."; + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Upload" ; +lang["DlgLnkTarget"] = "Ziel" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Neues Fenster (_blank)" ; +lang["DlgLnkTargetParent"] = "Übergeordnetes Fenster (_parent)" ; +lang["DlgLnkTargetSelf"] = "Aktuelles Fenster (_self)" ; +lang["DlgLnkTargetTop"] = "Oberstes Fenster (_top)" ; +lang["DlgLnkTitle"] = "Titel" ; +lang["DlgLnkBtnUpload"] = "Zum Server senden" ; +lang["DlgLnkBtnBrowse"] = "Server durchsuchen" ; +lang["DlgLnkMsgWrongExtA"] = "Es sind leider nur folgende Dateitypen erlaubt:\n\n" + config.LinkUploadAllowedExtensions + "\n\nBefehl abgebrochen." ; +lang["DlgLnkMsgWrongExtD"] = "Folgende Dateitypen sind leider nicht erlaubt:\n\n" + config.LinkUploadDeniedExtensions + "\n\nBefehl abgebrochen." ; + +// Color Dialog +lang["DlgColorTitle"] = "Farbe auswählen" ; +lang["DlgColorBtnClear"] = "Löschen" ; +lang["DlgColorHighlight"] = "Aktuell" ; +lang["DlgColorSelected"] = "Ausgewählt" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Smiley einfügen" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Sonderzeichen einfügen" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Tabelle einfügen" ; +lang["DlgTableTitleEdit"] = "Tabelle bearbeiten" ; +lang["DlgTableRows"] = "Zeilen" ; +lang["DlgTableColumns"] = "Spalten" ; +lang["DlgTableBorder"] = "Rahmenbreite" ; +lang["DlgTableAlign"] = "Ausrichtung" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Links" ; +lang["DlgTableAlignCenter"] = "Zentriert" ; +lang["DlgTableAlignRight"] = "Rechts" ; +lang["DlgTableWidth"] = "Breite" ; +lang["DlgTableWidthPx"] = "Pixel" ; +lang["DlgTableWidthPc"] = "Prozent" ; +lang["DlgTableHeight"] = "Höhe" ; +lang["DlgTableCellSpace"] = "Zellenabstand" ; +lang["DlgTableCellPad"] = "Randabstand" ; +lang["DlgTableCaption"] = "Überschrift" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Zelleneigenschaften" ; +lang["DlgCellWidth"] = "Breite" ; +lang["DlgCellWidthPx"] = "Pixel" ; +lang["DlgCellWidthPc"] = "Prozent" ; +lang["DlgCellHeight"] = "Höhe" ; +lang["DlgCellWordWrap"] = "Wortumbruch" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Ja" ; +lang["DlgCellWordWrapNo"] = "Nein" ; +lang["DlgCellHorAlign"] = "Horiz. Ausrichtung" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Links" ; +lang["DlgCellHorAlignCenter"] = "Zentriert" ; +lang["DlgCellHorAlignRight"] = "Rechts" ; +lang["DlgCellVerAlign"] = "Vertik. Ausrichtung" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Oben" ; +lang["DlgCellVerAlignMiddle"] = "Mittig" ; +lang["DlgCellVerAlignBottom"] = "Unten" ; +lang["DlgCellVerAlignBaseline"] = "Grundlinie" ; +lang["DlgCellRowSpan"] = "Zeilenumfang" ; +lang["DlgCellCollSpan"] = "Spaltenumfang" ; +lang["DlgCellBackColor"] = "Hintergrundfarbe" ; +lang["DlgCellBorderColor"] = "Rahmenfarbe" ; +lang["DlgCellBtnSelect"] = "Auswählen..." ; + +// About Dialog +lang["DlgAboutVersion"] = "Version" ; +lang["DlgAboutLicense"] = "Lizensiert unter den Bedingungen der GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "Weitere Informationen erhalten Sie unter" ; \ No newline at end of file Index: trunk/themes/default/img/ic_reviews.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_headnav.jpg =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-proxy.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-proxy.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-proxy.inc.php (revision 13) @@ -0,0 +1,28 @@ + \ No newline at end of file Index: trunk/kernel/include/adodb/drivers/adodb-informix72.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-informix72.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-informix72.inc.php (revision 13) @@ -0,0 +1,315 @@ + + +*/ + +class ADODB_informix72 extends ADOConnection { + var $databaseType = "informix72"; + var $dataProvider = "informix"; + var $replaceQuote = "''"; // string to use to replace quotes + var $fmtDate = "'Y-m-d'"; + var $fmtTimeStamp = "'Y-m-d H:i:s'"; + var $hasInsertID = true; + var $hasAffectedRows = true; + var $metaTablesSQL="select tabname from systables"; + var $metaColumnsSQL = "select colname, coltype, collength from syscolumns c, systables t where c.tabid=t.tabid and tabname='%s'"; + var $concat_operator = '||'; + + var $lastQuery = false; + var $has_insertid = true; + + var $_autocommit = true; + var $_bindInputArray = true; // set to true if ADOConnection.Execute() permits binding of array parameters. + var $sysDate = 'TODAY'; + var $sysTimeStamp = 'CURRENT'; + + function ADODB_informix72() + { + + // alternatively, use older method: + //putenv("DBDATE=Y4MD-"); + + // force ISO date format + putenv('GL_DATE=%Y-%m-%d'); + } + + function _insertid() + { + $sqlca =ifx_getsqlca($this->lastQuery); + return @$sqlca["sqlerrd1"]; + } + + function _affectedrows() + { + if ($this->lastQuery) { + return ifx_affected_rows ($this->lastQuery); + } else + return 0; + } + + function BeginTrans() + { + if ($this->transOff) return true; + $this->transCnt += 1; + $this->Execute('BEGIN'); + $this->_autocommit = false; + return true; + } + + function CommitTrans($ok=true) + { + if (!$ok) return $this->RollbackTrans(); + if ($this->transOff) return true; + if ($this->transCnt) $this->transCnt -= 1; + $this->Execute('COMMIT'); + $this->_autocommit = true; + return true; + } + + function RollbackTrans() + { + if ($this->transOff) return true; + if ($this->transCnt) $this->transCnt -= 1; + $this->Execute('ROLLBACK'); + $this->_autocommit = true; + return true; + } + + function RowLock($tables,$where) + { + if ($this->_autocommit) $this->BeginTrans(); + return $this->GetOne("select 1 as ignore from $tables where $where for update"); + } + + /* Returns: the last error message from previous database operation + Note: This function is NOT available for Microsoft SQL Server. */ + + function ErrorMsg() { + $this->_errorMsg = ifx_errormsg(); + return $this->_errorMsg; + } + + function ErrorNo() + { + return ifx_error(); + } + + function &MetaColumns($table) + { + return ADOConnection::MetaColumns($table,false); + } + + function UpdateBlob($table, $column, $val, $where, $blobtype = 'BLOB') + { + $type = ($blobtype == 'TEXT') ? 1 : 0; + $blobid = ifx_create_blob($type,0,$val); + return $this->Execute("UPDATE $table SET $column=(?) WHERE $where",array($blobid)); + } + + function BlobDecode($blobid) + { + return @ifx_get_blob($blobid); + } + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $dbs = $argDatabasename . "@" . $argHostname; + $this->_connectionID = ifx_connect($dbs,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + #if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $dbs = $argDatabasename . "@" . $argHostname; + $this->_connectionID = ifx_pconnect($dbs,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + #if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } +/* + // ifx_do does not accept bind parameters - wierd ??? + function Prepare($sql) + { + $stmt = ifx_prepare($sql); + if (!$stmt) return $sql; + else return array($sql,$stmt); + } +*/ + // returns query ID if successful, otherwise false + function _query($sql,$inputarr) + { + global $ADODB_COUNTRECS; + + // String parameters have to be converted using ifx_create_char + if ($inputarr) { + foreach($inputarr as $v) { + if (gettype($v) == 'string') { + $tab[] = ifx_create_char($v); + } + else { + $tab[] = $v; + } + } + } + + // In case of select statement, we use a scroll cursor in order + // to be able to call "move", or "movefirst" statements + if (!$ADODB_COUNTRECS && preg_match("/^\s*select/is", $sql)) { + if ($inputarr) { + $this->lastQuery = ifx_query($sql,$this->_connectionID, IFX_SCROLL, $tab); + } + else { + $this->lastQuery = ifx_query($sql,$this->_connectionID, IFX_SCROLL); + } + } + else { + if ($inputarr) { + $this->lastQuery = ifx_query($sql,$this->_connectionID, $tab); + } + else { + $this->lastQuery = ifx_query($sql,$this->_connectionID); + } + } + + // Following line have been commented because autocommit mode is + // not supported by informix SE 7.2 + + //if ($this->_autocommit) ifx_query('COMMIT',$this->_connectionID); + + return $this->lastQuery; + } + + // returns true or false + function _close() + { + $this->lastQuery = false; + return ifx_close($this->_connectionID); + } +} + + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordset_informix72 extends ADORecordSet { + + var $databaseType = "informix72"; + var $canSeek = true; + var $_fieldprops = false; + + function ADORecordset_informix72($id,$mode=false) + { + if ($mode === false) { + global $ADODB_FETCH_MODE; + $mode = $ADODB_FETCH_MODE; + } + $this->fetchMode = $mode; + return $this->ADORecordSet($id); + } + + + + /* Returns: an object containing field information. + Get column information in the Recordset object. fetchField() can be used in order to obtain information about + fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by + fetchField() is retrieved. */ + function &FetchField($fieldOffset = -1) + { + if (empty($this->_fieldprops)) { + $fp = ifx_fieldproperties($this->_queryID); + foreach($fp as $k => $v) { + $o = new ADOFieldObject; + $o->name = $k; + $arr = split(';',$v); //"SQLTYPE;length;precision;scale;ISNULLABLE" + $o->type = $arr[0]; + $o->max_length = $arr[1]; + $this->_fieldprops[] = $o; + $o->not_null = $arr[4]=="N"; + } + } + return $this->_fieldprops[$fieldOffset]; + } + + function _initrs() + { + $this->_numOfRows = -1; // ifx_affected_rows not reliable, only returns estimate -- ($ADODB_COUNTRECS)? ifx_affected_rows($this->_queryID):-1; + $this->_numOfFields = ifx_num_fields($this->_queryID); + } + + function _seek($row) + { + return @ifx_fetch_row($this->_queryID, $row); + } + + function MoveLast() + { + $this->fields = @ifx_fetch_row($this->_queryID, "LAST"); + if ($this->fields) $this->EOF = false; + $this->_currentRow = -1; + + if ($this->fetchMode == ADODB_FETCH_NUM) { + foreach($this->fields as $v) { + $arr[] = $v; + } + $this->fields = $arr; + } + + return true; + } + + function MoveFirst() + { + $this->fields = @ifx_fetch_row($this->_queryID, "FIRST"); + if ($this->fields) $this->EOF = false; + $this->_currentRow = 0; + + if ($this->fetchMode == ADODB_FETCH_NUM) { + foreach($this->fields as $v) { + $arr[] = $v; + } + $this->fields = $arr; + } + + return true; + } + + function _fetch($ignore_fields=false) + { + + $this->fields = @ifx_fetch_row($this->_queryID); + + if (!is_array($this->fields)) return false; + + if ($this->fetchMode == ADODB_FETCH_NUM) { + foreach($this->fields as $v) { + $arr[] = $v; + } + $this->fields = $arr; + } + return true; + } + + /* close() only needs to be called if you are worried about using too much memory while your script + is running. All associated result memory for the specified result identifier will automatically be freed. */ + function _close() + { + return ifx_free_result($this->_queryID); + } + +} +?> \ No newline at end of file Index: trunk/admin/images/icon16_search.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tree/ftv2vertline.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_permission_f2.gif =================================================================== diff -u Binary files differ Index: trunk/compat/scandir.php =================================================================== diff -u --- trunk/compat/scandir.php (revision 0) +++ trunk/compat/scandir.php (revision 13) @@ -0,0 +1,70 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: scandir.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace scandir() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.scandir + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('scandir')) +{ + function scandir ($directory, $sorting_order = 0) + { + if (!is_string($directory)) { + trigger_error('scandir() expects parameter 1 to be string, ' . gettype($directory) . ' given', E_USER_WARNING); + return null; + } + + if (!is_int($sorting_order)) { + trigger_error('scandir() expects parameter 2 to be long, ' . gettype($sorting_order) . ' given', E_USER_WARNING); + return null; + } + + if (!is_dir($directory) || (false === $fh = @opendir($directory))) { + trigger_error('scandir() failed to open dir: Invalid argument', E_USER_WARNING); + return false; + } + + $files = array (); + while (false !== ($filename = readdir($fh))) { + $files[] = $filename; + } + + closedir($fh); + + if ($sorting_order == 1) { + rsort($files); + } else { + sort($files); + } + + return $files; + } +} + +?> \ No newline at end of file Index: trunk/admin/textedit/textedit.php =================================================================== diff -u --- trunk/admin/textedit/textedit.php (revision 0) +++ trunk/admin/textedit/textedit.php (revision 13) @@ -0,0 +1,188 @@ + + + Mozilla and IE Editor + + + + + + + + +

    Template Editor

    + +
    +
    + + + + + +
    + +

    +Just for Mozilla 1.1+ testing: +

    + +
    + + Index: trunk/admin/images/toolbar/tool_new_group.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/modlist.php =================================================================== diff -u --- trunk/kernel/include/modlist.php (revision 0) +++ trunk/kernel/include/modlist.php (revision 13) @@ -0,0 +1,119 @@ +clsItemDB(); + $this->tablename = GetTablePrefix()."Modules"; + $this->type=11; + $this->BasePermission=""; + $this->id_field = "Name"; + $this->debuglevel=0; + if(strlen($name)) + $this->LoadFromDatabase($name); + } + + function ExecuteFunction($function_name, $params) + { + $function_name = $this->Get('Var').'_'.$function_name; + if( function_exists($function_name) ) + return $function_name($params); + else + return false; + } +} + +class clsModList extends clsItemCollection +{ + function clsModList() + { + $this->clsItemCollection(); + $this->SourceTable=GetTablePrefix()."Modules"; + $this->classname = "clsModule"; + $this->LoadModules(); + } + + function LoadModules() + { + $this->Clear(); + return $this->Query_Item("SELECT * FROM ".$this->SourceTable); + } + + function &FindModule($fieldname, $value) + { + // finds module by field specified + foreach($this->Items as $module) + if(strcasecmp($module->Get($fieldname), $value) == 0) + return $module; + return false; + } + + function GetModuleList() + { + // returns installed modules list + $ret = Array(); + foreach($this->Items as $module) $ret[] = $module->Get('Name'); + return $ret; + } + + function &GetModule($name) + { + //$this->LoadModules(); + return $this->FindModule('Name', $name); + } + + function ExecuteFunction($function, $params = Array() ) + { + // call specified function for each module + // and returns result as array (key = module name) + $result = Array(); + foreach($this->Items as $module) + $result[ $module->Get('Name') ] = $module->ExecuteFunction($function, $params); + return $result; + } + + function GetModuleByPath($path) + { + $ret = false; + if(strlen($path)) + { + $parts = explode("/",$path); + $modpath = $parts[0]."/"; + + //$this->LoadModules(); + return $this->FindModule('TemplatePath',$modpath); + } + return $ret; + } + + function GetModuleRoot($name) + { + //$this->LoadModules(); + $mod = $this->FindModule('Name', $name); + return is_object($mod) ? $mod->Get("RootCat") : 0; + } + + function SetModuleRoot($name, $CatId) + { + $mod =& $this->FindModule('Name', $name); + if( is_object($mod) ) + { + $mod->Set('RootCat',$CatId); + $mod->Update(); + } + } + + function Refresh() + { + // reloads table content + $this->LoadModules(); + } + + function ModuleInstalled($name) + { + //$this->LoadModules(); + return $this->FindModule('Name',$name); + } + +} Index: trunk/admin/images/icon_install.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/smicon1.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_post_none.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_deny.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/logo_inportal_b.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tree/ftv2folderopen.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tag_listing.php =================================================================== diff -u --- trunk/admin/tag_listing.php (revision 0) +++ trunk/admin/tag_listing.php (revision 13) @@ -0,0 +1,184 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$imagesURL = $rootURL."admin/images"; +$adminURL = $rootURL.$admin; + +$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"); +//Set Section +$section = "in-portal:tag_library"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", + "la_Save", + "#", + "swap('img_save','toolbar/tool_select_f2.gif');", + "swap('img_save', 'toolbar/tool_select.gif');", + "javascript:history.back();", + "tool_select.gif"); +$objCatToolBar->Add("img_cancel", + "la_Cancel", + "#", + "swap('img_cancel','toolbar/tool_cancel_f2.gif');", + "swap('img_cancel', 'toolbar/tool_cancel.gif');", + "javascript:history.back();", + "tool_cancel.gif"); +$extra_styles = ''; + +$title = admin_language("la_tag_library"); +int_header($objCatToolBar,NULL,$title,NULL,$extra_styles); + +$objTagList = new clsTagList(); + +$objTagList->Clear(); +$objTagList->Query_Item("SELECT * FROM ".$objTagList->SourceTable); +?> + +NumItems()>0) +{ + foreach($objTagList->Items as $i) + { + $i->LoadAttribs(); //echo " ".$i->attribs->NumItems()." Attributes
    \n"; + if( $i->Get("name") ) + { + ?> + + + + + + + + + + + + + + + + +
    + Get("scope") != "global") ? $i->Get("scope").'.'.$i->Get("name") : $i->Get("name"); ?> +
    Get("description"); ?>
    Attributes:Source example:
    + attribs->NumItems() > 0 ) { // has attributes ?> + + + attribs->Items as $a) + { + ?> + + + + + +
    Get("Name").'['.$a->Get("AttrType").']'; ?>Get("Description"); ?>
    + +   +
    + + Get('example'); + echo $example ? $example : ' '; + ?> +
    + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_select_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/msn/envelope.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/db_reconfig.php =================================================================== diff -u --- trunk/admin/install/db_reconfig.php (revision 0) +++ trunk/admin/install/db_reconfig.php (revision 13) @@ -0,0 +1,76 @@ + +  Database Configuration

    + + + + + + + +
     Step - Database Configuration
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/textedit/toolbar/italic.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/categories/catlist_element.tpl =================================================================== diff -u --- trunk/themes/default/categories/catlist_element.tpl (revision 0) +++ trunk/themes/default/categories/catlist_element.tpl (revision 13) @@ -0,0 +1,18 @@ + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Server Type: + +
    Server Hostname: + +
    Server Database: + +
    Databse User Name: + +
    Server Password: + +
    Table Name Prefix: + +


    +
    + + +
    +
    + + + + + + + + + + +
    + ">

    "> ( ) + <inp:m_language _Phrase=" /> + <inp:m_language _Phrase=" /> +
      
    ( )
    +
    Index: trunk/compat/array_diff_assoc.php =================================================================== diff -u --- trunk/compat/array_diff_assoc.php (revision 0) +++ trunk/compat/array_diff_assoc.php (revision 13) @@ -0,0 +1,80 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: array_diff_assoc.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace array_diff_assoc() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.array_diff_assoc + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.3.0 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('array_diff_assoc')) +{ + function array_diff_assoc () + { + // Check we have enough arguments + $args = func_get_args(); + $count = count($args); + if (count($args) < 2) { + trigger_error('Wrong parameter count for array_diff_assoc()', E_USER_WARNING); + return null; + } + + // Check arrays + for ($i = 0; $i < $count; $i++) + { + if (!is_array($args[$i])) { + trigger_error('array_diff_assoc() Argument #' . ($i + 1) . ' is not an array', E_USER_WARNING); + return null; + } + } + + // Get the comparison array + $array_comp = array_shift($args); + --$count; + + // Traverse values of the first array + foreach ($array_comp as $key => $value) + { + // Loop through the other arrays + for ($i = 0; $i < $count; $i++) + { + // Loop through this arrays key/value pairs and compare + foreach ($args[$i] as $comp_key => $comp_value) + { + if ((string)$key === (string)$comp_key && + (string)$value === (string)$comp_value) { + + unset($array_comp[$key]); + } + } + } + } + + return $array_comp; + } +} +?> \ No newline at end of file Index: trunk/admin/import/inlinkimport2.php =================================================================== diff -u --- trunk/admin/import/inlinkimport2.php (revision 0) +++ trunk/admin/import/inlinkimport2.php (revision 13) @@ -0,0 +1,151 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL=$rootURL.$admin; +$imagesURL = $adminURL."/images"; +//admin only util +$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"); +//Set Section +$section = "in-portal:inlink_inport"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +$formaction = $adminURL."/import/import.php?".$envar; + $sec = $objSections->GetSection($section); + $objCatToolBar = new clsToolBar(); + +if (true) +{ + + if(true) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + + $var="?env=".BuildEnv()."&en=$en_prev"; + $link=$adminURL."/import/inlinkimport1.php".$var; + + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + + if(true) + { + $MouseOver="if (document.inlinkimport2.choose[0].checked) swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="if (document.inlinkimport2.choose[0].checked) swap('moveright', 'toolbar/tool_next.gif');"; + + + $var="?env=".BuildEnv()."&en=$en_next"; + $link2=$adminURL."/import/inlinkimport3.php".$var; + + $onClick="if (document.inlinkimport2.choose[0].checked) document.location= '$link2'; "; + + $link="#"; + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif"); + } + + $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 2"; + + int_header($objCatToolBar,NULL,$title); +} +?> + + +"> + + > + + + > + + + + + + +
    + + Select the program you are importing the data from: + +
    + + +
    +
    +
    +
    + +
    +
    + \ No newline at end of file Index: trunk/admin/icons/icon46_list_search.gif =================================================================== diff -u Binary files differ Index: trunk/admin/help/credits.php =================================================================== diff -u --- trunk/admin/help/credits.php (revision 0) +++ trunk/admin/help/credits.php (revision 13) @@ -0,0 +1,216 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$cssURL = $adminURL."/include"; +$browseURL = $adminURL."/browse"; + + +//$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."/browse/toolbar.php"); +require_once($pathtoroot.$admin."/listview/listview.php"); +/* +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditCat); + +$objEditCat = new clsCatList(); +$objEditCat->SourceTable = $objSession->GetEditTable("Category"); + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditCat->Query_Item("SELECT * FROM ".$objEditCat->SourceTable); +$itemcount=$objEditCat->NumItems(); +$c = $objEditCat->GetItemByIndex($en); + +unset($objEditItems); + +$objEditItems = new clsRelationshipList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Relationship"); + +if(isset($_POST["itemlist"])) +{ + if(is_array($_POST["itemlist"])) + { + $RelationId = $_POST["itemlist"][0]; + } + else + { + $RelationId = $_POST["itemlist"]; + } + + $Rel = new clsRelationship(); + $Rel->tablename = $objEditItems->SourceTable; + $Rel->LoadExpanded($RelationId); + $action = "m_edit_relation"; +} +else +{ + $Rel = new clsRelationship(); + $Rel->Set("SourceType","1"); + $Rel->Set("SourceId",$c->Get("ResourceId")); + $Rel->Set("TargetId",$_POST["TargetId"]); + $Rel->Set("TargetType",$_POST["TargetType"]); + $Rel->Set("Type","0"); + $Rel->Set("Enabled","1"); + $action = "m_add_relation"; +} + +$item = $Rel->GetTargetItemData(); + +$envar = "env=" . BuildEnv() . "&en=$en"; + + +$section = 'in-portal:editcategory_relation'; +*/ + + + +$ado = GetADODBConnection(); +$title = "In-Portal ".language("la_Credits_Title"); +/* page header */ +print << + + $title + + + + + + + + + + + + + +END; + +if ((int)$m_var_list["lang"]) +{ + $objLanguages->Query_Item("SELECT * FROM ".$objLanguages->SourceTable." WHERE Enabled=1 AND LanguageId=".(int)$m_var_list["lang"]); + foreach ($objLanguages->Items as $l) + { + $lang_name = " ".$l->Get("LocalName"); + } +} + +?> + +"> + + + + +
    + + + + +
    +








    + In-Portal +

    + +

    + " onclick="window.close()">
    +
    + + Index: trunk/themes/default/img/lock.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_view.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/browse/inportal/browse.php =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/browse/inportal/browse.php (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/browse/inportal/browse.php (revision 13) @@ -0,0 +1,394 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); + +if(!strlen($admin)) + + $admin = "admin"; + +$adminURL = $rootURL.$admin; + + + + $IMAGES_BASE_URL = $rootURL."kernel/images/"; + + $IMAGES_BASE_DIR = $pathtoroot."kernel/images/"; + + + +// End int var + + + +// Thanks : php dot net at phor dot net + +function walk_dir($path) { + + if ($dir = opendir($path)) { + + while (false !== ($file = readdir($dir))) + + { + + if ($file[0]==".") continue; + + if (is_dir($path."/".$file)) + + $retval = array_merge($retval,walk_dir($path."/".$file)); + + else if (is_file($path."/".$file)) + + $retval[]=$path."/".$file; + + } + + closedir($dir); + + } + + return $retval; + +} + + + +function CheckImgExt($filename) { + + $img_exts = array("gif","jpg", "jpeg","png"); + + foreach($img_exts as $this_ext) { + + if (preg_match("/\.$this_ext$/", $filename)) { + + return TRUE; + + } + + } + + return FALSE; + +} + + + +foreach (walk_dir($IMAGES_BASE_DIR) as $file) { + + $file = preg_replace("#//+#", '/', $file); + + $IMAGES_BASE_DIR = preg_replace("#//+#", '/', $IMAGES_BASE_DIR); + + $file = preg_replace("#$IMAGES_BASE_DIR#", '', $file); + + if (CheckImgExt($file)) { + + $files[] = $file; //adding filenames to array + + } + +} + + + +sort($files); //sorting array + + + +// generating $html_img_lst + +foreach ($files as $file) { + + $html_img_lst .= "$file
    \n"; + +} + + + +?> + + + + + + + + + + Image Browser + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + +
    File :
    + +
    + +
    + +
        + + + + + + + + + + + + + + + +
    Preview :
    + +
    + +
    + +
    + +
    + +      + +
    + +
    + + + + + Index: trunk/compat/is_a.php =================================================================== diff -u --- trunk/compat/is_a.php (revision 0) +++ trunk/compat/is_a.php (revision 13) @@ -0,0 +1,48 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: is_a.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace function is_a() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.is_a + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.2.0 + * @require PHP 4.0.0 (is_subclass_of) + */ +if (!function_exists('is_a')) +{ + function is_a ($object, $class) + { + if (get_class($object) == strtolower($class)) { + return true; + } + + else { + return is_subclass_of($object, $class); + } + } +} + +?> \ No newline at end of file Index: trunk/kernel/admin/include/toolbar/editcategory_permissions.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/editcategory_permissions.php (revision 0) +++ trunk/kernel/admin/include/toolbar/editcategory_permissions.php (revision 13) @@ -0,0 +1,44 @@ + + + + +END; +?> Index: trunk/admin/images/toolbar/tool_editcat.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-mssql.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-mssql.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-mssql.inc.php (revision 13) @@ -0,0 +1,762 @@ += 0x4300) { +// docs say 4.2.0, but testing shows only since 4.3.0 does it work! + ini_set('mssql.datetimeconvert',0); +} else { +global $ADODB_mssql_mths; // array, months must be upper-case + + + $ADODB_mssql_date_order = 'mdy'; + $ADODB_mssql_mths = array( + 'JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6, + 'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12); +} + +//--------------------------------------------------------------------------- +// Call this to autoset $ADODB_mssql_date_order at the beginning of your code, +// just after you connect to the database. Supports mdy and dmy only. +// Not required for PHP 4.2.0 and above. +function AutoDetect_MSSQL_Date_Order($conn) +{ +global $ADODB_mssql_date_order; + $adate = $conn->GetOne('select getdate()'); + if ($adate) { + $anum = (int) $adate; + if ($anum > 0) { + if ($anum > 31) { + //ADOConnection::outp( "MSSQL: YYYY-MM-DD date format not supported currently"); + } else + $ADODB_mssql_date_order = 'dmy'; + } else + $ADODB_mssql_date_order = 'mdy'; + } +} + +class ADODB_mssql extends ADOConnection { + var $databaseType = "mssql"; + var $dataProvider = "mssql"; + var $replaceQuote = "''"; // string to use to replace quotes + var $fmtDate = "'Y-m-d'"; + var $fmtTimeStamp = "'Y-m-d h:i:sA'"; + var $hasInsertID = true; + var $hasAffectedRows = true; + var $metaDatabasesSQL = "select name from sysdatabases where name <> 'master'"; + var $metaTablesSQL="select name from sysobjects where (type='U' or type='V') and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE','dtproperties'))"; + var $metaColumnsSQL = # xtype==61 is datetime +"select c.name,t.name,c.length, + (case when c.xusertype=61 then 0 else c.xprec end), + (case when c.xusertype=61 then 0 else c.xscale end) + from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'"; + var $hasTop = 'top'; // support mssql SELECT TOP 10 * FROM TABLE + var $hasGenID = true; + var $sysDate = 'convert(datetime,convert(char,GetDate(),102),102)'; + var $sysTimeStamp = 'GetDate()'; + var $_has_mssql_init; + var $maxParameterLen = 4000; + var $arrayClass = 'ADORecordSet_array_mssql'; + var $uniqueSort = true; + var $leftOuter = '*='; + var $rightOuter = '=*'; + var $ansiOuter = true; // for mssql7 or later + var $poorAffectedRows = true; + var $identitySQL = 'select @@IDENTITY'; // 'select SCOPE_IDENTITY'; # for mssql 2000 + var $uniqueOrderBy = true; + + function ADODB_mssql() + { + $this->_has_mssql_init = (strnatcmp(PHP_VERSION,'4.1.0')>=0); + } + + function ServerInfo() + { + global $ADODB_FETCH_MODE; + + $stmt = $this->PrepareSP('sp_server_info'); + $val = 2; + if ($this->fetchMode === false) { + $savem = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + } else + $savem = $this->SetFetchMode(ADODB_FETCH_NUM); + + + $this->Parameter($stmt,$val,'attribute_id'); + $row = $this->GetRow($stmt); + + //$row = $this->GetRow("execute sp_server_info 2"); + + if ($this->fetchMode === false) { + $ADODB_FETCH_MODE = $savem; + } else + $this->SetFetchMode($savem); + + $arr['description'] = $row[2]; + $arr['version'] = ADOConnection::_findvers($arr['description']); + return $arr; + } + + function _insertid() + { + // SCOPE_IDENTITY() + // Returns the last IDENTITY value inserted into an IDENTITY column in + // the same scope. A scope is a module -- a stored procedure, trigger, + // function, or batch. Thus, two statements are in the same scope if + // they are in the same stored procedure, function, or batch. + return $this->GetOne($this->identitySQL); + } + + function _affectedrows() + { + return $this->GetOne('select @@rowcount'); + } + + var $_dropSeqSQL = "drop table %s"; + + function CreateSequence($seq='adodbseq',$start=1) + { + $start -= 1; + $this->Execute("create table $seq (id float(53))"); + $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)"); + if (!$ok) { + $this->Execute('ROLLBACK TRANSACTION adodbseq'); + return false; + } + $this->Execute('COMMIT TRANSACTION adodbseq'); + return true; + } + + function GenID($seq='adodbseq',$start=1) + { + //$this->debug=1; + $this->Execute('BEGIN TRANSACTION adodbseq'); + $ok = $this->Execute("update $seq with (tablock,holdlock) set id = id + 1"); + if (!$ok) { + $this->Execute("create table $seq (id float(53))"); + $ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)"); + if (!$ok) { + $this->Execute('ROLLBACK TRANSACTION adodbseq'); + return false; + } + $this->Execute('COMMIT TRANSACTION adodbseq'); + return $start; + } + $num = $this->GetOne("select id from $seq"); + $this->Execute('COMMIT TRANSACTION adodbseq'); + return $num; + + // in old implementation, pre 1.90, we returned GUID... + //return $this->GetOne("SELECT CONVERT(varchar(255), NEWID()) AS 'Char'"); + } + + // Format date column in sql string given an input format that understands Y M D + function SQLDate($fmt, $col=false) + { + if (!$col) $col = $this->sysTimeStamp; + $s = ''; + + $len = strlen($fmt); + for ($i=0; $i < $len; $i++) { + if ($s) $s .= '+'; + $ch = $fmt[$i]; + switch($ch) { + case 'Y': + case 'y': + $s .= "datename(yyyy,$col)"; + break; + case 'M': + $s .= "convert(char(3),$col,0)"; + break; + case 'm': + $s .= "replace(str(month($col),2),' ','0')"; + break; + case 'Q': + case 'q': + $s .= "datename(quarter,$col)"; + break; + case 'D': + case 'd': + $s .= "replace(str(day($col),2),' ','0')"; + break; + case 'h': + $s .= "substring(convert(char(14),$col,0),13,2)"; + break; + + case 'H': + $s .= "replace(str(datepart(mi,$col),2),' ','0')"; + break; + + case 'i': + $s .= "replace(str(datepart(mi,$col),2),' ','0')"; + break; + case 's': + $s .= "replace(str(datepart(ss,$col),2),' ','0')"; + break; + case 'a': + case 'A': + $s .= "substring(convert(char(19),$col,0),18,2)"; + break; + + default: + if ($ch == '\\') { + $i++; + $ch = substr($fmt,$i,1); + } + $s .= $this->qstr($ch); + break; + } + } + return $s; + } + + + function BeginTrans() + { + if ($this->transOff) return true; + $this->transCnt += 1; + $this->Execute('BEGIN TRAN'); + return true; + } + + function CommitTrans($ok=true) + { + if ($this->transOff) return true; + if (!$ok) return $this->RollbackTrans(); + if ($this->transCnt) $this->transCnt -= 1; + $this->Execute('COMMIT TRAN'); + return true; + } + function RollbackTrans() + { + if ($this->transOff) return true; + if ($this->transCnt) $this->transCnt -= 1; + $this->Execute('ROLLBACK TRAN'); + return true; + } + + /* + Usage: + + $this->BeginTrans(); + $this->RowLock('table1,table2','table1.id=33 and table2.id=table1.id'); # lock row 33 for both tables + + # some operation on both tables table1 and table2 + + $this->CommitTrans(); + + See http://www.swynk.com/friends/achigrik/SQL70Locks.asp + */ + function RowLock($tables,$where) + { + if (!$this->transCnt) $this->BeginTrans(); + return $this->GetOne("select top 1 null as ignore from $tables with (ROWLOCK,HOLDLOCK) where $where"); + } + + //From: Fernando Moreira + function MetaDatabases() + { + if(@mssql_select_db("master")) { + $qry=$this->metaDatabasesSQL; + if($rs=@mssql_query($qry)){ + $tmpAr=$ar=array(); + while($tmpAr=@mssql_fetch_row($rs)) + $ar[]=$tmpAr[0]; + @mssql_select_db($this->databaseName); + if(sizeof($ar)) + return($ar); + else + return(false); + } else { + @mssql_select_db($this->databaseName); + return(false); + } + } + return(false); + } + + // "Stein-Aksel Basma" + // tested with MSSQL 2000 + function MetaPrimaryKeys($table) + { + $sql = "select k.column_name from information_schema.key_column_usage k, + information_schema.table_constraints tc + where tc.constraint_name = k.constraint_name and tc.constraint_type = + 'PRIMARY KEY' and k.table_name = '$table'"; + + $a = $this->GetCol($sql); + if ($a && sizeof($a)>0) return $a; + return false; + } + + + + function SelectDB($dbName) + { + $this->databaseName = $dbName; + if ($this->_connectionID) { + return @mssql_select_db($dbName); + } + else return false; + } + + function ErrorMsg() + { + if (empty($this->_errorMsg)){ + $this->_errorMsg = mssql_get_last_message(); + } + return $this->_errorMsg; + } + + function ErrorNo() + { + if (empty($this->_errorMsg)) { + $this->_errorMsg = mssql_get_last_message(); + } + $id = @mssql_query("select @@ERROR",$this->_connectionID); + if (!$id) return false; + $arr = mssql_fetch_array($id); + @mssql_free_result($id); + if (is_array($arr)) return $arr[0]; + else return -1; + } + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = mssql_connect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = mssql_pconnect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + + // persistent connections can forget to rollback on crash, so we do it here. + if ($this->autoRollback) { + $cnt = $this->GetOne('select @@TRANCOUNT'); + while (--$cnt >= 0) $this->Execute('ROLLBACK TRAN'); + } + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + function Prepare($sql) + { + return $sql; + } + + function PrepareSP($sql) + { + if (!$this->_has_mssql_init) { + ADOConnection::outp( "PrepareSP: mssql_init only available since PHP 4.1.0"); + return $sql; + } + $stmt = mssql_init($sql,$this->_connectionID); + if (!$stmt) return $sql; + return array($sql,$stmt); + } + + /* + Usage: + $stmt = $db->PrepareSP('SP_RUNSOMETHING'); -- takes 2 params, @myid and @group + + # note that the parameter does not have @ in front! + $db->Parameter($stmt,$id,'myid'); + $db->Parameter($stmt,$group,'group',false,64); + $db->Execute($stmt); + + @param $stmt Statement returned by Prepare() or PrepareSP(). + @param $var PHP variable to bind to. Can set to null (for isNull support). + @param $name Name of stored procedure variable name to bind to. + @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8. + @param [$maxLen] Holds an maximum length of the variable. + @param [$type] The data type of $var. Legal values depend on driver. + + See mssql_bind documentation at php.net. + */ + function Parameter(&$stmt, &$var, $name, $isOutput=false, $maxLen=4000, $type=false) + { + if (!$this->_has_mssql_init) { + ADOConnection::outp( "Parameter: mssql_bind only available since PHP 4.1.0"); + return $sql; + } + + $isNull = is_null($var); // php 4.0.4 and above... + + if ($type === false) + switch(gettype($var)) { + default: + case 'string': $type = SQLCHAR; break; + case 'double': $type = SQLFLT8; break; + case 'integer': $type = SQLINT4; break; + case 'boolean': $type = SQLINT1; break; # SQLBIT not supported in 4.1.0 + } + + if ($this->debug) { + ADOConnection::outp( "Parameter(\$stmt, \$php_var='$var', \$name='$name'); (type=$type)"); + } + return mssql_bind($stmt[1], '@'.$name, $var, $type, $isOutput, $isNull, $maxLen); + } + + /* + Unfortunately, it appears that mssql cannot handle varbinary > 255 chars + So all your blobs must be of type "image". + + Remember to set in php.ini the following... + + ; Valid range 0 - 2147483647. Default = 4096. + mssql.textlimit = 0 ; zero to pass through + + ; Valid range 0 - 2147483647. Default = 4096. + mssql.textsize = 0 ; zero to pass through + */ + function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') + { + $sql = "UPDATE $table SET $column=0x".bin2hex($val)." WHERE $where"; + return $this->Execute($sql) != false; + } + + // returns query ID if successful, otherwise false + function _query($sql,$inputarr) + { + $this->_errorMsg = false; + if (is_array($sql)) $rez = mssql_execute($sql[1]); + else $rez = mssql_query($sql,$this->_connectionID); + return $rez; + } + + // returns true or false + function _close() + { + if ($this->transCnt) $this->RollbackTrans(); + $rez = @mssql_close($this->_connectionID); + $this->_connectionID = false; + return $rez; + } + + // mssql uses a default date like Dec 30 2000 12:00AM + function UnixDate($v) + { + return ADORecordSet_array_mssql::UnixDate($v); + } + + function UnixTimeStamp($v) + { + return ADORecordSet_array_mssql::UnixTimeStamp($v); + } +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordset_mssql extends ADORecordSet { + + var $databaseType = "mssql"; + var $canSeek = true; + var $hasFetchAssoc; // see http://phplens.com/lens/lensforum/msgs.php?id=6083 + // _mths works only in non-localised system + + function ADORecordset_mssql($id,$mode=false) + { + // freedts check... + $this->hasFetchAssoc = function_exists('mssql_fetch_assoc'); + + if ($mode === false) { + global $ADODB_FETCH_MODE; + $mode = $ADODB_FETCH_MODE; + } + $this->fetchMode = $mode; + return $this->ADORecordSet($id,$mode); + } + + + function _initrs() + { + GLOBAL $ADODB_COUNTRECS; + $this->_numOfRows = ($ADODB_COUNTRECS)? @mssql_num_rows($this->_queryID):-1; + $this->_numOfFields = @mssql_num_fields($this->_queryID); + } + + + //Contributed by "Sven Axelsson" + // get next resultset - requires PHP 4.0.5 or later + function NextRecordSet() + { + if (!mssql_next_result($this->_queryID)) return false; + $this->_inited = false; + $this->bind = false; + $this->_currentRow = -1; + $this->Init(); + return true; + } + + /* Use associative array to get fields array */ + function Fields($colname) + { + if ($this->fetchMode != ADODB_FETCH_NUM) return $this->fields[$colname]; + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + + return $this->fields[$this->bind[strtoupper($colname)]]; + } + + /* Returns: an object containing field information. + Get column information in the Recordset object. fetchField() can be used in order to obtain information about + fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by + fetchField() is retrieved. */ + + function FetchField($fieldOffset = -1) + { + if ($fieldOffset != -1) { + return @mssql_fetch_field($this->_queryID, $fieldOffset); + } + else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */ + return @mssql_fetch_field($this->_queryID); + } + return null; + } + + function _seek($row) + { + return @mssql_data_seek($this->_queryID, $row); + } + + // speedup + function MoveNext() + { + if ($this->EOF) return false; + + $this->_currentRow++; + + if ($this->fetchMode & ADODB_FETCH_ASSOC) { + if ($this->fetchMode & ADODB_FETCH_NUM) { + //ADODB_FETCH_BOTH mode + $this->fields = @mssql_fetch_array($this->_queryID); + } + else { + if ($this->hasFetchAssoc) {// only for PHP 4.2.0 or later + $this->fields = @mssql_fetch_assoc($this->_queryID); + } else { + $flds = @mssql_fetch_array($this->_queryID); + if (is_array($flds)) { + $fassoc = array(); + foreach($flds as $k => $v) { + if (is_numeric($k)) continue; + $fassoc[$k] = $v; + } + $this->fields = $fassoc; + } else + $this->fields = false; + } + } + + if (is_array($this->fields)) { + if (ADODB_ASSOC_CASE == 0) { + foreach($this->fields as $k=>$v) { + $this->fields[strtolower($k)] = $v; + } + } else if (ADODB_ASSOC_CASE == 1) { + foreach($this->fields as $k=>$v) { + $this->fields[strtoupper($k)] = $v; + } + } + } + } else { + $this->fields = @mssql_fetch_row($this->_queryID); + } + if ($this->fields) return true; + $this->EOF = true; + + return false; + } + + + // INSERT UPDATE DELETE returns false even if no error occurs in 4.0.4 + // also the date format has been changed from YYYY-mm-dd to dd MMM YYYY in 4.0.4. Idiot! + function _fetch($ignore_fields=false) + { + if ($this->fetchMode & ADODB_FETCH_ASSOC) { + if ($this->fetchMode & ADODB_FETCH_NUM) { + //ADODB_FETCH_BOTH mode + $this->fields = @mssql_fetch_array($this->_queryID); + } else { + if ($this->hasFetchAssoc) // only for PHP 4.2.0 or later + $this->fields = @mssql_fetch_assoc($this->_queryID); + else { + $this->fields = @mssql_fetch_array($this->_queryID); + if (is_array($$this->fields)) { + $fassoc = array(); + foreach($$this->fields as $k => $v) { + if (is_integer($k)) continue; + $fassoc[$k] = $v; + } + $this->fields = $fassoc; + } + } + } + + if (!$this->fields) { + } else if (ADODB_ASSOC_CASE == 0) { + foreach($this->fields as $k=>$v) { + $this->fields[strtolower($k)] = $v; + } + } else if (ADODB_ASSOC_CASE == 1) { + foreach($this->fields as $k=>$v) { + $this->fields[strtoupper($k)] = $v; + } + } + } else { + $this->fields = @mssql_fetch_row($this->_queryID); + } + return $this->fields; + } + + /* close() only needs to be called if you are worried about using too much memory while your script + is running. All associated result memory for the specified result identifier will automatically be freed. */ + + function _close() + { + $rez = mssql_free_result($this->_queryID); + $this->_queryID = false; + return $rez; + } + // mssql uses a default date like Dec 30 2000 12:00AM + function UnixDate($v) + { + return ADORecordSet_array_mssql::UnixDate($v); + } + + function UnixTimeStamp($v) + { + return ADORecordSet_array_mssql::UnixTimeStamp($v); + } + +} + + +class ADORecordSet_array_mssql extends ADORecordSet_array { + function ADORecordSet_array_mssql($id=-1,$mode=false) + { + $this->ADORecordSet_array($id,$mode); + } + + // mssql uses a default date like Dec 30 2000 12:00AM + function UnixDate($v) + { + + if (is_numeric(substr($v,0,1)) && ADODB_PHPVER >= 0x4200) return parent::UnixDate($v); + + global $ADODB_mssql_mths,$ADODB_mssql_date_order; + + //Dec 30 2000 12:00AM + if ($ADODB_mssql_date_order == 'dmy') { + if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4})|" ,$v, $rr)) { + return parent::UnixDate($v); + } + if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0; + + $theday = $rr[1]; + $themth = substr(strtoupper($rr[2]),0,3); + } else { + if (!preg_match( "|^([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})|" ,$v, $rr)) { + return parent::UnixDate($v); + } + if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0; + + $theday = $rr[2]; + $themth = substr(strtoupper($rr[1]),0,3); + } + $themth = $ADODB_mssql_mths[$themth]; + if ($themth <= 0) return false; + // h-m-s-MM-DD-YY + return mktime(0,0,0,$themth,$theday,$rr[3]); + } + + function UnixTimeStamp($v) + { + + if (is_numeric(substr($v,0,1)) && ADODB_PHPVER >= 0x4200) return parent::UnixTimeStamp($v); + + global $ADODB_mssql_mths,$ADODB_mssql_date_order; + + //Dec 30 2000 12:00AM + if ($ADODB_mssql_date_order == 'dmy') { + if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|" + ,$v, $rr)) return parent::UnixTimeStamp($v); + if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0; + + $theday = $rr[1]; + $themth = substr(strtoupper($rr[2]),0,3); + } else { + if (!preg_match( "|^([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|" + ,$v, $rr)) return parent::UnixTimeStamp($v); + if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0; + + $theday = $rr[2]; + $themth = substr(strtoupper($rr[1]),0,3); + } + + $themth = $ADODB_mssql_mths[$themth]; + if ($themth <= 0) return false; + + switch (strtoupper($rr[6])) { + case 'P': + if ($rr[4]<12) $rr[4] += 12; + break; + case 'A': + if ($rr[4]==12) $rr[4] = 0; + break; + default: + break; + } + // h-m-s-MM-DD-YY + return mktime($rr[4],$rr[5],0,$themth,$theday,$rr[3]); + } +} + +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/toolbar/button.specialchar.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/ko.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/ko.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/ko.js (revision 13) @@ -0,0 +1,395 @@ +��/* + + * FCKeditor - The text editor for internet + + * Copyright (C) 2003 Frederico Caldeira Knabben + + * + + * Licensed under the terms of the GNU Lesser General Public License + + * (http://www.opensource.org/licenses/lgpl-license.php) + + * + + * For further information go to http://www.fredck.com/FCKeditor/ + + * or contact fckeditor@fredck.com. + + * + + * ko.js: Korean support. + + * + + * Authors: + + * Kwag, Taehwan (thkwag@nate.com) + + */ + + + +// Toolbar Items and Context Menu + + + +lang["Cut"] = "��|���0�" ; + +lang["Copy"] = "����X�0�" ; + +lang["Paste"] = "����#�0�" ; + +lang["PasteText"] = "MѤ¸�\� ����#�0�" ; + +lang["PasteWord"] = "MS Word ���<�\� ����#�0�" ; + +lang["Find"] = ">�0�" ; + +lang["SelectAll"] = "ȴ� ���" ; + +lang["RemoveFormat"] = "���� �ɰ�0�" ; + +lang["InsertLink"] = "X�t�|���l� ����/����" ; + +lang["RemoveLink"] = "X�t�|���l� ���" ; + +lang["InsertImage"] = "t����� ����/����" ; + +lang["InsertTable"] = "L�t�� ����/����" ; + +lang["InsertLine"] = "��� � ����" ; + +lang["InsertSpecialChar"] = "���8��� ����" ; + +lang["InsertSmiley"] = "D�t�X� ����" ; + +lang["About"] = "FCKeditor�� �X���" ; + + + +lang["Bold"] = "��XՌ�" ; + +lang["Italic"] = "t�Tѭ�" ; + +lang["Underline"] = "��" ; + +lang["StrikeThrough"] = "�͌� �" ; + +lang["Subscript"] = "DŘ� �̐�" ; + +lang["Superscript"] = "� �̐�" ; + +lang["LeftJustify"] = "|ƽ� �,�" ; + +lang["CenterJustify"] = "���p� �,�" ; + +lang["RightJustify"] = "$�x��� �,�" ; + +lang["BlockJustify"] = "�Ž� ޹��" ; + +lang["DecreaseIndent"] = "������0�" ; + +lang["IncreaseIndent"] = "�����0�" ; + +lang["Undo"] = "�͌�" ; + +lang["Redo"] = "���‰�" ; + +lang["NumberedList"] = "���ǔ� ��]�" ; + +lang["BulettedList"] = "���Ŕ� ��]�" ; + + + +lang["ShowTableBorders"] = "L�t�� L�P��� ��0�" ; + +lang["ShowDetails"] = "8��0�8� ��0�" ; + + + +lang["FontStyle"] = "����|�" ; + +lang["FontFormat"] = "����" ; + +lang["Font"] = "�Ӹ�" ; + +lang["FontSize"] = "��� l�0�" ; + +lang["TextColor"] = "��� ����" ; + +lang["BGColor"] = "0��� ����" ; + +lang["Source"] = "<b>HTML ����</b>" ; + + + +// Context Menu + + + +lang["EditLink"] = "X�D�|���l� ��" ; + +lang["InsertRow"] = "�\�� ����" ; + +lang["DeleteRows"] = "�\�� ���" ; + +lang["InsertColumn"] = "8�\�� ����" ; + +lang["DeleteColumns"] = "8�\�� ���" ; + +lang["InsertCell"] = "@� ����" ; + +lang["DeleteCells"] = "@� ���" ; + +lang["MergeCells"] = "@� i�X�0�" ; + +lang["SplitCell"] = "@� ���0�" ; + +lang["CellProperties"] = "@� ��1�" ; + +lang["TableProperties"] = "L�t�� ��1�" ; + +lang["ImageProperties"] = "t����� ��1�" ; + + + +// Alerts and Messages + + + +lang["ProcessingXHTML"] = "XHTML �̬��. ����̹ 0��$������”�." ; + +lang["Done"] = "D�̸" ; + +lang["PasteWordConfirm"] = "����#�0� `� MѤ¸Ҕ� MS Word��� ����\� ����Ȳ�. ����#�0� ��� ��g�D� ���X�� ���ȲL�?" ; + +lang["NotCompatiblePaste"] = "t� ��9�@� x�0�7�uǤ� �\�� 5.5 ��� t������̹ ��ٳi�Ȳ�. ��g�D� ���X��� J�� ����#�0� X�� ���ȲL�?" ; + + + +// Dialogs + +lang["DlgBtnOK"] = "�" ; + +lang["DlgBtnCancel"] = "D�Ȳ$�" ; + +lang["DlgBtnClose"] = "�0�" ; + + + +// Image Dialog + +lang["DlgImgTitleInsert"] = "t����� ����" ; + +lang["DlgImgTitleEdit"] = "t����� ��" ; + +lang["DlgImgBtnUpload"] = "���\� ȡ�" ; + +lang["DlgImgURL"] = "URL" ; + +lang["DlgImgUpload"] = "��\�ܴ" ; + +lang["DlgImgBtnBrowse"] = "t����� ��0�" ; + +lang["DlgImgAlt"] = "���� $���" ; + +lang["DlgImgWidth"] = "�D�" ; + +lang["DlgImgHeight"] = "��t�" ; + +lang["DlgImgLockRatio"] = "D�(� ���" ; + +lang["DlgBtnResetSize"] = "�Ƙ� l�0�\�" ; + +lang["DlgImgBorder"] = "L�P���" ; + +lang["DlgImgHSpace"] = "����,�" ; + +lang["DlgImgVSpace"] = "����,�" ; + +lang["DlgImgAlign"] = "�,�" ; + +lang["DlgImgAlignLeft"] = "|ƽ�" ; + +lang["DlgImgAlignAbsBottom"] = "�DŘ�(Abs Bottom)" ; + +lang["DlgImgAlignAbsMiddle"] = "���(Abs Middle)" ; + +lang["DlgImgAlignBaseline"] = "0�� �" ; + +lang["DlgImgAlignBottom"] = "DŘ�" ; + +lang["DlgImgAlignMiddle"] = "��" ; + +lang["DlgImgAlignRight"] = "$�x���" ; + +lang["DlgImgAlignTextTop"] = "����(Text Top)" ; + +lang["DlgImgAlignTop"] = "�" ; + +lang["DlgImgPreview"] = "������0�" ; + +lang["DlgImgMsgWrongExt"] = "�ȡ�i�Ȳ�. �L� U֥ǐ�|� ��� �|�̹ ��\�ܴ `� � �ǵ�Ȳ�. :\n\n" + config.ImageUploadAllowedExtensions + "\n\n����t� �͌���ŵ�Ȳ�." ; + +lang["DlgImgAlertSelect"] = "��\�ܴ `� t�����|� ���X����”�." ; // NEW + + + + + +// Link Dialog + +lang["DlgLnkWindowTitle"] = "��l�" ; // NEW + +lang["DlgLnkURL"] = "URL" ; + +lang["DlgLnkUpload"] = "��\�ܴ" ; + +lang["DlgLnkTarget"] = "���" ; + +lang["DlgLnkTargetNotSet"] = "<0����>" ; + +lang["DlgLnkTargetBlank"] = "New Window (_blank)" ; + +lang["DlgLnkTargetParent"] = "Parent Window (_parent)" ; + +lang["DlgLnkTargetSelf"] = "Same Window (_self)" ; + +lang["DlgLnkTargetTop"] = "Topmost Window (_top)" ; + +lang["DlgLnkTitle"] = "ȩ�" ; + +lang["DlgLnkBtnUpload"] = "��\�ܴ" ; + +lang["DlgLnkBtnBrowse"] = "ȥ�� �|� ��0�" ; + +lang["DlgLnkMsgWrongExtA"] = "�ȡ�i�Ȳ�. �L� U֥ǐ�|� ��� �|�̹ ��\�ܴ `� � �ǵ�Ȳ�. :\n\n" + config.LinkUploadAllowedExtensions + "\n\n����t� �͌���ŵ�Ȳ�." ; + +lang["DlgLnkMsgWrongExtD"] = "�ȡ�i�Ȳ�. �L� U֥ǐ�|� ��� �|�@� ��\�ܴ `� � �ŵ�Ȳ�. :\n\n" + config.LinkUploadDeniedExtensions + "\n\n����t� �͌���ŵ�Ȳ�." ; + + + +// Color Dialog + +lang["DlgColorTitle"] = "���� ���" ; + +lang["DlgColorBtnClear"] = " ��� �͌�" ; + +lang["DlgColorHighlight"] = "Highlight" ; + +lang["DlgColorSelected"] = "Selected" ; + + + +// Smiley Dialog + +lang["DlgSmileyTitle"] = "D�t�X� ����" ; + + + +// Special Character Dialog + +lang["DlgSpecialCharTitle"] = "���8��� ����" ; + + + +// Table Dialog + +lang["DlgTableTitleInsert"] = "L�t�� ����" ; + +lang["DlgTableTitleEdit"] = "L�t�� ��" ; + +lang["DlgTableRows"] = "�\��" ; + +lang["DlgTableColumns"] = "8�\��" ; + +lang["DlgTableBorder"] = "L�P���" ; + +lang["DlgTableAlign"] = "�,�" ; + +lang["DlgTableAlignNotSet"] = "<0����>" ; + +lang["DlgTableAlignLeft"] = "|ƽ�" ; + +lang["DlgTableAlignCenter"] = "���p�" ; + +lang["DlgTableAlignRight"] = "$�x���" ; + +lang["DlgTableWidth"] = "�D�" ; + +lang["DlgTableWidthPx"] = "=�@�" ; + +lang["DlgTableWidthPc"] = "%" ; + +lang["DlgTableHeight"] = "��t�" ; + +lang["DlgTableCellSpace"] = "@� ���" ; + +lang["DlgTableCellPad"] = "HŽ� ��1�" ; + +lang["DlgTableCaption"] = "��X�" ; + + + +// Table Cell Dialog + +lang["DlgCellTitle"] = "@� ��1�" ; + +lang["DlgCellWidth"] = "�D�" ; + +lang["DlgCellWidthPx"] = "=�@�" ; + +lang["DlgCellWidthPc"] = "%" ; + +lang["DlgCellHeight"] = "�D�" ; + +lang["DlgCellWordWrap"] = "��ܴ��" ; + +lang["DlgCellWordWrapNotSet"] = "<0����>" ; + +lang["DlgCellWordWrapYes"] = "�" ; + +lang["DlgCellWordWrapNo"] = "D�Ȳ$�" ; + +lang["DlgCellHorAlign"] = "��� �,�" ; + +lang["DlgCellHorAlignNotSet"] = "<0����>" ; + +lang["DlgCellHorAlignLeft"] = "|ƽ�" ; + +lang["DlgCellHorAlignCenter"] = "���p�" ; + +lang["DlgCellHorAlignRight"] = "$�x���" ; + +lang["DlgCellVerAlign"] = "����,�" ; + +lang["DlgCellVerAlignNotSet"] = "<0����>" ; + +lang["DlgCellVerAlignTop"] = "�" ; + +lang["DlgCellVerAlignMiddle"] = "��" ; + +lang["DlgCellVerAlignBottom"] = "DŘ�" ; + +lang["DlgCellVerAlignBaseline"] = "0�� �" ; + +lang["DlgCellRowSpan"] = "Rows Span" ; + +lang["DlgCellCollSpan"] = "Columns Span" ; + +lang["DlgCellBackColor"] = "0��� ����" ; + +lang["DlgCellBorderColor"] = "L�ܴ�� ����" ; + +lang["DlgCellBtnSelect"] = " ���" ; + + + +// About Dialog + +lang["DlgAboutVersion"] = "version" ; + +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; + +lang["DlgAboutInfo"] = "For further information go to" ; \ No newline at end of file Index: trunk/admin/editor/FCKeditor/js/fck_editor.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_editor.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_editor.js (revision 13) @@ -0,0 +1,619 @@ +/* + + * FCKeditor - The text editor for internet + + * Copyright (C) 2003 Frederico Caldeira Knabben + + * + + * Licensed under the terms of the GNU Lesser General Public License + + * (http://www.opensource.org/licenses/lgpl-license.php) + + * + + * For further information go to http://www.fredck.com/FCKeditor/ + + * or contact fckeditor@fredck.com. + + * + + * fck_editor.js: Main script that initializes the editor. + + * + + * Authors: + + * Frederico Caldeira Knabben (fckeditor@fredck.com) + + */ + + + +var bInitialized = false ; + +var bDataLoaded = false ; + + + +function initEditor() + +{ + + if (! bInitialized) + + { + + bInitialized = true ; + + + + loadToolbarSet() ; + + loadToolbarSourceSet() ; + + + + objContent.BaseURL = config.BaseUrl ; + + } + + + + if (! bDataLoaded && ! objContent.Busy) + + { + + bDataLoaded = true ; + + + + objContent.DOM.body.onpaste = onPaste ; + + objContent.DOM.body.ondrop = onDrop ; + + + + objContent.DOM.body.onkeydown = onKeyDown ; + + + + objContent.ShowBorders = config.StartupShowBorders ; + + objContent.ShowDetails = config.StartupShowDetails ; + + + + //alert(config.EditorAreaCSS); + + objContent.DOM.createStyleSheet(config.EditorAreaCSS) ; + + setLinkedField() ; + + setTimeout("loadStylesheet()",1000); + + } + +} + + + +// Method: loadToolbarSet() + +// Description: Loads a toobar buttons set from an array inside the Toolbar holder. + +// Author: FredCK + +function loadToolbarSet() + +{ + + var sToolBarSet = URLParams["Toolbar"] == null ? "Default" : URLParams["Toolbar"] ; + + + + // FredCK: Toobar holder (DIV) + + var oToolbarHolder = document.getElementById("divToolbar") ; + + + + var oToolbar = new TBToolbar() ; + + oToolbar.LoadButtonsSet( sToolBarSet ) ; + + oToolbarHolder.innerHTML = oToolbar.GetHTML() ; + + + +} + + + +function loadToolbarSourceSet() + +{ + + // FredCK: Toobar holder (DIV) + + var oToolbarHolder = document.getElementById("divToolbarSource") ; + + + + var oToolbar = new TBToolbar() ; + + oToolbar.LoadButtonsSet( "Source" ) ; + + oToolbarHolder.innerHTML = oToolbar.GetHTML() ; + +} + + + +function switchEditMode() + +{ + + var bSource = (trSource.style.display == "none") ; + + + + if (bSource) + + txtSource.value = objContent.DOM.body.innerHTML ; + + else + + { + + objContent.DOM.body.innerHTML = "
     
    " + txtSource.value ; + + objContent.DOM.getElementById('__tmpFCKRemove__').removeNode(true) ; + + } + + + + trEditor.style.display = bSource ? "none" : "inline" ; + + trSource.style.display = bSource ? "inline" : "none" ; + + + + events.fireEvent('onViewMode', bSource) ; + +} + + + +// setValue(): called from reset() to make a select list show the current font + +// or style attributes + +function selValue(el, str, text) + +{ + + //if (!RichEditor.txtView) return; // Disabled in View Source mode + + for (var i = 0; i < el.length; i++) + + { + + if (((text || !el[i].value) && el[i].text == str) || ((!text || el[i].value) && el[i].value == str)) + + { + + el.selectedIndex = i; + + return; + + } + + } + + el.selectedIndex = 0; + +} + + + +var oLinkedField = null ; + +function setLinkedField() + +{ + + if (! URLParams['FieldName']) return ; + + + + oLinkedField = parent.document.getElementsByName(URLParams['FieldName'])[0] ; + + + + if (! oLinkedField) return ; + + + + // __tmpFCKRemove__ added and removed to solve DHTML component error when loading "


    " + + objContent.DOM.body.innerHTML = "
     
    " + oLinkedField.value ; + + objContent.DOM.getElementById('__tmpFCKRemove__').removeNode(true) ; + + + + var oForm = oLinkedField.form ; + + + + if (!oForm) return ; + + + + // Attaches the field update to the onsubmit event + + oForm.attachEvent("onsubmit", setFieldValue) ; + + + + // Attaches the field update to the submit method (IE doesn't fire onsubmit on this case) + + if (! oForm.updateFCKEditor) oForm.updateFCKEditor = new Array() ; + + oForm.updateFCKEditor[oForm.updateFCKEditor.length] = setFieldValue ; + + if (! oForm.originalSubmit) + + { + + oForm.originalSubmit = oForm.submit ; + + oForm.submit = function() + + { + + if (this.updateFCKEditor) + + { + + for (var i = 0 ; i < this.updateFCKEditor.length ; i++) + + { + + this.updateFCKEditor[i]() ; + + } + + } + + this.originalSubmit() ; + + } + + } + +} + + + +function setFieldValue() + +{ + + if (trSource.style.display != "none") + + { + + switchEditMode() ; + + } + + + + if (config.EnableXHTML) + + { + + window.status = lang["ProcessingXHTML"] ; + + oLinkedField.value = getXhtml( objContent.DOM.body ) ; + + window.status = 'Done' ; + + } + + else + + oLinkedField.value = objContent.DOM.body.innerHTML ; + +} + + + +function onPaste() + +{ + + if (config.ForcePasteAsPlainText) + + { + + pastePlainText() ; + + return false ; + + } + + else if (config.AutoDetectPasteFromWord && BrowserInfo.IsIE55OrMore) + + { + + var sHTML = GetClipboardHTML() ; + + var re = /<\w[^>]* class="?MsoNormal"?/gi ; + + if ( re.test( sHTML ) ) + + { + + if ( confirm( lang["PasteWordConfirm"] ) ) + + { + + cleanAndPaste( sHTML ) ; + + return false ; + + } + + } + + } + + else + + return true ; + +} + + + +function onDrop() + +{ + + if (config.ForcePasteAsPlainText) + + { + + var sText = HTMLEncode( objContent.DOM.parentWindow.event.dataTransfer.getData("Text") ) ; + + sText = sText.replace(/\n/g,'
    ') ; + + insertHtml(sText) ; + + return false ; + + } + + else if (config.AutoDetectPasteFromWord && BrowserInfo.IsIE55OrMore) + + { + + // TODO + + // To find a way to get the HTML that is dropped, + + // clean it and insert it into the document. + + return true ; + + } + + else + + return true ; + +} + + + +function onKeyDown() + +{ + + var oWindow = objContent.DOM.parentWindow ; + + + + if ( oWindow.event.ctrlKey || oWindow.event.altKey || oWindow.event.shiftKey ) + + { + + oWindow.event.returnValue = true ; + + return ; + + } + + + + if ( oWindow.event.keyCode == 9 && config.TabSpaces > 0 ) // added tab support + + { + + var sSpaces = "" ; + + for ( i = 0 ; i < config.TabSpaces ; i++ ) + + sSpaces += " " ; + + insertHtml( sSpaces ) ; + + } + + else if ( oWindow.event.keyCode == 13 && config.UseBROnCarriageReturn ) + + { + + if ( objContent.DOM.queryCommandState( 'InsertOrderedList' ) || objContent.DOM.queryCommandState( 'InsertUnorderedList' ) ) + + { + + oWindow.event.returnValue = true ; + + return ; + + } + + + + insertHtml("
     ") ; + + + + var oRange = objContent.DOM.selection.createRange() ; + + oRange.moveStart('character',-1) ; + + oRange.select() ; + + objContent.DOM.selection.clear() ; + + + + oWindow.event.returnValue = false ; + + } + +} + + + +function loadStylesheet() + +{ + + var a,b; + + var styleList = new Array(); + + + + passedValue = objContent.DOM.styleSheets; + + + + for (var i = 0; passedValue && i < passedValue.length; i++) + + { + + for (var j = 0; j < passedValue[i].rules.length; j++) + + { + + // Extract the rule and the rule definition from the passed style + + // data. + + a = passedValue[i].rules[j].selectorText.toString(); + + b = passedValue[i].rules[j].style.cssText; + + //alert(a + " --> " + b); + + //document.body.innerHTML += a + " --> " + b + "
    "; + + // Ignore non-style entries + + if (!a || !b) continue; + + + + // Id: These are added to the document style sheet but are not + + // available in the style dropdown + + if (a.indexOf("#") != -1) + + { + + continue; + + } + + + + // Class: Append a cless element to the style list + + if (a.indexOf(".") == 0) + + { + + styleList[styleList.length] = [a.substr(1), "Class " + a, 1]; + + //alert('Adding class '+a); + + } + + + + // SubClass: Append the sub-class to the style list + + else if(a.indexOf(".") > 0) + + { + + l = a.split("."); + + styleList[styleList.length] = [l[1], a, 1]; + + } + + + + // Otherwise, assume it's a tag and select the existing tag entry + + // in the style list. + + else + + { + + styleList[styleList.length] = [a, a.toLowerCase(), 1]; + + } + + } + + } + + + + for (var i = 0; i < styleList.length; i++) + + { + + var oOption = document.createElement("OPTION"); + + if (styleList[i][0]) oOption.value = styleList[i][0]; + + oOption.text = styleList[i][1]; + + oOption.style.backgroundColor = 'white'; + + // Choose the combobox, in this case cmbFontStyle + + if(document.all.cmbFontStyle) + + { + + document.all.cmbFontStyle.add(oOption); + + } + + } + +} \ No newline at end of file Index: trunk/themes/default/relcats_element.tpl =================================================================== diff -u --- trunk/themes/default/relcats_element.tpl (revision 0) +++ trunk/themes/default/relcats_element.tpl (revision 13) @@ -0,0 +1,16 @@ + + + + + + + + + + + + +
    ">

    "> ( ) + +
      
    ( )
    +
    Index: trunk/themes/default/img/ic_search_big.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/wink.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/icon_user_sm.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/divider_left_sel.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/image.php =================================================================== diff -u --- trunk/kernel/include/image.php (revision 0) +++ trunk/kernel/include/image.php (revision 13) @@ -0,0 +1,1122 @@ +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 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"); + if(strlen($p)) + { + $parts = pathinfo($pathtoroot.$p); + $d = $parts["dirname"]."/"; + } + + if($this->Pending) + $d .= "pending/"; + + return $d; + } + + + function Delete() + { + $this->DeleteLocalImage(); + parent::Delete(); + } + + 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()."
    "; + + 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(); +// echo "FULL: $filename
    \n"; + @unlink($filename); + } + } + + if($Thumb) + { + if($this->LocalThumbExists()) + { + $filename = $this->GetImageDir().$this->GetFileName(1); +// echo "THUMB: $filename
    \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/")) + { + $parts = pathinfo($file["name"]); + $ext = strtolower($parts["extension"]); + + if((int)$_GLOBALS["debuglevel"]) + echo "Processing ".$file["tmp_name"]."
    \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((int)$_GLOBALS["debuglevel"]) + echo $file["tmp_name"]."=>".$destination."
    \n"; + if(IsUpload==TRUE) + { + $result = @move_uploaded_file($file["tmp_name"],$destination); + } + else + $result = copy($file["tmp_name"],$destination); + if($result) + { + 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
    "; +// echo "THUMB PATH: $ThumbPath
    "; + + if(strlen($ThumbPath)) + { + if(file_exists($ThumbPath)) + { + $p = pathinfo($ThumbPath); + $d = $dest.$p["basename"]; + if(file_exists($d)) + unlink($d); + copy($ThumbPath,$d); + } + } + + + if(strlen($FullPath)) + { + if(file_exists($FullPath)) + { + $p = pathinfo($FullPath); + $d = $dest.$p["basename"]; + if(file_exists($d)) + unlink($d); + copy($FullPath,$d); + } + } + } + + 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); + + 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); + unlink($pathtoroot.$FullPath); + } + } + } + } + + function DeleteFromPending() + { + $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")); + } + } + + function FullURL($ForceNoThumb=FALSE,$Default="kernel/images/noimage.gif") + { + global $rootURL, $objConfig,$pathtoroot; + + if($this->Get("SameImages") && !$ForceNoThumb) + 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); + } +} + +class clsImageList extends clsItemCollection +{ + var $Page; + var $PerPageVar; + + function clsImageList() + { + $this->clsItemCollection(); + $this->PerPageVar = "Perpage_Images"; + $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."
    \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) + { + 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); + $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 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) + { + $found = FALSE; + foreach($this->Items as $img) + { + if($img->Get("ResourceId")==$ResourceId && $img->Get("Name")==$name) + { + $found=TRUE; + break; + } + } + if($found) + { + return $img; + } + else + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=$ResourceId AND Name LIKE '$name'"; + //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 $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)."
    \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")."
    "; + + ## 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")."
    "; + + if (strlen($set)) + { + $sql = "UPDATE $edit_table $set WHERE ImageId=$ImageId"; + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + $this->adodbConnection->Execute($sql); + } + } + } + + function CopyFromEditTable($idfield) + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + $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); + } + + function PurgeEditTable($idfield) + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + $this->DeletePendingFiles($edit_table); + @$this->adodbConnection->Execute("DROP TABLE $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*/ + +?> Index: trunk/admin/install/lang_default.php =================================================================== diff -u --- trunk/admin/install/lang_default.php (revision 0) +++ trunk/admin/install/lang_default.php (revision 13) @@ -0,0 +1,48 @@ + +  Select Default Language

    + + + + + + + +
     Step - Select Default Language
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_deny_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/backup/restore1.php =================================================================== diff -u --- trunk/admin/backup/restore1.php (revision 0) +++ trunk/admin/backup/restore1.php (revision 13) @@ -0,0 +1,190 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$adminURL = $rootURL.$admin; +$localURL=$rootURL."kernel/"; +$imagesURL = $rootURL."admin/images"; +//admin only util +$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"); +//Set Section +$section = "in-portal:restore"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); +global $tables; +unset($tables); + + +if($_POST["Action"]=="update") +{ + $newpath= $_POST["backup_path"]; + $newpath = str_replace('\\\\','\\',$newpath); + $objConfig->Set("Backup_Path",$newpath); + $objConfig->Save(); + +} +$filepath=$objConfig->Get("Backup_Path"); + +$limit = 100; +$success =0; + +$objSession->SetVariable("restore_filepath",$filepath); +$objSession->SetVariable("restore_success",0); +$objSession->SetVariable("restore_todo",""); + +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); + +if (true) +{ + + if($en_prev>-1) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + $onClick= $sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_prev"; + $link=$PHP_SELF.$var; + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + else + { + $MouseOver=""; + $MouseOut=""; + $onClick=""; + $link="#"; + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),"#","","","","tool_prev_f3.gif"); + + } + if(true) + { + $MouseOver="if (document.restore1.agree.checked == true) swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="if (document.restore1.agree.checked == true) swap('moveright', 'toolbar/tool_next.gif');"; + + + $var="?env=".BuildEnv()."&en=$en_next"; + $link2=$rootURL."admin/backup/restore2.php".$var; + $onClick="document.location= '$link2';"; + $onClick="if (document.restore1.agree.checked == true) document.restore1.submit();"; + + + $link="#"; + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif"); + } + + int_header($objCatToolBar,NULL,$title); +} +$SubmitUrl = $adminURL."/install.php"; +?> + +
    + + +$p) + { + + echo "\n"; + $checked = ""; + } +?> + + + + + +
    "; + echo ""; + echo $p; + echo "


    +
    + + + + + + + +
    +
    + + + > + + + + > + + + + + > + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    + Index: trunk/admin/images/itemicons/icon16_search_dropdown.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_catalog.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.selectall.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/js/dhtmled.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/dhtmled.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/dhtmled.js (revision 13) @@ -0,0 +1,83 @@ +// DHTML Editing Component Constants for JavaScript +// Copyright 1998 Microsoft Corporation. All rights reserved. + +// +// Command IDs +// +DECMD_BOLD = 5000 +DECMD_COPY = 5002 +DECMD_CUT = 5003 +DECMD_DELETE = 5004 +DECMD_DELETECELLS = 5005 +DECMD_DELETECOLS = 5006 +DECMD_DELETEROWS = 5007 +DECMD_FINDTEXT = 5008 +DECMD_FONT = 5009 +DECMD_GETBACKCOLOR = 5010 +DECMD_GETBLOCKFMT = 5011 +DECMD_GETBLOCKFMTNAMES = 5012 +DECMD_GETFONTNAME = 5013 +DECMD_GETFONTSIZE = 5014 +DECMD_GETFORECOLOR = 5015 +DECMD_HYPERLINK = 5016 +DECMD_IMAGE = 5017 +DECMD_INDENT = 5018 +DECMD_INSERTCELL = 5019 +DECMD_INSERTCOL = 5020 +DECMD_INSERTROW = 5021 +DECMD_INSERTTABLE = 5022 +DECMD_ITALIC = 5023 +DECMD_JUSTIFYCENTER = 5024 +DECMD_JUSTIFYLEFT = 5025 +DECMD_JUSTIFYRIGHT = 5026 +DECMD_LOCK_ELEMENT = 5027 +DECMD_MAKE_ABSOLUTE = 5028 +DECMD_MERGECELLS = 5029 +DECMD_ORDERLIST = 5030 +DECMD_OUTDENT = 5031 +DECMD_PASTE = 5032 +DECMD_REDO = 5033 +DECMD_REMOVEFORMAT = 5034 +DECMD_SELECTALL = 5035 +DECMD_SEND_BACKWARD = 5036 +DECMD_BRING_FORWARD = 5037 +DECMD_SEND_BELOW_TEXT = 5038 +DECMD_BRING_ABOVE_TEXT = 5039 +DECMD_SEND_TO_BACK = 5040 +DECMD_BRING_TO_FRONT = 5041 +DECMD_SETBACKCOLOR = 5042 +DECMD_SETBLOCKFMT = 5043 +DECMD_SETFONTNAME = 5044 +DECMD_SETFONTSIZE = 5045 +DECMD_SETFORECOLOR = 5046 +DECMD_SPLITCELL = 5047 +DECMD_UNDERLINE = 5048 +DECMD_UNDO = 5049 +DECMD_UNLINK = 5050 +DECMD_UNORDERLIST = 5051 +DECMD_PROPERTIES = 5052 + +// +// Enums +// + +// OLECMDEXECOPT +OLECMDEXECOPT_DODEFAULT = 0 +OLECMDEXECOPT_PROMPTUSER = 1 +OLECMDEXECOPT_DONTPROMPTUSER = 2 + +// DHTMLEDITCMDF +DECMDF_NOTSUPPORTED = 0 +DECMDF_DISABLED = 1 +DECMDF_ENABLED = 3 +DECMDF_LATCHED = 7 +DECMDF_NINCHED = 11 + +// DHTMLEDITAPPEARANCE +DEAPPEARANCE_FLAT = 0 +DEAPPEARANCE_3D = 1 + +// OLE_TRISTATE +OLE_TRISTATE_UNCHECKED = 0 +OLE_TRISTATE_CHECKED = 1 +OLE_TRISTATE_GRAY = 2 \ No newline at end of file Index: trunk/admin/icons/icon24_link_editor.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-pager.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-pager.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-pager.inc.php (revision 13) @@ -0,0 +1,289 @@ + implemented Render_PageLinks(). + + Please note, this class is entirely unsupported, + and no free support requests except for bug reports + will be entertained by the author. + + My company also sells a commercial pagination + object at http://phplens.com/ with much more + functionality, including search, create, edit, + delete records. +*/ +class ADODB_Pager { + var $id; // unique id for pager (defaults to 'adodb') + var $db; // ADODB connection object + var $sql; // sql used + var $rs; // recordset generated + var $curr_page; // current page number before Render() called, calculated in constructor + var $rows; // number of rows per page + var $linksPerPage=10; // number of links per page in navigation bar + var $showPageLinks; + + var $gridAttributes = 'width=100% border=1 bgcolor=white'; + + // Localize text strings here + var $first = '|<'; + var $prev = '<<'; + var $next = '>>'; + var $last = '>|'; + var $moreLinks = '...'; + var $startLinks = '...'; + var $gridHeader = false; + var $htmlSpecialChars = true; + var $page = 'Page'; + var $linkSelectedColor = 'red'; + var $cache = 0; #secs to cache with CachePageExecute() + + //---------------------------------------------- + // constructor + // + // $db adodb connection object + // $sql sql statement + // $id optional id to identify which pager, + // if you have multiple on 1 page. + // $id should be only be [a-z0-9]* + // + function ADODB_Pager(&$db,$sql,$id = 'adodb', $showPageLinks = false) + { + global $HTTP_SERVER_VARS,$PHP_SELF,$HTTP_SESSION_VARS,$HTTP_GET_VARS; + + $curr_page = $id.'_curr_page'; + if (empty($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; + + $this->sql = $sql; + $this->id = $id; + $this->db = $db; + $this->showPageLinks = $showPageLinks; + + $next_page = $id.'_next_page'; + + if (isset($HTTP_GET_VARS[$next_page])) { + $HTTP_SESSION_VARS[$curr_page] = $HTTP_GET_VARS[$next_page]; + } + if (empty($HTTP_SESSION_VARS[$curr_page])) $HTTP_SESSION_VARS[$curr_page] = 1; ## at first page + + $this->curr_page = $HTTP_SESSION_VARS[$curr_page]; + + } + + //--------------------------- + // Display link to first page + function Render_First($anchor=true) + { + global $PHP_SELF; + if ($anchor) { + ?> + first;?>   + first   "; + } + } + + //-------------------------- + // Display link to next page + function render_next($anchor=true) + { + global $PHP_SELF; + + if ($anchor) { + ?> + next;?>   + next   "; + } + } + + //------------------ + // Link to last page + // + // for better performance with large recordsets, you can set + // $this->db->pageExecuteCountRows = false, which disables + // last page counting. + function render_last($anchor=true) + { + global $PHP_SELF; + + if (!$this->db->pageExecuteCountRows) return; + + if ($anchor) { + ?> + last;?>   + last   "; + } + } + + //--------------------------------------------------- + // original code by "Pablo Costa" + function render_pagelinks() + { + global $PHP_SELF; + $pages = $this->rs->LastPageNo(); + $linksperpage = $this->linksPerPage ? $this->linksPerPage : $pages; + for($i=1; $i <= $pages; $i+=$linksperpage) + { + if($this->rs->AbsolutePage() >= $i) + { + $start = $i; + } + } + $numbers = ''; + $end = $start+$linksperpage-1; + $link = $this->id . "_next_page"; + if($end > $pages) $end = $pages; + + + if ($this->startLinks && $start > 1) { + $pos = $start - 1; + $numbers .= "$this->startLinks "; + } + + for($i=$start; $i <= $end; $i++) { + if ($this->rs->AbsolutePage() == $i) + $numbers .= "linkSelectedColor>$i "; + else + $numbers .= "$i "; + + } + if ($this->moreLinks && $end < $pages) + $numbers .= "$this->moreLinks "; + print $numbers . '   '; + } + // Link to previous page + function render_prev($anchor=true) + { + global $PHP_SELF; + if ($anchor) { + ?> + prev;?>   + prev   "; + } + } + + //-------------------------------------------------------- + // Simply rendering of grid. You should override this for + // better control over the format of the grid + // + // We use output buffering to keep code clean and readable. + function RenderGrid() + { + global $gSQLBlockRows; // used by rs2html to indicate how many rows to display + include_once(ADODB_DIR.'/tohtml.inc.php'); + ob_start(); + $gSQLBlockRows = $this->rows; + rs2html($this->rs,$this->gridAttributes,$this->gridHeader,$this->htmlSpecialChars); + $s = ob_get_contents(); + ob_end_clean(); + return $s; + } + + //------------------------------------------------------- + // Navigation bar + // + // we use output buffering to keep the code easy to read. + function RenderNav() + { + ob_start(); + if (!$this->rs->AtFirstPage()) { + $this->Render_First(); + $this->Render_Prev(); + } else { + $this->Render_First(false); + $this->Render_Prev(false); + } + if ($this->showPageLinks){ + $this->Render_PageLinks(); + } + if (!$this->rs->AtLastPage()) { + $this->Render_Next(); + $this->Render_Last(); + } else { + $this->Render_Next(false); + $this->Render_Last(false); + } + $s = ob_get_contents(); + ob_end_clean(); + return $s; + } + + //------------------- + // This is the footer + function RenderPageCount() + { + if (!$this->db->pageExecuteCountRows) return ''; + $lastPage = $this->rs->LastPageNo(); + if ($lastPage == -1) $lastPage = 1; // check for empty rs. + return "$this->page ".$this->curr_page."/".$lastPage.""; + } + + //----------------------------------- + // Call this class to draw everything. + function Render($rows=10) + { + global $ADODB_COUNTRECS; + + $this->rows = $rows; + + $savec = $ADODB_COUNTRECS; + if ($this->db->pageExecuteCountRows) $ADODB_COUNTRECS = true; + if ($this->cache) + $rs = &$this->db->CachePageExecute($this->cache,$this->sql,$rows,$this->curr_page); + else + $rs = &$this->db->PageExecute($this->sql,$rows,$this->curr_page); + $ADODB_COUNTRECS = $savec; + + $this->rs = &$rs; + if (!$rs) { + print "

    Query failed: $this->sql

    "; + return; + } + + if (!$rs->EOF && (!$rs->AtFirstPage() || !$rs->AtLastPage())) + $header = $this->RenderNav(); + else + $header = " "; + + $grid = $this->RenderGrid(); + $footer = $this->RenderPageCount(); + $rs->Close(); + $this->rs = false; + + $this->RenderLayout($header,$grid,$footer); + } + + //------------------------------------------------------ + // override this to control overall layout and formating + function RenderLayout($header,$grid,$footer,$attributes='border=1 bgcolor=beige') + { + echo "
    ", + $header, + "
    ", + $grid, + "
    ", + $footer, + "
    "; + } +} + + +?> Index: trunk/admin/relation_select.php =================================================================== diff -u --- trunk/admin/relation_select.php (revision 0) +++ trunk/admin/relation_select.php (revision 13) @@ -0,0 +1,402 @@ +
    "; + +//$pathtoroot=""; +if(!strlen($pathtoroot)) +{ + $path=dirname(realpath($_SERVER['SCRIPT_FILENAME'])); + if(strlen($path)) + { + /* determine the OS type for path parsing */ + $pos = strpos($path,":"); + if ($pos === false) + { + $gOS_TYPE="unix"; + $pathchar = "/"; + } + else + { + $gOS_TYPE="win"; + $pathchar="\\"; + } + $p = $path.$pathchar; + /*Start looking for the root flag file */ + while(!strlen($pathtoroot) && strlen($p)) + { + $sub = substr($p,strlen($pathchar)*-1); + if($sub==$pathchar) + { + $filename = $p."root.flg"; + } + else + $filename = $p.$pathchar."root.flg"; + if(file_exists($filename)) + { + $pathtoroot = $p; + } + else + { + $parent = realpath($p.$pathchar."..".$pathchar); + if($parent!=$p) + { + $p = $parent; + } + else + $p = ""; + } + } + if(!strlen($pathtoroot)) + $pathtoroot = ".".$pathchar; + } + else + { + $pathtoroot = ".".$pathchar; + } +} + +$sub = substr($pathtoroot,strlen($pathchar)*-1); +if($sub!=$pathchar) +{ + $pathtoroot = $pathtoroot.$pathchar; +} +//echo $pathtoroot; + +require_once($pathtoroot."kernel/startup.php"); + +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; + +$adminURL = $rootURL.$admin; + +$imagesURL = $adminURL."/images"; +$browseURL = $adminURL."/browse"; +$cssURL = $adminURL."/include"; + +$m_var_list_update["cat"] = 0; +$homeURL = $_SERVER["PHP_SELF"]."?env=".BuildEnv(); + +unset($m_var_list_update["cat"]); + +$envar = "env=" . BuildEnv(); + +if($objCatList->CurrentCategoryID()>0) +{ + $c = $objCatList->CurrentCat(); + $upURL = $c->Admin_Parent_Link(); +} +else + $upURL = $_SERVER["PHP_SELF"]."?".$envar; + + + +//admin only util + +$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."/browse/toolbar.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot.$value."admin/include/parser.php"; + if(file_exists($path)) + { + //echo ""; + @include_once($path); + } +} + +//Set Section +$section = 'in-portal:editcategory_relationselect'; + +$Selector = GetVar('Selector'); +if(!$Selector) $Selector = 'checkbox'; +//Set Environment Variable + +//echo $objCatList->ItemsOnClipboard()." Categories on the clipboard
    \n"; +//echo $objTopicList->ItemsOnClipboard()." Topics on the clipboard
    \n"; +//echo $objLinkList->ItemsOnClipboard()." Links on the clipboard
    \n"; +//echo $objArticleList->ItemsOnClipboard()." Articles on the clipboard
    \n"; + +$SearchType = $objSession->GetVariable("SearchType"); +if(!strlen($SearchType)) + $SearchType = "Categories"; +$SearchLabel = "la_SearchLabel"; + +/* page header */ +print << + + In-portal + + + + +END; + + require_once($pathtoroot.$admin."/include/mainscript.php"); +load_module_styles(); +print << + + + + + + +END; +int_SectionHeader(); +?> +
    + + + + + + +
    +
    + " ImagePath=""> + " ImagePath=""> + "> + " ImagePath=""> + " ImagePath=""> + "> + " ImagePath=""> +
    +
    + + + + + + + +
    + + +
    " NAME="admin_search" ID="admin_search"> + "> + "> + + + + + + +
     /icon16_search.gif" alt="" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" src="/arrow16.gif" onmouseover="this.src='/icon16_search_f2.gif'" onmouseout="this.src='/icon16_search.gif'" style="cursor:hand" width="22" width="22"><?php echo admin_language(" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" src="/arrow16.gif" onmouseover="this.src='/arrow16_f2.gif'" onmouseout="this.src='/arrow16.gif'" style="cursor:hand"> + /icon16_search_reset.gif" alt="" align="absMiddle" onclick="this.action = this.getAttribute('action'); actionHandler(this);" onmouseover="this.src='/icon16_search_reset_f2.gif'" onmouseout="this.src='/icon16_search_reset.gif'" style="cursor:hand" width="22" width="22">  +
    +
    + +
    +
    + + +Clear(); + $OrderBy = $objCatList->QueryOrderByClause(TRUE,TRUE,TRUE); + if($SearchType=="categories" || $SearchType="all") + { + $list = $objSession->GetVariable("SearchWord"); + $SearchQuery = $objCatList->AdminSearchWhereClause($list); + if(strlen($SearchQuery)) + { + $SearchQuery = " (".$SearchQuery.") "; + $objCatList->LoadCategories($SearchQuery.$CategoryFilter,$OrderBy); + } + else + $objCatList->LoadCategories("ParentId=".$objCatList->CurrentCategoryID()." ".$CategoryFilter,$OrderBy); + } + else + $objCatList->LoadCategories("ParentId=".$objCatList->CurrentCategoryID()." ".$CategoryFilter,$OrderBy); +?> + + + + + + + +
    + + + + + +
    + : (QueryItemCount; ?>)    
    +
     
    +
    +
    +
    +
    + +
    +
    + + CurrentCategoryID(),"cat_select_element.tpl"); ?> +
    +
    + +
    + TabRow(); + ?> +
    +
    + $value) + { + $path = $pathtoroot.$value."admin/relation_select.php"; + if(file_exists($path)) + { + echo "\n\n"; + include_once($path); + } + } + ?> +
    " name="viewmenu"> + + + + +
    +
    + + + Index: trunk/admin/images/summary/overviewbox_cl.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/js/fck_displaychange.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_displaychange.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_displaychange.js (revision 13) @@ -0,0 +1,103 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_displaychange.js: Functions fired on the editor's change event. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +var oFontStyle ; +var oFontFormatCombo ; +var oFontNameCombo ; +var oFontSizeCombo ; + +function checkDecCommand(cmdId) +{ + if (objContent.Busy) return OLE_TRISTATE_GRAY ; + switch (objContent.QueryStatus(cmdId)) + { + case (DECMDF_DISABLED || DECMDF_NOTSUPPORTED) : + return OLE_TRISTATE_GRAY ; + case (DECMDF_ENABLED || DECMDF_NINCHED) : + return OLE_TRISTATE_UNCHECKED ; + default : // DECMDF_LATCHED + return OLE_TRISTATE_CHECKED ; + } +} + +function checkDocCommand(command) +{ + if (objContent.Busy) return OLE_TRISTATE_GRAY ; + return (objContent.DOM && objContent.DOM.queryCommandValue(command)) ; +} + +function checkShowTableBorders() +{ + return objContent.ShowBorders ; +} + +function checkShowDetails() +{ + return objContent.ShowDetails ; +} + +function CheckStyle(comboName) +{ + if (oFontStyle == null) oFontStyle = document.getElementById(comboName) ; + //CheckComboValue(oFontFormatCombo,DECMD_GETBLOCKFMT) ; +} + +function CheckFontFormat(comboName) +{ + if (oFontFormatCombo == null) oFontFormatCombo = document.getElementById(comboName) ; + + // Load all available Format Block options + if (oFontFormatCombo.options.length == 0) + { + if (!FCKFormatBlockNames) loadFormatBlockNames() ; + + for (var i = 0 ; i < FCKFormatBlockNames.length ; i++) + { + oFontFormatCombo.options[oFontFormatCombo.options.length] = new Option(FCKFormatBlockNames[i], FCKFormatBlockNames[i]) ; + } + } + + CheckComboValue(oFontFormatCombo,DECMD_GETBLOCKFMT) ; +} + +function CheckFontName(comboName) +{ + if (oFontNameCombo == null) oFontNameCombo = document.getElementById(comboName) ; + CheckComboValue(oFontNameCombo,DECMD_GETFONTNAME) ; +} + +function CheckFontSize(comboName) +{ + if (oFontSizeCombo == null) oFontSizeCombo = document.getElementById(comboName) ; + CheckComboValue(oFontSizeCombo,DECMD_GETFONTSIZE) ; +} + +function CheckComboValue(combo,command) +{ + if (!combo) return ; + + var sValue = "" ; + var s = objContent.QueryStatus(command) ; + + if (s == DECMDF_DISABLED || s == DECMDF_NOTSUPPORTED) + combo.disabled = true ; + else + { + combo.disabled = false ; + sValue = objContent.ExecCommand(command, OLECMDEXECOPT_DODEFAULT); + } + combo.value = sValue ; +} \ No newline at end of file Index: trunk/admin/listview/listview.js =================================================================== diff -u --- trunk/admin/listview/listview.js (revision 0) +++ trunk/admin/listview/listview.js (revision 13) @@ -0,0 +1,225 @@ +var lcp = 0; +var cbContainers = new Array(); +function initSelectiorContainers() +{ + var selectorType; + var inputs = document.getElementsByTagName("INPUT"); + for (var i = 0; i < inputs.length; i++) + if (inputs[i].getAttribute("isSelector")) + { + selectorType = inputs[i].type; + break; + } + + + if (!selectorType) return; + + for (var i = 0; i < inputs.length; i++) + if (inputs[i].type == selectorType && inputs[i].getAttribute("isSelector")) + { + var container = inputs[i].parentNode.parentNode; + inputs[i].container = container; + container.chB = inputs[i]; + cbContainers[cbContainers.length] = container; + inputs[i].checked=false; + + if (selectorType != "radio") + + container.chB.onclick = function(e) + { + this.lcp = lcp++; + eval(this.getAttribute("onclicksrc")); + var evt = (e) ? e : window.event; + if (!evt) return; + evt.cancelBubble = true; + + } + else container.chB.onclick = container.onclick; + + container.chB.onclickA = function() + { + eval(this.getAttribute("onclicksrc")); + } + + container.onclick = function(e) + { + var evt = (e) ? e : window.event; + if (!evt) return; + + if (evt.ctrlKey && selectorType != "radio") + { + this.chB.checked = !this.chB.checked; + this.chB.onclick(); + if (document.selection) document.selection.empty(); + return; + } + + if (evt.shiftKey && selectorType != "radio") + { + var maxLcp = 0; + var maxIndex = 0; + var cIndex = 0; + + for (var i = 0; i < cbContainers.length; i++) + { + if (cbContainers[i].chB.lcp > maxLcp) + { + maxLcp = cbContainers[i].chB.lcp; + maxIndex = i; + } + if (cbContainers[i] == this) cIndex = i; + } + + for (var i = 0; i < cbContainers.length; i++) + { + var cChb = (i <= cIndex && i >= maxIndex && maxIndex <= cIndex || i >= cIndex && i <= maxIndex && maxIndex > cIndex); + if (cChb != cbContainers[i].chB.checked) + { + cbContainers[i].chB.checked = cChb; + cbContainers[i].chB.onclickA(); + } + } + if (document.selection) document.selection.empty(); + return; + } + selectAll(false); + + this.chB.checked = !this.chB.checked; + if (selectorType != "radio") this.chB.onclick() + else + { + var checkArray; + this.chB.onclickA(); + + for (var i = 0; i < cbContainers.length; i++) + if (this.id != cbContainers[i].id) + { + var rowId = cbContainers[i].chB.getAttribute('rowId') + try + { + if (!checkArray) checkArray = eval(cbContainers[i].chB.getAttribute('checkArrayName')) + } + catch (err) + { + } + checkArray.CheckValues[rowId]=0; + + cbContainers[i].className = "table_color" + (i % 2 + 1); + } + + if (checkArray) checkArray.itemschecked = (this.chB.checked) ? 1 : 0; + } + } + + container.ondblclick = function(e) + { if (selectorType == "radio") return; + selectAll(false); + + if (this.chB.checked != true) this.chB.checked = true; + this.chB.onclick(); + handleDoubleClick(); + } + + container.oncontextmenu = function(e) + { if (selectorType == "radio") return; + var evt = (e) ? e : window.event; + if (!evt) return; + evt.cancelBubble = true; + evt.returnValue = false; + if (!this.chB.checked) + { + selectAll(false); + this.chB.checked = !this.chB.checked; + this.chB.onclick(); + } + showContextMenu(); + return false; + } + } + + document.onkeydown = function(e) + { if (selectorType == "radio") return; + var evt = (e) ? e : window.event; + if (!evt) return; + var keyCode = (e) ? e.which : window.event.keyCode; + if (keyCode == 65 && evt.ctrlKey) + { + selectAll(true) + if (document.selection) document.selection.empty(); + evt.returnValue = false; + evt.cancelBubble = true; + return false; + } + } +} + +function selectAll(value) +{ + for (var i = 0; i < cbContainers.length; i++) + if (value != cbContainers[i].chB.checked) + { + cbContainers[i].chB.checked = value; + cbContainers[i].chB.onclickA(); + } +} + +function showContextMenu() +{ + if(initContextMenu()) + { + window.FW_showMenu(window.contextMenu,window.event.clientX,window.event.clientY); + window.event.returnValue = false; + window.event.cancelBubble = true; + } + return false; +} + +//unchanged +function ShowViewMenu() +{ + button = document.getElementById('viewmenubutton'); + if(button) + { + x = getRealLeft(button); + y = getRealTop(button); + + fwLoadMenus(); + window.FW_showMenu(window.view_menu,x,y+32); + } + return false; +} + + +//This overrides the function in tabs.js for use in lists +function edit_submit(formname, status_field, targetURL, save_value,env_str) +{ + + var full_env = env + if(env_str != null) full_env += env_str; + + if(full_env.substr(0,3)!="env") + full_env = 'env='+full_env; + + var loc = rootURL + targetURL + '?' + full_env; + document.location = loc; +} + +function HandleKeyPress(e) +{ + alert(e.which); +} + +d = document.getElementById('ListSearchWord'); +if(d) +{ + d.onkeyup = function(event) + { + if(window.event.keyCode==13) + { + var el = document.getElementById('imgSearch'); + el.onclick(); + } + } +} + + Index: trunk/admin/editor/FCKeditor/images/smiley/fun/angry1.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_pages.gif =================================================================== diff -u Binary files differ Index: trunk/admin/config/addlang.php =================================================================== diff -u --- trunk/admin/config/addlang.php (revision 0) +++ trunk/admin/config/addlang.php (revision 13) @@ -0,0 +1,322 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$browseURL = $adminURL."/browse"; + +$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."/browse/toolbar.php"); +require_once($pathtoroot.$admin."/listview/listview.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +$objMessages = new clsEmailMessageList(); + +unset($objEditItems); + +$objEditItems = new clsLanguageList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Language"); +$objEditItems->EnablePaging = FALSE; +$objPhraseList = new clsPhraseList(); +$objPhraseList->EnablePaging = FALSE; +if ($_GET["new"] == 1) +{ + $c = new clsLanguage(NULL); + $c->Set("DecimalPoint","."); + $c->Set("ThousandSep",","); + $c->Set("DateFormat","m-d-Y"); + $c->Set("TimeFormat","g:i:s a"); + $en = 0; + $action = "m_lang_add"; + $name = prompt_language("la_Text_New"); + $objLanguages->CreateEmptyEditTable("LanguageId"); + $objPhraseList->CreateEmptyEditTable("PhraseId"); + $objMessages->CreateEmptyEditTable($_POST["itemlist"]); +} +else +{ + $en = (int)$_GET["en"]; + + if (isset($_POST["itemlist"])) + { + $objLanguages->CopyToEditTable("LanguageId",$_POST["itemlist"]); + $objPhraseList->CopyToEditTable("LanguageId",$_POST["itemlist"]); + $objMessages->CopyToEditTable("LanguageId",$_POST["itemlist"]); + } + $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); + $itemcount=$objEditItems->NumItems(); + + $c = $objEditItems->GetItemByIndex($en); + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_lang_edit"; + $name = $c->Get("LocalName"); +} + +$section = "in-portal:lang_general"; + +$envar = "env=".BuildEnv(); + +$title = prompt_language("la_Text_Configuration")." - ".$name."' ".prompt_language("la_Text_Pack")." - ".prompt_language("la_tab_General"); + +//Display header +$sec = $objSections->GetSection($section); +$objListToolbar = new clsToolBar(); +$objListToolbar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('language','LangEditStatus','".$admin."/config/config_lang.php',1);",$imagesURL."/toolbar/tool_select.gif"); +$objListToolbar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('language','LangEditStatus','".$admin."/config/config_lang.php',2);",$imagesURL."/toolbar/tool_cancel.gif"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $admin."/config/addlang.php"; + $objListToolbar->Add("divider"); + $form = "language"; + if($en_prev>-1) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + $onClick= $sec->Get("onclick"); + $var="env=".BuildEnv()."&en=$en_prev"; + $link = "javascript:edit_submit('$form','$url',0,'$var');"; + $objListToolbar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Category"),$link,$MouseOver,$MouseOut,"","toolbar/tool_prev.gif"); + } + else + { + $MouseOver=""; + $MouseOut=""; + $onClick=""; + $link="#"; + $objListToolbar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Category"),"#","","","","toolbar/tool_prev_f3.gif"); + + } + if($en_next>-1) + { + $MouseOver="swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="swap('moveright', 'toolbar/tool_next.gif');"; + $onClick=$sec->Get("onclick"); + $var="env=".BuildEnv()."&en=$en_next"; + $link = "javascript:edit_submit('$form','$url',0,'$var');"; + $objListToolbar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Category"),$link,$MouseOver,$MouseOut,"","toolbar/tool_next.gif"); + } + else + { + $objListToolbar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Category"),$link,$MouseOver,$MouseOut,"","toolbar/tool_next_f3.gif"); + } +} + + int_header($objListToolbar,NULL,$title); +?> +
    + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + +> + + + + + +> + + + + +> + + + + + "> + + + +
    Get("LanguageId"); ?>
    ">
    ">
    ">
    "> + Get("DateFormat"))) echo prompt_language("la_Text_example").":".date($c->Get("DateFormat")); ?> +
    "> + Get("TimeFormat"))) echo prompt_language("la_Text_example").":".date($c->Get("TimeFormat")); ?> +
    ">
    ">
    + Get("Enabled") == 1) echo "checked"; ?>> +  
    + Get("PrimaryLang") == 1) echo "checked"; ?>> +  
    + + + + +
    +
    + +
    " name="viewmenu"> + + + + +
    + + Index: trunk/kernel/admin/include/toolbar/editcategory_relations.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/editcategory_relations.php (revision 0) +++ trunk/kernel/admin/include/toolbar/editcategory_relations.php (revision 13) @@ -0,0 +1,32 @@ + + + + +END; +?> Index: trunk/themes/default/img/relevance/rel_2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/icon_browse.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/images/spacer.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/icon16_search.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/advanced_search.tpl =================================================================== diff -u --- trunk/themes/default/advanced_search.tpl (revision 0) +++ trunk/themes/default/advanced_search.tpl (revision 13) @@ -0,0 +1,131 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + +

    + + + + + + +
       + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +
    + + +
    + + + + +

    + + + +
    + + + + + +

    + +
    + + + + +
    + + + + + +

    +
    + + + + + + + + + + + + + + + +
    + + + + + +
     * - + +
    +


    + +
    +

    +
    + + + Index: trunk/kernel/include/dates.php =================================================================== diff -u --- trunk/kernel/include/dates.php (revision 0) +++ trunk/kernel/include/dates.php (revision 13) @@ -0,0 +1,214 @@ + $val) + { + if($f==$field) + { + $fpos = $i; + break; + } + $i++; + } + return $fpos; +} + +/** + * splits the date into its parts + * + * @param string $date date in string form + * @param string $SourceFormat PHP Date formatting string + * @return Array Assoc. array containg date fields +*/ +function GetDateArray($date,$SourceFormat) +{ + $temp_format = GetStdFormat($SourceFormat); + $parts = preg_split("/\s*\D\s*/",$date); + + $fpos = DateFieldOrder($temp_format,"year"); + if($fpos>0) + $year = $parts[$fpos-1]; + + $fpos = DateFieldOrder($temp_format,"month"); + if($fpos>0) + $month = $parts[$fpos-1]; + + $fpos = DateFieldOrder($temp_format,"day"); + + if($fpos>0) + $day = $parts[$fpos-1]; + + $date_parts = array(); + $date_parts["year"] = $year; + $date_parts["month"] = $month; + $date_parts["day"] = $day; + + return $date_parts; +} + +/** + * convert date to Unix timestamp + * + * @param string $date date in string form + * @param string $SourceFormat PHP Date formatting string + * @return integer Unix Timestamp of date +*/ +function DateTimestamp($date,$SourceFormat) +{ + if(strlen($date)) + { + $d = GetDateArray($date,$SourceFormat); + $ticks = adodb_mktime(0,0,0,$d["month"],$d["day"],$d["year"]); + } + else + $ticks = 0; + + return $ticks; +} + +/** + * convert date from one string format to another + * + * @param string $date date in string form + * @param string $SourceFormat PHP Date formatting string + * @param string $DestFormat PHP Date formatting string to return + * @return string reformatted date string +*/ +function ReformatDate($date,$SourceFormat,$DestFormat) +{ + $unixtime = DateTimestamp($date,$SourceFormat); + if($unixtime>0) + $newdate = adodb_date($DestFormat,$unixtime); + return $newdate; +} + +/** + * Number of days in the month of a given date + * + * @param integer $date timestamp to check + * @return string Number of days in month +*/ +function DaysInMonth($date) +{ + return adodb_date("t",$date); +} + +/** + * Checks a date for validity + * + * @param integer $date date to check + * @param string $format PHP Date formatting string + * @return boolean +*/ +function ValidDate($date,$format) +{ + $valid = TRUE; + $d = GetDateArray($date,$format); + $valid = $valid && ((int)$d["year"]>0); + $valid = $valid && ((int)$d["month"]>0); + if($valid) + { + $day = (int)$d["day"]; + $checkdays = adodb_mktime(0,0,0,$d["month"],1,$d["year"]); + $days = DaysInMonth($checkdays); + $valid = $valid && (($day>0) && ($day<=$days)); + } + return $valid; +} + +function Is12HourTime($timestr) +{ + $timestr = strtoupper($timestr); + return (strpos($timestr,"AM")>0 || strpos($timestr,"PM")>0); +} + + +function GetTimeParts($timestr) +{ + if(Is12HourTime($timestr)) + { + /* parse 12 hr clock */ + list ($hour,$min,$sec,$ampm) = split('[: ]',$timestr); + if($ampm=="PM" && $hour != 12) + $hour = $hour + 12; + if($ampm=="AM" && $hour==12) + $hour=0; + + $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); + + } + else + $time = $timestr; + $parts = explode(":",$time); + return $parts; +} + +function ValidTime($timestr) +{ + global $objConfig; + + $timestr = strtoupper($timestr); + if($objConfig->Get("ampm_time")=="1") + { + $valid = Is12HourTime($timestr); + } + else + $valid = !Is12HourTime($timestr); + + $time = GetTimeParts($timestr); + $valid = $valid && (($time["hour"]<24) && ($time["min"]<60) && ($time["sec"]<60)); + $valid = $valid && (($time["hour"]>-1) && ($time["min"]>-1) && ($time["sec"]>-1)); + return $valid; +} + +function SecondsSinceMidnight($timestr) +{ + $timestr = strtoupper($timestr); + $time = GetTimeParts($timestr); +// echo $timestr."
    \n"; +// print_r($time); + $ticks = $time[2] + ($time[1]*60) + ($time[0]*3600); + return $ticks; +} +/* + $date = "10-03-71"; + $source_format = "m-d-y"; + print "date:". ReformatDate($date,$source_format,"m/d/Y")."
    \n"; + if(ValidDate($date,"Y.m.d")) + echo " Date is valid
    \n"; +*/ +?> Index: trunk/admin/config/module_email.php =================================================================== diff -u --- trunk/admin/config/module_email.php (revision 0) +++ trunk/admin/config/module_email.php (revision 13) @@ -0,0 +1,376 @@ +Logout(); + header("Location: ".$adminURL."/login.php"); + die(); + //require_once($pathtoroot."admin/login.php"); +} + +//admin only util +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditItems); + +//$objEditItems = new clsPhraseList(); +//$objEditItems->SourceTable = $objSession->GetEditTable("Language"); + +/* -------------------------------------- Section configuration ------------------------------------------- */ +$section = $_GET["section"]; +$sec = $objSections->GetSection($section); + +$module = $_GET["module"]; +$envar = "env=" . BuildEnv()."&module=$module§ion=$section"; + +//$title = prompt_language("la_Text_Configuration")." - '".$module."' - ".prompt_language("la_tab_EmailEvents"); + +$SortFieldVar = "Event_LV_SortField"; +$SortOrderVar = "Event_LV_SortOrder"; +$DefaultSortField = "Description"; +$PerPageVar = "Perpage_Event"; +$CurrentPageVar = "Page_Event"; +$CurrentFilterVar = "EmailEvent_View"; + +$ListForm = "language"; +$CheckClass = "EmailChecks"; + + +//echo $envar."
    \n"; +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$objListToolBar = new clsToolBar(); +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass","EmailChecks"); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); + +$listImages = array(); + +/* +$objListToolBar->Add("email_edit", "la_ToolTip_Edit","#","if (EmailChecks.itemChecked()) swap('email_edit','toolbar/tool_edit_f2.gif');", + "if (EmailChecks.itemChecked()) swap('email_edit', 'toolbar/tool_edit.gif');", + "EmailChecks.check_submit('email_edit', '');", + "tool_edit.gif"); +$listImages[] = "EmailChecks.addImage('email_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; +*/ + +$EditVar = "env=".BuildEnv(); + +$objListToolBar->Add("email_user", "la_ToolTip_Email_UserSelect","#","if (EmailChecks.itemChecked()) swap('email_user','toolbar/tool_usertogroup_f2.gif');", + "if (EmailChecks.itemChecked()) swap('email_user', 'toolbar/tool_usertogroup.gif');", + "OpenUserSelector('EventId',$CheckClass,'".$EditVar."&Selector=radio&destform=userpopup&destfield=FromUserId&IdField=PortalUserId&dosubmit=1');", + "tool_usertogroup.gif",TRUE,TRUE); + +$listImages[] = "EmailChecks.addImage('email_user','$imagesURL/toolbar/tool_usertogroup.gif','$imagesURL/toolbar/tool_usertogroup_f3.gif',1); "; + +$objListToolBar->Add("email_enable", "la_ToolTip_Email_Enable","#","if (EmailChecks.itemChecked()) swap('email_enable','toolbar/tool_approve_f2.gif');", + "if (EmailChecks.itemChecked()) swap('email_enable', 'toolbar/tool_approve.gif');", + "EmailChecks.check_submit('module_email', 'm_emailevent_enable');", + "tool_approve.gif",FALSE,TRUE); + +$listImages[] = "EmailChecks.addImage('email_enable','$imagesURL/toolbar/tool_approve.gif','$imagesURL/toolbar/tool_approve_f3.gif',1); "; + +$objListToolBar->Add("email_disable", "la_ToolTip_Email_Disable","#","if (EmailChecks.itemChecked()) swap('email_disable','toolbar/tool_deny_f2.gif');", + "if (EmailChecks.itemChecked()) swap('email_disable', 'toolbar/tool_deny.gif');", + "EmailChecks.check_submit('module_email', 'm_emailevent_disable');", + "tool_deny.gif",FALSE,TRUE); + +$listImages[] = "EmailChecks.addImage('email_disable','$imagesURL/toolbar/tool_deny.gif','$imagesURL/toolbar/tool_deny_f3.gif',1); "; + +$objListToolBar->Add("email_front", "la_ToolTip_Email_FrontOnly","#","if (EmailChecks.itemChecked()) swap('email_front','toolbar/tool_frontend_mail_f2.gif');", + "if (EmailChecks.itemChecked()) swap('email_front', 'toolbar/tool_frontend_mail.gif');", + "EmailChecks.check_submit('module_email', 'm_emailevent_frontonly');", + "tool_frontend_mail.gif",FALSE,TRUE); + +$listImages[] = "EmailChecks.addImage('email_front','$imagesURL/toolbar/tool_frontend_mail.gif','$imagesURL/toolbar/tool_frontend_mail_f3.gif',1); "; + + +$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();"); + +$objEvents = new clsEventList(); +//$objEvents->SourceTable = $objSession->GetEditTable("Events"); + +$order = trim($objConfig->Get("Event_LV_SortField")." ".$objConfig->Get("Event_LV_SortOrder")); + +$SearchWords = $objSession->GetVariable("EmailEventSearchWord"); +$where = "(Module='$module')"; +if(strlen($SearchWords)) + $where .= ' AND '.$objEvents->AdminSearchWhereClause($SearchWords); + +/* ----------------------------------------- Set the View Filter ---------------------------------------- */ +$ViewNormal=1; +$Bit_Disabled=2; +$Bit_Enabled=1; +$Bit_FrontOnly=4; +$Bit_All = 7; +$FilterLabels[0] = admin_language("la_Text_Enabled"); +$FilterLabels[1] = admin_language("la_Text_Disabled"); +$FilterLabels[2] = admin_language("la_Text_FrontOnly"); + +/* determine current view menu settings */ +$MsgView = $objConfig->Get("EmailEvent_View"); + +$ViewNormal=0; + +if(!is_numeric($MsgView)) +{ + $MsgView = $Bit_All; //Set all bits ON + $MsgFilter = ""; +} +unset($Status); +$Status = array(); + +if($MsgView & $Bit_Disabled) + $Status[] = 0; + +if($MsgView & $Bit_Enabled) + $Status[] = 1; + +if($MsgView & $Bit_FrontOnly) + $Status[] = 2; + +if(count($Status)>0) +{ + $MsgFilter = "Enabled IN (".implode(",",$Status).")"; +} +else + $MsgFilter = "Enabled = -1"; + +$UserTable = GetTablePrefix()."PortalUser"; +$EventTable = GetTablePrefix()."Events"; +$MessageTable = GetTablePrefix()."EmailMessage"; + +$sql = "SELECT e.Description as Description, e.Module as Module, e.EventId as EventId, "; +$sql .="ELT(e.Enabled+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")."','".admin_language("la_Text_FrontOnly")." ') as EmailStatus, "; +$sql .="ELT(e.Type+1,'".admin_language("la_Text_User")." ','".admin_language("la_Text_Admin")." ') as EventType, "; +$sql .="u.Login as FromUser FROM $EventTable as e LEFT JOIN $UserTable as u ON (e.FromUserId=u.PortalUserId) WHERE $where "; +if(strlen($MsgFilter)) + $sql .= "AND $MsgFilter "; + +if(strlen(trim($objConfig->Get($SortFieldVar)))) +{ + $order = " ORDER BY ".$objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar); +} +else + $order = ""; + +if($objConfig->Get($CurrentPageVar)>0) +{ + $objEvents->Page = $objConfig->Get($CurrentPageVar); +} + +if($objConfig->Get($PerPageVar)>0) +{ + $objListView->PerPage = $objConfig->Get($PerPageVar); +} + +$sql .= $order." "; + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + +$objListView = new clsListView($objListToolBar); +$objListView->CurrentPageVar = $CurrentPageVar; +$objListView->PerPageVar = $PerPageVar; + +$objEvents->Query_Item($sql, $objListView->GetLimitSQL() ); +$itemcount = TableCount($objEvents->SourceTable, $where, 0); + +$objListView->SetListItems($objEvents); +$objListView->IdField = "EventId"; + +$order = $objConfig->Get($PerPageVar); + +$objListView->ColumnHeaders->Add("Description",admin_language("la_prompt_Description"),1,0,$order,"width=\"50%\"",$SortFieldVar,$SortOrderVar,"Description"); +//$objListView->ColumnHeaders->Add("Module",admin_language("la_prompt_Module"),1,0,$order,"width=\"10%\"","Email_LV_SortField","Email_LV_SortOrder","Module"); +$objListView->ColumnHeaders->Add("EventType",admin_language("la_prompt_Type"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"EventType"); +$objListView->ColumnHeaders->Add("EmailStatus",admin_language("la_prompt_Status"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"EmailStatus"); +$objListView->ColumnHeaders->Add("FromUser",admin_language("la_prompt_FromUser"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"FromUser"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar)); + +$objListView->PrintToolBar = FALSE; +$objListView->checkboxes = TRUE; +$objListView->CheckboxName = "itemlist[]"; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_emailevent_search"; + +$objListView->TotalItemCount = $itemcount; + +$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, + $CurrentFilterVar,$MsgView,$Bit_All); + +foreach($FilterLabels as $Bit=>$Label) +{ + $objListView->AddViewMenuFilter($Label,$Bit); +} + +for($i=0;$iItems);$i++) +{ + $e =& $objEvents->GetItemRefByIndex($i); + $e->Set("Description",prompt_language($e->Get("Description"))); +} + +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
    " method=POST> + + +PrintList(); +?> + + + + + + > + + + +
    +
    + + +
    " name="viewmenu"> + + + + +
    +
    "> + + +
    + +
    " ID="popup"> + + + + + + + +
    + +
    " ID="userpopup"> + + + +
    + + + + Index: trunk/kernel/include/adodb/drivers/adodb-mysql.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-mysql.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-mysql.inc.php (revision 13) @@ -0,0 +1,564 @@ +GetOne("select version()"); + $arr['version'] = ADOConnection::_findvers($arr['description']); + return $arr; + } + + // if magic quotes disabled, use mysql_real_escape_string() + function qstr($s,$magic_quotes=false) + { + if (!$magic_quotes) { + + if (ADODB_PHPVER >= 0x4300) { + if (is_resource($this->_connectionID)) + return "'".mysql_real_escape_string($s,$this->_connectionID)."'"; + } + if ($this->replaceQuote[0] == '\\'){ + $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s); + } + return "'".str_replace("'",$this->replaceQuote,$s)."'"; + } + + // undo magic quotes for " + $s = str_replace('\\"','"',$s); + return "'$s'"; + } + + function _insertid() + { + return mysql_insert_id($this->_connectionID); + } + + function _affectedrows() + { + return mysql_affected_rows($this->_connectionID); + } + + // See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html + // Reference on Last_Insert_ID on the recommended way to simulate sequences + var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);"; + var $_genSeqSQL = "create table %s (id int not null)"; + var $_genSeq2SQL = "insert into %s values (%s)"; + var $_dropSeqSQL = "drop table %s"; + + function CreateSequence($seqname='adodbseq',$startID=1) + { + if (empty($this->_genSeqSQL)) return false; + $u = strtoupper($seqname); + + $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname)); + if (!$ok) return false; + return $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1)); + } + + function GenID($seqname='adodbseq',$startID=1) + { + // post-nuke sets hasGenID to false + if (!$this->hasGenID) return false; + + $getnext = sprintf($this->_genIDSQL,$seqname); + $rs = @$this->Execute($getnext); + if (!$rs) { + $u = strtoupper($seqname); + $this->Execute(sprintf($this->_genSeqSQL,$seqname)); + $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1)); + $rs = $this->Execute($getnext); + } + $this->genID = mysql_insert_id($this->_connectionID); + + if ($rs) $rs->Close(); + + return $this->genID; + } + + function &MetaDatabases() + { + $qid = mysql_list_dbs($this->_connectionID); + $arr = array(); + $i = 0; + $max = mysql_num_rows($qid); + while ($i < $max) { + $db = mysql_tablename($qid,$i); + if ($db != 'mysql') $arr[] = $db; + $i += 1; + } + return $arr; + } + + + // Format date column in sql string given an input format that understands Y M D + function SQLDate($fmt, $col=false) + { + if (!$col) $col = $this->sysTimeStamp; + $s = 'DATE_FORMAT('.$col.",'"; + $concat = false; + $len = strlen($fmt); + for ($i=0; $i < $len; $i++) { + $ch = $fmt[$i]; + switch($ch) { + case 'Y': + case 'y': + $s .= '%Y'; + break; + case 'Q': + case 'q': + $s .= "'),Quarter($col)"; + + if ($len > $i+1) $s .= ",DATE_FORMAT($col,'"; + else $s .= ",('"; + $concat = true; + break; + case 'M': + $s .= '%b'; + break; + + case 'm': + $s .= '%m'; + break; + case 'D': + case 'd': + $s .= '%d'; + break; + + case 'H': + $s .= '%H'; + break; + + case 'h': + $s .= '%I'; + break; + + case 'i': + $s .= '%i'; + break; + + case 's': + $s .= '%s'; + break; + + case 'a': + case 'A': + $s .= '%p'; + break; + + default: + + if ($ch == '\\') { + $i++; + $ch = substr($fmt,$i,1); + } + $s .= $ch; + break; + } + } + $s.="')"; + if ($concat) $s = "CONCAT($s)"; + return $s; + } + + + // returns concatenated string + // much easier to run "mysqld --ansi" or "mysqld --sql-mode=PIPES_AS_CONCAT" and use || operator + function Concat() + { + $s = ""; + $arr = func_get_args(); + $first = true; + /* + foreach($arr as $a) { + if ($first) { + $s = $a; + $first = false; + } else $s .= ','.$a; + }*/ + + // suggestion by andrew005@mnogo.ru + $s = implode(',',$arr); + if (strlen($s) > 0) return "CONCAT($s)"; + else return ''; + } + + function OffsetDate($dayFraction,$date=false) + { + if (!$date) $date = $this->sysDate; + return "from_unixtime(unix_timestamp($date)+($dayFraction)*24*3600)"; + } + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + if (ADODB_PHPVER >= 0x4300) + $this->_connectionID = @mysql_connect($argHostname,$argUsername,$argPassword, + $this->forceNewConnect,$this->clientFlags); + else if (ADODB_PHPVER >= 0x4200) + $this->_connectionID = @mysql_connect($argHostname,$argUsername,$argPassword, + $this->forceNewConnect); + else + $this->_connectionID = @mysql_connect($argHostname,$argUsername,$argPassword); + + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + if (ADODB_PHPVER >= 0x4300) + $this->_connectionID = @mysql_pconnect($argHostname,$argUsername,$argPassword,$this->clientFlags); + else + $this->_connectionID = @mysql_pconnect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($this->autoRollback) $this->RollbackTrans(); + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->forceNewConnect = true; + $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename); + } + + function &MetaColumns($table) + { + + if ($this->metaColumnsSQL) { + global $ADODB_FETCH_MODE; + + $save = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false); + + $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table)); + + if (isset($savem)) $this->SetFetchMode($savem); + $ADODB_FETCH_MODE = $save; + + if ($rs === false) return false; + + $retarr = array(); + while (!$rs->EOF){ + $fld = new ADOFieldObject(); + $fld->name = $rs->fields[0]; + $type = $rs->fields[1]; + + // split type into type(length): + if (preg_match("/^(.+)\((\d+)/", $type, $query_array)) { + $fld->type = $query_array[1]; + $fld->max_length = $query_array[2]; + } else { + $fld->max_length = -1; + $fld->type = $type; + } + $fld->not_null = ($rs->fields[2] != 'YES'); + $fld->primary_key = ($rs->fields[3] == 'PRI'); + $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false); + $fld->binary = (strpos($fld->type,'blob') !== false); + if (!$fld->binary) { + $d = $rs->fields[4]; + if ($d != "" && $d != "NULL") { + $fld->has_default = true; + $fld->default_value = $d; + } else { + $fld->has_default = false; + } + } + + $retarr[strtoupper($fld->name)] = $fld; + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + return false; + } + + // returns true or false + function SelectDB($dbName) + { + $this->databaseName = $dbName; + if ($this->_connectionID) { + return @mysql_select_db($dbName,$this->_connectionID); + } + else return false; + } + + // parameters use PostgreSQL convention, not MySQL + function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $arg3=false,$secs=0) + { + $offsetStr =($offset>=0) ? "$offset," : ''; + + return ($secs) ? $this->CacheExecute($secs,$sql." LIMIT $offsetStr$nrows",$inputarr,$arg3) + : $this->Execute($sql." LIMIT $offsetStr$nrows",$inputarr,$arg3); + + } + + + // returns queryID or false + function _query($sql,$inputarr) + { + //global $ADODB_COUNTRECS; + //if($ADODB_COUNTRECS) + return mysql_query($sql,$this->_connectionID); + //else return @mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6 + } + + /* Returns: the last error message from previous database operation */ + function ErrorMsg() + { + if (empty($this->_connectionID)) $this->_errorMsg = @mysql_error(); + else $this->_errorMsg = @mysql_error($this->_connectionID); + return $this->_errorMsg; + } + + /* Returns: the last error number from previous database operation */ + function ErrorNo() + { + if (empty($this->_connectionID)) return @mysql_errno(); + else return @mysql_errno($this->_connectionID); + } + + + + // returns true or false + function _close() + { + @mysql_close($this->_connectionID); + $this->_connectionID = false; + } + + + /* + * Maximum size of C field + */ + function CharMax() + { + return 255; + } + + /* + * Maximum size of X field + */ + function TextMax() + { + return 4294967295; + } + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_mysql extends ADORecordSet{ + + var $databaseType = "mysql"; + var $canSeek = true; + + function ADORecordSet_mysql($queryID,$mode=false) + { + if ($mode === false) { + global $ADODB_FETCH_MODE; + $mode = $ADODB_FETCH_MODE; + } + switch ($mode) + { + case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break; + case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break; + default: + case ADODB_FETCH_DEFAULT: + case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break; + } + + $this->ADORecordSet($queryID); + } + + function _initrs() + { + //GLOBAL $ADODB_COUNTRECS; + // $this->_numOfRows = ($ADODB_COUNTRECS) ? @mysql_num_rows($this->_queryID):-1; + $this->_numOfRows = @mysql_num_rows($this->_queryID); + $this->_numOfFields = @mysql_num_fields($this->_queryID); + } + + function &FetchField($fieldOffset = -1) + { + + if ($fieldOffset != -1) { + $o = @mysql_fetch_field($this->_queryID, $fieldOffset); + $f = @mysql_field_flags($this->_queryID,$fieldOffset); + $o->max_length = @mysql_field_len($this->_queryID,$fieldOffset); // suggested by: Jim Nicholson (jnich@att.com) + //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable + $o->binary = (strpos($f,'binary')!== false); + } + else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */ + $o = @mysql_fetch_field($this->_queryID); + $o->max_length = @mysql_field_len($this->_queryID); // suggested by: Jim Nicholson (jnich@att.com) + //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable + } + + return $o; + } + + function &GetRowAssoc($upper=true) + { + if ($this->fetchMode == MYSQL_ASSOC && !$upper) return $this->fields; + return ADORecordSet::GetRowAssoc($upper); + } + + /* Use associative array to get fields array */ + function Fields($colname) + { + // added @ by "Michael William Miller" + if ($this->fetchMode != MYSQL_NUM) return @$this->fields[$colname]; + + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + return $this->fields[$this->bind[strtoupper($colname)]]; + } + + function _seek($row) + { + if ($this->_numOfRows == 0) return false; + return @mysql_data_seek($this->_queryID,$row); + } + + + // 10% speedup to move MoveNext to child class + function MoveNext() + { + //global $ADODB_EXTENSION;if ($ADODB_EXTENSION) return adodb_movenext($this); + + if ($this->EOF) return false; + + $this->_currentRow++; + $this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode); + if (is_array($this->fields)) return true; + + $this->EOF = true; + + /* -- tested raising an error -- appears pointless + $conn = $this->connection; + if ($conn && $conn->raiseErrorFn && ($errno = $conn->ErrorNo())) { + $fn = $conn->raiseErrorFn; + $fn($conn->databaseType,'MOVENEXT',$errno,$conn->ErrorMsg().' ('.$this->sql.')',$conn->host,$conn->database); + } + */ + return false; + } + + function _fetch() + { + $this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode); + return is_array($this->fields); + } + + function _close() { + @mysql_free_result($this->_queryID); + $this->_queryID = false; + } + + function MetaType($t,$len=-1,$fieldobj=false) + { + if (is_object($t)) { + $fieldobj = $t; + $t = $fieldobj->type; + $len = $fieldobj->max_length; + } + + $len = -1; // mysql max_length is not accurate + switch (strtoupper($t)) { + case 'STRING': + case 'CHAR': + case 'VARCHAR': + case 'TINYBLOB': + case 'TINYTEXT': + case 'ENUM': + case 'SET': + if ($len <= $this->blobSize) return 'C'; + + case 'TEXT': + case 'LONGTEXT': + case 'MEDIUMTEXT': + return 'X'; + + // php_mysql extension always returns 'blob' even if 'text' + // so we have to check whether binary... + case 'IMAGE': + case 'LONGBLOB': + case 'BLOB': + case 'MEDIUMBLOB': + return !empty($fieldobj->binary) ? 'B' : 'X'; + case 'YEAR': + case 'DATE': return 'D'; + + case 'TIME': + case 'DATETIME': + case 'TIMESTAMP': return 'T'; + + case 'INT': + case 'INTEGER': + case 'BIGINT': + case 'TINYINT': + case 'MEDIUMINT': + case 'SMALLINT': + + if (!empty($fieldobj->primary_key)) return 'R'; + else return 'I'; + + default: return 'N'; + } + } + +} +} +?> \ No newline at end of file Index: trunk/kernel/admin/include/toolbar/edituser_custom.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/edituser_custom.php (revision 0) +++ trunk/kernel/admin/include/toolbar/edituser_custom.php (revision 13) @@ -0,0 +1,34 @@ + + + + +END; +?> Index: trunk/admin/editor/FCKeditor/images/toolbar/button.underline.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/_docs/whatsnew.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/_docs/whatsnew.html (revision 0) +++ trunk/admin/editor/FCKeditor/_docs/whatsnew.html (revision 13) @@ -0,0 +1,445 @@ + + + + FCKeditor - What's New + +

    Version 1.4

    +
      +
    • + ATTENTION: For PHP users: The editor was changed and now uses + htmlspecialchars instead of htmlentities + when handling the initial value. It should works well, but please make some + tests before upgrading definitively. If there is any problem just uncomment the + line in the fckeditor.php file (and send me a message!). +
    • + The editor is now integrated with ieSpell (http://www.iespell.com) + for Spell Checking. You can configure the download URL in + then fck_config.js file. Thanks to Sanjay Sharma. (ieSpell is free for personal + use but must be paid for commercial use) +
    • + Table and table cell dialogs has been + changed. Now you can select the class + you want to be applied. Thanks to Alexander Lezos. +
    • + [SF + Feature-865378]A new upload support is available for ASP. + It uses the /UserImages/ folder in the root of the web site as the files + container and a counter controlled by the upload.cnt file. Both must have write + permissions set to the IUSR_xxx user. Thanks to Trax and Juanjo. +
    • + [SF + Patch-798128] The user (programmer) can now define a custom + separator + for the list items of a combo in the toolbar. Thanks to Wulff D. Heiss. +
    • + [SF + Feature-741963][SF + Feature-878941][SF + Patch-869389] A minimal support for a �fake� TAB is now available, + even if HTML has no support for TAB. Now when the user presses the TAB key a + configurable number of spaces (&nbsp;) is added. Take a look at + config.TabSpaces on the fck_config.js file. No action is performed if it is set + to zero. The default value is 4. Thanks to Phil Hassey. +
    • + [SF + BUG-782779][SF + BUG-790939] The problem with big images has been corrected. Thanks + to Raver. +
    • + [SF + BUG-862975] Now the editor does nothing if no image is selected in + the image dialog box and the OK button is hit. +
    • + [SF + BUG-851609] The problem with ASP and null values has been solved. +
    • + Norwegean + language pack. Thanks to Martin Kronstad. +
    • + Hungarian + language pack. Thanks to Bal�zs Szab�. +
    • + Bosnian language pack. Thanks to Trax. +
    • + Japanese + language pack. Thanks to Kato Yuichiro. +
    • + Updates on the Polish + language pack. Thanks to Norbert Neubauer. +
    • + The Chinese (Taiwan) (zh-tw) has been removed from the package + because it's corrupt. I'm sorry. I hope someone could send me a good version + soon. +
    • +
    +

    Version 1.3.1

    +
      +
    • + It's now possible to configure the editor the insert a <BR> tag + instead of <P> when the user presses the <Enter> + key. Take a look at the fck_config.js configuration file for the "UseBROnCarriageReturn" + key. This option is disabled by default. +
    • + Icelandic + language pack. Thanks to Andri �skarsson. +
    • + [SF + BUG-853374] On IE 5.0 there was a little error introduced with + version 1.3 on initialization. It was corrected. +
    • + [SF + BUG-853372] On IE 5.0 there was a little error introduced with + version 1.3 when setting the focus in the editor. It was corrected. +
    • + Minor errors on the language file for english + has been corrected. Thanks to Anders Madsen. +
    • + Minor errors on the language file for danish has been + corrected. Thanks to Martin Johansen. +
    • +
    +

    Version 1.3

    +
      +
    • + Language support for Danish, Polish, Simple Chinese, Slovak, Swedish and + Turkish. +
    • + Language updates for Romanian. +
    • + It's now possible to override any of the editor's + configurations + (for now it's implemented just for JavaScript, ASPX and HTC modules). See + _test/test.html for a sample. I'm now waiting for the Community for the ASP, + CFM and PHP versions. +
    • + A new method is available for PHP users. It's called ReturnFCKeditor. + It works exactly like CreateFCKeditor, but it returns a string with the + HTML + for the editor instead of output it (echo). This feature is useful for people + who are working with Smarty Templates or something like that. Thanks to Timothy + J. Finucane. +
    • + Many people have had problems with international characters over + PHP. I had also the same problem. PHP have strange problems + with character encoding. The code hasn't been changed but just saved again with + Western European encoding. Now it works well in my system.
      + Take a look also at the "default_charset" configuration option at the php.ini + file. It doesn't seem to be an editor's problem but a PHP issue. +
    • + The "testsubmit.php" file now strips the "Magic Quotes + " that are automatically added by PHP on form posts. +
    • + A new language integration module is available for ASP/Jscript. + Thanks to Dimiter Naydenov. +
    • + New configuration options are available to customize the + Target combo box in the Insert/Modify Link + dialog box. Now you can hide it, or set which options are available in the + combo box. Take a look at the fck_config.js file. +
    • + The Text as Plain Text toolbar icon has been + changed to avoid confusion + with the Normal Paste or. Thanks to Kaupo Kalda. +
    • + The file dhtmled.cab has been removed + from the package. It's not needed to the editor to work and caused some + confusion for a few users. +
    • + The editor's content now doesn't loose the focus + when the user clicks with the mouse in a toolbar button. +
    • + On drag-and-drop operations the data to be inserted in the + editor is now converted to plain text when the "ForcePasteAsPlainText" + configuration is set to true. +
    • + The image browser sample in PHP now sorts the files + by name. Thanks to Sergey Lupashko. +
    • + Two new configuration options are available to turn on/off + by default the "Show Borders" and "Show + Details" commands. +
    • + Some characters have been removed from the "Insert Special + Chars" dialog box because they were causing encoding problems + in some languages. Thanks to Abomb Hua. +
    • + JSP versions of the image and file upload and browsing + features. Thanks to Simone Chiaretta.
    +

    Version 1.2.4

    +
      +
    • + Language support for Spanish, Finnish, Romanian and Korean. +
    • + Language updates for German. +
    • + New Zoom toolbar option. (Thanks + to "mtn_roadie")
    +

    Version 1.2.2

    +
      +
    • + Language support for French. +
    • + [SF BUG-782779] Version 1.2 introduced a bug on the + image dialog window: when changing the image, no update was done. This bug is + now fixed. +
    • +
    +

    Version 1.2

    +
      +
    • + Enhancements to the Word cleaning + feature (Thanks to Karl von Randow). +
    • + The Table dialog box + now handles the Style width and height set in the table (Thanks to Roberto + Arruda). There where many problems on prior version when people changed + manually the table's size, dragging the size handles, and then it was not + possible to set a new size using the table dialog box. +
    • + For the Image dialog box: +
        +
      • + No image is shown in the preview pane if no image has been set. +
      • + If no HSpace is set in the image a "-1" value was shown in the dialog box. Now, + nothing is shown if the value is negative. +
      • +
      +
    • + [SF BUG-739630] Image with link lost the link when + changing its properties. The problem is solved. +
    • + Due to some problems in the XHTML cleaning (content duplication when the source + HTML is dirty and malformed), the XHTML support is turned off by default + from this version. You can still change this behavior and turn it on in + the configuration file. +
    • + Some little updates on the English + language file. +
    • + A few addition of missing entries on all languages files (translations for + these changes are pending). +
    • + Language files has been added for the following languages: +
        +
      • + Brazilian Portuguese + (pt-br) +
      • + Czech + (cz) +
      • + Dutch + (nl) +
      • + Russian + (ru) +
      • + Chinese (Taiwan) + (zh-tw) +
      • + Greek + (gr) +
      • + German (de)
      +
    • +
    +

    Version 1.1

    +
      +
    • + The "Multi Language" system is now available. This version + ships with English and Italian versions completed. Other languages will be + available soon. The editor automatically detects the client language and sets + all labels, tooltips and dialog boxes to it, if available. The auto detection + and the default language can be set in the fck_config.file. +
    • + Two files can now be created to isolate customizations code from the original + source code of the editor: fckeditor.config.js and fckeditor.custom.js. + Create these files in the root folder of your web site, if needed. The first + one can be used to add or override configurations set on fck_config.js. The + second one is used for custom actions and behaviors. +
    • + A problem with relative links and images like "/test/test.doc" has been solved. + In prior versions, only with XHTML support enabled, the URL was changed to + something like "http://www.mysite.xxx/test/test.doc" (The domain was + automatically added). Now the XHTML cleaning procedure gets the URLs exactly + how they are defined in the editor�s HTML. +
    • + [SF BUG-742168] Mouse drag and drop from toolbar + buttons has been disabled. +
    • + [SF BUG-768210] HTML entities, like &lt;, + were not load correctly. The problem is solved. +
    • + [SF BUG-748812] The link dialog window doesn't open when + the link button is grayed. +
    • +
    +

    Version 1.0

    +
      +
    • + Three new options are available in the configuration file to set what file + types are allowed / denied to be uploaded from the "Insert Link" and "Insert + Image" dialog boxes. +
    • + Upload options, for links and images, are automatically hidden on IE 5.0 + browsers (it's not compatible). +
    • + [SF BUG-734894] Fixed a problem on XHTML cleaning: the value on INPUT fields + were lost. +
    • + [SF BUG-713797] Fixed some image dialog errors when trying to set image + properties when no image is available. +
    • + [SF BUG-736414] Developed a workaround for a DHTML control bug when loading in + the editor some HTML started with <p><hr></p>. +
    • + [SF BUG-737143] Paste from Word cleaning changed to solve some IE 5.0 errors. + This feature is still not available over IE 5.0. +
    • + [SF BUG-737233] CSS mappings are now OK on the PHP image browser module. +
    • + [SF BUG-737495] The image preview in the image dialog box is now working + correctly. +
    • + [SF BUG-737532] The editor automatically switches to WYSIWYG mode when the form + is posted. +
    • + [SF BUG-739571] The editor is now working well over Opera (as for Netscape, a + TEXTAREA is shown). +
    • +
    +

    Version 1.0 Final Candidate

    +
      +
    • + A new dialog box for the "Link" command is available. Now you can upload and + browse the server exactly like the image dialog box. It's also possible to + define the link title and target window (_blank, _self, _parent and _top). As + with the image dialog box, a sample (and simple) file server browser is + available. +
    • + A new configuration option is available to force every paste action to be + handled as plain text. See "config.ForcePasteAsPlainText" in fck_config.js. +
    • + A new Toolbar button is available: "Paste from Word". It automatically cleans + the clipboard content before pasting (removesWord styles, classes, xml stuff, + etc...). This command is available for IE 5.5 and more. For IE 5.0 users, a + message is displayed advising that the text will not be cleaned before pasting. +
    • + The editor automatically detects Word clipboard data on pasting operations and + asks the user to clean it before pasting. This option is turned on by default + but it can be configured. See "config.AutoDetectPasteFromWord" in + fck_config.js. +
    • + Table properties are now available in cells' right click context menu. +
    • + It's now possible to edit cells advanced properties from it's right click + context menu. +
    • +
    +

    Version 1.0 Release Candidate 1 (RC1)

    +
      +
    • + Some performance improvements. +
    • + The file dhtmled.cab has been added to the package for clients ho needs to + install the Microsoft DHTML Editor component. +
    • + [SF BUG-713952] The format command options are localized, so it depends on the + IE language to work. Until version 0.9.5 it was working only over English IE + browsers. Now the options are load dynamically on the client using the client's + language. +
    • + [SF BUG-712103] The style command is localized, so it depends on the IE + language to work. Until version 0.9.5 it was working only over English IE + browsers. Now it configures itself using the client's language. +
    • + [SF BUG-726137] On version 0.9.5, some commands (special chars, image, + emoticons, ...) remove the next available character before inserting the + required content even if no selection was made in the editor. Now the editor + replaces only the selected content (if available). +
    • +
    +

    Version 0.9.5 beta

    +
      +
    • + XHTML support is now available! It can be enabled/disabled in the fck_config.js + file. +
    • + "Show Table Borders" option: show borders for tables with borders size set to + zero. +
    • + "Show Details" option: show hidden elements (comments, scripts, paragraphs, + line breaks) +
    • + IE behavior integration module. Thanks to Daniel Shryock. +
    • + "Find" option: to find text in the document. +
    • + More performance enhancements. +
    • + New testsubmit.php file. Thansk to Jim Michaels. +
    • + Two initial PHP upload manager implementations (not working yet). Thanks to + Frederic Tyndiuk and Christian Liljedahl. +
    • + Initial PHP image browser implementation (not working yet). Thanks to Frederic + Tyndiuk. +
    • + Initial CFM upload manager implementation. Thanks to John Watson. +
    • +
    +

    Version 0.9.4 beta

    +
      +
    • + ColdFusion module integration is now available! Thanks to John Watson. +
    • + "Insert Smiley" toolbar option! Thanks to Fredox. Take a look at fck_config.js + for configuration options. +
    • + "Paste as plain text" toolbar option! +
    • + Right click support for links (edit / remove). +
    • + Buttons now are shown in gray when disabled. +
    • + Buttons are shown just when the image is downloaded (no more "red x" while + waiting for it). +
    • + The toolbar background color can be set with a CSS style (see fck_editor.css). +
    • + Toolbar images have been reviewed: +
        +
      • + Now they are transparent. +
      • + No more over...gif for every button (so the editor loads quicker). +
      • + Buttons states are controlled with CSS styles. (see fck_editor.css).
      +
    • + Internet Explorer 5.0 compatibility, except for the image uploading popup. +
    • + Optimizations when loading the editor. +
    • + [SF BUG-709544] - Toolbar buttons wait for the images to be downloaded to start + watching and responding the user actions (turn buttons on/off when the user + changes position inside the editor). +
    • + Javascript integration is now Object Oriented. CreateFCKeditor function is not + available anymore. Take a look in test.html. +
    • + Two new configuration options, ImageBrowser and ImageUpload, are available to + turn on and off the image upload and image browsing options in the Image dialog + box. This options can be hidden for a specific editor instance throw specific + URL parameter in the editor�s IFRAME (upload=true/false&browse=true/false). + All specific language integration modules handle this option. For sample see + the _test directory. +
    • +
    + + Index: trunk/themes/default/img/arr_more.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/sad.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/fi.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/fi.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/fi.js (revision 13) @@ -0,0 +1,198 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fi.js: Finnish support for FCKeditor v1.2.2 + * + * Authors: + * Marko Korhonen (marko.korhonen@datafisher.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Leikkaa" ; +lang["Copy"] = "Kopioi" ; +lang["Paste"] = "Liitä" ; +lang["PasteText"] = "Liitä tekstinä" ; +lang["PasteWord"] = "Liitä Wordista" ; +lang["Find"] = "Etsi" ; +lang["SelectAll"] = "Valitse kaikki" ; +lang["RemoveFormat"] = "Poista muotoilu" ; +lang["InsertLink"] = "Lisää linkki/muokkaa linkkiä" ; +lang["RemoveLink"] = "Poista linkki" ; +lang["InsertImage"] = "Lisää kuva/muokkaa kuvaa" ; +lang["InsertTable"] = "Lisä taulu/muokkaa taulua" ; +lang["InsertLine"] = "Lisää murtoviiva" ; +lang["InsertSpecialChar"] = "Lisää erikoismerkki" ; +lang["InsertSmiley"] = "Lisää hymiö" ; +lang["About"] = "Editorista" ; + +lang["Bold"] = "Lihavoitu" ; +lang["Italic"] = "Kursivoitu" ; +lang["Underline"] = "Alleviivattu" ; +lang["StrikeThrough"] = "Yliviivattu" ; +lang["Subscript"] = "Alaindeksi" ; +lang["Superscript"] = "Yläindeksi" ; +lang["LeftJustify"] = "Tasaa vasemmat reunat" ; +lang["CenterJustify"] = "Keskitä" ; +lang["RightJustify"] = "Tasaa oikeat reunat" ; +lang["BlockJustify"] = "Tasaa molemmat reunat" ; +lang["DecreaseIndent"] = "Pienennä sisennystä" ; +lang["IncreaseIndent"] = "Suurenna sisennystä" ; +lang["Undo"] = "Kumoa" ; +lang["Redo"] = "Toista" ; +lang["NumberedList"] = "Numerointi" ; +lang["BulettedList"] = "Luettelomerkit" ; + +lang["ShowTableBorders"] = "Näytä taulurajat" ; +lang["ShowDetails"] = "Näytä muotoilumerkit" ; + +lang["FontStyle"] = "Tyyli" ; +lang["FontFormat"] = "Formaatti" ; +lang["Font"] = "Fontti" ; +lang["FontSize"] = "Koko" ; +lang["TextColor"] = "Tekstin väri" ; +lang["BGColor"] = "Taustaväri" ; +lang["Source"] = "Koodi" ; + +// Context Menu + +lang["EditLink"] = "Muokkaa linkkiä" ; +lang["InsertRow"] = "Lisää rivi" ; +lang["DeleteRows"] = "Poista rivit" ; +lang["InsertColumn"] = "Lisää sarake" ; +lang["DeleteColumns"] = "Poista sarakkeet" ; +lang["InsertCell"] = "Lisää solu" ; +lang["DeleteCells"] = "Poista solut" ; +lang["MergeCells"] = "Yhdistä solut" ; +lang["SplitCell"] = "Jaa solu" ; +lang["CellProperties"] = "Solun ominaisuudet" ; +lang["TableProperties"] = "Taulun ominaisuudet" ; +lang["ImageProperties"] = "Kuvan ominaisuudet" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Ajetaan XHTML:ää. Hetkinen..." ; +lang["Done"] = "Valmis" ; +lang["PasteWordConfirm"] = "Teksti, jonka haluat liittää, näyttää olevan kopioidun Wordista. Haluatko puhdistaa sen ennen liittämistä? (Suositeltavaa)" ; +lang["NotCompatiblePaste"] = "Tämä komento on mahdollista ajaa Internet Explorerin versiolla 5.5 tai uudemmalla. Haluatko liittää tekstin ilman puhdistusta?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Peruuta" ; +lang["DlgBtnClose"] = "Sulje" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Lisää kuva" ; +lang["DlgImgTitleEdit"] = "Muokkaa kuvaa" ; +lang["DlgImgBtnUpload"] = "Lähetä kuva serverille" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Lähetä" ; +lang["DlgImgBtnBrowse"] = "Selaa serveriä" ; +lang["DlgImgAlt"] = "Vaihtoehtoinen teksti" ; +lang["DlgImgWidth"] = "Leveys" ; +lang["DlgImgHeight"] = "Korkeus" ; +lang["DlgImgLockRatio"] = "Lukitse suhteet" ; +lang["DlgBtnResetSize"] = "Alkuperäinen koko" ; +lang["DlgImgBorder"] = "Reunaviiva" ; +lang["DlgImgHSpace"] = "Vaakatila" ; +lang["DlgImgVSpace"] = "Pystytila" ; +lang["DlgImgAlign"] = "Kohdistus" ; +lang["DlgImgAlignLeft"] = "Vasemmalle" ; +lang["DlgImgAlignAbsBottom"] = "Kuvan ja rivin alareuna" ; +lang["DlgImgAlignAbsMiddle"] = "Kuvan ja rivin keskelle" ; +lang["DlgImgAlignBaseline"] = "Rivin alareuna" ; +lang["DlgImgAlignBottom"] = "Kuvan alareuna" ; +lang["DlgImgAlignMiddle"] = "Keskelle" ; +lang["DlgImgAlignRight"] = "Oikealle" ; +lang["DlgImgAlignTextTop"] = "Ylös (teksti)" ; +lang["DlgImgAlignTop"] = "Ylös" ; +lang["DlgImgPreview"] = "Esikatselu" ; +lang["DlgImgMsgWrongExt"] = "Vain seuraavat tiedostotyypit ovat sallittuja:\n\n" + config.ImageUploadAllowedExtensions + "\n\nToiminto peruutettiin." ; +lang["DlgImgAlertSelect"] = "Valitse kuva, jonka haluat lisätä." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Linkki" ; // NEW +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Kuvan lähetys" ; +lang["DlgLnkTarget"] = "Kohdesivu" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Uuteen ikkunaan (_blank)" ; +lang["DlgLnkTargetParent"] = "Kehykseen, josta kutsuttiin (_parent)" ; +lang["DlgLnkTargetSelf"] = "Samaan kehykseen (_self)" ; +lang["DlgLnkTargetTop"] = "Päällimmäiseksi (_top)" ; +lang["DlgLnkTitle"] = "Nimi" ; +lang["DlgLnkBtnUpload"] = "Lähetä serverille" ; +lang["DlgLnkBtnBrowse"] = "Selaa serveriä" ; +lang["DlgLnkMsgWrongExtA"] = "Vain seuraavat tiedostotyypit ovat sallittuja:\n\n" + config.LinkUploadAllowedExtensions + "\n\nToiminto Peruutettiin." ; +lang["DlgLnkMsgWrongExtD"] = "Seuraavat tiedostotyypit eivät ole sallittuja:\n\n" + config.LinkUploadDeniedExtensions + "\n\nToiminto peruutettiin." ; + +// Color Dialog +lang["DlgColorTitle"] = "Valitse väri" ; +lang["DlgColorBtnClear"] = "Tyhjennä" ; +lang["DlgColorHighlight"] = "Kohdistettu" ; +lang["DlgColorSelected"] = "Valittu" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Lisää hymiö" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Lisää erikoismerkki" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Lisää taulu" ; +lang["DlgTableTitleEdit"] = "Muokkaa taulua" ; +lang["DlgTableRows"] = "Rivit" ; +lang["DlgTableColumns"] = "Sarakkeet" ; +lang["DlgTableBorder"] = "Rajan paksuus" ; +lang["DlgTableAlign"] = "Kohdistus" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Vasemmalle" ; +lang["DlgTableAlignCenter"] = "Keskelle" ; +lang["DlgTableAlignRight"] = "Oikealle" ; +lang["DlgTableWidth"] = "Leveys" ; +lang["DlgTableWidthPx"] = "pikseliä" ; +lang["DlgTableWidthPc"] = "prosenttia" ; +lang["DlgTableHeight"] = "Korkeus" ; +lang["DlgTableCellSpace"] = "Solujen etäisyys toisistaan" ; +lang["DlgTableCellPad"] = "Solun sisäinen marginaali" ; +lang["DlgTableCaption"] = "Otsikko" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Solun ominaisuudet" ; +lang["DlgCellWidth"] = "Leveys" ; +lang["DlgCellWidthPx"] = "pikseliä" ; +lang["DlgCellWidthPc"] = "prosenttia" ; +lang["DlgCellHeight"] = "Korkeus" ; +lang["DlgCellWordWrap"] = "Sanankierrätys" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Kyllä" ; +lang["DlgCellWordWrapNo"] = "Ei" ; +lang["DlgCellHorAlign"] = "Vaakakohdistus" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Vasemmalle" ; +lang["DlgCellHorAlignCenter"] = "Keskelle" ; +lang["DlgCellHorAlignRight"] = "Oikealle" ; +lang["DlgCellVerAlign"] = "Pystykohdistus" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Ylös" ; +lang["DlgCellVerAlignMiddle"] = "Keskelle" ; +lang["DlgCellVerAlignBottom"] = "Kuvan alareuna" ; +lang["DlgCellVerAlignBaseline"] = "Rivin alareuna" ; +lang["DlgCellRowSpan"] = "Solun rivikorkeus" ; +lang["DlgCellCollSpan"] = "Solun sarakeleveys" ; +lang["DlgCellBackColor"] = "Tausta väri" ; +lang["DlgCellBorderColor"] = "Rajan väri" ; +lang["DlgCellBtnSelect"] = "Valitse..." ; + +// About Dialog +lang["DlgAboutVersion"] = "versio" ; +lang["DlgAboutLicense"] = "GNU Lesser General Public License -lisenssin allaoleva ohjelmistokirjasto" ; +lang["DlgAboutInfo"] = "Lisätietoa editorista saat seuraavasta osoitteesta:" ; \ No newline at end of file Index: trunk/admin/images/toolbar/tool_disconnect_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/notify.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/summary/overviewbox_header.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/happy.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_preview_language_f3.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/suggest_cat/suggest_cat_confirm_pending.tpl =================================================================== diff -u --- trunk/themes/default/suggest_cat/suggest_cat_confirm_pending.tpl (revision 0) +++ trunk/themes/default/suggest_cat/suggest_cat_confirm_pending.tpl (revision 13) @@ -0,0 +1,111 @@ + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + + +

    +
    + + "> + + + + + + + + + + + + + + + + + + + + + +



     
    +

    +

    +



    +
    + " class="button"> +
    +
    + + +

    +
    + + + \ No newline at end of file Index: trunk/admin/images/tabnav_back.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_settings_smiley.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_settings_general.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/arr_sort_up.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_move_up_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_export_language_f3.gif =================================================================== diff -u Binary files differ Index: trunk/compat/version_compare.php =================================================================== diff -u --- trunk/compat/version_compare.php (revision 0) +++ trunk/compat/version_compare.php (revision 13) @@ -0,0 +1,170 @@ + | +// | Aidan Lister | +// +----------------------------------------------------------------------+ +// +// $Id: version_compare.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace version_compare() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/version_compare + * @author Philippe Jausions + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.1.0 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('version_compare')) { + + function version_compare ($version1, $version2, $operator = '<') + { + // Check input + if (!is_scalar($version1)) { + trigger_error('version_compare() expects parameter 1 to be string, ' . gettype($version1) . ' given', E_USER_WARNING); + return null; + } + + if (!is_scalar($version2)) { + trigger_error('version_compare() expects parameter 2 to be string, ' . gettype($version2) . ' given', E_USER_WARNING); + return null; + } + + if (!is_scalar($operator)) { + trigger_error('version_compare() expects parameter 3 to be string, ' . gettype($operator) . ' given', E_USER_WARNING); + return null; + } + + // Standardise versions + $v1 = explode('.', + str_replace('..', '.', + preg_replace('/([^0-9\.]+)/', '.$1.', + str_replace(array('-', '_', '+'), '.', + trim($version1))))); + + $v2 = explode('.', + str_replace('..', '.', + preg_replace('/([^0-9\.]+)/', '.$1.', + str_replace(array('-', '_', '+'), '.', + trim($version2))))); + + // Replace empty entries at the start of the array + while (empty($v1[0]) && array_shift($v1)) {} + while (empty($v2[0]) && array_shift($v2)) {} + + // Describe our release states + $versions = array( + 'dev' => 0, + 'alpha' => 1, + 'a' => 1, + 'beta' => 2, + 'b' => 2, + 'RC' => 3, + 'pl' => 4); + + // Loop through each segment in the version string + $compare = 0; + for ($i = 0, $x = min(count($v1), count($v2)); $i < $x; $i++) + { + if ($v1[$i] == $v2[$i]) { + continue; + } + if (is_numeric($v1[$i]) && is_numeric($v2[$i])) { + $compare = ($v1[$i] < $v2[$i]) ? -1 : 1; + } + elseif (is_numeric($v1[$i])) { + $compare = 1; + } + elseif (is_numeric($v2[$i])) { + $compare = -1; + } + elseif (isset($versions[$v1[$i]]) && isset($versions[$v2[$i]])) { + $compare = ($versions[$v1[$i]] < $versions[$v2[$i]]) ? -1 : 1; + } + else { + $compare = strcmp($v2[$i], $v1[$i]); + } + + break; + } + + // If previous loop didn't find anything, compare the "extra" segments + if ($compare == 0) { + if (count($v2) > count($v1)) + { + if (isset($versions[$v2[$i]])) { + $compare = ($versions[$v2[$i]] < 4) ? 1 : -1; + } else { + $compare = -1; + } + } + elseif (count($v2) < count($v1)) + { + if (isset($versions[$v1[$i]])) { + $compare = ($versions[$v1[$i]] < 4) ? -1 : 1; + } else { + $compare = 1; + } + } + } + + // Compare the versions + if (func_num_args() > 2) + { + switch ($operator) + { + case '>': + case 'gt': + return (bool) ($compare > 0); + break; + case '>=': + case 'ge': + return (bool) ($compare >= 0); + break; + case '<=': + case 'le': + return (bool) ($compare <= 0); + break; + case '==': + case '=': + case 'eq': + return (bool) ($compare == 0); + break; + case '<>': + case '!=': + case 'ne': + return (bool) ($compare != 0); + break; + case '': + case '<': + case 'lt': + return (bool) ($compare < 0); + break; + default: + return null; + } + } + + return $compare; + } +} + +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/toolbar/separator.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_print.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-csv.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-csv.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-csv.inc.php (revision 13) @@ -0,0 +1,147 @@ +_insertid; + } + + function _affectedrows() + { + return $this->_affectedrows; + } + + function &MetaDatabases() + { + return false; + } + + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_url = $argHostname; + return true; + } + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_url = $argHostname; + return true; + } + + function &MetaColumns($table) + { + return false; + } + + + // parameters use PostgreSQL convention, not MySQL + function &SelectLimit($sql,$nrows=-1,$offset=-1,$arg3=false) + { + $url = $this->_url.'?sql='.urlencode($sql)."&nrows=$nrows&$offset=&offset&arg3=".urlencode($arg3); + $err = false; + $rs = csv2rs($url,$err,false); + if ($this->debug) print "$url
    $err
    "; + + $at = strpos($err,'::::'); + if ($at === false) { + $this->_errorMsg = $err; + $this->_errorNo = (integer)$err; + } else { + $this->_errorMsg = substr($err,$at+4,1024); + $this->_errorNo = -9999; + } + if (is_object($rs)) { + $rs->databaseType='csv'; + } + return $rs; + } + + // returns queryID or false + function Execute($sql,$inputarr=false,$arg3=false) + { + $url = $this->_url.'?sql='.urlencode($sql); + if ($arg3) $url .= "&arg3=".urlencode($arg3); + $err = false; + + $rs = csv2rs($url,$err,false); + if ($this->debug) print urldecode($url)."
    $err
    "; + $at = strpos($err,'::::'); + if ($at === false) { + $this->_errorMsg = $err; + $this->_errorNo = (integer)$err; + } else { + $this->_errorMsg = substr($err,$at+4,1024); + $this->_errorNo = -9999; + } + if (is_object($rs)) { + $this->_affectedrows = $rs->affectedrows; + $this->_insertid = $rs->insertid; + $rs->databaseType='csv'; + } + return $rs; + } + + /* Returns: the last error message from previous database operation */ + function ErrorMsg() + { + return $this->_errorMsg; + } + + /* Returns: the last error number from previous database operation */ + function ErrorNo() + { + return $this->_errorNo; + } + + // returns true or false + function _close() + { + return true; + } +} // class + +class ADORecordset_csv extends ADORecordset { + function ADORecordset_csv($id) + { + $this->ADORecordset($id); + } + + function _close() + { + return true; + } +} + +} // define + +?> \ No newline at end of file Index: trunk/kernel/include/adodb/server.php =================================================================== diff -u --- trunk/kernel/include/adodb/server.php (revision 0) +++ trunk/kernel/include/adodb/server.php (revision 13) @@ -0,0 +1,97 @@ +Connect($host,$uid,$pwd,$database)) err($conn->ErrorNo(). $sep . $conn->ErrorMsg()); +$sql = undomq($HTTP_GET_VARS['sql']); + +if (isset($HTTP_GET_VARS['fetch'])) + $ADODB_FETCH_MODE = $HTTP_GET_VARS['fetch']; + +if (isset($HTTP_GET_VARS['nrows'])) { + $nrows = $HTTP_GET_VARS['nrows']; + $offset = isset($HTTP_GET_VARS['offset']) ? $HTTP_GET_VARS['offset'] : -1; + $rs = $conn->SelectLimit($sql,$nrows,$offset); +} else + $rs = $conn->Execute($sql); +if ($rs){ + //$rs->timeToLive = 1; + echo _rs2serialize($rs,$conn,$sql); + $rs->Close(); +} else + err($conn->ErrorNo(). $sep .$conn->ErrorMsg()); + +?> \ No newline at end of file Index: trunk/themes/default/misc/right_recommend.tpl =================================================================== diff -u --- trunk/themes/default/misc/right_recommend.tpl (revision 0) +++ trunk/themes/default/misc/right_recommend.tpl (revision 13) @@ -0,0 +1,32 @@ + + + + + + + + + + +

    \ No newline at end of file Index: trunk/admin/icons/icon46_site.gif =================================================================== diff -u Binary files differ Index: trunk/compat/array_chunk.php =================================================================== diff -u --- trunk/compat/array_chunk.php (revision 0) +++ trunk/compat/array_chunk.php (revision 13) @@ -0,0 +1,76 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: array_chunk.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace array_combine() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.array_chunk + * @author Aidan Lister + * @author Thiemo M�ttig (http://maettig.com) + * @version $Revision: 1.1 $ + * @since PHP 4.2.0 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('array_chunk')) +{ + function array_chunk ($input, $size, $preserve_keys = false) + { + if (!is_array($input)) { + trigger_error('array_chunk() expects parameter 1 to be array, ' . gettype($input) . ' given', E_USER_WARNING); + return null; + } + + if (!is_numeric($size)) { + trigger_error('array_chunk() expects parameter 2 to be long, ' . gettype($size) . ' given', E_USER_WARNING); + return null; + } + + $size = (int)$size; + if ($size <= 0) + { + trigger_error('array_chunk() Size parameter expected to be greater than 0', E_USER_WARNING); + return null; + } + + $chunks = array(); + $i = 0; + + if ($preserve_keys !== false) + { + foreach ($input as $key => $value) { + $chunks[(int)($i++ / $size)][$key] = $value; + } + } + else + { + foreach ($input as $value) { + $chunks[(int)($i++ / $size)][] = $value; + } + } + + return $chunks; + } +} + +?> \ No newline at end of file Index: trunk/admin/images/toolbar/tool_decline.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/pl.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/pl.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/pl.js (revision 13) @@ -0,0 +1,198 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * pl.js: Polish support. + * + * Authors: + * Jakub Boesche (jboesche@gazeta.pl) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Wytnij" ; +lang["Copy"] = "Kopiuj" ; +lang["Paste"] = "Wklej" ; +lang["PasteText"] = "Wklej jako czysty tekst" ; +lang["PasteWord"] = "Wklej z Worda" ; +lang["Find"] = "Znajdź" ; +lang["SelectAll"] = "Zaznacz wszystko" ; +lang["RemoveFormat"] = "Usuń formatowanie" ; +lang["InsertLink"] = "Wstaw/edytuj hiperłšcze" ; +lang["RemoveLink"] = "Usuń hiperłącze" ; +lang["InsertImage"] = "Wstaw/edytuj obrazek" ; +lang["InsertTable"] = "Wstaw/edytuj tabelę" ; +lang["InsertLine"] = "Wstaw linię poziomą" ; +lang["InsertSpecialChar"] = "Wstaw znak specjalny" ; +lang["InsertSmiley"] = "Wstaw emotikonę" ; +lang["About"] = "FCKeditor - informacje" ; + +lang["Bold"] = "Pogrubienie" ; +lang["Italic"] = "Kursywa" ; +lang["Underline"] = "Podkreślenie" ; +lang["StrikeThrough"] = "Przekreślenie" ; +lang["Subscript"] = "Indeks dolny" ; +lang["Superscript"] = "Indeks górny" ; +lang["LeftJustify"] = "Wyrównanie do lewej" ; +lang["CenterJustify"] = "Wyrównanie do środka" ; +lang["RightJustify"] = "Wyrównaj do prawej" ; +lang["BlockJustify"] = "Wyjustuj" ; +lang["DecreaseIndent"] = "Zmniejsz wcięcie" ; +lang["IncreaseIndent"] = "Zwiększ wcięcie" ; +lang["Undo"] = "Cofnij" ; +lang["Redo"] = "Ponów" ; +lang["NumberedList"] = "Lista numerowana" ; +lang["BulettedList"] = "Lista wypunktowana" ; + +lang["ShowTableBorders"] = "Pokazuj ramkę tabeli" ; +lang["ShowDetails"] = "Pokaż szczegóły" ; + +lang["FontStyle"] = "Styl" ; +lang["FontFormat"] = "Format" ; +lang["Font"] = "Czcionka" ; +lang["FontSize"] = "Rozmiar" ; +lang["TextColor"] = "Kolor tekstu" ; +lang["BGColor"] = "Kolor tła" ; +lang["Source"] = "Źródło dokumentu" ; + +// Context Menu + +lang["EditLink"] = "Edytuj hiperłącze" ; +lang["InsertRow"] = "Wstaw wiersz" ; +lang["DeleteRows"] = "Usuń wiersze" ; +lang["InsertColumn"] = "Wstaw kolumnę" ; +lang["DeleteColumns"] = "Usuń kolumny" ; +lang["InsertCell"] = "Wstaw komórkę" ; +lang["DeleteCells"] = "Usuń komórki" ; +lang["MergeCells"] = "Połącz komórki" ; +lang["SplitCell"] = "Podziel komórkę" ; +lang["CellProperties"] = "Właściwości komórki" ; +lang["TableProperties"] = "Właściwości tabeli" ; +lang["ImageProperties"] = "Właściwości obrazka" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Przetwarzanie XHTML. Proszę czekać..." ; +lang["Done"] = "Gotowe" ; +lang["PasteWordConfirm"] = "Tekst, który chcesz wkleić, prawdopodobnie pochodzi z programu Word. Czy chcesz go wyczyścić przed wklejeniem?" ; +lang["NotCompatiblePaste"] = "Ta funkcja jest dostępna w programie Internet Explorer w wersji 5.5 lub wyższej. Czy chcesz wkleić bez czyszczenia?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Anuluj" ; +lang["DlgBtnClose"] = "Zamknij" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Wstaw obrazek" ; +lang["DlgImgTitleEdit"] = "Edytuj obrazek" ; +lang["DlgImgBtnUpload"] = "Wyślij" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Wyślij" ; +lang["DlgImgBtnBrowse"] = "Przeglądaj" ; +lang["DlgImgAlt"] = "Tekst zastępczy" ; +lang["DlgImgWidth"] = "Szerokość" ; +lang["DlgImgHeight"] = "Wysokość" ; +lang["DlgImgLockRatio"] = "Zachowaj proporcje" ; +lang["DlgBtnResetSize"] = "Skasuj rozmiar" ; +lang["DlgImgBorder"] = "Ramka" ; +lang["DlgImgHSpace"] = "Odstęp poziomy" ; +lang["DlgImgVSpace"] = "Odstęp pionowy" ; +lang["DlgImgAlign"] = "Wyrównanie" ; +lang["DlgImgAlignLeft"] = "Do lewej" ; +lang["DlgImgAlignAbsBottom"] = "Do dołu" ; +lang["DlgImgAlignAbsMiddle"] = "Do środka w pionie" ; +lang["DlgImgAlignBaseline"] = "Do linii bazowej" ; +lang["DlgImgAlignBottom"] = "Do dołu" ; +lang["DlgImgAlignMiddle"] = "Do środka" ; +lang["DlgImgAlignRight"] = "Do prawej" ; +lang["DlgImgAlignTextTop"] = "Do góry tekstu" ; +lang["DlgImgAlignTop"] = "Do góry" ; +lang["DlgImgPreview"] = "Podgląd" ; +lang["DlgImgMsgWrongExt"] = "Niestety dozwolone są tylko następujące typy plików:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperacja nie powiodła się." ; +lang["DlgImgAlertSelect"] = "Wybierz obrazek do wysłania." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Hiperłącze" ; // NEW +lang["DlgLnkURL"] = "Adres URL" ; +lang["DlgLnkUpload"] = "Wyślij" ; +lang["DlgLnkTarget"] = "Okno docelowe" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Nowe okno (_blank)" ; +lang["DlgLnkTargetParent"] = "Okno nadrzędne (_parent)" ; +lang["DlgLnkTargetSelf"] = "Okno bieżące (_self)" ; +lang["DlgLnkTargetTop"] = "Okno najwyższe w hierarchii (_top)" ; +lang["DlgLnkTitle"] = "Tytuł" ; +lang["DlgLnkBtnUpload"] = "Wyślij" ; +lang["DlgLnkBtnBrowse"] = "Przeglądaj" ; +lang["DlgLnkMsgWrongExtA"] = "Dozwolone są tylko następujące typy plików:\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperacja nie powiodła się." ; +lang["DlgLnkMsgWrongExtD"] = "Niedozwolone typy plików:\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperacja nie powiodła się." ; + +// Color Dialog +lang["DlgColorTitle"] = "Wybierz kolor" ; +lang["DlgColorBtnClear"] = "Wyczyść" ; +lang["DlgColorHighlight"] = "Podgląd" ; +lang["DlgColorSelected"] = "Wybrane" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Wstaw emotikonę" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Wstaw znak specjalny" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Wstaw tabelę" ; +lang["DlgTableTitleEdit"] = "Edytuj tabelę" ; +lang["DlgTableRows"] = "Liczba wierszy" ; +lang["DlgTableColumns"] = "Liczba kolumn" ; +lang["DlgTableBorder"] = "Grubość ramki" ; +lang["DlgTableAlign"] = "Wyrównanie" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Do lewej" ; +lang["DlgTableAlignCenter"] = "Do środka" ; +lang["DlgTableAlignRight"] = "Do prawej" ; +lang["DlgTableWidth"] = "Szerokość" ; +lang["DlgTableWidthPx"] = "piksele" ; +lang["DlgTableWidthPc"] = "%" ; +lang["DlgTableHeight"] = "Wysokość" ; +lang["DlgTableCellSpace"] = "Odstęp pomiędzy komórkami" ; +lang["DlgTableCellPad"] = "Margines wewnętrzny komórek" ; +lang["DlgTableCaption"] = "Tytuł" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Właściwości komórki" ; +lang["DlgCellWidth"] = "Szerokość" ; +lang["DlgCellWidthPx"] = "piksele" ; +lang["DlgCellWidthPc"] = "percent" ; +lang["DlgCellHeight"] = "Wysokość" ; +lang["DlgCellWordWrap"] = "Zawijanie tekstu" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Tak" ; +lang["DlgCellWordWrapNo"] = "Nie" ; +lang["DlgCellHorAlign"] = "Wyrównanie poziome" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Do lewej" ; +lang["DlgCellHorAlignCenter"] = "Do środka" ; +lang["DlgCellHorAlignRight"] = "Do prawej" ; +lang["DlgCellVerAlign"] = "Wyrównanie pionowe" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Do góry" ; +lang["DlgCellVerAlignMiddle"] = "Do środka" ; +lang["DlgCellVerAlignBottom"] = "Do dołu" ; +lang["DlgCellVerAlignBaseline"] = "Do linii bazowej" ; +lang["DlgCellRowSpan"] = "Zajętość wierszy" ; +lang["DlgCellCollSpan"] = "Zajętość kolumn" ; +lang["DlgCellBackColor"] = "Kolor tła" ; +lang["DlgCellBorderColor"] = "Kolor ramki" ; +lang["DlgCellBtnSelect"] = "Wybierz..." ; + +// About Dialog +lang["DlgAboutVersion"] = "wersja" ; +lang["DlgAboutLicense"] = "na licencji GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "Więcej informacji uzyskasz w" ; \ No newline at end of file Index: trunk/admin/icons/icon46_settings_general.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/sel_license.php =================================================================== diff -u --- trunk/admin/install/sel_license.php (revision 0) +++ trunk/admin/install/sel_license.php (revision 13) @@ -0,0 +1,55 @@ + +  Select License

    + + + + + + + +
     Step - Select License
    + + +
    + + + + + \ No newline at end of file Index: trunk/kernel/admin/include/toolbar/sendmail.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/sendmail.php (revision 0) +++ trunk/kernel/admin/include/toolbar/sendmail.php (revision 13) @@ -0,0 +1,99 @@ +GetItemByField("ResourceId",$id); + $r .= $u->Get("FirstName")." ".$u->Get("LastName"); + $r .="<".$u->Get("Email").">"; + $addr_list[] = $u->Get("Email"); + $reciplist[] = $r; + $r = ""; + } + $recip_ids = implode(",",$idlist); + break; + + case "group": + $recip_ids = $_POST["idlist"]; + $idlist = explode(",",$recip_ids); + foreach($idlist as $id) + { + $g = $objGroups->GetItem($id); + if(is_object($g)) + { + $reciplist[] .= "<".$g->Get("Name").">"; + $ulist = $g->GetUserList(); + foreach($ulist as $uid) + { + $u = $objUsers->GetItem($uid); + $addr_list[] = $u->Get("Email"); + } + } + } + $recip_ids = implode(",",$idlist); + break; +} + +print << + + + + +END; +?> + + + Index: trunk/admin/import/inlinkimport1.php =================================================================== diff -u --- trunk/admin/import/inlinkimport1.php (revision 0) +++ trunk/admin/import/inlinkimport1.php (revision 13) @@ -0,0 +1,175 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//admin only util +$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"); +//Set Section +$section = "in-portal:inlink_inport"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +$formaction = $adminURL."/import/import.php?".$envar; + $sec = $objSections->GetSection($section); + $objCatToolBar = new clsToolBar(); + +//inlink import variables clean up +$objSession->SetVariable("import_inlink_sql_type",""); +$objSession->SetVariable("import_inlink_server",""); +$objSession->SetVariable("import_inlink_db",""); +$objSession->SetVariable("import_inlink_user",""); +$objSession->SetVariable("import_inlink_pass",""); +$objSession->SetVariable("error_importing",""); + +//importal import variables clean up. +$objSession->SetVariable("user_admin_names",""); +$objSession->SetVariable("user_regular_names",""); +$objSession->SetVariable("user_admin_values",""); +$objSession->SetVariable("user_regular_values",""); +$objSession->SetVariable("catnavbar",""); +$objSession->SetVariable("init_cat",""); +$objSession->SetVariable("user_input1",""); +$objSession->SetVariable("user_input2",""); +$objSession->SetVariable("importtodo",""); + +if (true) +{ + + if($en_prev>-1) + { + $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; + $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; + $onClick= $sec->Get("onclick"); + $var="?env=".BuildEnv()."&en=$en_prev"; + $link=$_SERVER["PHP_SELF"].$var; + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + } + else + { + $MouseOver=""; + $MouseOut=""; + $onClick=""; + $link="#"; + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),"#","","","","tool_prev_f3.gif"); + + } + if(true) + { + $MouseOver="if (document.inlinkimport1.agree.checked == true) swap('moveright','toolbar/tool_next_f2.gif');"; + $MouseOut="if (document.inlinkimport1.agree.checked == true) swap('moveright', 'toolbar/tool_next.gif');"; + + $var="?env=".BuildEnv()."&en=$en_next"; + $link2=$adminURL."/import/inlinkimport2.php".$var; + $onClick="if (document.inlinkimport1.agree.checked == true) document.location= '$link2';"; + + $link="#"; + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif"); + } + + $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 1"; + + int_header($objCatToolBar,NULL,$title); +} +?> + +
    + + + + + + + + + + + + + + + + + + + +
    Download from Intechnic
    Upload License File: + +
    >Use Existing License
    Skip License (Local Domain Installation)


    +
    + + + + + + + +
    +
    +"> + + > + + + > + + + + + + +
    This utility allows you to import data from other databases and applications, including third party products and earlier versions of this software. + +
    + +
    + + +
    + \ No newline at end of file Index: trunk/admin/images/itemicons/icon16_cat_attn.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_tool_restore.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/divider_sel_right.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/blocks-vert.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/smile.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_mypreferences_big.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_search_log.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/question2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_validate_reset.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/arrow16.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/icon16_search_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/upload/cfm/upload.cfm =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/upload/cfm/upload.cfm (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/upload/cfm/upload.cfm (revision 13) @@ -0,0 +1,39 @@ + + + + + FCKeditor - File Upload + + + + + + +
    + Upload in progress... +
    + + + + + + + + + \ No newline at end of file Index: trunk/compat/image_type_to_mime_type.php =================================================================== diff -u --- trunk/compat/image_type_to_mime_type.php (revision 0) +++ trunk/compat/image_type_to_mime_type.php (revision 13) @@ -0,0 +1,128 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: image_type_to_mime_type.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +if (!defined('IMAGETYPE_GIF')) { + define('IMAGETYPE_GIF', 0); +} + +if (!defined('IMAGETYPE_JPEG')) { + define('IMAGETYPE_JPEG', 1); +} + +if (!defined('IMAGETYPE_PNG')) { + define('IMAGETYPE_PNG', 2); +} + +if (!defined('IMAGETYPE_SWF')) { + define('IMAGETYPE_SWF', 3); +} + +if (!defined('IMAGETYPE_PSD')) { + define('IMAGETYPE_PSD', 4); +} + +if (!defined('IMAGETYPE_BMP')) { + define('IMAGETYPE_BMP', 5); +} + +if (!defined('IMAGETYPE_TIFF_II')) { + define('IMAGETYPE_TIFF_II', 6); +} + +if (!defined('IMAGETYPE_TIFF_MM')) { + define('IMAGETYPE_TIFF_MM', 7); +} + +if (!defined('IMAGETYPE_JPC')) { + define('IMAGETYPE_JPC', 8); +} + +if (!defined('IMAGETYPE_JP2')) { + define('IMAGETYPE_JP2', 9); +} + +if (!defined('IMAGETYPE_JPX')) { + define('IMAGETYPE_JPX', 10); +} + +if (!defined('IMAGETYPE_JB2')) { + define('IMAGETYPE_JB2', 11); +} + +if (!defined('IMAGETYPE_SWC')) { + define('IMAGETYPE_SWC', 12); +} + +if (!defined('IMAGETYPE_IFF')) { + define('IMAGETYPE_IFF', 13); +} + +if (!defined('IMAGETYPE_WBMP')) { + define('IMAGETYPE_WBMP', 14); +} + +if (!defined('IMAGETYPE_XBM')) { + define('IMAGETYPE_XBM', 15); +} + + +/** + * Replace image_type_to_mime_type() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.image_type_to_mime_type + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.3.0 + * @require PHP 3 + */ +if (!function_exists('image_type_to_mime_type')) +{ + function image_type_to_mime_type ($imagetype) + { + static $image_type_to_mime_type = array ( + IMAGETYPE_GIF => 'image/gif', + IMAGETYPE_JPEG => 'image/jpeg', + IMAGETYPE_PNG => 'image/png', + IMAGETYPE_SWF => 'application/x-shockwave-flash', + IMAGETYPE_PSD => 'image/psd', + IMAGETYPE_BMP => 'image/bmp', + IMAGETYPE_TIFF_II => 'image/tiff', + IMAGETYPE_TIFF_MM => 'image/tiff', + IMAGETYPE_JPC => 'application/octet-stream', + IMAGETYPE_JP2 => 'image/jp2', + IMAGETYPE_JPX => 'application/octet-stream', + IMAGETYPE_JB2 => 'application/octet-stream', + IMAGETYPE_SWC => 'application/x-shockwave-flash', + IMAGETYPE_IFF => 'image/iff', + IMAGETYPE_WBMP => 'image/vnd.wap.wbmp', + IMAGETYPE_XBM => 'image/xbm', + ); + + return (isset($image_type_to_mime_type[$imagetype]) ? + $image_type_to_mime_type[$imagetype] : + $image_type_to_mime_type[IMAGETYPE_JPC]); + } +} + +?> \ No newline at end of file Index: trunk/admin/icons/icon46_list_modules.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_image_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/msn/teeth_smile.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/search_results/error.tpl =================================================================== diff -u --- trunk/themes/default/search_results/error.tpl (revision 0) +++ trunk/themes/default/search_results/error.tpl (revision 13) @@ -0,0 +1,115 @@ + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + + +

    +
    + + " /> + + + + + + + + + + + + + + + + + + + + + +



     
    +

    +
    + + + +




    +
    + " class="button"> +
    +
    + + +

    +
    + + + Index: trunk/admin/editor/FCKeditor/images/smiley/fun/lol3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_prev.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/lang/chinese_gb.gif =================================================================== diff -u Binary files differ Index: trunk/admin/email/do_send.php =================================================================== diff -u --- trunk/admin/email/do_send.php (revision 0) +++ trunk/admin/email/do_send.php (revision 13) @@ -0,0 +1,312 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; + +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$browseURL = $adminURL."/browse"; + +//admin only util + +$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."/browse/toolbar.php"); + +//Set Section +$section = 'in-portal:sendmail'; + +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +$State = $_POST["EmailState"]; +if(!strlen($State)) +{ + $State = $_GET["EmailState"]; +} + +$ado = GetADODBConnection(); +$table = "ses_".$objSession->GetSessionKey()."_sendmail"; +$MessagesPerPage =2; + +$SendQueue = new clsEmailQueue($table,$MessagesPerPage); + +$FromUser = $objUsers->GetItem($objSession->Get("PortalUserId")); + +$FromAddr = $FromUser->Get("Email"); +$FromName = $FromUser->Get("FirstName")." ".$FromUser->Get("LastName"); + +if(!strlen(trim($FromAddr))) +{ + $FromAddr = $objConfig->Get("Default_FromAddr"); +} + +if(!strlen(trim($FromName))) +{ + $FromName = "System Administrator"; +} + +$TargetURL = $_SERVER["PHP_SELF"]."?".$envar; +$CancelURL = $TargetURL."&EmailState=email_user_cancel"; + + +/*Initialize page*/ +switch($State) +{ + case "email_single_send": /*single user send */ + $PageTitle = admin_language("la_Title_SendInit"); + $Subject = $_POST["subject"]; + $Html = $_POST["messageHTML"]; + $Text = strip_tags($_POST["messageTEXT"]); + + if(is_array($_FILES)) + { + $attatch = $_FILES["attatchment"]; + if(strlen($attatch["name"]) >0 && $attatch["size"]>0) + { + $FileName = $attatch["name"]; + $FileLoc = $attatch["tmp_name"]; + } + else + { + $FileName = NULL; + $FileLoc = NULL; + } + } + else + { + $FileName = NULL; + $FileLoc = NULL; + } + $charset = ""; + $TargetURL .= "&EmailState=email_send_complete"; + break; + case "email_multi_send": /*Init multiuser send*/ + $UserList = explode(",",$_POST["sendaddrs"]); + //echo $_POST["sendaddrs"]."
    \n"; + + $Subject = $_POST["subject"]; + $Html = $_POST["messageHTML"]; + $Text = strip_tags($_POST["messageTEXT"]); + + if(is_array($_FILES)) + { + $attatch = $_FILES["attatchment"]; + if(strlen($attatch["name"]) >0 && $attatch["size"]>0) + { + $FileName = $attatch["name"]; + $FileLoc = $attatch["tmp_name"]; + } + else + { + $FileName = NULL; + $FileLoc = NULL; + } + } + else + { + $FileName = NULL; + $FileLoc = NULL; + } + + $charset = ""; + $PageTitle = admin_language("la_Title_SendMailInit"); + $TargetURL .="&EmailState=email_send_progress&Start=0&Total=".count($UserList); + break; + case "email_send_progress": + $total = $_GET["Total"]; + $start = $_GET["Start"]; + if($start < $total) + { + $pct = (int)(($start/$total)*100); + $NewStart = $start+$MessagesPerPage; + $TargetURL .= "&EmailState=email_send_progress&Start=$NewStart&Total=$total"; + $PageTitle = admin_language("la_Title_SendMailProgress")." - ".$pct."% ".admin_language("la_Text_Complete"); + } + else + { + $PageTitle = admin_language("la_Title_SendMailProgress"); + $TargetURL .= "&EmailState=email_send_complete"; + } + break; + case "email_send_complete": + $PageTitle = admin_language("la_Title_SendMailComplete"); + $TargetURL=""; + break; + case "email_user_cancel": + $PageTitle = admin_language("la_Title_SendMailCancel"); + $TargetURL = ""; + break; + +} + int_header(NULL,NULL,admin_language("la_Title_PleaseWait")); + echo "\n"; + +/*do page functions */ +// echo "Current State:". $State."
    \n"; + +echo "
    "; +switch($State) +{ +case "email_single_send": /*single user send */ + $PageTitle = admin_language($Pagetitle); + $ToAddr = $_POST["sendaddrs"]; + + $SendQueue->SendMail($FromAddr,$FromName,$ToAddr,"",$Subject,$Text,$Html,$charset,$FileName,$FileLoc,0, NULL); + $o = ""; + $o .= int_subsection_title_ret($PageTitle); + $o .= ""; + $o .= ""; + $o .= "
    ".admin_language("la_prompt_EmailInitMessage")."
    "; + echo $o."\n"; + break; + case "email_multi_send": /*Init multiuser send*/ + /*Create storage Table for Queue */ + $o = ""; + $o .= int_subsection_title_ret($PageTitle); + $o .= ""; + $o .= ""; + $o .= "
    ".admin_language("la_prompt_EmailInitMessage")."
    "; + echo $o."\n"; + + $sql = "CREATE TABLE $table SELECT * FROM ".$objEmailQueue->SourceTable." WHERE queued=99"; + $ado->Execute($sql); + //echo $sql."
    \n"; + for($i=0;$iSendMail($FromAddr,$FromName,$ToAddr,"",$Subject,$Text,$Html,$charset,$FileName,$FileLoc,1, NULL); + } + break; + case "email_send_progress": + $sql = "SELECT * FROM $table LIMIT $start,".$MessagesPerPage; + // echo $sql."
    \n"; + $rs = $ado->Execute($sql); + while($rs && !$rs->EOF) + { + $data = $rs->fields; + + $SendQueue->DeliverMail($data["toaddr"],$data["fromaddr"],$data["Subject"],$data["message"],$data["headers"],1); + $rs->MoveNext(); + } + $o = ""; + $o .= int_subsection_title_ret($PageTitle); + $o .=""; + $comp_pct = 100-$pct; + $o .= ""; + $o .= "
     
    "; + $o .= ""; + + echo $o."\n"; + break; + case "email_send_complete": + $sql = "DROP TABLE $table"; + $ado->Execute($sql); + $o = ""; + $o .= int_subsection_title_ret($PageTitle); + $o .= ""; + $o .= ""; + $o .= "
    ".admin_language("la_prompt_EmailCompleteMessage")."
    "; + echo $o."\n"; + break; + case "email_user_cancel": + $o = ""; + $o .= int_subsection_title_ret($PageTitle); + $o .= ""; + $o .= "
    ".admin_language("la_prompt_EmailCancelMessage")."
    "; + echo $o."\n"; + + break; +} +echo "
    "; +if(strlen($TargetURL)) +{ +?> + + + Index: trunk/admin/images/toolbar/tool_primary_cat.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_paste_f3.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_head_separ.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/arrows.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_deny_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/category/addpermission_modules.php =================================================================== diff -u --- trunk/admin/category/addpermission_modules.php (revision 0) +++ trunk/admin/category/addpermission_modules.php (revision 13) @@ -0,0 +1,293 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; + +$imagesURL = $adminURL."/images"; +$cssURL = $adminURL."/include"; +$browseURL = $adminURL."/browse"; + +//$pathtolocal = $pathtoroot."in-news/"; +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."/browse/toolbar.php"); +require_once($pathtoroot.$admin."/listview/listview.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditItems); + +$objEditItems = new clsCatList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Category"); + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); + +if(isset($_GET["en"])) +{ + $c = $objEditItems->GetItemByIndex($en); +} +else +{ + $c = new clsCategory($m_var_list["cat"]); +} + +if(!is_object($c)) +{ + $c = new clsCategory(); + $c->Set("CategoryId",0); +} +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_edit_permissions"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +//$section = 'in-portal:editcategory_permissions'; +$section = 'in-portal:catperm_modules'; + +if(count($_POST)) +{ + if($_POST["Action"]=="m_edit_permissions") + { + $GroupId = $_POST["GroupId"]; + $g = $objGroups->GetItem($GroupId); + } + else + { + if(!is_array($_POST["itemlist"])) + { + $g = $objGroups->GetItemByField("ResourceId", $_POST["itemlist"]); + if(is_object($g)) + $GroupId = $g->Get("GroupId"); + } + else + { + $g = $objGroups->GetItemByField("ResourceId", $_POST["itemlist"][0]); + $GroupId = $g->Get("GroupId"); + } + } +} +else +{ + $GroupId = $_GET["GroupId"]; + $g = $objGroups->GetItem($GroupId); +} + +$objPermList = new clsPermList($c->Get("CategoryId"),$GroupId); + +$ado = GetADODBConnection(); +$sql = "SELECT DISTINCT(ModuleId) FROM ".GetTablePrefix()."PermissionConfig"; +$rs = $ado->Execute($sql); +$Modules = array(); + +while($rs && !$rs->EOF) +{ + $data = $rs->fields; + $Modules[] = $data["ModuleId"]; + $rs->MoveNext(); +} +/* page header */ +print << + + In-portal + + + + + + + + + + + +END; + +//int_SectionHeader(); +if($c->Get("CategoryId")!=0) +{ + $title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Category")." '".$c->Get("Name")."' - ".admin_language("la_tab_Permissions"); + $title .= " ".admin_language("la_text_for")." '".$g->parsetag("group_name")."'"; +} +else +{ + $title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Root")." ".admin_language("la_Text_Category")." - "."' - ".admin_language("la_tab_Permissions"); + $title .= " ".admin_language("la_text_for")." '".$g->parsetag("group_name")."'"; +} + +$objListToolBar = new clsToolBar(); +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('category','CatEditStatus','$admin/category/addcategory_permissions.php',0);",$imagesURL."/toolbar/tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('category','CatEditStatus','".$admin."/category/addcategory_permissions.php',-1);", $imagesURL."/toolbar/tool_cancel.gif"); + +$sec =& $objSections->GetSection($section); +if($c->Get("CategoryId")==0) +{ + $sec->Set("left",NULL); + $sec->Set("right",NULL); +} + +int_header($objListToolBar,NULL,$title); +if ($objSession->GetVariable("HasChanges") == 1) { +?> + + + + +
    + +
    + + + + + + + +
    + + + +"; + echo ""; + echo ""; + } + } +?> + +
    "; + $getvar = "?env=".BuildEnv()."&module=$module&GroupId=$GroupId"; + echo "$module
    + "> + "> + + + + +
    + > + + + + +
    + +
    + + + + +
    + + Index: trunk/themes/default/img/noimage.gif =================================================================== diff -u Binary files differ Index: trunk/admin/index.php =================================================================== diff -u --- trunk/admin/index.php (revision 0) +++ trunk/admin/index.php (revision 13) @@ -0,0 +1,152 @@ +"; + echo "Please use the installation script to fix the problem.

    "; + echo "Go to installation script

    "; + flush(); + die(); +} + +$sub = substr($pathtoroot,strlen($pathchar)*-1); +if($sub!=$pathchar) +{ + $pathtoroot = $pathtoroot.$pathchar; +} +//echo "
    "; print_r($_POST); echo "
    "; +require_once("../kernel/startup.php"); + +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); +$admin = substr($path,strlen($pathtoroot)); +$objConfig->Set("AdminDirectory",$admin,0,TRUE); +$objConfig->Save(); + +//echo "Setting admin to $admin
    \n"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$browseURL = $adminURL."/browse"; +$cssURL = $adminURL."/include"; + + +if (!admin_login()) +{ + if(!headers_sent()) + setcookie("sid"," ",time()-3600); + $objSession->Logout(); + + require_once("login.php"); +} + +$envar = "env=" . BuildEnv(); + +require_once ("include/elements.php"); +require_once ("../kernel/admin/include/navmenu.php"); + +$pathtolocal = $pathtoroot; + +?> + + + + + + + + In-portal Administration + + + + + + + + " name="main" marginwidth="0" marginheight="0" frameborder="NO" noresize scrolling="auto"> + + + + <body bgcolor="#ffffff"> + <p></p> + </body> + + \ No newline at end of file Index: trunk/admin/icons/icon46_settings_smiley.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/sad2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.undo.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-oci8po.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-oci8po.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-oci8po.inc.php (revision 13) @@ -0,0 +1,166 @@ + + + Should some emulation of RecordCount() be implemented? + +*/ + +include_once(ADODB_DIR.'/drivers/adodb-oci8.inc.php'); + +class ADODB_oci8po extends ADODB_oci8 { + var $databaseType = 'oci8po'; + var $dataProvider = 'oci8'; + var $metaColumnsSQL = "select lower(cname),coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno"; //changed by smondino@users.sourceforge. net + var $metaTablesSQL = "select lower(table_name) from cat where table_type in ('TABLE','VIEW')"; + + function Prepare($sql) + { + $sqlarr = explode('?',$sql); + $sql = $sqlarr[0]; + for ($i = 1, $max = sizeof($sqlarr); $i < $max; $i++) { + $sql .= ':'.($i-1) . $sqlarr[$i]; + } + return ADODB_oci8::Prepare($sql); + } + + // emulate handling of parameters ? ?, replacing with :bind0 :bind1 + function _query($sql,$inputarr) + { + if (is_array($inputarr)) { + $i = 0; + if (is_array($sql)) { + foreach($inputarr as $v) { + $arr['bind'.$i++] = $v; + } + } else { + $sqlarr = explode('?',$sql); + $sql = $sqlarr[0]; + foreach($inputarr as $k => $v) { + $sql .= ":$k" . $sqlarr[++$i]; + } + } + } + return ADODB_oci8::_query($sql,$inputarr); + } + + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordset_oci8po extends ADORecordset_oci8 { + + var $databaseType = 'oci8po'; + + function ADORecordset_oci8po($queryID,$mode=false) + { + $this->ADORecordset_oci8($queryID,$mode); + } + + function Fields($colname) + { + if ($this->fetchMode & OCI_ASSOC) return $this->fields[$colname]; + + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + return $this->fields[$this->bind[strtoupper($colname)]]; + } + + // lowercase field names... + function &_FetchField($fieldOffset = -1) + { + $fld = new ADOFieldObject; + $fieldOffset += 1; + $fld->name = strtolower(OCIcolumnname($this->_queryID, $fieldOffset)); + $fld->type = OCIcolumntype($this->_queryID, $fieldOffset); + $fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset); + if ($fld->type == 'NUMBER') { + //$p = OCIColumnPrecision($this->_queryID, $fieldOffset); + $sc = OCIColumnScale($this->_queryID, $fieldOffset); + if ($sc == 0) $fld->type = 'INT'; + } + return $fld; + } + + // 10% speedup to move MoveNext to child class + function MoveNext() + { + if (!$this->EOF) { + $this->_currentRow++; + if(@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) { + if ($this->fetchMode & OCI_ASSOC) $this->_updatefields(); + return true; + } + $this->EOF = true; + } + return false; + } + + /* Optimize SelectLimit() by using OCIFetch() instead of OCIFetchInto() */ + function &GetArrayLimit($nrows,$offset=-1) + { + if ($offset <= 0) return $this->GetArray($nrows); + for ($i=1; $i < $offset; $i++) + if (!@OCIFetch($this->_queryID)) return array(); + + if (!@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) return array(); + if ($this->fetchMode & OCI_ASSOC) $this->_updatefields(); + $results = array(); + $cnt = 0; + while (!$this->EOF && $nrows != $cnt) { + $results[$cnt++] = $this->fields; + $this->MoveNext(); + } + + return $results; + } + + // Create associative array + function _updatefields() + { + if (ADODB_ASSOC_CASE == 2) return; // native + + $arr = array(); + $lowercase = ADODB_ASSOC_CASE == 0; + foreach ($this->fields as $k => $v) { + if (is_integer($k)) $arr[$k] = $v; + else { + if ($lowercase) + $arr[strtolower($k)] = $v; + else + $arr[strtoupper($k)] = $v; + } + } + $this->fields = $arr; + } + + function _fetch() + { + $ret = @OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode); + if ($ret) { + if ($this->fetchMode & OCI_ASSOC) $this->_updatefields(); + } + return $ret; + } + +} +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/lang/zh-cn.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/zh-cn.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/zh-cn.js (revision 13) @@ -0,0 +1,198 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * en.js: English support. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "剪切" ; +lang["Copy"] = "拷贝" ; +lang["Paste"] = "粘贴" ; +lang["PasteText"] = "纯文本粘贴" ; +lang["PasteWord"] = "来自Word的粘贴" ; +lang["Find"] = "查找..." ; +lang["SelectAll"] = "选择全部" ; +lang["RemoveFormat"] = "去除格式" ; +lang["InsertLink"] = "插入/编辑 链接 " ; +lang["RemoveLink"] = "去除链接" ; +lang["InsertImage"] = "插入/编辑 图片" ; +lang["InsertTable"] = "插入/编辑 表格" ; +lang["InsertLine"] = "插入水平线" ; +lang["InsertSpecialChar"] = "插入特殊字符" ; +lang["InsertSmiley"] = "插入表情符号" ; +lang["About"] = "关于..." ; + +lang["Bold"] = "粗体" ; +lang["Italic"] = "斜体" ; +lang["Underline"] = "下划线" ; +lang["StrikeThrough"] = "文字删除线" ; +lang["Subscript"] = "下标" ; +lang["Superscript"] = "上标" ; +lang["LeftJustify"] = "左对齐" ; +lang["CenterJustify"] = "居中对齐" ; +lang["RightJustify"] = "右对齐" ; +lang["BlockJustify"] = "两端对齐" ; +lang["DecreaseIndent"] = "减少缩进" ; +lang["IncreaseIndent"] = "增加缩进" ; +lang["Undo"] = "撤销" ; +lang["Redo"] = "还原" ; +lang["NumberedList"] = "自动编号" ; +lang["BulettedList"] = "项目符号" ; + +lang["ShowTableBorders"] = "显示表格线" ; +lang["ShowDetails"] = "显示明细" ; + +lang["FontStyle"] = "样式" ; +lang["FontFormat"] = "格式" ; +lang["Font"] = "字体" ; +lang["FontSize"] = "字体大小" ; +lang["TextColor"] = "字体颜色" ; +lang["BGColor"] = "背景色" ; +lang["Source"] = "Html源" ; + +// Context Menu + +lang["EditLink"] = "编辑链接" ; +lang["InsertRow"] = "插入行" ; +lang["DeleteRows"] = "删除行" ; +lang["InsertColumn"] = "插入列" ; +lang["DeleteColumns"] = "删除列" ; +lang["InsertCell"] = "插入单元格" ; +lang["DeleteCells"] = "删除单元格" ; +lang["MergeCells"] = "合并单元格" ; +lang["SplitCell"] = "拆分单元格" ; +lang["CellProperties"] = "单元格属性" ; +lang["TableProperties"] = "表格属性" ; +lang["ImageProperties"] = "图片属性" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "正在处理XHTML. 请稍等..." ; +lang["Done"] = "完成" ; +lang["PasteWordConfirm"] = "粘贴的内容来自Word. 你需要去除它的格式吗?" ; +lang["NotCompatiblePaste"] = "这个操作需要Internet Explorer version 5.5 或以上版本. 你需要粘贴它而不去除格式吗?" ; + +// Dialogs +lang["DlgBtnOK"] = "确定" ; +lang["DlgBtnCancel"] = "取消" ; +lang["DlgBtnClose"] = "关闭" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "插入图片" ; +lang["DlgImgTitleEdit"] = "编辑图片" ; +lang["DlgImgBtnUpload"] = "放送到服务器" ; +lang["DlgImgURL"] = "地址" ; +lang["DlgImgUpload"] = "上传" ; +lang["DlgImgBtnBrowse"] = "浏览服务器" ; +lang["DlgImgAlt"] = "替换的文本" ; +lang["DlgImgWidth"] = "宽度" ; +lang["DlgImgHeight"] = "高度" ; +lang["DlgImgLockRatio"] = "锁定比例" ; +lang["DlgBtnResetSize"] = "重置尺寸" ; +lang["DlgImgBorder"] = "边框" ; +lang["DlgImgHSpace"] = "横向坐标" ; +lang["DlgImgVSpace"] = "纵向坐标" ; +lang["DlgImgAlign"] = "对齐方式" ; +lang["DlgImgAlignLeft"] = "左边" ; +lang["DlgImgAlignAbsBottom"] = "绝对靠底" ; +lang["DlgImgAlignAbsMiddle"] = "绝对靠中" ; +lang["DlgImgAlignBaseline"] = "基准线" ; +lang["DlgImgAlignBottom"] = "靠底" ; +lang["DlgImgAlignMiddle"] = "靠中" ; +lang["DlgImgAlignRight"] = "靠右" ; +lang["DlgImgAlignTextTop"] = "文字顶" ; +lang["DlgImgAlignTop"] = "顶端" ; +lang["DlgImgPreview"] = "预览" ; +lang["DlgImgMsgWrongExt"] = "对不起, 只运行上传以下类型的文件:\n\n" + config.ImageUploadAllowedExtensions + "\n\n操作取消." ; +lang["DlgImgAlertSelect"] = "请选择要上传的文件." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "链接" ; // NEW +lang["DlgLnkURL"] = "地址" ; +lang["DlgLnkUpload"] = "上传" ; +lang["DlgLnkTarget"] = "目标" ; +lang["DlgLnkTargetNotSet"] = "<无>" ; +lang["DlgLnkTargetBlank"] = "新窗口 (_blank)" ; +lang["DlgLnkTargetParent"] = "父窗口 (_parent)" ; +lang["DlgLnkTargetSelf"] = "同一窗口 (_self)" ; +lang["DlgLnkTargetTop"] = "顶端窗口(_top)" ; +lang["DlgLnkTitle"] = "标题" ; +lang["DlgLnkBtnUpload"] = "发送到服务器" ; +lang["DlgLnkBtnBrowse"] = "浏览服务器" ; +lang["DlgLnkMsgWrongExtA"] = "对不起, 只运行上传以下类型的文件:\n\n" + config.LinkUploadAllowedExtensions + "\n\n操作取消." ; +lang["DlgLnkMsgWrongExtD"] = "对不起, 以下类型的文件不运行上传:\n\n" + config.LinkUploadDeniedExtensions + "\n\n操作取消." ; + +// Color Dialog +lang["DlgColorTitle"] = "颜色选择" ; +lang["DlgColorBtnClear"] = "清除" ; +lang["DlgColorHighlight"] = "高亮" ; +lang["DlgColorSelected"] = "已选择" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "插入表情符号" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "插入特殊符号" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "插入表格" ; +lang["DlgTableTitleEdit"] = "编辑表格" ; +lang["DlgTableRows"] = "行数" ; +lang["DlgTableColumns"] = "列数" ; +lang["DlgTableBorder"] = "边框大小" ; +lang["DlgTableAlign"] = "对齐方式" ; +lang["DlgTableAlignNotSet"] = "<无>" ; +lang["DlgTableAlignLeft"] = "居左" ; +lang["DlgTableAlignCenter"] = "居中" ; +lang["DlgTableAlignRight"] = "居右" ; +lang["DlgTableWidth"] = "宽度" ; +lang["DlgTableWidthPx"] = "像素" ; +lang["DlgTableWidthPc"] = "百分比" ; +lang["DlgTableHeight"] = "高度" ; +lang["DlgTableCellSpace"] = "单元格间距" ; +lang["DlgTableCellPad"] = "单元格填充" ; +lang["DlgTableCaption"] = "标题" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "单元格属性" ; +lang["DlgCellWidth"] = "宽度" ; +lang["DlgCellWidthPx"] = "像素" ; +lang["DlgCellWidthPc"] = "百分比" ; +lang["DlgCellHeight"] = "高度" ; +lang["DlgCellWordWrap"] = "自动折行" ; +lang["DlgCellWordWrapNotSet"] = "<无>" ; +lang["DlgCellWordWrapYes"] = "是" ; +lang["DlgCellWordWrapNo"] = "否" ; +lang["DlgCellHorAlign"] = "水平对齐方式" ; +lang["DlgCellHorAlignNotSet"] = "<无>" ; +lang["DlgCellHorAlignLeft"] = "居左" ; +lang["DlgCellHorAlignCenter"] = "居中" ; +lang["DlgCellHorAlignRight"] = "居右" ; +lang["DlgCellVerAlign"] = "垂直对齐方式" ; +lang["DlgCellVerAlignNotSet"] = "<无>" ; +lang["DlgCellVerAlignTop"] = "顶端" ; +lang["DlgCellVerAlignMiddle"] = "居中" ; +lang["DlgCellVerAlignBottom"] = "底端" ; +lang["DlgCellVerAlignBaseline"] = "基准线" ; +lang["DlgCellRowSpan"] = "行跨越" ; +lang["DlgCellCollSpan"] = "列跨越" ; +lang["DlgCellBackColor"] = "背景色" ; +lang["DlgCellBorderColor"] = "单元线颜色" ; +lang["DlgCellBtnSelect"] = "选择..." ; + +// About Dialog +lang["DlgAboutVersion"] = "版本" ; +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "查看更多信息请到" ; \ No newline at end of file Index: trunk/kernel/admin/include/toolbar/editgroup_users.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/editgroup_users.php (revision 0) +++ trunk/kernel/admin/include/toolbar/editgroup_users.php (revision 13) @@ -0,0 +1,93 @@ +SetVariable("Page_Userlist","1"); + +/* determine current view menu settings */ +$UserView = $objConfig->Get("User_View"); +$ViewNormal = 0; + +if(!is_numeric($UserView)) +{ + $UserView = $Bit_All; //Set all bits ON + $UserFilter = ""; +} + if($UserView & $Bit_Valid) + $Status[] = 1; + + if($UserView & $Bit_Disabled) + $Status[] = 0; + + if($UserView & $Bit_Pending) + $Status[] = 2; + + + if(count($Status)>0) + { + $UserFilter = "Status IN (".implode(",",$Status).")"; + } + else + $UserFilter = "Status = -1"; + +/* Set the Items PerPage value */ +$User_Page = (int)$objConfig->Get("Perpage_User"); +if(!$User_Page) + $User_Page = 10; + +/* Set the sort values */ +$SortField = trim($objConfig->Get("User_SortField")); +$SortOrder = trim($objConfig->Get("User_SortOrder")); + +if(!strlen($SortOrder)) + $SortOrder = "asc"; + +$browseURL = $adminURL."/browse"; + +$lang_users = admin_language("la_Text_Users"); +$lang_Username = admin_language("la_prompt_Username"); +$lang_LastName = admin_language("la_prompt_LastName"); +$lang_FirstName = admin_language("la_prompt_FirstName"); +$lang_Email = admin_language("la_prompt_Email"); +$lang_PrimaryGroup = admin_language("la_prompt_PrimaryGroup"); +$lang_Valid = admin_language("la_Text_Valid"); + +print << + + + + + + + +END; +?> \ No newline at end of file Index: trunk/themes/default/img/ic_addtofav.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/index.tpl =================================================================== diff -u --- trunk/themes/default/index.tpl (revision 0) +++ trunk/themes/default/index.tpl (revision 13) @@ -0,0 +1,90 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + + + + + + + + + + + + + +

    +
    + + + Index: trunk/admin/install/domain.php =================================================================== diff -u --- trunk/admin/install/domain.php (revision 0) +++ trunk/admin/install/domain.php (revision 13) @@ -0,0 +1,49 @@ + +  Select Domain

    + + + + + + + +
     Step - Select Domain
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/icons/icon24_site.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/images/techcable.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/ak.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/tr.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/tr.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/tr.js (revision 13) @@ -0,0 +1,197 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * tr.js: Turkish support. + * Author: + * Ali Bulbul (abulbul@yahoo.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Kes" ; +lang["Copy"] = "Kopyala" ; +lang["Paste"] = "Paste" ; +lang["PasteText"] = "Yapıştır" ; +lang["PasteWord"] = "Word'den Yapıştır" ; +lang["Find"] = "Ara" ; +lang["SelectAll"] = "Tümünü Seç" ; +lang["RemoveFormat"] = "Biçimi Kaldır" ; +lang["InsertLink"] = "Link Ekle/Düzelt" ; +lang["RemoveLink"] = "Link'i Kaldır" ; +lang["InsertImage"] = "Resim Ekle/Düzenle" ; +lang["InsertTable"] = "Tablo Ekle/Düzenle" ; +lang["InsertLine"] = "Yatay Çizgi Ekle" ; +lang["InsertSpecialChar"] = "Özel Karakter Ekle" ; +lang["InsertSmiley"] = "İfade Ekle" ; +lang["About"] = "FCKeditor Hakkında" ; + +lang["Bold"] = "Kalın" ; +lang["Italic"] = "İtalik" ; +lang["Underline"] = "Altçizi" ; +lang["StrikeThrough"] = "Üstü Çizili" ; +lang["Subscript"] = "Alt Yazı" ; +lang["Superscript"] = "Üst Yazı" ; +lang["LeftJustify"] = "Sola Hizala" ; +lang["CenterJustify"] = "Ortala" ; +lang["RightJustify"] = "Sağa Hizala" ; +lang["BlockJustify"] = "Her iki yana Hizala" ; +lang["DecreaseIndent"] = "Girintiyi Azalt" ; +lang["IncreaseIndent"] = "Girintiyi Artır" ; +lang["Undo"] = "Geri Al" ; +lang["Redo"] = "Yenile" ; +lang["NumberedList"] = "Numaralandırma" ; +lang["BulettedList"] = "Madde İşaretleri" ; + +lang["ShowTableBorders"] = "Tablo Kenarlıklarını Göster" ; +lang["ShowDetails"] = "Ayrıntıları Göster" ; + +lang["FontStyle"] = "Yazı Sitili" ; +lang["FontFormat"] = "Yazı Biçimi" ; +lang["Font"] = "Yazı Tipi" ; +lang["FontSize"] = "Yazı Tipi Büyüklüğü" ; +lang["TextColor"] = "Yazı Rengi" ; +lang["BGColor"] = "Arkaplan Rengi" ; +lang["Source"] = "Kaynak" ; + +// Context Menu + +lang["EditLink"] = "Bağlantı Ekle" ; +lang["InsertRow"] = "Satır Ekle" ; +lang["DeleteRows"] = "Satır Sil" ; +lang["InsertColumn"] = "Sütun Ekle" ; +lang["DeleteColumns"] = "Sütun Sil" ; +lang["InsertCell"] = "Hücre Ekle" ; +lang["DeleteCells"] = "Hücre Sil" ; +lang["MergeCells"] = "Hücre Birleştir" ; +lang["SplitCell"] = "Hücre Böl" ; +lang["CellProperties"] = "Hücre Özellikleri" ; +lang["TableProperties"] = "Tablo Özellikleri" ; +lang["ImageProperties"] = "Resim Özellikleri" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "XHTML Yürütülüyor. Lütfen Bekleyiniz..." ; +lang["Done"] = "Tamamlandı." ; +lang["PasteWordConfirm"] = "Word Belgesinden kopyaladığınız bir metni yapıştırmak istiyorsunuz. Yapıştırmadan önce onu temizlemek ister misiniz?"; +lang["NotCompatiblePaste"] = "Bu komut Internet Explorer version 5.5 veya yükseğinde çalışır. Temizlemeden yapıştırmak istiyor musunuz?" ; + +// Dialogs +lang["DlgBtnOK"] = "Tamam" ; +lang["DlgBtnCancel"] = "İptal" ; +lang["DlgBtnClose"] = "Kapat" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Resim Ekle" ; +lang["DlgImgTitleEdit"] = "Resmi Düzenle" ; +lang["DlgImgBtnUpload"] = "Sunucuya Gönder" ; +lang["DlgImgURL"] = "İnternet Adresi" ; +lang["DlgImgUpload"] = "Yükle" ; +lang["DlgImgBtnBrowse"] = "Sonucuya bak" ; +lang["DlgImgAlt"] = "Alternatif Yazı" ; +lang["DlgImgWidth"] = "Genişlik" ; +lang["DlgImgHeight"] = "Yükseklik" ; +lang["DlgImgLockRatio"] = "Oranı Sabitle" ; +lang["DlgBtnResetSize"] = "Büyüklüğü Sıfırla" ; +lang["DlgImgBorder"] = "Kenarlık" ; +lang["DlgImgHSpace"] = "Yatay Boşluk" ; +lang["DlgImgVSpace"] = "Dikey Boşluk" ; +lang["DlgImgAlign"] = "Hizala" ; +lang["DlgImgAlignLeft"] = "Soldan" ; +lang["DlgImgAlignAbsBottom"] = "Alttan" ; +lang["DlgImgAlignAbsMiddle"] = "Ortada" ; +lang["DlgImgAlignBaseline"] = "Taban" ; +lang["DlgImgAlignBottom"] = "Alt" ; +lang["DlgImgAlignMiddle"] = "Orta" ; +lang["DlgImgAlignRight"] = "Sol" ; +lang["DlgImgAlignTextTop"] = "Yazının Üstü" ; +lang["DlgImgAlignTop"] = "Üst" ; +lang["DlgImgPreview"] = "Önizleme" ; +lang["DlgImgMsgWrongExt"] = "Lütfen Sadece izin verilen dosyaları upload ediniz. : \n\n" + config.ImageUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgImgAlertSelect"] = "Upload Edeceğiniz Dosyayı Seçiniz." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; // NEW +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Upload" ; +lang["DlgLnkTarget"] = "Hedef" ; +lang["DlgLnkTargetNotSet"] = "Belirtilmemiş" ; +lang["DlgLnkTargetBlank"] = "Yeni Pencere(_blank)" ; +lang["DlgLnkTargetParent"] = "Geçerli Pencere (_parent)" ; +lang["DlgLnkTargetSelf"] = "Aynı Pencere (_self)" ; +lang["DlgLnkTargetTop"] = "Enüstteki Pencere (_top)" ; +lang["DlgLnkTitle"] = "Başlık" ; +lang["DlgLnkBtnUpload"] = "Sunucuya Gönder" ; +lang["DlgLnkBtnBrowse"] = "Sunucudaki Dosyalar" ; +lang["DlgLnkMsgWrongExtA"] = "Lütfen Sadece izin verilen dosyaları upload ediniz. :\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgLnkMsgWrongExtD"] = "Lütfen Sadece izin verilen dosyaları upload ediniz. :\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperation canceled." ; + +// Color Dialog +lang["DlgColorTitle"] = "Renk Seç" ; +lang["DlgColorBtnClear"] = "Temizle" ; +lang["DlgColorHighlight"] = "Vurgu" ; +lang["DlgColorSelected"] = "Seçili" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "İfade Ekle" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Özel Karakter Ekle" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Tablo Ekle" ; +lang["DlgTableTitleEdit"] = "Tablo Düzenle" ; +lang["DlgTableRows"] = "Satırlar" ; +lang["DlgTableColumns"] = "Sütunlar" ; +lang["DlgTableBorder"] = "Kenarlık Büyüklüğü" ; +lang["DlgTableAlign"] = "Hizalama" ; +lang["DlgTableAlignNotSet"] = "Belirtilmemiş" ; +lang["DlgTableAlignLeft"] = "Sol" ; +lang["DlgTableAlignCenter"] = "Ortalı" ; +lang["DlgTableAlignRight"] = "Sağ" ; +lang["DlgTableWidth"] = "Genişlik" ; +lang["DlgTableWidthPx"] = "Piksel" ; +lang["DlgTableWidthPc"] = "Yüzde" ; +lang["DlgTableHeight"] = "Yükseklik" ; +lang["DlgTableCellSpace"] = "Hücre Boşluğu" ; +lang["DlgTableCellPad"] = "Hücre Doluluğu" ; +lang["DlgTableCaption"] = "Başlık" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Hücre Özellikleri" ; +lang["DlgCellWidth"] = "Genişik" ; +lang["DlgCellWidthPx"] = "Piksel" ; +lang["DlgCellWidthPc"] = "Yüzde" ; +lang["DlgCellHeight"] = "Yükseklik" ; +lang["DlgCellWordWrap"] = "Satır Dönüşü" ; +lang["DlgCellWordWrapNotSet"] = "Belirtilmemiş" ; +lang["DlgCellWordWrapYes"] = "Evet" ; +lang["DlgCellWordWrapNo"] = "Hayır" ; +lang["DlgCellHorAlign"] = "Yatay Hizalama" ; +lang["DlgCellHorAlignNotSet"] = "Belirtilmemiş" ; +lang["DlgCellHorAlignLeft"] = "Sol" ; +lang["DlgCellHorAlignCenter"] = "Ortalı" ; +lang["DlgCellHorAlignRight"] = "Sağ" ; +lang["DlgCellVerAlign"] = "Dikey Hizalama" ; +lang["DlgCellVerAlignNotSet"] = "Belirtilmemiş" ; +lang["DlgCellVerAlignTop"] = "Yukarıda" ; +lang["DlgCellVerAlignMiddle"] = "Ortada" ; +lang["DlgCellVerAlignBottom"] = "Altta" ; +lang["DlgCellVerAlignBaseline"] = "Tabanda" ; +lang["DlgCellRowSpan"] = "Satır Aralığı " ; +lang["DlgCellCollSpan"] = "Sütun Aralığı" ; +lang["DlgCellBackColor"] = "Arkaplan Rengi" ; +lang["DlgCellBorderColor"] = "Kenarlık Rengi" ; +lang["DlgCellBtnSelect"] = "Seçim..." ; + +// About Dialog +lang["DlgAboutVersion"] = "Sürüm" ; +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License\n \n Türkcesi: Ali Bulbul (abulbul@yahoo.com)" ; +lang["DlgAboutInfo"] = "Bilgi için: " ; \ No newline at end of file Index: trunk/admin/icons/icon24_settings_general.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_rateit.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/upgrade.php =================================================================== diff -u --- trunk/admin/install/upgrade.php (revision 0) +++ trunk/admin/install/upgrade.php (revision 13) @@ -0,0 +1,50 @@ + "; + } + return $o; + }//Individual Tab + + function active_tab() + { + global $imagesURL, $envar; + + $link = $this->URL(); + $onclick = $this->Get("onclick"); + if(!$this->IsJavaScriptLink()) + { + if(!strstr($link,"env=")) + $link .= "?". $envar; + } + + $caption = language($this->Get("name")); + + if (strlen($caption)<=8) + $backgr = "$imagesURL/tab_active_back3.jpg"; + else if (strlen($caption)<=20) + $backgr = "$imagesURL/tab_active_back2.jpg"; + else + $backgr = "$imagesURL/tab_active_back.jpg"; + + $o = " + "; + return $o; + }//Active Tab +} /*clsSection*/ + +class clsSectionList +{ + var $sections; +// var $section; + var $current; + + function clsSectionList() + { + $this->sections = array(); + $this->current = "default"; + } + + function GetSection($section) + { + if(is_array($this->sections) && strlen($section)) + { + if(array_key_exists($section,$this->sections)) + { + return $this->sections[$section]; + } + else + return NULL; + } + else + return NULL; + } + + function SetCurrentSection($section) + { + $this->current = $section; + } + + function GetCurrentSection() + { + $ret = $this->GetSection($this->current); + if(!is_object($ret)) + $ret = $this->GetSection("default"); + return $ret; + } + + function AddSection($section,$name,$title,$path,$file,$icon,$icon_small, $child,$parent,$left,$right, + $notree=0,$onClick = "",$notabs=0,$nonavbar=0,$notitle=0,$toolbar=0,$icon_list="", $bar_title = "", $bar_title_plain_text = "") + { + if($file == "subitems.php") + $file .= "?section=$section"; + + $s = new clsSection(); + + $s->Set("name", $name); + $s->Set("title",$title); + $s->Set("path", $path); + $s->Set("file", $file); + $s->Set("icon", $icon); + $s->Set("icon_list", $icon_list); + $s->Set("icon_small", $icon_small); + $s->Set("child", $child); + $s->Set("parent", $parent); + $s->Set("left", $left); + $s->Set("right", $right); + $s->Set("notree", $notree); + $s->Set("notabs", $notabs); + $s->Set("nonavbar", $nonavbar); + $s->Set("notitle", $notitle); + $s->Set("toolbar", $toolbar); + $s->Set("description", NULL); + $s->Set("onclick", $onClick); + $s->Set("key",$section); + $s->Set("bar_title",$bar_title); + $s->Set("bar_title_plain_text", $bar_title_plain_text); + + if($parent != NULL) + { + $p = $this->GetSection($parent); + if(is_object($p)) + { + if(!strlen($p->Get("child"))) + { + //echo "Setting child of $parent to $section
    \n"; + $p->Set("child", $section); //set the parent if none set! + $this->sections[$parent]=$p; + } + } + if(!strlen($left) && !strlen($right)) + { + /* find first child w/ a null right value */ + foreach($this->sections as $secname => $subsection) + { + if($subsection->Get("parent") == $parent) + { + if(!strlen($subsection->Get("right"))) + { + $this->sections[$secname]->Set("right", $section); + $s->Set("left", $secname); + break; + } + } + } + } + } + $this->sections[$section]=$s; + } + + function AddDescription($section,$desc) + { + $sec = $this->GetSection($section); + if(is_object($sec)) + { + $sec->Set("description",$desc); + $this->sections[$section] = $sec; + } + } + + function sectionURL($section) + { + return $this->sections[$section]->URL(); + } + + function SectionIconURL($section,$large=1) + { + return $this->sections[$section]->IconURL($large); + } + + function BuildTree($element, $parent) + { + global $pathtoroot,$envar; + global $rootURL; + + $org = $element; + $element = strtolower($element); + $j_el=str_replace("-","_",$element); + $j_el=str_replace(":","_",$j_el); + $j_par=str_replace("-","_",$parent); + $j_par=str_replace(":","_",$j_par); + $sec = $this->sections[$element]; + if(is_object($sec)) + { + $caption = $this->sections[$element]->Get("name"); + if(strlen($caption)==0) + $caption = $this->sections[$element]->Get("title"); + $caption = language($caption); + $child =$this->sections[$element]->Get("child"); + $notree = ""; + if( isset($this->sections[$child]) && is_object($this->sections[$child]) ) + $notree = $this->sections[$child]->Get("notree"); + if (($child == NULL) or ($notree==-1)) + { + print "var item = insDoc($j_par, gLnk(0, \"".$caption."\", \"".$this->SectionURL($element)."\"));\n"; + print "item.iconSrc = '".$this->SectionIconURL($element,0)."';\n"; + if($this->sections[$element]->Get("right")!=NULL) + $this->BuildTree($this->sections[$element]->Get("right"), $parent); + + return; + } + if ($child != NULL && $notree !=-1) + { //print "$j_el = insFld($j_par, gFld(\"".$sections[$element]['name']."\"));\n"; + + print "var $j_el = insFld($j_par, gFld(\"".$caption."\",\"".$this->SectionURL($element)."\"));\n"; + print $j_el . ".iconSrc='".$this->SectionIconURL($element,0)."';\n"; + if($this->sections[$element]->Get("right")!=NULL) + $this->BuildTree($this->sections[$element]->Get("right"), $parent); + + $parent = $element; + $this->BuildTree($this->sections[$element]->Get("child"), $parent); + + } + } + } + + function page_title() + { + global $imagesURL,$adminURL, $objConfig; + + $o = ""; + $sec = $this->GetCurrentSection(); + if($sec->Get("notitle")!="1") + { + $caption = $sec->Get("title"); + + if(strlen($caption)==0) + { + if(strlen($sec->Get("parent"))) + { + $p = $this->GetSection($sec->Get("parent")); + if(is_object($p)) + { + $caption = $p->Get("title"); + $icon = $p->IconURL(1); + } + } + } + else + $icon = $sec->IconURL(1); + $logout_link = $adminURL."/index.php"; + if(strlen($caption)) + { + if($sec->Get("key")=="in-portal:root") + { + $caption=$objConfig->Get("Site_Name"); + } + else + { + $caption = admin_language($caption); + } + $bg_image = 'logo_bg.gif'; + $replace_modules = Array('in-link','in-news','in-bulletin'); + foreach($replace_modules as $r_module) + if( $this->IsModule($r_module) ) + { + $bg_image = 'logo_bg_'.$r_module.'.gif'; + break; + } + + $o = "
    +
    +
    +
    "; + $o .= "
    + +\n"; +?> + + + + + + + + +
    "; + echo ""; + echo $current; + echo "
    + Other: + +


    +
    + + + + + + + +
    +
    +  Select Modules to Upgrade

    + + + + + + + +
     Step - Select Modules
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/install/nav_bg.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_theme_disabled.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/relevance/rel_1.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_community.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_disconnect_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_preview_language.gif =================================================================== diff -u Binary files differ Index: trunk/compat/vsprintf.php =================================================================== diff -u --- trunk/compat/vsprintf.php (revision 0) +++ trunk/compat/vsprintf.php (revision 13) @@ -0,0 +1,47 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: vsprintf.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace vsprintf() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.vsprintf + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.1.0 + * @require PHP 4.0.4 (call_user_func_array) + */ +if (!function_exists('vsprintf')) +{ + function vsprintf ($format, $args) + { + if (count($args) < 2) { + trigger_error('vsprintf() Too few arguments', E_USER_WARNING); + return null; + } + + array_unshift($args, $format); + return call_user_func_array('sprintf', $args); + } +} +?> \ No newline at end of file Index: trunk/admin/images/icon_error.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/rsfilter.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/rsfilter.inc.php (revision 0) +++ trunk/kernel/include/adodb/rsfilter.inc.php (revision 13) @@ -0,0 +1,54 @@ + $v) { + $arr[$k] = ucwords($v); + } + } + $rs = RSFilter($rs,'do_ucwords'); + */ +function &RSFilter($rs,$fn) +{ + if ($rs->databaseType != 'array') { + if (!$rs->connection) return false; + + $rs = &$rs->connection->_rs2rs($rs); + } + $rows = $rs->RecordCount(); + for ($i=0; $i < $rows; $i++) { + $fn($rs->_array[$i],$rs); + } + if (!$rs->EOF) { + $rs->_currentRow = 0; + $rs->fields = $rs->_array[0]; + } + + return $rs; +} +?> \ No newline at end of file Index: trunk/admin/category/addcategory_images.php =================================================================== diff -u --- trunk/admin/category/addcategory_images.php (revision 0) +++ trunk/admin/category/addcategory_images.php (revision 13) @@ -0,0 +1,345 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +/* ------------------------------------- Edit Table --------------------------------------------------- */ +unset($objEditItems); + +$objEditItems = new clsCatList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Category"); + +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); +$c = $objEditItems->GetItemByIndex($en); + +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_item_image"; +/* -------------------------------------- Section configuration ------------------------------------------- */ +$envar = "env=" . BuildEnv() . "&en=$en"; +$section = 'in-portal:editcategory_images'; +$sec = $objSections->GetSection($section); +$title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Category")." '".$c->Get("Name")."' - ".admin_language("la_tab_Images"); + +$SortFieldVar = "Image_LV_Sortfield"; +$SortOrderVar = "Image_LV_Sortorder"; +$DefaultSortField = "FullName"; +$PerPageVar = "Perpage_Images"; +$CurrentPageVar = "Page_Images"; +$CurrentFilterVar = "CatImg_View"; + +$ListForm = "imagelistform"; +$CheckClass = "PermChecks"; +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$objListToolBar = new clsToolBar(); +$saveURL = $admin."/category/category_maint.php"; +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','CatEditStatus','$saveURL',1);","tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('save_edit_buttons','CatEditStatus','".$admin."/browse.php',2);","tool_cancel.gif"); +if($itemcount == 1) $objListToolBar->Add("divider"); +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/category/addcategory_images.php"; + $StatusField = "CatEditStatus"; + $form = "category"; + MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevCategory','la_NextCategory'); + $objListToolBar->Add("divider"); +} + +$listImages = array(); +$objListToolBar->Add("new_img", "la_ToolTip_New_Image",$adminURL."/category/addimage.php?".$envar,"swap('new_img','toolbar/tool_new_image_f2.gif');", + "swap('new_img', 'toolbar/tool_new_image.gif');", + "","tool_new_image.gif"); + +$objListToolBar->Add("img_edit","la_ToolTip_Edit","#", "if (PermChecks.itemChecked()) swap('img_edit','toolbar/tool_edit_f2.gif');", + "if (PermChecks.itemChecked()) swap('img_edit', 'toolbar/tool_edit.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addimage', '');", + "tool_edit.gif",TRUE,TRUE); +$listImages[] = "PermChecks.addImage('img_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1);\n"; + +$objListToolBar->Add("img_del","la_ToolTip_Delete","#", "if (PermChecks.itemChecked()) swap('img_del','toolbar/tool_delete_f2.gif');", + "if (PermChecks.itemChecked()) swap('img_del', 'toolbar/tool_delete.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_images', 'm_img_delete');", + "tool_delete.gif",FALSE,TRUE); +$listImages[] = "PermChecks.addImage('img_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1);\n "; + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("img_move_up","la_ToolTip_Move_Up","#", "if (PermChecks.itemChecked()) swap('img_move_up','toolbar/tool_move_up_f2.gif');", + "if (PermChecks.itemChecked()) swap('img_move_up', 'toolbar/tool_move_up.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_images', 'm_img_move_up');", + "tool_move_up.gif",FALSE,TRUE); +$listImages[] = "PermChecks.addImage('img_move_up','$imagesURL/toolbar/tool_move_up.gif','$imagesURL/toolbar/tool_move_up_f3.gif',1);\n "; + +$objListToolBar->Add("img_move_down","la_ToolTip_Move_Down","#", "if (PermChecks.itemChecked()) swap('img_move_down','toolbar/tool_move_down_f2.gif');", + "if (PermChecks.itemChecked()) swap('img_move_down', 'toolbar/tool_move_down.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addcategory_images', 'm_img_move_down');", + "tool_move_down.gif",FALSE,TRUE); +$listImages[] = "PermChecks.addImage('img_move_down','$imagesURL/toolbar/tool_move_down.gif','$imagesURL/toolbar/tool_move_down_f3.gif',1);\n "; + +$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); + +/* ----------------------------------------- Set the View Filter ---------------------------------------- */ +$Img_AllValue = 3; +$Bit_Enabled=1; +$Bit_Disabled=2; +$FilterLabels = array(); + +$FilterLabels[0] = admin_language("la_Text_Enabled"); +$FilterLabels[1] = admin_language("la_Text_Disabled"); + +$ImgView = $objConfig->Get($CurrentFilterVar); + +if(!is_numeric($ImgView)) +{ + $ImgView = $Img_AllValue; +} +else +{ + if($ImgView & $Bit_Enabled) + $Filters[] = "img.Enabled=1"; + + if($ImgView & $Bit_Disabled) + $Filters[] = "img.Enabled=0"; + + if(count($Filters)) + { + $imgFilter = implode(" OR ",$Filters); + } + else + $imgFilter = "ImageId = -1"; +} + +/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/ +$objImageList = new clsImageList(); +$objImageList->SourceTable = $objSession->GetEditTable("Images"); + +$sql = "SELECT ELT(img.Enabled+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ') as Status, "; +$sql .="img.AltName as AltName, img.ImageId as ImageId, img.Enabled as Enabled, img.Priority as Priority, "; +$sql .="concat(img.Name,ELT(img.DefaultImg+1,'','
    (".admin_language("la_prompt_Primary").") ')) as FullName, "; +$sql .="if(img.LocalImage=1,'(".admin_language("la_Text_Local").") ',img.Url) as ShowURL, concat( '') AS Preview "; + +$sql .="FROM ".$objImageList->SourceTable." as img WHERE img.ResourceId=".$c->Get("ResourceId"); + +if(strlen($imgFilter)) + $sql .= " AND ($imgFilter)"; + +$order = trim($objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar)); + +$sql .=" ORDER BY Priority DESC"; +if(strlen($order)) + $sql .= ", ".$order; + +$sql .=" ".GetLimitSQL($objSession->GetVariable($CurrentPageVar),$objConfig->Get($PerPageVar)); + +$objImageList->Query_Item($sql); +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + +for($i=0;$iItems);$i++) +{ + $img =& $objImageList->GetItemRefByIndex($i); + $icon = $imagesURL."/itemicons/icon16_image_disabled.gif"; + + if($img->Get("Enabled")=="1") + { + $icon = $imagesURL."/itemicons/icon16_image.gif"; + } + $img->Set("Icon",$icon); +} + +/* ---------------------------------------- Configure the list view ---------------------------------------- */ + $objListView = new clsListView($objListToolBar,$objImageList); + $objListView->IdField = "ImageId"; + $SortOrder=0; + + if($objConfig->Get($SortOrderVar)=="asc") + $SortOrder=1; + + $objListView->ColumnHeaders->Add("FullName",language("la_ColHeader_Image"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"FullName"); + $objListView->ColumnHeaders->Add("AltName",language("la_ColHeader_AltValue"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"AltName"); + $objListView->ColumnHeaders->Add("ShowURL",language("la_ColHeader_Url"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"ShowURL"); + $objListView->ColumnHeaders->Add("Status",language("la_ColHeader_Enabled"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"Status"); + $objListView->ColumnHeaders->Add("Preview",language("la_ColHeader_Preview"),1,0,$order,"width=\"40%\"",$SortFieldVar,$SortOrderVar,"Preview"); + $objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar)); + + $objListView->PrintToolBar = FALSE; + $objListView->CurrentPageVar = "Page_Images"; + $objListView->PerPageVar = "Perpage_Images"; + $objListView->CheckboxName = "itemlist[]"; + + $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, + $CurrentFilterVar,$ImgView,$Img_AllValue); + + foreach($FilterLabels as $Bit=>$Label) + { + $objListView->AddViewMenuFilter($Label,$Bit); + } + for($i=0;$iItems);$i++) + { + $img =& $objImageList->GetItemRefByIndex($i); + $objListView->RowIcons[] = $img->Get("Icon"); + } + +$objListToolBar->AddToInitScript("fwLoadMenus();\n"); + +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +if ($objSession->GetVariable("HasChanges") == 1) { +?> +
    + + +\n"; + $i++; + } +?> + + + + + + + + +
    "; + echo ""; + echo $Texts[$i]; + echo "


    +
    + + + + + + + +
    +
    + + + +
    + +
    + +
    " method=POST> + + +PrintList(); +?> + "> + + + +
    +
    + + +
    +
    + + +
    + +
    " name="viewmenu"> + + + + +
    + + + + + \ No newline at end of file Index: trunk/themes/default/img/ic_lang_default.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_preview_language_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemtabs/tab_active.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_usersearch.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/register/register_notallowed.tpl =================================================================== diff -u --- trunk/themes/default/register/register_notallowed.tpl (revision 0) +++ trunk/themes/default/register/register_notallowed.tpl (revision 13) @@ -0,0 +1,125 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

      + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + +
    + + + + + + + + +

    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +



      +
    +


    +




      +
    " /> + " class="button"> +
    +
    + +
    +

    +

    +
    + + + Index: trunk/admin/images/toolbar/tool_new_language_var.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/js/fck_events.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_events.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_events.js (revision 13) @@ -0,0 +1,42 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_events.js: Creates the events object that handles the editor + * changes events for the toolbar. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +var events = new Object() ; + +events.attachEvent = function(eventName, attachedFunction) +{ + if (! events["ev" + eventName]) + events["ev" + eventName] = new Array() ; + + events["ev" + eventName][events["ev" + eventName].length] = attachedFunction ; +} + +events.fireEvent = function(eventName, params) +{ + var oEvents = events["ev" + eventName] ; + + if (oEvents) + { + for (i in oEvents) + { + if (typeof(oEvents[i]) == "function") + oEvents[i](params) ; + else + oEvents[i][eventName](params) ; + } + } +} \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/icon12.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/common/head.tpl =================================================================== diff -u --- trunk/themes/default/common/head.tpl (revision 0) +++ trunk/themes/default/common/head.tpl (revision 13) @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + +<inp:m_page_title /> + + + + + + + + + Index: trunk/admin/editor/FCKeditor/images/toolbar/button.justifycenter.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_move_up_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/magnifier.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/arr_no_sort.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/advsearch/advsearch_item.tpl =================================================================== diff -u --- trunk/themes/default/advsearch/advsearch_item.tpl (revision 0) +++ trunk/themes/default/advsearch/advsearch_item.tpl (revision 13) @@ -0,0 +1,27 @@ +
    "> + + + + + + + + + + + + + + + + +


    + + +
    +


    + " class="button"> + " class="button">

    +
    + +
    \ No newline at end of file Index: trunk/admin/images/toolbar/tool_export_language_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_edit.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_e-mail_f3.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/advsearch/action.php =================================================================== diff -u --- trunk/themes/default/advsearch/action.php (revision 0) +++ trunk/themes/default/advsearch/action.php (revision 13) @@ -0,0 +1,11 @@ +SetCurrentItem($n_var_list["id"]); +//$objArticleList->Page = $n_var_list["p"]; + + switch($Action) + { + + } +?> \ No newline at end of file Index: trunk/admin/include/sections.php =================================================================== diff -u --- trunk/admin/include/sections.php (revision 0) +++ trunk/admin/include/sections.php (revision 13) @@ -0,0 +1,589 @@ +$var) ? $this->$var : ''; + } + + function Set($name, $value) + { + if (is_array($name)) + { + for ($i=0; $i$var = $value[$i]; + } + } + else + { + $var = "m_" . $name; + $this->$var = $value; + } + } + + function IsJavaScriptLink() + { + $file = $this->Get('file'); + if(!$file) return false; + + return (substr($file, 0, 10) == 'javascript' || $file == '#') ? true : false; + } + + function IconURL($large=1) + { + global $rootURL; + + if($large==1) + { + $url = $rootURL.$this->Get("icon"); + } + elseif($large==2) + { + $url = $rootURL.$this->Get("icon_list"); + } + else + $url = $rootURL.$this->Get("icon_small"); + return $url; + } + + function URL() + { + global $rootURL; + + $env = BuildEnv(); + + if(!$this->IsJavaScriptLink()) + { + $url = $rootURL.$this->Get("path").$this->Get("file"); + if(strstr($url,"?")) + { + $url .= "&env=".$env; + } + else + $url .= "?env=".$env; + } + else + $url = $this->Get("file"); + return $url; + } + + /* functions to display navigation elements */ + function tab($envar) + { + global $imagesURL; + + $link = $this->URL(); + if(!$this->IsJavaScriptLink()) + { + if(!strstr($link,"env=")) + $link .= "?". $envar; + } + $onclick = $this->Get("onclick"); + $caption = language($this->Get("name")); + if(strlen($this->Get("name"))) + { + $o =" +
    + + + + + +
    \"\" + $caption
    +
    \"\"
    + + + +
    \"\" + $caption
    +
    \"\"
    +
    + \"\" $caption
    +
    +
    "; + } + } + return $o; + } + + function IsModule($module_name) + { + // checks if there is requested module used in right frame + + // module folder match + $url_split = explode('/', $_SERVER['PHP_SELF']); + if( in_array($module_name, $url_split) ) return 1; + + // module section match + if( isset($_REQUEST['section']) ) + { + $section = explode(':', $_GET['section']); + if( $section[0] == $module_name ) return true; + } + return false; + } + + function page_tabs($envar) + { + $showtabs=0; + $o = ''; + $sec = $this->GetCurrentSection(); + if ($sec->Get("notabs")!=1) + { + //get starting node + $node = $sec; + while (strlen($node->Get("left"))) + { + $node = $this->GetSection($node->Get("left")); + } + if($node) + { + + $o = " +
    + "; + $showtabs=1; + } + //traverse and print tabs + while ( isset($node) && is_object($node) ) + { + if ($node->Get("key") == $this->current) + $o .= $node->active_tab(); + else + $o .= $node->tab($envar); + + $right = $node->Get("right"); + unset($node); + if(strlen($right)) + $node = $this->GetSection($right); + } + if($showtabs) + { + $o .= "
    "; + } + } + return $o; + } + + function section_header($envar,$navbar=NULL,$extra_title=NULL) + { + global $pathtoroot; + global $pathtolocal; + global $imagesURL; + global $adminURL; + global $objConfig; + + $output = ''; + $HelpIcon = $imagesURL."/blue_bar_help.gif"; + $node = $this->GetCurrentSection(); + if(is_object($node)) + { + $helpURL = $adminURL."/help/help.php?env=$envar§ion=".$node->Get("key"); + $o = ""; + //background="'.$imagesURL.'/tabnav_left.jpg" + $o .= ''; + $o .= '"; + $o .= "
    '; + + //get path up to the parent node + while ( isset($node) && is_object($node) ) + { + if(!strlen($extra_title)) + { + $bar_title = $node->Get("bar_title"); + $bar_title_plain_text = $node->Get("bar_title_plain_text"); + + if(strlen($bar_title) && !is_null($bar_title)) + $caption = language($bar_title); + elseif (is_null($bar_title)) + $caption = ""; + else + $caption = language($node->Get("name")); + + if (strlen($bar_title_plain_text)) + $caption.= $bar_title_plain_text; + } + else + $caption = $extra_title; + + $output = "$caption"; + unset($node); + } + + $o .= $output; + if(strlen($navbar)) + $o .= "::".$navbar.""; + + $o .= ""; + $o .= "
    "; + } + return $o; + } + +} /* clsSectionList */ + +$objSections = new clsSectionList(); +$objSections->AddSection("in-portal:root", $objConfig->Get("Site_Name"), $objConfig->Get("Site_Name"), $admin."/","subitems.php", + $admin."/icons/icon46_site.gif", $admin."/icons/icon24_site.gif", + "in-portal:site", NULL, NULL,"in-portal:users",0,"",1, NULL,NULL,NULL, "", "la_section_overview"); + +$objSections->AddSection("in-portal:site", "la_tab_Site_Structure","la_title_Site_Structure", $admin."/","subitems.php", + $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_struct.gif", + "in-portal:browse", "in-portal:root", NULL,"in-portal:users",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_struct.gif","la_selecting_categories"); + +$objSections->AddSection("in-portal:users","la_tab_Community","la_title_Community",$admin."/","subitems.php", + $admin."/icons/icon46_community.gif",$admin."/icons/icon24_community.gif", NULL,"in-portal:root","in-portal:site","in-portal:modules",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_community.gif","la_section_overview"); + +$objSections->AddSection("in-portal:modules","la_tab_ModulesSettings","la_title_Settings",$admin."/","subitems.php", + $admin."/icons/icon46_modules.gif",$admin."/icons/icon24_modules.gif",NULL, "in-portal:root","in-portal:users","in-portal:reports",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_modules.gif","la_section_overview"); + +$objSections->AddSection("in-portal:mod_status","la_tab_Modules","la_title_Module_Status",$admin."/modules/","mod_status.php", + $admin."/icons/icon46_modules.gif",$admin."/icons/icon24_modules.gif",NULL, NULL,NULL,NULL,0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_modules.gif"); + +$objSections->AddSection("in-portal:addmodule","la_tab_Modules","la_title_Add_Module",$admin."/modules/","addmodule.php", + $admin."/icons/icon46_modules.gif",$admin."/icons/icon24_modules.gif",NULL, NULL,NULL,NULL,0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_modules.gif"); + +$objSections->AddSection("in-portal:reports","la_tab_Reports","la_title_Reports",$admin."/","subitems.php", + $admin."/icons/icon46_summary_logs.gif",$admin."/icons/icon24_summary_logs.gif",NULL, "in-portal:root","in-portal:modules","in-portal:system",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_summary_logs.gif","la_section_overview"); + +$objSections->AddSection("in-portal:log_summary","la_tab_Summary","la_tab_Summary",$admin."/logs/","summary.php", + $admin."/icons/icon46_summary.gif",$admin."/icons/icon24_summary.gif",NULL, + "in-portal:reports",NULL,"in-portal:searchlog",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_summary.gif"); + +$objSections->AddSection("in-portal:searchlog","la_tab_SearchLog","la_tab_SearchLog",$admin."/logs/","searchlog.php", + $admin."/icons/icon46_search_log.gif",$admin."/icons/icon24_search_log.gif", + NULL,"in-portal:reports","in-portal:log_summary","in-portal:sessionlog",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_search_log.gif"); + +$objSections->AddSection("in-portal:sessionlog","la_tab_SessionLog","la_tab_SessionLog",$admin."/logs/","session_list.php", + $admin."/icons/icon46_sessions_log.gif",$admin."/icons/icon24_sessions_log.gif", + NULL,"in-portal:reports","in-portal:sessionlog",NULL,0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_sessions_log.gif"); + +/* Help */ +$objSections->AddSection("in-portal:help","la_tab_Help","la_title_Help",$admin."/help/","help.php", + $admin."/icons/icon46_help.gif",$admin."/icons/icon24_help.gif", + NULL,"in-portal:root","in-portal:system",NULL,0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_help.gif"); + +$objSections->AddSection("in-portal:help_overview","la_tab_Overview","la_title_Help",$admin."/help/","help.php", + $admin."/icons/icon46_help.gif",$admin."/icons/icon24_help.gif", + NULL,"in-portal:help",NULL,"in-portal:help_ch1",NULL,NULL,NULL,NULL,NULL,NULL,$admin."/icons/icon46_list_help.gif"); +$objSections->AddSection("in-portal:help_ch1","Chapter 1","Chapter 1",$admin."/help/","help.php", + $admin."/icons/icon46_help.gif",$admin."/icons/icon24_help.gif", + NULL,"inportal:help","in-portal:help_overview","in-portal:help_ch2"); +$objSections->AddSection("in-portal:help_ch2","Chapter 2","Chapter 2",$admin."/help/","help.php", + $admin."/icons/icon46_help.gif",$admin."/icons/icon24_help.gif", + NULL,"inportal:help","in-portal:help_ch1",NULL); + +/* Help ends */ +$objSections->AddSection("in-portal:item_select","la_title_Select_Item","Select Item",$admin."/","item_select.php","","", + NULL,NULL,NULL,0,"",1,1); + +$objSections->AddSection("in-portal:rel_select","la_title_Select_Target_Item","Select Item",$admin."/","rel_select.php","","", + NULL,NULL,NULL,0,"",1,0,1,1); + +$NewButtons = array(); +/* each module will add to the array declared below, which contains the info for the + 'new' button for the module's Browse data. The array is an array of arrays, + and the subarray should contain the following indexes: + + ImagePath = URL to the directory containing the image + Action = Action attribute of the image (this is also the "base name" of the image + Alt = Image ALT value + Tab = If set, button will only be displayed when this div is active + +*/ + +$m = GetModuleArray("admin"); +if(is_array($m)) +{ + foreach($m as $key=>$value) + { + $mod = $pathtoroot . $value . "admin/include/navmenu.php"; + include_once($mod); + } +} +$objSections->AddSection("default","","",$admin."/","#",NULL,NULL,NULL,NULL,NULL,NULL); + +?> Index: trunk/admin/category/images/Thumbs.db =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_preview_template.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/summary/usersbox_ex.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/dialog/fck_about/logo_fredck_top.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_logout46.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/client.php =================================================================== diff -u --- trunk/kernel/include/adodb/client.php (revision 0) +++ trunk/kernel/include/adodb/client.php (revision 13) @@ -0,0 +1,194 @@ + + +$url

    "; + $rs = csv2rs($url,$err); + if ($err) print $err; + return $rs; + } + + function print_pre($s) + { + print "
    ";print_r($s);print "
    "; + } + + +$serverURL = 'http://localhost/php/adodb/server.php'; +$testhttp = false; + +$sql1 = "insertz into products (productname) values ('testprod 1')"; +$sql2 = "insert into products (productname) values ('testprod 1')"; +$sql3 = "insert into products (productname) values ('testprod 2')"; +$sql4 = "delete from products where productid>80"; +$sql5 = 'select * from products'; + +if ($testhttp) { + print "Client Driver Tests

    "; + print "

    Test Error

    "; + $rs = send2server($serverURL,$sql1); + print_pre($rs); + print "
    "; + + print "

    Test Insert

    "; + + $rs = send2server($serverURL,$sql2); + print_pre($rs); + print "
    "; + + print "

    Test Insert2

    "; + + $rs = send2server($serverURL,$sql3); + print_pre($rs); + print "
    "; + + print "

    Test Delete

    "; + + $rs = send2server($serverURL,$sql4); + print_pre($rs); + print "
    "; + + + print "

    Test Select

    "; + $rs = send2server($serverURL,$sql5); + if ($rs) rs2html($rs); + + print "
    "; +} + + +print "

    CLIENT Driver Tests

    "; +$conn = ADONewConnection('csv'); +$conn->Connect($serverURL); +$conn->debug = true; + +print "

    Bad SQL

    "; + +$rs = $conn->Execute($sql1); + +print "

    Insert SQL 1

    "; +$rs = $conn->Execute($sql2); + +print "

    Insert SQL 2

    "; +$rs = $conn->Execute($sql3); + +print "

    Select SQL

    "; +$rs = $conn->Execute($sql5); +if ($rs) rs2html($rs); + +print "

    Delete SQL

    "; +$rs = $conn->Execute($sql4); + +print "

    Select SQL

    "; +$rs = $conn->Execute($sql5); +if ($rs) rs2html($rs); + + +/* EXPECTED RESULTS FOR HTTP TEST: + +Test Insert +http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29 + +adorecordset Object +( + [dataProvider] => native + [fields] => + [blobSize] => 64 + [canSeek] => + [EOF] => 1 + [emptyTimeStamp] => + [emptyDate] => + [debug] => + [timeToLive] => 0 + [bind] => + [_numOfRows] => -1 + [_numOfFields] => 0 + [_queryID] => 1 + [_currentRow] => -1 + [_closed] => + [_inited] => + [sql] => insert into products (productname) values ('testprod') + [affectedrows] => 1 + [insertid] => 81 +) + + +-------------------------------------------------------------------------------- + +Test Insert2 +http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29 + +adorecordset Object +( + [dataProvider] => native + [fields] => + [blobSize] => 64 + [canSeek] => + [EOF] => 1 + [emptyTimeStamp] => + [emptyDate] => + [debug] => + [timeToLive] => 0 + [bind] => + [_numOfRows] => -1 + [_numOfFields] => 0 + [_queryID] => 1 + [_currentRow] => -1 + [_closed] => + [_inited] => + [sql] => insert into products (productname) values ('testprod') + [affectedrows] => 1 + [insertid] => 82 +) + + +-------------------------------------------------------------------------------- + +Test Delete +http://localhost/php/adodb/server.php?sql=delete+from+products+where+productid%3E80 + +adorecordset Object +( + [dataProvider] => native + [fields] => + [blobSize] => 64 + [canSeek] => + [EOF] => 1 + [emptyTimeStamp] => + [emptyDate] => + [debug] => + [timeToLive] => 0 + [bind] => + [_numOfRows] => -1 + [_numOfFields] => 0 + [_queryID] => 1 + [_currentRow] => -1 + [_closed] => + [_inited] => + [sql] => delete from products where productid>80 + [affectedrows] => 2 + [insertid] => 0 +) + +[more stuff deleted] + . + . + . +*/ +?> Index: trunk/admin/editor/FCKeditor/lang/pt-br.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/pt-br.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/pt-br.js (revision 13) @@ -0,0 +1,197 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * pt-br.js: Brazilian Portuguese support. + * + * Authors: + * Anderson Raghiante (anderson_raghiante@hotmail.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Cortar" ; +lang["Copy"] = "Copiar" ; +lang["Paste"] = "Colar" ; +lang["PasteText"] = "Colar como texto simples" ; +lang["PasteWord"] = "Colar do Word" ; +lang["Find"] = "Pesquisar" ; +lang["SelectAll"] = "Selecionar Tudo" ; +lang["RemoveFormat"] = "Remover Formatação" ; +lang["InsertLink"] = "Inserir/Editar Link" ; +lang["RemoveLink"] = "Remover Link" ; +lang["InsertImage"] = "Inserir/Editar Imagem" ; +lang["InsertTable"] = "Inserir/Editar Tabela" ; +lang["InsertLine"] = "Inserir Linha Horizontal" ; +lang["InsertSpecialChar"] = "Inserir Caractere Especial" ; +lang["InsertSmiley"] = "Inserir Emoticon" ; +lang["About"] = "Sobre FCKeditor" ; + +lang["Bold"] = "Negrito" ; +lang["Italic"] = "Itálico" ; +lang["Underline"] = "Sublinhado" ; +lang["StrikeThrough"] = "Linha Atravessada" ; +lang["Subscript"] = "Subscrito" ; +lang["Superscript"] = "Sobrescrito" ; +lang["LeftJustify"] = "Alinhar Esquerda" ; +lang["CenterJustify"] = "Alinhar Centro" ; +lang["RightJustify"] = "Alinhar Direita" ; +lang["BlockJustify"] = "Alinhar Bloco" ; +lang["DecreaseIndent"] = "Diminuir Recuo" ; +lang["IncreaseIndent"] = "Aumentar Recuo" ; +lang["Undo"] = "Desfazer" ; +lang["Redo"] = "Refazer" ; +lang["NumberedList"] = "Numeração" ; +lang["BulettedList"] = "Marcadores" ; + +lang["ShowTableBorders"] = "Mostrar Bordas Tabelas" ; +lang["ShowDetails"] = "Mostrar Detalhes" ; + +lang["FontStyle"] = "Estilo" ; +lang["FontFormat"] = "Formato" ; +lang["Font"] = "Fonte" ; +lang["FontSize"] = "Tamanho" ; +lang["TextColor"] = "Cor da Fonte" ; +lang["BGColor"] = "Cor de Fundo" ; +lang["Source"] = "Código Fonte" ; + +// Context Menu + +lang["EditLink"] = "Editar Link" ; +lang["InsertRow"] = "Inserir Linha" ; +lang["DeleteRows"] = "Remover Linhas" ; +lang["InsertColumn"] = "Inserir Coluna" ; +lang["DeleteColumns"] = "Remover Colunas" ; +lang["InsertCell"] = "Inserir Célula" ; +lang["DeleteCells"] = "Remover Células" ; +lang["MergeCells"] = "Mesclar Células" ; +lang["SplitCell"] = "Dividir Célula" ; +lang["CellProperties"] = "Propriedades Célula" ; +lang["TableProperties"] = "Propriedades Tabela" ; +lang["ImageProperties"] = "Propriedades Imagem" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Processando XHTML. Por favor, aguarde..." ; +lang["Done"] = "Feito" ; +lang["PasteWordConfirm"] = "O texto a ser colado parece ser uma cópia do Word. Deseja limpá-lo antes de colar ?" ; +lang["NotCompatiblePaste"] = "Este comando está disponível apenas o Internet Explorer 5.5 ou superior. Você deseja colar sem limpar o texto ?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Cancelar" ; +lang["DlgBtnClose"] = "Fechar" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Inserir Imagem" ; +lang["DlgImgTitleEdit"] = "Editar Imagem" ; +lang["DlgImgBtnUpload"] = "Enviar para o Servidor" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Upload" ; +lang["DlgImgBtnBrowse"] = "Navegar Servidor" ; +lang["DlgImgAlt"] = "Texto Alternativo" ; +lang["DlgImgWidth"] = "Largura" ; +lang["DlgImgHeight"] = "Altura" ; +lang["DlgImgLockRatio"] = "Travar Proporção" ; +lang["DlgBtnResetSize"] = "Retornar Tamanho Original" ; +lang["DlgImgBorder"] = "Borda" ; +lang["DlgImgHSpace"] = "Espaço Hor." ; +lang["DlgImgVSpace"] = "Espaço Ver." ; +lang["DlgImgAlign"] = "Alinhamento" ; +lang["DlgImgAlignLeft"] = "Esquerda" ; +lang["DlgImgAlignAbsBottom"] = "Abs Inferior" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Meio" ; +lang["DlgImgAlignBaseline"] = "Baseline" ; +lang["DlgImgAlignBottom"] = "Inferior" ; +lang["DlgImgAlignMiddle"] = "Meio" ; +lang["DlgImgAlignRight"] = "Direita" ; +lang["DlgImgAlignTextTop"] = "Texto Superior" ; +lang["DlgImgAlignTop"] = "Superior" ; +lang["DlgImgPreview"] = "Preview" ; +lang["DlgImgMsgWrongExt"] = "Desculpe, apenas os seguintes tipos de arquivo são permitidos para upload :\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperação cancelada." ; +lang["DlgImgAlertSelect"] = "Nenhum arquivo selecionado." ; + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Upload" ; +lang["DlgLnkTarget"] = "Alvo" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Nova Janela (_blank)" ; +lang["DlgLnkTargetParent"] = "Janela Pai (_parent)" ; +lang["DlgLnkTargetSelf"] = "Mesma Janela (_self)" ; +lang["DlgLnkTargetTop"] = "Janela Superior (_top)" ; +lang["DlgLnkTitle"] = "Titolo" ; +lang["DlgLnkBtnUpload"] = "Enviar para o Servidor" ; +lang["DlgLnkBtnBrowse"] = "Navegar Servidor" ; +lang["DlgLnkMsgWrongExtA"] = "Desculpe, apenas os seguintes tipos de arquivo são permitidos para upload :\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperação cancelada." ; +lang["DlgLnkMsgWrongExtD"] = "Desculpe, apenas os seguintes tipos de arquivos são permitidos para upload :\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperação cancelada." ; + +// Color Dialog +lang["DlgColorTitle"] = "Selecionar Cor" ; +lang["DlgColorBtnClear"] = "Limpar"; +lang["DlgColorHighlight"] = "Destacada" ; +lang["DlgColorSelected"] = "Selecionada" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Inserir um Emoticon" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Inserir Caractere Especial" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Inserir Tabela" ; +lang["DlgTableTitleEdit"] = "Editar Tabela" ; +lang["DlgTableRows"] = "Linhas" ; +lang["DlgTableColumns"] = "Colunas" ; +lang["DlgTableBorder"] = "Borda" ; +lang["DlgTableAlign"] = "Alinhamento" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Esquerda" ; +lang["DlgTableAlignCenter"] = "Centro" ; +lang["DlgTableAlignRight"] = "Direita" ; +lang["DlgTableWidth"] = "Largura" ; +lang["DlgTableWidthPx"] = "px" ; +lang["DlgTableWidthPc"] = "%" ; +lang["DlgTableHeight"] = "Altura" ; +lang["DlgTableCellSpace"] = "Espaço" ; +lang["DlgTableCellPad"] = "Recuo"; +lang["DlgTableCaption"] = "Título" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Propriedades Célula" ; +lang["DlgCellWidth"] = "Largura" ; +lang["DlgCellWidthPx"] = "px" ; +lang["DlgCellWidthPc"] = "%" ; +lang["DlgCellHeight"] = "Altura" ; +lang["DlgCellWordWrap"] = "Quebra de Linha" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Sim" ; +lang["DlgCellWordWrapNo"] = "Não" ; +lang["DlgCellHorAlign"] = "Alinhamento Horizontal" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Esquerda" ; +lang["DlgCellHorAlignCenter"] = "Centro" ; +lang["DlgCellHorAlignRight"] = "Direita" ; +lang["DlgCellVerAlign"] = "Alinhamento Vertical" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Superior" ; +lang["DlgCellVerAlignMiddle"] = "Meio" ; +lang["DlgCellVerAlignBottom"] = "Inferior" ; +lang["DlgCellVerAlignBaseline"] = "Baseline" ; +lang["DlgCellRowSpan"] = "Transpor Linhas" ; +lang["DlgCellCollSpan"] = "Transpor Colunas" ; +lang["DlgCellBackColor"] = "Cor de Fundo" ; +lang["DlgCellBorderColor"] = "Cor da Borda" ; +lang["DlgCellBtnSelect"] = "Selecionar..." ; + +// About Dialog +lang["DlgAboutVersion"] = "Versão" ; +lang["DlgAboutLicense"] = "Lincenciado sob os termos da GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "Para maiores informações acesse" ; Index: trunk/kernel/include/adodb/adodb-fbsql.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-fbsql.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-fbsql.inc.php (revision 13) @@ -0,0 +1,251 @@ +. + Set tabs to 8. +*/ + +if (! defined("_ADODB_FBSQL_LAYER")) { + define("_ADODB_FBSQL_LAYER", 1 ); + +class ADODB_fbsql extends ADODBConnection { + var $databaseType = 'fbsql'; + var $hasInsertID = true; + var $hasAffectedRows = true; + var $metaTablesSQL = "SHOW TABLES"; + var $metaColumnsSQL = "SHOW COLUMNS FROM %s"; + var $fmtTimeStamp = "'Y-m-d H:i:s'"; + var $hasLimit = false; + + function ADODB_fbsql() + { + } + + function _insertid() + { + return fbsql_insert_id($this->_connectionID); + } + + function _affectedrows() + { + return fbsql_affected_rows($this->_connectionID); + } + + function &MetaDatabases() + { + $qid = fbsql_list_dbs($this->_connectionID); + $arr = array(); + $i = 0; + $max = fbsql_num_rows($qid); + while ($i < $max) { + $arr[] = fbsql_tablename($qid,$i); + $i += 1; + } + return $arr; + } + + // returns concatenated string + function Concat() + { + $s = ""; + $arr = func_get_args(); + $first = true; + + foreach($arr as $a) { + if ($first) { + $s = $a; + $first = false; + } else $s .= ','.$a; + } + if (sizeof($s) > 0) return "CONCAT($s)"; + else return ''; + } + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = fbsql_connect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = fbsql_pconnect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + function &MetaColumns($table) + { + if ($this->metaColumnsSQL) { + + $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table)); + + if ($rs === false) return false; + + $retarr = array(); + while (!$rs->EOF){ + $fld = new ADODBFieldObject(); + $fld->name = $rs->fields[0]; + $fld->type = $rs->fields[1]; + + // split type into type(length): + if (preg_match("/^(.+)\((\d+)\)$/", $fld->type, $query_array)) { + $fld->type = $query_array[1]; + $fld->max_length = $query_array[2]; + } else { + $fld->max_length = -1; + } + $fld->not_null = ($rs->fields[2] != 'YES'); + $fld->primary_key = ($rs->fields[3] == 'PRI'); + $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false); + $fld->binary = (strpos($fld->type,'blob') !== false); + + $retarr[strtoupper($fld->name)] = $fld; + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + return false; + } + + // returns true or false + function SelectDB($dbName) + { + $this->databaseName = $dbName; + if ($this->_connectionID) { + return @fbsql_select_db($dbName,$this->_connectionID); + } + else return false; + } + + + // returns queryID or false + function _query($sql,$inputarr) + { + return fbsql_query("$sql;",$this->_connectionID); + } + + /* Returns: the last error message from previous database operation */ + function ErrorMsg() + { + $this->_errorMsg = @fbsql_error($this->_connectionID); + return $this->_errorMsg; + } + + /* Returns: the last error number from previous database operation */ + function ErrorNo() + { + return @fbsql_errno($this->_connectionID); + } + + // returns true or false + function _close() + { + return @fbsql_close($this->_connectionID); + } + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_fbsql extends ADORecordSet{ + + var $databaseType = "fbsql"; + var $canSeek = true; + + function ADORecordSet_fbsql($queryID) { + return $this->ADORecordSet($queryID); + } + + function _initrs() + { + GLOBAL $ADODB_COUNTRECS; + $this->_numOfRows = ($ADODB_COUNTRECS) ? @fbsql_num_rows($this->_queryID):-1; + $this->_numOfFields = @fbsql_num_fields($this->_queryID); + } + + + + function &FetchField($fieldOffset = -1) { + if ($fieldOffset != -1) { + $o = @fbsql_fetch_field($this->_queryID, $fieldOffset); + //$o->max_length = -1; // fbsql returns the max length less spaces -- so it is unrealiable + $f = @fbsql_field_flags($this->_queryID,$fieldOffset); + $o->binary = (strpos($f,'binary')!== false); + } + else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */ + $o = @fbsql_fetch_field($this->_queryID);// fbsql returns the max length less spaces -- so it is unrealiable + //$o->max_length = -1; + } + + return $o; + } + + function _seek($row) + { + return @fbsql_data_seek($this->_queryID,$row); + } + + function _fetch($ignore_fields=false) + { + $this->fields = @fbsql_fetch_array($this->_queryID); + return ($this->fields == true); + } + + function _close() { + return @fbsql_free_result($this->_queryID); + } + + function MetaType($t,$len=-1,$fieldobj=false) + { + $len = -1; // fbsql max_length is not accurate + switch (strtoupper($t)) { + case 'CHARACTER': + case 'CHARACTER VARYING': + case 'BLOB': + case 'CLOB': + case 'BIT': + case 'BIT VARYING': + if ($len <= $this->blobSize) return 'C'; + + // so we have to check whether binary... + case 'IMAGE': + case 'LONGBLOB': + case 'BLOB': + case 'MEDIUMBLOB': + return !empty($fieldobj->binary) ? 'B' : 'X'; + + case 'DATE': return 'D'; + + case 'TIME': + case 'TIME WITH TIME ZONE': + case 'TIMESTAMP': + case 'TIMESTAMP WITH TIME ZONE': return 'T'; + + case 'PRIMARY_KEY': + return 'R'; + case 'INTEGER': + case 'SMALLINT': + case 'BOOLEAN': + + if (!empty($fieldobj->primary_key)) return 'R'; + else return 'I'; + + default: return 'N'; + } + } + +} //class +} // defined +?> \ No newline at end of file Index: trunk/themes/default/incs/inportal_main.css =================================================================== diff -u --- trunk/themes/default/incs/inportal_main.css (revision 0) +++ trunk/themes/default/incs/inportal_main.css (revision 13) @@ -0,0 +1,776 @@ +/*--- THE BASICS ---*/ + +body { + color : #000000; + background : #ffffff; + font-family : arial, helvetica, sans-serif; + font-size : 12px; + margin : 0; + padding: 0; + } +ul,ol,li { + color : #333333; + font-family : arial, helvetica, sans-serif; + font-size : 12px; + } +form { + margin : 0; + } +img, a img { + border: 0; + } + +.img-intextleft { + margin-left: 5px; + margin-bottom: 5px; + } + +a { + color : #1f569a; + text-decoration : underline; + } +a:link { + color : #1f569a; + text-decoration : underline; + } +a:hover { + color : #619ae0; + text-decoration : underline; + } + +p { + font-family : arial, helvetica, sans-serif; + font-size : 11px; + font-weight : normal; + color: #000000; + line-height: 14px; + margin-top: 2px; + margin-bottom: 5px; + } + +td { + font-family : arial, verdana, sans-serif; + font-size : 12px; + } + +h1 { + font-family : verdana, helvetica, sans-serif; + font-size : 20px; + font-weight : bold; + color: #1f569a; + margin: 10px 0px; + line-height: 22px + } + +h1 span { + font-size : 14px; + color: #999999; + } + +h2, h2 span { + font-family : verdana, helvetica, sans-serif; + font-size : 20px; + font-weight : normal; + color: #009ff0; + margin : 0; + } +h2 span { + font-size : 14px; + color: #999999; + } + +h3, h3 span { + font-family : verdana, helvetica, sans-serif; + font-size : 16px; + font-weight : normal; + color: #009ff0; + margin: 0; + } +h3 span { + font-size : 12px; + font-weight : normal; + color: #999999; + } + +h4, h4 span { + font-family : verdana, helvetica, sans-serif; + font-size : 12px; + font-weight : normal; + color: #009ff0; + margin: 0; + } + +h4 span { + font-size : 10px; + font-weight : normal; + color: #999999; + } + +.tip { + cursor : help; + border-bottom : 1px dashed #999999; + } + +.table-collapse { + border-collapse: collapse; + } + +.input { + font-family : arial, verdana, sans-serif; + font-size : 11px; + color: #000000; + background-color: #ffffff; + border: 1px inset #94c0de; + } + +.textarea { + font-family : arial, verdana, sans-serif; + font-size : 11px; + color: #000000; + background-color: #ffffff; + border: 1px inset #94c0de; + } + +.button { + font-family: arial, helvetica, sans-serif; + font-size: 10px; + font-weight: normal; + text-decoration: none; + color: #000000; + padding: 0 2 0 2; + border-style: outset; + border-color: #ffffff #999999 #999999 #ffffff; + border-width: 1px; + width:auto; + cursor: hand; + background: #fcde79 url("../img/bgr_button.gif") repeat-x scroll right top; + margin: 1px; + } + +select { + font-size: 11px; + } + +/*--- HEADINGS ---*/ +.welcome { + font-family : verdana, helvetica, sans-serif; + color : #009ff0; + font-size : 20px; + font-weight : bold; + text-decoration : none; + } +.page-title { + margin-bottom: 10px; + color : #1f569a; + } + +.item, .item a, item a:hover, +.item-small, .item-small a, .item-small a:hover, +.item-spec, .item-spec a, .item-spec a:hover, +.item-my, .item-my a, item-my a:hover, .item-my-stat +.quick-title, .quick-title a, .quick-title a:hover, +.reviewer { + font-family : verdana, helvetica, sans-serif; + color : #1f569a; + font-size : 12px; + font-weight : bold; + text-decoration : none; + } +.item a { + text-decoration : underline; + } +.item a:hover { + color : #619ae0; + text-decoration : underline; + } +.item-spec { + font-size : 11px; + } +.item-spec a { + color: 3333ff; + font-size : 11px; + text-decoration : underline; + } +.item-spec a:hover { + color : #619ae0; + font-size : 11px; + text-decoration : underline; + } +.item-small { + font-size : 11px; + } +.item-small a { + font-size : 11px; + text-decoration : underline; + } +.item-small a:hover { + color : #619ae0; + font-size : 11px; + text-decoration : underline; + } +.item-my, .item-my a, .item-my a:hover { + font-size : 11px; + } +.item-my a:hover { + text-decoration : none; + } +.item-my-stat { + font-size : 10px; + font-weight : normal; + } + +.quick-title { + color : #009FF0; + font-size : 11px; + font-weight : bold; + text-decoration : none; + } +.quick-title a { + color : #009FF0; + font-size : 11px; + text-decoration : underline; + } +.quick-title a:hover { + color : #1f569a; + font-size : 11px; + text-decoration : underline; + } + +.reviewer { + color : #000000; + font-size : 12px; + font-weight : bold; + text-decoration : none; + } + +.posts, a.posts, a:hover.posts, .posts a, .posts a:hover { + font: 11px verdana, helvetica, sans-serif; + color : #1f569a; + text-decoration : none; + } +a.posts { + text-decoration : none; + } +a:hover.posts { + color : #619ae0; + text-decoration : underline; + } +.posts a { + text-decoration : none; + } +.posts a:hover { + color : #619ae0; + text-decoration : underline; + } + +.post-altern { + background: #E6F0F9 + } + + +.new, .pop, .hot, .top { + font-family : arial, helvetica, sans-serif; + color : #00c600; + font-size : 9px; + vertical-align: super; + font-weight : normal; + text-decoration : none; + text-transform: uppercase; + } +.pop { + color : #00cece; + } +.hot { + color : #d92100; + } +.top { + color : #00cece; + } +.poster { + font: 10px verdana, sans-serif; + } + + +.forum-data, .forum-time { + font: 10px verdana, helvetica, sans-serif; + text-decoration : none; + } + +.forum-time { + color : #666; + } + +.forum-name td { + font: 11px verdana, sans-serif; + border-bottom: 1px dashed #ccc + } +.post-text, .post-text td { + font: 10px verdana, sans-serif; + } + + +.forum { + font: 14px arial, sans-serif; + text-decoration: none + } + +.login-box-top, .friend-box-top, .login-name { + font-family : verdana, helvetica, sans-serif; + color : #ffffff; + font-size : 12px; + font-weight : bold; + text-decoration : none; + background-color: #64a1df; + padding: 5px; + padding-left: 7px; + } + +.login-name { + font-size : 11px; + font-weight : normal; + text-decoration : none; + background-color: #64a1df; + padding: 1px; + } +.login-name a { + text-decoration: none; + color: #fff + } +.login-name a:hover { + color: #1f569a; + text-decoration: none + } + +.friend-box-top { + color : #1f569a; + background-color: #94c0de; + border-top: 1px solid #64a1df; + } +.act-box-top, .act-title-it { + padding-left: 7px; + font-family : arial, helvetica, sans-serif; + color : #ffffff; + font-size : 20px; + font-weight : bold; + text-decoration : none; + letter-spacing: 0,5em; + background-color: #1F569A; + } +.act-sep { + color : #ffffff; + font-size : 16px; + font-weight : normal; + } +.act-title-it { + padding-left: 0px; + font-weight : normal; + font-style: oblique; + } + +.bgr-login, .bgr-friend-box, .bgr-quick-links-top, .bgr-quick-links, .bgr-quick-links-bottom, .bgr-act { + padding: 7px; + background: #e3edf6 url("../img/bgr_login.jpg") repeat-y scroll left top; + border-bottom: 1px solid #64a1df; + } +.bgr-loggedin { + padding: 7px; + background: #e3edf6 url("../img/bgr_loggedin.jpg") no-repeat scroll right top; + } +.bgr-friend-box { + background: #ffffff url("../img/bgr_friendbox.jpg") repeat-y scroll left top; + border-bottom: 1px solid #64a1df; + } +.bgr-quick-links-top { + background: #ffffff url("../img/bgr_quick_links_top.jpg") no-repeat scroll right top; + border-bottom: none; + } +.bgr-quick-links { + background: #ffffff url("../img/bgr_quick_links.jpg") no-repeat scroll right top; + border-bottom: none; + } +.bgr-quick-links-bottom { + background: none; + } + +.bgr-act { + padding-top: 0px; + background: #ffffff url("../img/bgr_actionbox.jpg") repeat-y scroll right top; + border-top: none; + border-bottom: none; + } +.bgr-act-bottom { + background: #ffffff url("../img/bgr_actionbox.jpg") repeat-y scroll right top; + border-bottom: 1px solid #64a1df; + padding: 0px; + } +.box { + border: 1px solid #64a1df; + } +.open-box { + border: 1px solid #64a1df; + border-top: none; + } + + + +/*--- NAVIGATION STYLES ---*/ + +.head-nav, .head-nav td, .head-nav td a, head-nav td a:hover { + font-family : verdana, helvetica, sans-serif; + color : #ffffff; + font-size : 10px; + font-weight : bold; + text-decoration : none; + } +.head-nav td a { + color : #94c0de; + } +.head-highlight a, .head-nav td a:hover { + color : #ffffff; + text-decoration : none; + } + +.head-highlight { + color : #ffffff; + text-decoration : none; +} + +.post-action, .post-action a { + font-family : arial, helvetica, sans-serif; + color : #ffffff; + font-size : 10px; + font-weight : normal; + text-decoration : none; + } + +.post-action a:hover { + color : #ffffff; + text-decoration : underline; + } + +.post-action-alt,.post-action-alt, .post-action-alt a, .post-action-alt a { + font-family : arial, helvetica, sans-serif; + color : #ffffff; + font-size : 10px; + font-weight : normal; + text-decoration : none; + } + +.post-action-alt a:hover,.post-action-alt-last a:hover { + color : #ffffff; + text-decoration : underline; + } + +.path, .path a, .zoom { + font-family : arial, helvetica, sans-serif; + color : #ffffff; + font-size : 10px; + font-weight : normal; + text-decoration : none; + } + +.path a { + text-decoration : underline; + color : #ffff00; + } + +.path a:hover { + color : #ffffff; + text-decoration : underline; + } + +.zoom, .zoom a, .zoom a:hover { + text-decoration : none; + } + +.quick-links, .quick-links a, .quick-links a:hover, .links-action, .links-action a, .links-action a:hover, + .tips, .tips a, .tips a:hover, + .option-txt { + font-family : verdana, helvetica, sans-serif; + color : #1f569a; + font-size : 10px; + font-weight : normal; + text-decoration : none; + } +.quick-links a { + color : #1f569a; + text-decoration : underline; + } +.quick-links a:hover { + color : #619ae0; + text-decoration : underline; + } +.links-action a { + color : #999999; + text-decoration : none; + } +.links-action a:hover { + color : #1f569a; + text-decoration : none; + } +.tips-i { + font-family : verdana, helvetica, sans-serif; + font-size : 11px; + font-weight : normal; + font-style: oblique; + } +.tips, .tips-i { + color : #666666; + } +.tips a, .tips-i a { + text-decoration : underline; + color : #666666; + } +.tips a:hover, .tips-i a:hover { + text-decoration : underline; + color : #999999; + } +.option-txt { + color : #2c73cb; + } +.option-txt a { + text-decoration : underline; + color : #2c73cb; + } +.option-txt a:hover { + color : #619ae0; + text-decoration : underline; + } + +.box-links { + font-family : Tahoma, helvetica, sans-serif; + color : #004080; + font-size : 11px; + font-weight : normal; + text-decoration : none; + } +.box-links a { + color : #004080; + text-decoration : none; + } + + + +/*--- ---*/ + +.pagination, .pagination a, .pagination a:hover { + font: bold 11px verdana, sans-serif; + } +.pagination a { + color: #619ae0; + } +.pagination a:hover { + color: #1f569a; + background-color: #deebf8; + } + +.updated { + font-family : arial, helvetica, sans-serif; + color : #778055; + font-size : 10px; + font-weight : normal; + text-decoration : none; + letter-spacing: 1px; + } + +.statistics, .statistics span, .statistics a, .statistics a:hover, .statistics td a, .statistics td a:hover { + font-family : arial, helvetica, sans-serif; + color : #64a1df; + font-size : 10px; + font-weight : normal; + text-decoration : none; + } + + +.statistics span { + color : #999999; + font-size : 10px; + } +.statistics a { + color : #009ff0; + } +.statistics a:hover { + color : #94c0de; + } +.statistics td a { + color : #009ff0; + } +.statistics td a:hover { + color : #94c0de; + } + +.comments, .field-title { + font-family : arial, helvetica, sans-serif; + color : #999999; + font-size : 10px; + font-weight : normal; + text-decoration : none; + } +.field-title { + color : #333333; + } + +.welcome-text { + font-family : verdana, helvetica, sans-serif; + color : #666666; + font-size : 11px; + font-weight : normal; + text-decoration : none; + line-height: 14px; + } + +.field-name { + font-family : verdana, helvetica, sans-serif; + color : #666666; + font-size : 11px; + font-weight : normal; + text-decoration : none; + background: #eeeeee none; + padding: 3px 10px 3px 10px; + white-space: nowrap; + } +.field-content, .field-content-top, .field-content-input { + padding: 4px 0px 4px 5px; + border-top: 1px dotted #eaeaea; + } +.field-content-input, .field-content-input-top { + padding: 1px 0px 1px 5px; + } +.field-content-top { + border-top: none; + } +.field-content-input-top { + border-top: none; + } + +.copyright, .norate { + font-family : verdana, helvetica, sans-serif; + font-size : 9px; + color: #deebf8; + } +.norate { + color: #ff8000; + font-weight: normal; + } +.error { + color: #ff0000; + } + + + +/*--- BACKGROUNDS ---*/ + +.bgr-categories { + background: #ffffff url("../img/bgr_categories.jpg") no-repeat scroll right top; + } + +.bgr-myaccount { + background: #ffffff url("../img/bgr_empty.jpg") no-repeat scroll right top; + } + +.bgr-news { + background: #ffffff url("../img/bgr_news.jpg") no-repeat scroll right top; + } + +.bgr-links { + background: #ffffff url("../img/bgr_links.jpg") no-repeat scroll right top; + } + +.bgr-forum { + background: #ffffff url("../img/bgr_forum.jpg") no-repeat scroll right top; + } + +.bgr-logoside { + background: #ffffff url("../img/bgr_top_short.jpg") repeat-y scroll right top; + } + +.bgr-logounder { + background: #1866AE url("../img/bgr_headmiddle.jpg") repeat-y scroll right top; + } + +.bgr-headnav { + background: #1866AE url("../img/bgr_headnav.jpg") repeat-y scroll left top; + } + +.bgr-topsquares { + background: #ffffff url("../img/bgr_topsquares.jpg") repeat-y scroll right top; + } + +.bgr-path { + background: #61b0ec url("../img/bgr_path.jpg") repeat-y scroll left top; + } + +.bott-line { + border-bottom: 1px solid #1f569a; + } + +.dott-line { + border-bottom: 1px dotted #94c0de; + } + +.bgr-updatefill { + background-color: #deebf8; + } + +.bgr-dark { + background-color: #1f569a; + } + +.bgr-updatelight { + background-color: #f5f9fd; + } + +.bgr-on, .bgr-on td{ + background-color: #e7f0fa; + } +.bgr-off, .bgr-off td { + background-color: #eeeeee; + } + +.bgr-underactbox { + background: #e0ebf9 url("../img/bgr_underactbox.jpg") repeat-x scroll right top; + } + +.bgr-welcome { + background-color: #ecede4; + } + +.match { + background-color: #ffff00; + } + + +/* COLORS in use: + + link hover: #619ae0 + +*/ + + +.lang-box-top { + font-family : verdana, helvetica, sans-serif; + color : #ffffff; + font-size : 12px; + font-weight : bold; + text-decoration : none; + background-color: #1866AE; + padding: 5px; + padding-left: 7px; +} + +.bgr-lang { + padding: 7px; + background: #e3edf6 url("../img/bgr_loggedin.jpg") no-repeat scroll right top; + border: 1px solid #64a1df; +} + +.bgr-act-top { + background: #fff9dd url("../img/bgr_actbox.gif") no-repeat scroll right top; + border-top: none; + border-bottom: none; + } + +.relevance-bar { + border-color: red; + border-width: 1px; + } \ No newline at end of file Index: trunk/themes/default/img/act_remove_from_favor.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_online.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/smtp.php =================================================================== diff -u --- trunk/kernel/include/smtp.php (revision 0) +++ trunk/kernel/include/smtp.php (revision 13) @@ -0,0 +1,344 @@ + + ** pass - Password for authentication Default: + ** timeout - The timeout in seconds for the call Default: 5 + ** to fsockopen() + ***************************************/ + + function smtp($params = array()){ + + $this->timeout = 5; + $this->status = SMTP_STATUS_NOT_CONNECTED; + $this->host = 'localhost'; + $this->port = 25; + $this->helo = 'localhost'; + $this->auth = FALSE; + $this->user = ''; + $this->pass = ''; + $this->errors = array(); + $this->buffer = array(); + $this->debug=0; + foreach($params as $key => $value){ + $this->$key = $value; + } + } + + /*************************************** + ** Connect function. This will, when called + ** statically, create a new smtp object, + ** call the connect function (ie this function) + ** and return it. When not called statically, + ** it will connect to the server and send + ** the HELO command. + ***************************************/ + + function connect($params = array()){ + + if(!isset($this->status)) + { + $obj = new smtp($params); + if($obj->connect()){ + $obj->status = SMTP_STATUS_CONNECTED; + } + + return $obj; + + } + else + { + $this->connection = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout); + if(is_resource($this->connection)) + { + socket_set_timeout($this->connection, 0, 250000); + socket_set_blocking($this->connection,TRUE); + $greeting = $this->get_data(); + $this->status = SMTP_STATUS_CONNECTED; + return $this->auth ? $this->ehlo() : $this->helo(); + } + else + { + $this->errors[] = 'Failed to connect to server: '.$errstr; + return FALSE; + } + } + } + + function disconnect() + { + if(is_resource($this->connection)) + fclose($this->connection); + unset($this->connection); + $this->status=SMTP_STATUS_NOT_CONNECTED; + } + /*************************************** + ** Function which handles sending the mail. + ** Arguments: + ** $params - Optional assoc array of parameters. + ** Can contain: + ** recipients - Indexed array of recipients + ** from - The from address. (used in MAIL FROM:), + ** this will be the return path + ** headers - Indexed array of headers, one header per array entry + ** body - The body of the email + ** It can also contain any of the parameters from the connect() + ** function + ***************************************/ + + function send($params = array()){ + global $CRLF; + foreach($params as $key => $value){ + $this->set($key, $value); + } + if($this->is_connected()){ + + // Do we auth or not? Note the distinction between the auth variable and auth() function + if($this->auth){ + if(!$this->auth()) + return FALSE; + } + + $this->mail($this->from); + if(is_array($this->recipients)) + foreach($this->recipients as $value) + $this->rcpt($value); + else + $this->rcpt($this->recipients); + + if(!$this->data()) + return FALSE; + + // Transparency + $headers = str_replace($CRLF.'.', $CRLF.'..', trim(implode($CRLF, $this->headers))); + $body = str_replace($CRLF.'.', $CRLF.'..', $this->body); + $body = $body[0] == '.' ? '.'.$body : $body; + + $this->send_data($headers); + $this->send_data(''); + $this->send_data($body); + $this->send_data($CRLF."."); + + return (substr(trim($this->get_data()), 0, 3) === '250'); + }else{ + $this->errors[] = 'Not connected!'; + return FALSE; + } + } + + /*************************************** + ** Function to implement HELO cmd + ***************************************/ + + function helo(){ + if(is_resource($this->connection) + AND $this->send_data('HELO '.$this->helo) + AND substr(trim($error = $this->get_data()), 0, 3) === '250' ){ + + return TRUE; + + }else{ + $this->errors[] = 'HELO command failed, output: ' . trim(substr(trim($error),3)); + return FALSE; + } + } + + /*************************************** + ** Function to implement EHLO cmd + ***************************************/ + + function ehlo(){ + if(is_resource($this->connection) + AND $this->send_data('EHLO '.$this->helo) + AND substr(trim($error = $this->get_data()), 0, 3) === '250' ){ + + return TRUE; + + }else{ + $this->errors[] = 'EHLO command failed, output: ' . trim(substr(trim($error),3)); + return FALSE; + } + } + + /*************************************** + ** Function to implement AUTH cmd + ***************************************/ + + function auth(){ + if(is_resource($this->connection) + AND $this->send_data('AUTH LOGIN') + AND substr(trim($error = $this->get_data()), 0, 3) === '334' + AND $this->send_data(base64_encode($this->user)) // Send username + AND substr(trim($error = $this->get_data()),0,3) === '334' + AND $this->send_data(base64_encode($this->pass)) // Send password + AND substr(trim($error = $this->get_data()),0,3) === '235' ){ + + return TRUE; + + }else{ + $this->errors[] = 'AUTH command failed: ' . trim(substr(trim($error),3)); + return FALSE; + } + } + + /*************************************** + ** Function that handles the MAIL FROM: cmd + ***************************************/ + + function mail($from){ + + if($this->is_connected() + AND $this->send_data('MAIL FROM:'.$from.'') + AND substr(trim($this->get_data()), 0, 2) === '250' ){ + + return TRUE; + + }else + return FALSE; + } + + /*************************************** + ** Function that handles the RCPT TO: cmd + ***************************************/ + + function rcpt($to){ + + if($this->is_connected() + AND $this->send_data('RCPT TO:'.$to.'') + AND substr(trim($error = $this->get_data()), 0, 2) === '25' ){ + + return TRUE; + + }else{ + $this->errors[] = trim(substr(trim($error), 3)); + return FALSE; + } + } + + /*************************************** + ** Function that sends the DATA cmd + ***************************************/ + + function data(){ + + if($this->is_connected() + AND $this->send_data('DATA') + AND substr(trim($error = $this->get_data()), 0, 3) === '354' ){ + + return TRUE; + + }else{ + $this->errors[] = trim(substr(trim($error), 3)); + return FALSE; + } + } + + /*************************************** + ** Function to determine if this object + ** is connected to the server or not. + ***************************************/ + + function is_connected(){ + + return (is_resource($this->connection) AND ($this->status === SMTP_STATUS_CONNECTED)); + } + + /*************************************** + ** Function to send a bit of data + ***************************************/ + + function send_data($data){ + global $CRLF; + if($this->debug) + { + $this->buffer[] = "SEND: $data\n"; + } + if(is_resource($this->connection)){ + return fwrite($this->connection, $data.$CRLF, strlen($data)+2); + }else + return FALSE; + } + + function bytes_left($fp) + { + $status = socket_get_status ($fp); + //print_r($status); + $bytes = $status["unread_bytes"]; + return $bytes; + } + + /*************************************** + ** Function to get data. + ***************************************/ + function &get_data(){ + global $CRLF; + $return = ''; + $line = ''; + + if(is_resource($this->connection)) + { + while(strpos($return, $CRLF) === FALSE OR substr($line,3,1) !== ' ') + { + $line = fgets($this->connection, 512); + $return .= $line; + } + if($this->debug) + { + $this->buffer[] = "GET: ".$return."\n"; + } + return $return; + + }else + return FALSE; + } + + /*************************************** + ** Sets a variable + ***************************************/ + + function set($var, $value){ + + $this->$var = $value; + return TRUE; + } + + } // End of class +?> Index: trunk/kernel/admin/include/toolbar/catselect.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/catselect.php (revision 0) +++ trunk/kernel/admin/include/toolbar/catselect.php (revision 13) @@ -0,0 +1,685 @@ +Get("CatTab_Hide"); + +$CategoryView = $objConfig->Get("Category_View"); +if(!is_numeric($CategoryView)) +{ + $CategoryView = 127; +} + +$Category_Sortfield = $objConfig->Get("Category_Sortfield"); +if(!strlen($Category_Sortfield)) + $Category_Sortfield = "Name"; + +$Category_Sortorder = $objConfig->Get("Category_Sortorder"); +if(!strlen($Category_Sortorder)) + $Category_Sortorder = "desc"; + +$Perpage_Category = (int)$objConfig->Get("Perpage_Category"); +if(!$Perpage_Category) + $Perpage_Category="'all'"; + + +if($CategoryView == 127) +{ + $Category_ShowAll = 1; +} +else +{ + $Category_ShowAll=0; + $Status = array(); + $Mod = array(); + if($CategoryView & $Bit_Pending) + $Status[] = STATUS_PENDING; + + if($CategoryView & $Bit_Active) + $Status[] = STATUS_ACTIVE; + + + if($CategoryView & $Bit_Disabled) + $Status[] = STATUS_DISABLED; + + if(count($Status)) + { + $CategoryFilter .= " AND (Status IN (".implode(",",$Status).") "; + } + else + $CategoryFilter .= " AND ((Status=-1) "; + + if($CategoryView & $Bit_Ed) + { + $CategoryFilter .= " OR (EditorsPick=1) "; + } + + if($CategoryView & $Bit_New) + { + $cutoff = adodb_date("U") - ($objConfig->Get("Category_DaysNew") * 86400); + $CategoryFilter .= " OR (CreatedOn > ".$cutoff.") "; + } + $CategoryFilter .= ")"; +} + +$list = $objSession->GetVariable("SearchWord"); +if(strlen($list)) +{ + $CatScope = $objSession->GetVariable("SearchScope"); + switch($CatScope) + { + case 0 : + $CatScopeClause = ""; + break; + case 1: + $cat = $objCatList->CurrentCategoryID(); + if($cat>0) + { + $allcats = $objCatList->AllSubCats($cat); + if(count($allcats)>0) + { + $catlist = implode(",",$allcats); + $CatScopeClause = " CategoryId IN ($catlist) "; + } + } + break; + case 2: + $CatScopeClause = "CategoryId=".$objCatList->CurrentCategoryID(); + break; + } +} +else + $CatScopeClause=""; + +$mnuClearSearch = language("la_SearchMenu_Clear"); +$mnuNewSearch = language("la_SearchMenu_New"); +$mnuSearchCategory = language("la_SearchMenu_Categories"); + +$lang_New = language("la_Text_New"); +$lang_Hot = language("la_Text_Hot"); +$lang_EdPick = language("la_prompt_EditorsPick"); +$lang_Pop = language("la_Text_Pop"); + +$lang_Rating = language("la_prompt_Rating"); +$lang_Hits = language("la_prompt_Hits"); +$lang_Votes = language("la_prompt_Votes"); +$lang_Name = language("la_prompt_Name"); + +$lang_Categories = language("la_ItemTab_Categories"); +$lang_Description = language("la_prompt_Description"); +$lang_MetaKeywords = language("la_prompt_MetaKeywords"); +$lang_SubSearch = language("la_prompt_SubSearch"); +$lang_Within = language("la_Text_Within"); +$lang_Current = language("la_Text_Current"); +$lang_Active = language("la_Text_Active"); +$lang_SubCats = language("la_Text_SubCats"); +$lang_SubItems = language("la_Text_Subitems"); + +$destform = $_GET["destform"]; +$destfield = $_GET["destfield"]; +print << +var Category_Sortfield = '$Category_Sortfield'; +var Category_Sortorder = '$Category_Sortorder'; +var Category_Perpage = $Perpage_Category; +var Category_ShowAll = $Category_ShowAll; +var CategoryView = $CategoryView; +var default_tab = "$DefaultTab"; + +//JS Language variables +var lang_New = "$lang_New"; +var lang_Hot = "$lang_Hot"; +var lang_EdPick = "$lang_EdPick"; + +var lang_Pop = "$lang_Pop"; +var lang_Rating = "$lang_Rating"; +var lang_Hits = "$lang_Hits"; +var lang_Votes = "$lang_Votes"; +var lang_Name = "$lang_Name"; +var lang_Categories = "$lang_Categories"; +var lang_Description = "$lang_Description"; +var lang_MetaKeywords = "$lang_MetaKeywords"; +var lang_SubSearch = "$lang_SubSearch"; +var lang_Within="$lang_Within"; +var lang_Current = "$lang_Current"; +var lang_Active = "$lang_Active"; +var lang_SubCats = "$lang_SubCats"; +var lang_SubItems = "$lang_SubItems"; + +var m_tab_CatTab_hide = $m_tab_CatTab_Hide; +var hostname = '$rootURL'; +var env = '$envar'; +var actionlist = new Array(); +var homeURL = "$homeURL"; +var upURL = "$upURL"; +var Categories_Paste = false; + + function InitPage() + { + addCommonActions(); + initToolbar('mainToolBar', actionHandler); + initCheckBoxes(); + toggleMenu(); + } + + function AddButtonAction(actionname,actionval) + { + var item = new Array(actionname,actionval); + actionlist[actionlist.length] = item; + } + + function actionHandler(button) + { + //alert('a button has been pressed!'); + for(i=0; i0) + path = path + '?'+attr; + + alert(path); + window.location.href=path; + return true; + } + + function check_submit(page,actionValue) + { + if (actionValue.match(/delete$/)) { + if (!theMainScript.Confirm(lang_DeleteConfirm)) return; + } + + var formname = ''; + if ((activeTab) && (!isAnyChecked('categories'))) + { + form_name = activeTab.id; + action_prefix = activeTab.ActionPrefix; + if(page.length==0) + page = activeTab.EditURL; + } + else + { + form_name = 'categories'; + action_prefix = 'm_cat_'; + if(page.length==0) + page="$admin" + '/category/addcategory'; + } + var f = document.getElementById(form_name+'_form'); + if(f) + { + f.Action.value = action_prefix + actionValue; + f.action = '$rootURL' + page + '.php?'+ env; + //alert(f.name+ ' is submitting to '+ f.action + ' action=' + f.Action.value); + f.submit(); + } + } // check submit + + function flip_current(field_suffix) + { + if(activeTab) + { + field = activeTab.getAttribute("tabTitle")+field_suffix; + return flip(eval(field)); + } + } + + function config_current(field_suffix,value) + { + if(activeTab) + { + field = activeTab.getAttribute("tabTitle")+field_suffix; + config_val(field,value); + } + } + + function getSType(type,value) + { + f = document.getElementById("admin_search"); + if(f) + { + if (f.SearchType.value == type) return 2; else return 0; + } else return 0; + + } + + function getSScope(scope) + { + f = document.getElementById("admin_search"); + if(f) + { + if (f.SearchScope.value == scope) return 2; else return 0; + } else return 0; + + } + + function setSearchMenu() + { + + window.SearchMenu = new Menu("search"); + SearchMenu.addMenuItem(lang_All,"SetSearchType('all');",getSType('all')); + SearchMenu.addMenuSeparator() + + SearchMenu.addMenuItem(lang_Categories, "SetSearchType('categories');",getSType('categories')); + param = ""; + + for (var i = 0; i < tabIDs.length; i++) + { + d = document.getElementById(tabIDs[i]); + if(d) + { + tabname = d.getAttribute("tabTitle"); + param = "SetSearchType('"+tabname+"');"; + + SearchMenu.addMenuItem(tabname,param,getSType(tabname)); + } + } + + SearchMenu.addMenuSeparator(); + SearchMenu.addMenuItem(lang_All+' '+lang_Categories,"SetSearchScope('0');",getSScope(0)); + SearchMenu.addMenuItem(lang_SubSearch,"ToggleNewSearch();",isNewSearch()); + SearchMenu.addMenuItem(lang_Current+' '+lang_Categories,"SetSearchScope('2');",getSScope(2)); + SearchMenu.addMenuItem(lang_Within+' '+lang_Categories,"SetSearchScope('1');",getSScope(1)); + + SearchMenu.addMenuSeparator(); + + window.SearchMenu.addMenuItem('$mnuClearSearch',"ClearSearch();",""); + window.triedToWriteMenus = false; + window.SearchMenu.writeMenus(); + } + + function Category_SortMenu(caption) + { + menu_sorting = new Menu(caption); + + menu_sorting.addMenuItem(lang_Asc,"config_val('Category_Sortorder','asc');",RadioIsSelected(Category_Sortorder,'asc')); + menu_sorting.addMenuItem(lang_Desc,"config_val('Category_Sortorder','desc');",RadioIsSelected(Category_Sortorder,'desc')); + menu_sorting.addMenuSeparator(); + + menu_sorting.addMenuItem(lang_Default,"config_val('Category_Sortfield','Name');",""); + menu_sorting.addMenuItem(lang_Name,"config_val('Category_Sortfield','Name');",RadioIsSelected(Category_Sortfield,'Name')); + menu_sorting.addMenuItem(lang_Description,"config_val('Category_Sortfield','Description');",RadioIsSelected(Category_Sortfield,'Description')); + + menu_sorting.addMenuItem(lang_CreatedOn,"config_val('Category_Sortfield','CreatedOn');",RadioIsSelected(Category_Sortfield,'CreatedOn')); + menu_sorting.addMenuItem(lang_SubCats,"config_val('Category_Sortfield','CachedDescendantCatsQty');",RadioIsSelected(Category_Sortfield,'CachedDescendantCatsQty')); + menu_sorting.addMenuItem(lang_SubItems,"config_val('Category_Sortfield','SubItems');",RadioIsSelected(Category_Sortfield,'SubItems')); + + return menu_sorting; + + } + + + function Category_FilterMenu(caption) + { + menu_filter = new Menu(caption); + menu_filter.addMenuItem(lang_All,"config_val('Category_View', 127);",CategoryView==127); + menu_filter.addMenuSeparator(); + menu_filter.addMenuItem(lang_Active,"FlipBit('Category_View',CategoryView,6);",BitStatus(CategoryView,6)); + menu_filter.addMenuItem(lang_Pending,"FlipBit('Category_View',CategoryView,5);", BitStatus(CategoryView,5)); + menu_filter.addMenuItem(lang_Disabled,"FlipBit('Category_View',CategoryView,4);",BitStatus(CategoryView,4)); + + menu_filter.addMenuSeparator(); + menu_filter.addMenuItem(lang_New,"FlipBit('Category_View',CategoryView,3);",BitStatus(CategoryView,3)); + menu_filter.addMenuItem(lang_EdPick,"FlipBit('Category_View',CategoryView,0);",BitStatus(CategoryView,0)); + + return menu_filter; + } + + function toggleMenu() + { + //var tab_title = GetTabTitle(activeTab.id); + //alert(tab_title); + if ((document.getElementById('categories').active) && (activeTab)) + { + filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu();'; + + window.cat_menu_filter_sub = Category_FilterMenu(lang_Categories); + window.sub_menu_filter_sub = eval(filterfunc); + + window.cat_menu_filter = new Menu(lang_View); + cat_menu_filter.addMenuItem(cat_menu_filter_sub); + cat_menu_filter.addMenuItem(sub_menu_filter_sub); + } + else + { + if (document.getElementById('categories').active) + { + window.cat_menu_filter = Category_FilterMenu(lang_View); + } + if (activeTab) + { + filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu();'; + window.cat_menu_filter = eval(filterfunc); + } + } // Filter + + //Sorting + if ((document.getElementById('categories').active) && (activeTab)) + { + //Sort->Categories + sortfunc = activeTab.getAttribute("tabTitle")+'_SortMenu();'; + + window.cat_menu_sorting_sub = Category_SortMenu(lang_Categories); + window.sub_menu_sorting_sub = eval(sortfunc); + + window.cat_menu_sorting = new Menu(lang_Sort); + cat_menu_sorting.addMenuItem(cat_menu_sorting_sub); + cat_menu_sorting.addMenuItem(sub_menu_sorting_sub); + } + else + { + if (document.getElementById('categories').active) + { + window.cat_menu_sorting = Category_SortMenu(lang_Sort); + + } // categories + if (activeTab) + { + window.cat_menu_sorting = Category_SortMenu(lang_Sort); + } + + } // && Sorting + if ((document.getElementById('categories').active) && (activeTab)) + { + window.cat_menu_select_sub = new Menu(lang_Categories); + cat_menu_select_sub.addMenuItem(lang_All,"javascript:selectAll('categories');",""); + cat_menu_select_sub.addMenuItem(lang_Unselect,"javascript:unselectAll('categories');",""); + cat_menu_select_sub.addMenuItem(lang_Invert,"javascript:invert('categories');",""); + + selectfunc = activeTab.getAttribute("tabTitle")+"_SelectMenu();"; + + window.sub_menu_select_sub = eval(selectfunc); +// sub_menu_select_sub.addMenuItem(lang_All,"javascript:selectAll('"+activeTab.id+"');",""); +// sub_menu_select_sub.addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');",""); +// sub_menu_select_sub.addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');",""); + +END; +if (!$hideSelectAll) { +echo " + window.cat_menu_select = new Menu(lang_Select); + cat_menu_select.addMenuItem(cat_menu_select_sub); + cat_menu_select.addMenuItem(sub_menu_select_sub);"; +} +print << + +END; +?> \ No newline at end of file Index: trunk/admin/icons/icon46_community.gif =================================================================== diff -u Binary files differ Index: trunk/admin/templates/user_list_element.tpl =================================================================== diff -u --- trunk/admin/templates/user_list_element.tpl (revision 0) +++ trunk/admin/templates/user_list_element.tpl (revision 13) @@ -0,0 +1,9 @@ + + + + +, +
    + + + Index: trunk/admin/include/fw_menu.js =================================================================== diff -u --- trunk/admin/include/fw_menu.js (revision 0) +++ trunk/admin/include/fw_menu.js (revision 13) @@ -0,0 +1,715 @@ +/** + * fw_menu 24OCT2000 Version 4.0 + * John Ahlquist, October 2000 + * Copyright (c) 2000 Macromedia, Inc. + * + * based on menu.js + * by gary smith, July 1997 + * Copyright (c) 1997-1999 Netscape Communications Corp. + * + * Netscape grants you a royalty free license to use or modify this + * software provided that this copyright notice appears on all copies. + * This software is provided "AS IS," without a warranty of any kind. + * + * Modified By Intechnic Corporation for use in In-Portal + * 6/28/02 + * + */ +function Menu(label) { + this.version = "990702 [Menu; menu.js]"; + this.type = "Menu"; + this.menuWidth = 0; + this.menuItemHeight = 0; + this.fontSize = 11; + this.fontWeight = "normal"; + this.fontFamily = "helvetica, arial, verdana, helvetica"; + this.fontColor = "#000000"; + this.fontColorHilite = "#000000"; + this.bgColor = "#555555"; + this.menuBorder = 1; + this.menuItemBorder = 0; + this.menuItemBgColor = "#f0f1eb"; + this.menuLiteBgColor = "#ffffff"; + this.menuBorderBgColor = "#777777"; + this.menuHiliteBgColor = "#e0e0da"; + this.menuContainerBgColor = "#cccccc"; + this.imagePath ="images/"; + this.childMenuIcon = "menu_arrow.gif"; + this.items = new Array(); + this.actions = new Array(); + this.types = new Array(); //for check/radio type to show pics + this.childMenus = new Array(); + + this.hideOnMouseOut = true; + + this.addMenuItem = addMenuItem; + this.addMenuSeparator = addMenuSeparator; + this.writeMenus = writeMenus; + this.FW_showMenu = FW_showMenu; + this.onMenuItemOver = onMenuItemOver; + this.onMenuItemAction = onMenuItemAction; + this.hideMenu = hideMenu; + this.hideChildMenu = hideChildMenu; + + if (!window.menus) window.menus = new Array(); + this.label = label || "menuLabel" + window.menus.length; + window.menus[this.label] = this; + window.menus[window.menus.length] = this; + if (!window.activeMenus) window.activeMenus = new Array(); +} + +function addMenuItem(label, action, type) { + this.items[this.items.length] = label; + this.actions[this.actions.length] = action; + if (type == 1) this.types[this.types.length] = this.imagePath+"check_on.gif"; + if (type == 2) this.types[this.types.length] = this.imagePath+"menu_dot.gif"; + if ((type!=1) && (type !=2)) this.types[this.types.length] = ""; +} + +function addMenuSeparator() { + this.items[this.items.length] = "separator"; + this.actions[this.actions.length] = ""; + this.types[this.types.length] = ""; + this.menuItemBorder = 0; +} + +// For NS6. +function FIND(item) { + if (document.all) return(document.all[item]); + if (document.getElementById) return(document.getElementById(item)); + return(false); +} + +function writeMenus(container) { + + if (window.triedToWriteMenus) return; + + if (!container && document.layers) { + window.delayWriteMenus = this.writeMenus; + var timer = setTimeout('delayWriteMenus()', 100); + container = new Layer(100); + clearTimeout(timer); + } else if (document.all || document.hasChildNodes) { + container = FIND("menuContainer"); + if (!container) + { + document.writeln(''); + container = FIND("menuContainer"); + } + else container.innerHTML = ""; + } + + window.fwHideMenuTimer = null; + if (!container) return; window.triedToWriteMenus = true; + container.isContainer = true; + container.menus = new Array(); + for (var i=0; i
    \n'; + } + i=x; + } + if (document.layers) { + container.clip.width = window.innerWidth; + container.clip.height = window.innerHeight; + container.onmouseout = mouseoutMenu; + container.menuContainerBgColor = this.menuContainerBgColor; + for (var i=0; i0) l.top = body.document.layers[n-1].top + body.document.layers[n-1].clip.height + proto.menuItemBorder; + l.hilite = l.document.layers[1]; + if (proto.bgImageUp) l.background.src = proto.bgImageUp; + l.document.layers[1].isHilite = true; + if (l.document.layers[0].id.indexOf("menuSeparator") != -1) { + l.hilite = null; + l.clip.height -= l.clip.height / 2; + l.document.layers[0].document.bgColor = proto.bgColor; + l.document.layers[0].clip.width = l.clip.width -2; + l.document.layers[0].clip.height = 1; + l.document.layers[1].document.bgColor = proto.menuLiteBgColor; + l.document.layers[1].clip.width = l.clip.width -2; + l.document.layers[1].clip.height = 1; + l.document.layers[1].top = l.document.layers[0].top + 1; + } else if (l.document.layers.length > 2) { + l.childMenu = container.menus[i].items[n].menuLayer; + l.document.layers[2].left = l.clip.width -13; + l.document.layers[2].top = (l.clip.height / 2) -4; + l.document.layers[2].clip.left += 3; + l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu; + } + } + body.document.bgColor = proto.bgColor; + body.clip.width = l.clip.width +proto.menuBorder; + body.clip.height = l.top + l.clip.height +proto.menuBorder; + var focusItem = body.document.layers[n]; + focusItem.clip.width = body.clip.width; + focusItem.Menu = l.Menu; + focusItem.top = -30; + focusItem.captureEvents(Event.MOUSEDOWN); + focusItem.onmousedown = onMenuItemDown; + menu.document.bgColor = proto.menuBorderBgColor; + var lite = menu.document.layers[0]; + lite.document.bgColor = proto.menuLiteBgColor; + lite.clip.width = body.clip.width +1; + lite.clip.height = body.clip.height +1; + menu.clip.width = body.clip.width + (proto.menuBorder * 3) ; + menu.clip.height = body.clip.height + (proto.menuBorder * 3); + } + } else { + if ((document.all) || (container.hasChildNodes)) { + container.innerHTML=content; + } else { + container.document.open("text/html"); + container.document.writeln(content); + container.document.close(); + } + if (!FIND("menuLayer0")) return; + var menuCount = 0; + for (var x=0; x window.innerWidth || + NS4sIH > window.innerHeight || + NS4sIH < window.innerHeight ) + { + window.location.reload(); + } +} + +function onMenuItemOver(e, l) { + FW_clearTimeout(); + l = l || this; + a = window.ActiveMenuItem; + if (document.layers) { + if (a) { + a.document.bgColor = a.saveColor; + if (a.hilite) a.hilite.visibility = "hidden"; + if (a.Menu.bgImageOver) { + a.background.src = a.Menu.bgImageUp; + } + a.focusItem.top = -100; + a.clicked = false; + } + if (l.hilite) { + l.document.bgColor = l.menuHiliteBgColor; + l.zIndex = 100; + l.hilite.visibility = "inherit"; + l.hilite.zIndex = 101; + l.document.layers[1].zIndex = 100; + l.focusItem.zIndex = this.zIndex +2; + } + if (l.Menu.bgImageOver) { + l.background.src = l.Menu.bgImageOver; + } + l.focusItem.top = this.top; + l.Menu.hideChildMenu(l); + } else if (l.style && l.Menu) { + if (a) { + a.style.backgroundColor = a.saveColor; + if (a.hilite) a.hilite.style.visibility = "hidden"; + if (a.Menu.bgImageUp) { + a.style.background = "url(" + a.Menu.bgImageUp +")";; + } + } + if (l.isSeparator) return; + l.style.backgroundColor = l.menuHiliteBgColor; + l.zIndex = 100; // magic IE 4.5 mac happy doohicky. jba + if (l.Menu.bgImageOver) { + l.style.background = "url(" + l.Menu.bgImageOver +")"; + } + if (l.hilite) { + l.style.backgroundColor = l.menuHiliteBgColor; + l.hilite.style.visibility = "inherit"; + } + l.focusItem.style.top = l.focusItem.style.pixelTop = l.style.pixelTop; + l.focusItem.style.zIndex = l.zIndex +1; + l.Menu.hideChildMenu(l); + } else { + return; // not a menu - magic IE 4.5 mac happy doohicky. jba + } + window.ActiveMenuItem = l; +} + +function onMenuItemAction(e, l) { + l = window.ActiveMenuItem; + if (!l) return; + hideActiveMenus(); + if (l.action) { + eval("" + l.action); + } + window.ActiveMenuItem = 0; +} + +function FW_clearTimeout() +{ + if (fwHideMenuTimer) clearTimeout(fwHideMenuTimer); + fwHideMenuTimer = null; + fwDHFlag = false; +} +function FW_startTimeout() +{ + fwStart = new Date(); + fwDHFlag = true; + fwHideMenuTimer = setTimeout("fwDoHide()", 1000); +} + +function fwDoHide() +{ + if (!fwDHFlag) return; + var elapsed = new Date() - fwStart; + if (elapsed < 1000) { + fwHideMenuTimer = setTimeout("fwDoHide()", 1100-elapsed); + return; + } + fwDHFlag = false; + hideActiveMenus(); + window.ActiveMenuItem = 0; +} + +function FW_showMenu(menu, x, y, child) { + if (!window.fwWroteMenu) + { + alert('No Menu Written'); + return; + } + FW_clearTimeout(); + if (document.layers) { + if (menu) { + var l = menu.menuLayer || menu; + l.left = 1; + l.top = 1; + hideActiveMenus(); + if (this.visibility) l = this; + window.ActiveMenu = l; + } else { + var l = child; + } + if (!l) return; + for (var i=0; i 0) + FW_showMenu(null, "relative", "relative", l.layers[i]); + } + if (l.parentLayer) { + if (x != "relative") + l.parentLayer.left = x || window.pageX || 0; + if (l.parentLayer.left + l.clip.width > window.innerWidth) + l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth); + if (y != "relative") + l.parentLayer.top = y || window.pageY || 0; + if (l.parentLayer.isContainer) { + l.Menu.xOffset = window.pageXOffset; + l.Menu.yOffset = window.pageYOffset; + l.parentLayer.clip.width = window.ActiveMenu.clip.width +2; + l.parentLayer.clip.height = window.ActiveMenu.clip.height +2; + if (l.parentLayer.menuContainerBgColor) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor; + } + } + l.visibility = "inherit"; + if (l.Menu) l.Menu.container.visibility = "inherit"; + } else if (FIND("menuItem0")) { + var l = menu.menuLayer || menu; + hideActiveMenus(); + if (typeof(l) == "string") { + l = FIND(l); + } + window.ActiveMenu = l; + var s = l.style; + s.visibility = "inherit"; + if (x != "relative") + s.left = s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0; + if (y != "relative") + s.top = s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0; + l.Menu.xOffset = document.body.scrollLeft; + l.Menu.yOffset = document.body.scrollTop; + } + if (menu) { + window.activeMenus[window.activeMenus.length] = l; + } +} + +function onMenuItemDown(e, l) { + var a = window.ActiveMenuItem; + if (document.layers) { + if (a) { + a.eX = e.pageX; + a.eY = e.pageY; + a.clicked = true; + } + } +} + +function mouseupMenu(e) +{ + hideMenu(true, e); + hideActiveMenus(); + return true; +} + +function mouseoutMenu() +{ + hideMenu(false, false); + return true; +} + + +function hideMenu(mouseup, e) { + var a = window.ActiveMenuItem; + if (a && document.layers) { + a.document.bgColor = a.saveColor; + a.focusItem.top = -30; + if (a.hilite) a.hilite.visibility = "hidden"; + if (mouseup && a.action && a.clicked && window.ActiveMenu) { + if (a.eX <= e.pageX+15 && a.eX >= e.pageX-15 && a.eY <= e.pageY+10 && a.eY >= e.pageY-10) { + setTimeout('window.ActiveMenu.Menu.onMenuItemAction();', 2); + } + } + a.clicked = false; + if (a.Menu.bgImageOver) { + a.background.src = a.Menu.bgImageUp; + } + } else if (window.ActiveMenu && FIND("menuItem0")) { + if (a) { + a.style.backgroundColor = a.saveColor; + if (a.hilite) a.hilite.style.visibility = "hidden"; + if (a.Menu.bgImageUp) { + a.style.background = "url(" + a.Menu.bgImageUp +")";; + } + } + } + if (!mouseup && window.ActiveMenu) { + if (window.ActiveMenu.Menu) { + if (window.ActiveMenu.Menu.hideOnMouseOut) { + FW_startTimeout(); + } + return(true); + } + } + return(true); +} + +function PxToNum(pxStr) +{ // pxStr == 27px, we want 27. + if (pxStr.length > 2) { + n = Number(pxStr.substr(0, pxStr.length-2)); + return(n); + } + return(0); +} + +function hideChildMenu(hcmLayer) { + FW_clearTimeout(); + var l = hcmLayer; + for (var i=0; i < l.Menu.childMenus.length; i++) { + var theLayer = l.Menu.childMenus[i]; + if (document.layers) { + theLayer.visibility = "hidden"; + } else { + theLayer = FIND(theLayer); + theLayer.style.visibility = "hidden"; + } + theLayer.Menu.hideChildMenu(theLayer); + } + + if (l.childMenu) { + var childMenu = l.childMenu; + if (document.layers) { + l.Menu.FW_showMenu(null,null,null,childMenu.layers[0]); + childMenu.zIndex = l.parentLayer.zIndex +1; + childMenu.top = l.top + l.parentLayer.top + l.Menu.menuLayer.top + l.Menu.menuItemHeight/3; + if (childMenu.left + childMenu.clip.width > window.innerWidth) { + childMenu.left = l.parentLayer.left - childMenu.clip.width + l.Menu.menuLayer.left + 15; + l.Menu.container.clip.left -= childMenu.clip.width; + } else { + childMenu.left = l.parentLayer.left + l.parentLayer.clip.width + l.Menu.menuLayer.left -5; + } + var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left; + if (w > l.Menu.container.clip.width) + l.Menu.container.clip.width = w; + var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top; + if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h; + l.document.layers[1].zIndex = 0; + childMenu.visibility = "inherit"; + } else if (FIND("menuItem0")) { + childMenu = FIND(l.childMenu); + var menuLayer = FIND(l.Menu.menuLayer); + var s = childMenu.style; + s.zIndex = menuLayer.style.zIndex+1; + if (document.all) { // ie case. + s.pixelTop = l.style.pixelTop + menuLayer.style.pixelTop + l.Menu.menuItemHeight/3; + left = s.pixelLeft = (menuLayer.style.pixelWidth) + menuLayer.style.pixelLeft -5; +// alert(left + parseInt(s.width) - document.body.scrollLeft) + if (left + parseInt(s.width) > document.body.scrollLeft + document.body.offsetWidth) + left -= parseInt(s.width) + l.offsetWidth - 5; + s.left = left; + + + } else { // zilla case + var top = PxToNum(l.style.top) + PxToNum(menuLayer.style.top) + l.Menu.menuItemHeight/3; + var left = (PxToNum(menuLayer.style.width)) + PxToNum(menuLayer.style.left) -5; + s.top = top; +// alert() + if (left + parseInt(s.width) > document.body.offsetWidth) + left -= parseInt(s.width) + l.offsetWidth - 5; + s.left = left; + } + childMenu.style.visibility = "inherit"; + } else { + return; + } + window.activeMenus[window.activeMenus.length] = childMenu; + } +} + +function hideActiveMenus() { + if (!window.activeMenus) return; + for (var i=0; i < window.activeMenus.length; i++) { + if (!activeMenus[i]) continue; + if (activeMenus[i].visibility && activeMenus[i].Menu) { + activeMenus[i].visibility = "hidden"; + activeMenus[i].Menu.container.visibility = "hidden"; + activeMenus[i].Menu.container.clip.left = 0; + } else if (activeMenus[i].style) { + var s = activeMenus[i].style; + s.visibility = "hidden"; + s.left = -200; + s.top = -200; + } + } + if (window.ActiveMenuItem) { + hideMenu(false, false); + } + window.activeMenus.length = 0; +} + + Index: trunk/themes/default/common/right_inside.tpl =================================================================== diff -u --- trunk/themes/default/common/right_inside.tpl (revision 0) +++ trunk/themes/default/common/right_inside.tpl (revision 13) @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file Index: trunk/themes/default/img/ic_post_time.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/icon23.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_user_group_f3.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_favorite.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/check_on.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/inportal_data.sql =================================================================== diff -u --- trunk/admin/install/inportal_data.sql (revision 0) +++ trunk/admin/install/inportal_data.sql (revision 13) @@ -0,0 +1,266 @@ +INSERT INTO ConfigurationAdmin VALUES ('Site_Name', 'la_Text_Website', 'la_config_website_name', 'text', '', '', 7, 1); +INSERT INTO ConfigurationAdmin VALUES ('Site_Path', 'la_Text_Website', 'la_config_web_address', 'text', '', '', 6, 1); +INSERT INTO ConfigurationAdmin VALUES ('Domain_Detect', 'la_Text_Website', 'la_config_detect_domain', 'text', '', '', 8, 1); +INSERT INTO ConfigurationAdmin VALUES ('Category_Sortfield', 'la_Text_General', 'la_category_sortfield_prompt', 'select', '', 'Name=la_Category_Name,Description=la_Category_Description,CreatedOn=la_Category_Date,EditorsPick=la_Category_Pick,Pop=la_Category_Pop,SELECT FieldLabel as OptionName, FieldName as OptionValue FROM CustomField WHERE Type=0', 1, 1); +INSERT INTO ConfigurationAdmin VALUES ('Category_Sortorder', 'la_Text_General', 'la_category_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 2, 1); +INSERT INTO ConfigurationAdmin VALUES ('Category_Sortfield2', 'la_Text_General', 'la_category_sortfield2_prompt', 'select', '', 'Name=la_Category_Name,Description=la_Category_Description,CreatedOn=la_Category_Date,EditorsPick=la_Category_Pick,Pop=la_Category_Pop,SELECT FieldLabel as OptionName, FieldName as OptionValue FROM CustomField WHERE Type=0', 3, 1); +INSERT INTO ConfigurationAdmin VALUES ('Category_Sortorder2', 'la_text_General', 'la_category_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 4, 1); +INSERT INTO ConfigurationAdmin VALUES ('Perpage_Category', 'la_Text_General', 'la_category_perpage_prompt', 'text', '', '', 5, 1); +INSERT INTO ConfigurationAdmin VALUES ('Category_DaysNew', 'la_Text_General', 'la_category_daysnew_prompt', 'text', '', '', 6, 1); +INSERT INTO ConfigurationAdmin VALUES ('Category_ShowPick', 'la_Text_General', 'la_category_showpick_prompt', 'checkbox', '', '', 7, 1); +INSERT INTO ConfigurationAdmin VALUES ('Category_MetaKey', 'la_Text_MetaInfo', 'la_category_metakey', 'text', '', '', 8, 1); +INSERT INTO ConfigurationAdmin VALUES ('Category_MetaDesc', 'la_Text_MetaInfo', 'la_category_metadesc', 'text', '', '', 9, 1); +INSERT INTO ConfigurationAdmin VALUES ('User_NewGroup', 'la_Text_General', 'la_users_new_group', 'select', NULL, '0=lu_none,SELECT GroupId as OptionName, Name as OptionValue FROM PortalGroup WHERE Enabled=1 AND Personal=0', 3, 1); +INSERT INTO ConfigurationAdmin VALUES ('User_GuestGroup', 'la_Text_General', 'la_users_guest_group', 'select', NULL, '0=lu_none,SELECT GroupId as OptionName, Name as OptionValue FROM PortalGroup WHERE Enabled=1 AND Personal=0', 4, 1); +INSERT INTO ConfigurationAdmin VALUES ('RootPass', 'la_Text_General', 'la_prompt_root_pass', 'password', NULL, NULL, 11, 0); +INSERT INTO ConfigurationAdmin VALUES ('RootPassVerify', 'la_Text_General', 'la_prompt_root_pass_verify', 'password', NULL, NULL, 11, 0); +INSERT INTO ConfigurationAdmin VALUES ('User_Allow_New', 'la_Text_General', 'la_users_allow_new', 'radio', '', '1=la_User_Instant,2=la_User_Not_Allowed,3=la_User_Upon_Approval', 1, 1); +INSERT INTO ConfigurationAdmin VALUES ('User_Password_Auto', 'la_Text_General', 'la_users_password_auto', 'checkbox', '', '', 10, 1); +INSERT INTO ConfigurationAdmin VALUES ('User_Votes_Deny', 'la_Text_Restrictions', 'la_users_votes_deny', 'text', '', '', 4, 1); +INSERT INTO ConfigurationAdmin VALUES ('User_Review_Deny', 'la_Text_Restrictions', 'la_users_review_deny', 'text', '', '', 5, 1); +INSERT INTO ConfigurationAdmin VALUES ('Server_Name', 'la_Text_Website', 'la_config_server_name', 'text', '', '', 4, 0); +INSERT INTO ConfigurationAdmin VALUES ('Config_Server_Time', 'la_Text_Date_Time_Settings', 'la_config_time_server', 'select', '', '1=la_m12,2=la_m11,3=la_m10,5=la_m9,6=la_m8,7=la_m7,8=la_m6,9=la_m5,10=la_m4,11=la_m3,12=la_m2,13=la_m1,14=la_m0,15=la_p1,16=la_p2,17=la_p3,18=la_p4,19=la_p5,20=la_p6,21=la_p7,22=la_p8,23=la_p9,24=la_p10,25=la_p11,26=la_p12,27=la_p13', 6, 1); +INSERT INTO ConfigurationAdmin VALUES ('Config_Site_Time', 'la_Text_Date_Time_Settings', 'la_config_site_zone', 'select', '', '1=la_m12,2=la_m11,3=la_m10,5=la_m9,6=la_m8,7=la_m7,8=la_m6,9=la_m5,10=la_m4,11=la_m3,12=la_m2,13=la_m1,14=la_m0,15=la_p1,16=la_p2,17=la_p3,18=la_p4,19=la_p5,20=la_p6,21=la_p7,22=la_p8,23=la_p9,24=la_p10,25=la_p11,26=la_p12,27=la_p13', 7, 1); +INSERT INTO ConfigurationAdmin VALUES ('Smtp_Server', 'la_Text_smtp_server', 'la_prompt_mailserver', 'text', NULL, NULL, 10, 1); +INSERT INTO ConfigurationAdmin VALUES ('Smtp_Port', 'la_Text_smtp_server', 'la_prompt_mailport', 'text', NULL, NULL, 11, 1); +INSERT INTO ConfigurationAdmin VALUES ('Smtp_Authenticate', 'la_Text_smtp_server', 'la_prompt_mailauthenticate', 'checkbox', NULL, NULL, 12, 1); +INSERT INTO ConfigurationAdmin VALUES ('Smtp_User', 'la_Text_smtp_server', 'la_prompt_smtp_user', 'text', NULL, NULL, 13, 1); +INSERT INTO ConfigurationAdmin VALUES ('Smtp_Pass', 'la_Text_smtp_server', 'la_prompt_smtp_pass', 'text', NULL, NULL, 14, 1); +INSERT INTO ConfigurationAdmin VALUES ('Smtp_SendHTML', 'la_Text_smtp_server', 'la_prompt_mailhtml', 'checkbox', NULL, NULL, 15, 0); +INSERT INTO ConfigurationAdmin VALUES ('Smtp_DefaultHeaders', 'la_Text_smtp_server', 'la_prompt_smtpheaders', 'textarea', NULL, 'COLS=40 ROWS=5', 16, 0); +INSERT INTO ConfigurationAdmin VALUES ('Smtp_AdminMailFrom', 'la_Text_smtp_server', 'la_prompt_AdminMailFrom', 'text', NULL, NULL, 17, 1); +INSERT INTO ConfigurationAdmin VALUES ('Perpage_Category_Short', 'la_Text_General', 'la_category_perpage__short_prompt', 'text', '', '', 5, 1); +INSERT INTO ConfigurationAdmin VALUES ('CookieSessions', 'la_Text_Website', 'la_prompt_session_management', 'select', NULL, '0=lu_query_string,1=lu_cookies,2=lu_auto', 8, 1); +INSERT INTO ConfigurationAdmin VALUES ('SessionTimeout', 'la_Text_Website', 'la_prompt_session_timeout', 'text','', '', 9, 1); +INSERT INTO ConfigurationAdmin VALUES ('SystemTagCache', 'la_Text_Website', 'la_prompt_syscache_enable', 'checkbox', NULL, NULL, 10, 0); +INSERT INTO ConfigurationAdmin VALUES ('User_SubscriberGroup', 'la_Text_General', 'la_users_subscriber_group', 'select', NULL, '0=lu_none,SELECT GroupId as OptionName, Name as OptionValue FROM PortalGroup WHERE Enabled=1 AND Personal=0', 5, 1); +INSERT INTO ConfigurationAdmin VALUES ('Root_Name', 'la_Text_General', 'la_prompt_root_name', 'text', '', '', 8, 1); +INSERT INTO ConfigurationAdmin VALUES ('SocketBlockingMode', 'la_Text_Website', 'la_prompt_socket_blocking_mode', 'checkbox', NULL, NULL, 11, 0); +INSERT INTO ConfigurationAdmin VALUES ('Min_UserName', 'la_Text_General', 'la_text_min_username', 'text', '', '', 1, 0); +INSERT INTO ConfigurationAdmin VALUES ('Min_Password', 'la_Text_General', 'la_text_min_password', 'text', '', '', 2, 0); + +INSERT INTO ConfigurationValues VALUES ('Columns_Category', '2', 'In-Portal', 'Categories') +INSERT INTO ConfigurationValues VALUES ('DomainSelect','1','In-Portal','in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Site_Path', '/', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Perpage_Archive', '25', 'inportal', '') +INSERT INTO ConfigurationValues VALUES ('debug', '1', 'inportal', '') +INSERT INTO ConfigurationValues VALUES ('Perpage_User', '100', 'inportal', '') +INSERT INTO ConfigurationValues VALUES ('Perpage_LangEmail', '20', 'inportal', '') +INSERT INTO ConfigurationValues VALUES ('Default_FromAddr', '', 'inportal', '') +INSERT INTO ConfigurationValues VALUES ('email_replyto', '', 'inportal', '') +INSERT INTO ConfigurationValues VALUES ('email_footer', 'message footer goes here', 'inportal', '') +INSERT INTO ConfigurationValues VALUES ('Default_Theme', 'default', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Default_Language', 'English', 'inportal', '') +INSERT INTO ConfigurationValues VALUES ('SessionTimeout', '3600', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('User_SortOrder', 'asc', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Suggest_MinInterval', '3600', 'inportal', '') +INSERT INTO ConfigurationValues VALUES ('SubCat_ListCount', '3', 'inportal', '') +INSERT INTO ConfigurationValues VALUES ('Timeout_Rating', '3600', 'In-Portal', 'System') +INSERT INTO ConfigurationValues VALUES ('User_SortField', 'DateCreated', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Perpage_Relations', '10', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Group_SortField', 'GroupName', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Group_SortOrder', 'asc', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Default_FromName', 'Webmaster', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Perpage_Category', '10', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('Category_Sortfield', 'Name', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('Category_Sortorder', 'asc', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('MetaKeywords', NULL, 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Relation_LV_Sortfield', 'ItemType', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('ampm_time', '1', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Perpage_Template', '10', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Perpage_Phrase', '40', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Perpage_Sessionlist', '20', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Category_Sortfield2', 'Description', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('Category_Sortorder2', 'asc', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('Category_DaysNew', '8', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('Category_ShowPick', '', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('Category_MetaKey', '', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('Category_MetaDesc', '', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('MetaDescription', NULL, 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('User_NewGroup', '13', 'In-Portal:Users', 'in-portal:configure_users') +INSERT INTO ConfigurationValues VALUES ('User_Allow_New', '3', 'In-Portal:Users', 'in-portal:configure_users') +INSERT INTO ConfigurationValues VALUES ('User_Password_Auto', '0', 'In-Portal:Users', 'in-portal:configure_users') +INSERT INTO ConfigurationValues VALUES ('User_Votes_Deny', '5', 'In-Portal:Users', 'in-portal:configure_users') +INSERT INTO ConfigurationValues VALUES ('User_Review_Deny', '5', 'In-Portal:Users', 'in-portal:configure_users') +INSERT INTO ConfigurationValues VALUES ('Config_Name', 'Zhenya', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Config_Company', 'Hohlov', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Config_Reg_Number', '', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Config_Website_Name', '', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Config_Web_Address', '', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Config_Server_Time', '14', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Config_Site_Time', '14', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Site_Name', 'In-Portal', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Backup_Path', '', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Perpage_Items', '20', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('GuestSessions', '1', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Smtp_Server', NULL, 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Smtp_Port', NULL, 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Smtp_User', NULL, 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Smtp_Pass', NULL, 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Smtp_SendHTML', '1', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Smtp_Authenticate', '0', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Perpage_Email', '10', 'In-Portal', '') +INSERT INTO ConfigurationValues VALUES ('Smtp_DefaultHeaders', 'X-Priority: 1\r\nX-MSMail-Priority: High\r\nX-Mailer: In-Portal', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Smtp_AdminMailFrom', 'portal@user.domain.name', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('Category_Highlight_OpenTag', '', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('Category_Highlight_CloseTag', '', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('User_GuestGroup', '14', 'In-Portal:Users', 'in-portal:configure_users') +INSERT INTO ConfigurationValues VALUES ('RootPass', '', 'In-Portal:Users', 'in-portal:configure_users') +INSERT INTO ConfigurationValues VALUES ('RootPassVerify', '', 'In-Portal:Users', 'in-portal:configure_users') +INSERT INTO ConfigurationValues VALUES ('Perpage_Category_Short', '3', 'In-Portal', 'in-portal:configure_categories') +INSERT INTO ConfigurationValues VALUES ('CookieSessions', '2', 'In-Portal', 'in-portal:configure_general') +INSERT INTO ConfigurationValues VALUES ('SearchRel_Increase_category', '30', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('SearchRel_Keyword_category', '90', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('SearchRel_Pop_category', '5', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('SearchRel_Rating_category', '5', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('SearchRel_DefaultIncrease', '30', 'In-Portal', 'inportal:configure_searchdefault'); +INSERT INTO ConfigurationValues VALUES ('SearchRel_DefaultKeyword', '80', 'In-Portal', 'SearchRel_DefaultKeyword'); +INSERT INTO ConfigurationValues VALUES ('SearchRel_DefaultPop', '10', 'In-Portal', 'inportal:configuration_searchdefault'); +INSERT INTO ConfigurationValues VALUES ('SearchRel_DefaultRating', '10', 'In-Portal', 'inportal:configure_searchdefault'); +INSERT INTO ConfigurationValues VALUES ('SystemTagCache', '0', 'In-Portal', 'in-portal:configure_general'); +INSERT INTO ConfigurationValues VALUES ('Root_Name', 'lu_rootcategory_name', 'In-Portal', 'in-portal:configure_categories'); +INSERT INTO ConfigurationValues VALUES ('User_SubscriberGroup', '12', 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES ('SocketBlockingMode', '0', 'In-Portal', 'in-portal:configure_general'); +INSERT INTO ConfigurationValues VALUES ('Min_UserName', '3', 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES ('Min_Password', '5', 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES ('LinksValidation_LV_Sortfield', 'ValidationTime', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('CustomConfig_LV_Sortfield', 'FieldName', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('Event_LV_SortField', 'Description', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('Theme_LV_SortField', 'Name', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('Template_LV_SortField', 'FileName', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('Lang_LV_SortField', 'PackName', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('Phrase_LV_SortField', 'Phrase', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('LangEmail_LV_SortField', 'Description', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('CustomData_LV_SortField', 'FieldName', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('Summary_SortField', 'Module', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('Session_SortField', 'UserName', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('SearchLog_SortField', 'Keyword', 'In-Portal', ''); +INSERT INTO ConfigurationValues VALUES ('Perpage_StatItem', '10', 'inportal', ''); + +INSERT INTO Events VALUES (30, 'USER.ADD', 1, 19, 'In-Portal:Users', 'la_event_user.add', 0) +INSERT INTO Events VALUES (32, 'USER.ADD', 2, 0, 'In-Portal:Users', 'la_event_user.add', 1) +INSERT INTO Events VALUES (31, 'USER.APPROVE', 1, 0, 'In-Portal:Users', 'la_event_user.approve', 0) +INSERT INTO Events VALUES (33, 'USER.APPROVE', 2, 0, 'In-Portal:Users', 'la_event_user.approve', 1) +INSERT INTO Events VALUES (34, 'USER.VALIDATE', 1, 0, 'In-Portal:Users', 'la_event_user.validate', 0) +INSERT INTO Events VALUES (35, 'USER.VALIDATE', 2, 0, 'In-Portal:Users', 'la_event_user.validate', 1) +INSERT INTO Events VALUES (36, 'USER.DENY', 1, 0, 'In-Portal:Users', 'la_event_user.deny', 0) +INSERT INTO Events VALUES (37, 'USER.DENY', 2, 0, 'In-Portal:Users', 'la_event_user.deny', 1) +INSERT INTO Events VALUES (38, 'USER.PSWD', 2, 19, 'In-Portal:Users', 'la_event_user.forgotpw', 1) +INSERT INTO Events VALUES (39, 'USER.PSWD', 1, 19, 'In-Portal:Users', 'la_event_user.forgotpw', 0) +INSERT INTO Events VALUES (45, 'USER.ADD.PENDING', 1, 0, 'In-Portal:Users', 'la_event_user.add.pending', 0) +INSERT INTO Events VALUES (47, 'CATEGORY.ADD', 1, 0, 'In-Portal:Category', 'la_event_category.add', 0) +INSERT INTO Events VALUES (48, 'CATEGORY.ADD.PENDING', 1, 0, 'In-Portal:Category', 'la_event_category.add.pending', 0) +INSERT INTO Events VALUES (49, 'CATEGORY.ADD.PENDING', 2, 0, 'In-Portal:Category', 'la_event_category.add.pending', 1) +INSERT INTO Events VALUES (50, 'CATEGORY.ADD', 2, 0, 'In-Portal:Category', 'la_event_category.add', 1) +INSERT INTO Events VALUES (51, 'CATEGORY.DELETE', 1, 0, 'In-Portal:Category', 'la_event_category_delete', 0) +INSERT INTO Events VALUES (52, 'CATEGORY.DELETE', 2, 0, 'In-Portal:Category', 'la_event_category_delete', 1) +INSERT INTO Events VALUES (53, 'CATEGORY.MODIFY', 1, 0, 'In-Portal:Category', 'la_event_category.modify', 0) +INSERT INTO Events VALUES (54, 'CATEGORY.MODIFY', 2, 0, 'In-Portal:Category', 'la_event_category.modify', 1) +INSERT INTO Events VALUES (56, 'CATEGORY.APPROVE', 1, 0, 'In-Portal:Category', 'la_event_category.approve', 0) +INSERT INTO Events VALUES (57, 'CATEGORY.APPROVE', 2, 0, 'In-Portal:Category', 'la_event_category.approve', 1) +INSERT INTO Events VALUES (58, 'CATEGORY.DENY', 1, 0, 'In-Portal:Category', 'la_event_category.deny', 0) +INSERT INTO Events VALUES (59, 'CATEGORY.DENY', 2, 0, 'In-Portal:Category', 'la_event_category.deny', 1) +INSERT INTO Events VALUES (60, 'USER.SUBSCRIBE', 1, 19, 'In-Portal:Users', 'la_event_user.subscribe', 0); +INSERT INTO Events VALUES (61, 'USER.SUBSCRIBE', 2, 0, 'In-Portal:Users', 'la_event_user.subscribe', 1); +INSERT INTO Events VALUES (62, 'USER.UNSUBSCRIBE', 1, 19, 'In-Portal:Users', 'la_event_user.unsubscribe', 0); +INSERT INTO Events VALUES (63, 'USER.UNSUBSCRIBE', 2, 0, 'In-Portal:Users', 'la_event_user.unsubscribe', 1); +INSERT INTO Events VALUES (64,'USER.SUGGEST', '1', '0', 'In-Portal:Users', 'la_event_user.suggest', '0'); +INSERT INTO Events VALUES (65,'USER.SUGGEST', '2', '0', 'In-Portal:Users', 'la_event_user.suggest', '1'); + +INSERT INTO IdGenerator VALUES ('100'); + +INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category'); +INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'PortalUser', 'Login', '', NULL, NULL, '', 0, '', 'clsPortalUser', 'User'); + +INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Portal', 'kernel/', 'm', '1.0.1', 1, 0, '', 0, '1054738405'); + +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.VIEW', 'lu_PermName_Category.View_desc', 'lu_PermName_Category.View_error', 'In-Portal'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.ADD', 'lu_PermName_Category.Add_desc', 'lu_PermName_Category.Add_error', 'In-Portal'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.DELETE', 'lu_PermName_Category.Delete_desc', 'lu_PermName_Category.Delete_error', 'In-Portal'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.ADD.PENDING', 'lu_PermName_Category.AddPending_desc', 'lu_PermName_Category.AddPending_error', 'In-Portal'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('CATEGORY.MODIFY', 'lu_PermName_Category.Modify_desc', 'lu_PermName_Category.Modify_error', 'In-Portal'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('ADMIN', 'lu_PermName_Admin_desc', 'lu_PermName_Admin_error', 'Admin'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LOGIN', 'lu_PermName_Login_desc', 'lu_PermName_Admin_error', 'Front'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('DEBUG.ITEM', 'lu_PermName_Debug.Item_desc', '', 'Admin'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('DEBUG.LIST', 'lu_PermName_Debug.List_desc', '', 'Admin'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('DEBUG.INFO', 'lu_PermName_Debug.Info_desc', '', 'Admin'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('PROFILE.MODIFY', 'lu_PermName_Profile.Modify_desc', '', 'Admin'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('SHOWLANG', 'lu_PermName_ShowLang_desc', '', 'Admin'); +INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('FAVORITES', 'lu_PermName_favorites_desc', 'lu_PermName_favorites_error', 'In-Portal'); + +INSERT INTO PortalGroup VALUES (13, 'Member', '', '1054738682', 0, 0, 1, 13); +INSERT INTO PortalGroup VALUES (12, 'Subscribers', '', '1054738670', 0, 0, 1, 12); +INSERT INTO PortalGroup VALUES (14, 'Guest', 'Guest User', '0', 1, 0, 1, 14); +INSERT INTO PortalGroup VALUES (11, 'admin', '', '1054738405', 0, 0, 1, 11); + +INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LOGIN', 13, 1, 1, 0); +INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LOGIN', 11, 1, 1, 0); +INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LOGIN', 12, 1, 1, 0); +INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('ADMIN', 11, 1, 1, 0); + +INSERT INTO SearchConfig VALUES ('Category', 'NewItem', 0, 1, 'lu_fielddesc_category_newitem', 'lu_field_newitem', 'In-Portal', 'la_Text_Category', 18, 80, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'PopItem', 0, 1, 'lu_fielddesc_category_popitem', 'lu_field_popitem', 'In-Portal', 'la_Text_Category', 19, 81, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'HotItem', 0, 1, 'lu_fielddesc_category_hotitem', 'lu_field_hotitem', 'In-Portal', 'la_Text_Category', 17, 79, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'MetaDescription', 0, 1, 'lu_fielddesc_category_metadescription', 'lu_field_metadescription', 'In-Portal', 'la_Text_Category', 16, 78, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'ParentPath', 0, 1, 'lu_fielddesc_category_parentpath', 'lu_field_parentpath', 'In-Portal', 'la_Text_Category', 15, 77, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'ResourceId', 0, 1, 'lu_fielddesc_category_resourceid', 'lu_field_resourceid', 'In-Portal', 'la_Text_Category', 14, 76, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'CreatedById', 0, 1, 'lu_fielddesc_category_createdbyid', 'lu_field_createdbyid', 'In-Portal', 'la_Text_Category', 13, 75, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'CachedNavbar', 0, 1, 'lu_fielddesc_category_cachednavbar', 'lu_field_cachednavbar', 'In-Portal', 'la_Text_Category', 12, 74, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'CachedDescendantCatsQty', 0, 1, 'lu_fielddesc_category_cacheddescendantcatsqty', 'lu_field_cacheddescendantcatsqty', 'In-Portal', 'la_Text_Category', 11, 73, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'MetaKeywords', 0, 1, 'lu_fielddesc_category_metakeywords', 'lu_field_metakeywords', 'In-Portal', 'la_Text_Category', 10, 72, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'Priority', 0, 1, 'lu_fielddesc_category_priority', 'lu_field_priority', 'In-Portal', 'la_Text_Category', 9, 71, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'Status', 0, 1, 'lu_fielddesc_category_status', 'lu_field_status', 'In-Portal', 'la_Text_Category', 7, 69, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'EditorsPick', 0, 1, 'lu_fielddesc_category_editorspick', 'lu_field_editorspick', 'In-Portal', 'la_Text_Category', 6, 68, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'CreatedOn', 0, 1, 'lu_fielddesc_category_createdon', 'lu_field_createdon', 'In-Portal', 'la_Text_Category', 5, 67, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'Description', 1, 1, 'lu_fielddesc_category_description', 'lu_field_description', 'In-Portal', 'la_Text_Category', 4, 66, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'Name', 1, 1, 'lu_fielddesc_category_name', 'lu_field_name', 'In-Portal', 'la_Text_Category', 3, 65, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'ParentId', 0, 1, 'lu_fielddesc_category_parentid', 'lu_field_parentid', 'In-Portal', 'la_Text_Category', 2, 64, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'CategoryId', 0, 1, 'lu_fielddesc_category_categoryid', 'lu_field_categoryid', 'In-Portal', 'la_Text_Category', 0, 62, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'Modified', 0, 1, 'lu_fielddesc_category_modified', 'lu_field_modified', 'In-Portal', 'la_Text_Category', 20, 82, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('Category', 'ModifiedById', 0, 1, 'lu_fielddesc_category_modifiedbyid', 'lu_field_modifiedbyid', 'In-Portal', 'la_Text_Category', 21, 83, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'PortalUserId', 0, 0, 'lu_fielddesc_user_portaluserid', 'lu_field_portaluserid', 'In-Portal', 'la_text_user', 0, 173, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Login', 0, 0, 'lu_fielddesc_user_login', 'lu_field_login', 'In-Portal', 'la_text_user', 1, 174, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Password', 0, 0, 'lu_fielddesc_user_password', 'lu_field_password', 'In-Portal', 'la_text_user', 2, 175, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'tz', 0, 0, 'lu_fielddesc_user_tz', 'lu_field_tz', 'In-Portal', 'la_text_user', 17, 190, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'dob', 0, 0, 'lu_fielddesc_user_dob', 'lu_field_dob', 'In-Portal', 'la_text_user', 16, 189, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Modified', 0, 0, 'lu_fielddesc_user_modified', 'lu_field_modified', 'In-Portal', 'la_text_user', 15, 188, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Status', 0, 0, 'lu_fielddesc_user_status', 'lu_field_status', 'In-Portal', 'la_text_user', 14, 187, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'ResourceId', 0, 0, 'lu_fielddesc_user_resourceid', 'lu_field_resourceid', 'In-Portal', 'la_text_user', 13, 186, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Country', 0, 0, 'lu_fielddesc_user_country', 'lu_field_country', 'In-Portal', 'la_text_user', 12, 185, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Zip', 0, 0, 'lu_fielddesc_user_zip', 'lu_field_zip', 'In-Portal', 'la_text_user', 11, 184, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'State', 0, 0, 'lu_fielddesc_user_state', 'lu_field_state', 'In-Portal', 'la_text_user', 10, 183, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'City', 0, 0, 'lu_fielddesc_user_city', 'lu_field_city', 'In-Portal', 'la_text_user', 9, 182, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Street', 0, 0, 'lu_fielddesc_user_street', 'lu_field_street', 'In-Portal', 'la_text_user', 8, 181, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Phone', 0, 0, 'lu_fielddesc_user_phone', 'lu_field_phone', 'In-Portal', 'la_text_user', 7, 180, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'CreatedOn', 0, 0, 'lu_fielddesc_user_createdon', 'lu_field_createdon', 'In-Portal', 'la_text_user', 6, 179, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Email', 0, 0, 'lu_fielddesc_user_email', 'lu_field_email', 'In-Portal', 'la_text_user', 5, 178, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'LastName', 0, 0, 'lu_fielddesc_user_lastname', 'lu_field_lastname', 'In-Portal', 'la_text_user', 4, 177, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO SearchConfig VALUES ('PortalUser', 'FirstName', 0, 0, 'lu_fielddesc_user_firstname', 'lu_field_firstname', 'In-Portal', 'la_text_user', 3, 176, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, 0); + +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT count(*) FROM <%prefix%>Category WHERE Status=1 ', NULL, 'la_prompt_ActiveCategories', '0', '1'); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT count(*) FROM <%prefix%>PortalUser WHERE Status=1 ', NULL, 'la_prompt_ActiveUsers', '0', '1'); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT count(*) FROM <%prefix%>UserSession', NULL, 'la_prompt_CurrentSessions', '0', '1'); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) as CategoryCount FROM <%prefix%>Category', NULL, 'la_prompt_TotalCategories', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS ActiveCategories FROM <%prefix%>Category WHERE Status = 1', NULL, 'la_prompt_ActiveCategories', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS PendingCategories FROM <%prefix%>Category WHERE Status = 2', NULL, 'la_prompt_PendingCategories', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS DisabledCategories FROM <%prefix%>Category WHERE Status = 0', NULL, 'la_prompt_DisabledCategories', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS NewCategories FROM <%prefix%>Category WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Category_DaysNew"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewCategories', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) FROM <%prefix%>Category WHERE EditorsPick = 1', NULL, 'la_prompt_CategoryEditorsPick', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Category', NULL, 'la_prompt_NewestCategoryDate', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Category', NULL, 'la_prompt_LastCategoryUpdate', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS TotalUsers FROM <%prefix%>PortalUser', NULL, 'la_prompt_TopicsUsers', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS ActiveUsers FROM <%prefix%>PortalUser WHERE Status = 1', NULL, 'la_prompt_UsersActive', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS PendingUsers FROM <%prefix%>PortalUser WHERE Status = 2', NULL, 'la_prompt_UsersPending', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS DisabledUsers FROM <%prefix%>PortalUser WHERE Status = 0', NULL, 'la_prompt_UsersDisabled', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>PortalUser', NULL, 'la_prompt_NewestUserDate', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT( DISTINCT LOWER( Country ) ) FROM <%prefix%>PortalUser WHERE LENGTH(Country) > 0', NULL, 'la_prompt_UsersUniqueCountries', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT( DISTINCT LOWER( State ) ) FROM <%prefix%>PortalUser WHERE LENGTH(State) > 0', NULL, 'la_prompt_UsersUniqueStates', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS TotalUserGroups FROM <%prefix%>PortalGroup', NULL, 'la_prompt_TotalUserGroups', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS BannedUsers FROM <%prefix%>PortalUser WHERE IsBanned = 1', NULL, 'la_prompt_BannedUsers', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS NonExipedSessions FROM <%prefix%>UserSession WHERE Status = 1', NULL, 'la_prompt_NonExpiredSessions', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS ThemeCount FROM <%prefix%>Theme', NULL, 'la_prompt_ThemeCount', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', 'SELECT COUNT(*) AS RegionsCount FROM <%prefix%>Language', NULL, 'la_prompt_RegionsCount', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', '<%m:sql_action sql="SHOW+TABLES" action="COUNT" field="*"%>', NULL, 'la_prompt_TablesCount', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', '<%m:sql_action sql="SHOW+TABLE+STATUS" action="SUM" field="Rows"%>', NULL, 'la_prompt_RecordsCount', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', '<%m:custom_action sql="empty" action="SysFileSize"%>', NULL, 'la_prompt_SystemFileSize', 0, 2); +INSERT INTO StatItem VALUES (0, 'In-Portal', '<%m:sql_action sql="SHOW+TABLE+STATUS" action="SUM" format_as="file" field="Data_length"%>', NULL, 'la_prompt_DataSize', 0, 2); \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/toolbar/button.subscript.gif =================================================================== diff -u Binary files differ Index: trunk/admin/config/email_edit.php =================================================================== diff -u --- trunk/admin/config/email_edit.php (revision 0) +++ trunk/admin/config/email_edit.php (revision 13) @@ -0,0 +1,252 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$cssURL = $adminURL."/include"; +$browseURL = $adminURL."/browse"; + +//$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."/browse/toolbar.php"); +//require_once($pathtoroot.$admin."/listview/listview.php"); +require_once($pathtoroot.$admin."/editor/FCKeditor/fckeditor.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +$objLangEdit = new clsLanguageList(); +$objLangEdit->SourceTable = $objSession->GetEditTable("Language"); +$objLangEdit->EnablePaging = FALSE; +$en = (int)$_GET["en"]; +$objLangEdit->Query_Item("SELECT * FROM ".$objLangEdit->SourceTable); +$itemcount=$objLangEdit->NumItems(); +$l = $objLangEdit->GetItemByIndex($en); +$LangId = $l->Get("LanguageId"); + +unset($objEditItems); + +$objEditItems = new clsEmailMessageList(); +$objEditItems->SourceTable = $objSession->GetEditTable("EmailMessage"); +$objEditItems->EnablePaging = FALSE; +if(is_array($_POST["itemlist"])) +{ + $EventId = $_POST["itemlist"][0]; +} +else +{ + $EventId = $_POST["itemlist"]; +} + +$m = $objEditItems->GetMessage($EventId,$LangId); + +$objEvents = new clsEventList(); + +$ev = $objEvents->GetItem($EventId); + +if($m===FALSE) +{ + $m = new clsEmailMessage(); + $m->tablename = $objEditItems->SourceTable; + $m->Set("EventId",$EventId); + $m->Set("LanguageId",$LangId); + $id = (int)GetMinValue($m->tablename,"EmailMessageId"); + $m->Set("EmailMessageId",$id-1); + $m->Create(); + $m->Set("EmailMessageId",$id-1); + $m->headers = explode("\n",$objConfig->Get("Smtp_DefaultHeaders")); +} +else +{ + $m->ReadTemplate(); +} +$subject = $m->subject; + +if(strlen($subject)) + $subject = substr($subject,strpos($subject,":")+2); + +$action = "m_emailevent_edit"; + +$envar = "env=" . BuildEnv() . "&en=$en"; +$section = 'in-portal:lang_email'; +$ado = GetADODBConnection(); + +/* page header */ +print << + + In-portal + + + + + + + + + + + + +END; + +$objListToolBar = new clsToolBar(); + +$objListToolBar->Add("msg_save", "la_Save","#","swap('msg_save','toolbar/tool_select_f2.gif');", "swap('msg_save', 'toolbar/tool_select.gif');","edit_submit('language','LangEditStatus','".$admin."/config/addlang_email.php',0);",$imagesURL."/toolbar/tool_select.gif"); +$objListToolBar->Add("msg_cancel", "la_Cancel","#","swap('msg_cancel','toolbar/tool_cancel_f2.gif');", "swap('msg_cancel', 'toolbar/tool_cancel.gif');","msg_submit('language','".$admin."/config/addlang_email.php');", $imagesURL."/toolbar/tool_cancel.gif"); + + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_MailEvent")." '".prompt_language($ev->Get("Description"))."'"; +if($ev->Get("Type")==0) +{ + $title .= " - ".prompt_language("la_Text_User"); +} +else + $title .= " - ".prompt_language("la_Text_Admin"); + +int_header($objListToolBar,NULL,$title); +?> + + + + + + "> + + + + > + + + + + + > + + + + + + > + + + + + + + > + + + +
    + +
    + Get("MessageType")!="html") echo "CHECKED"; ?>> + Get("MessageType")=="html") echo "CHECKED"; ?>> + +
    + +
    +Value = $m->body; +// $oFCKeditor->CreateFCKeditor( 'messageBody', '100%',300 ) ; +?> + +
    + Index: trunk/admin/templates/cat_select_element.tpl =================================================================== diff -u --- trunk/admin/templates/cat_select_element.tpl (revision 0) +++ trunk/admin/templates/cat_select_element.tpl (revision 13) @@ -0,0 +1,11 @@ + +
    + " name="catlist" ItemType="1"> + ">" border="0"> + + ">: + + + +
    + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/demis_roussos.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_relation_one-way.gif =================================================================== diff -u Binary files differ Index: trunk/admin/category/js/main.js =================================================================== diff -u --- trunk/admin/category/js/main.js (revision 0) +++ trunk/admin/category/js/main.js (revision 13) @@ -0,0 +1,134 @@ +var jsPath = "js/"; +var cssPath = "css/"; +var imgPath = "images/"; + +var preloadImages = new Array(); +cbPath = imgPath + "ddarrow.gif"; +cbPathO = imgPath + "ddarrow_over.gif"; +cbPathA = imgPath + "ddarrow_active.gif"; + +preloadImage(cbPath); +preloadImage(cbPathO); +preloadImage(cbPathA); + +addScript("core.js"); +addScript("lang.js"); + +addCss("wnd.css"); +addCss("calendar.css"); + +function initCalendar(id, dateFormat) +{ + var input = document.getElementById(id); + if (!input) return; + input.dateFormat = dateFormat; + + var inputContainer = document.createElement("DIV"); + inputContainer.className = "dpContainer"; + inputContainer.noWrap = true; + var pNode = input.parentNode; + pNode.insertBefore(inputContainer, input); + inputContainer.appendChild(pNode.removeChild(input)); + + var calendarButton = document.createElement("IMG"); + calendarButton.setAttribute("width", "24"); + calendarButton.setAttribute("height", "24"); + calendarButton.style.width=24 + calendarButton.style.height=24 + calendarButton.style.cursor = "hand"; + + calendarButton.setAttribute("hspace", 2); + calendarButton.src = cbPath; + calendarButton.onmouseover = cbMouseOver; + calendarButton.onmouseout = cbMouseOut; + calendarButton.onmouseup = calendarButton.onmouseout; + calendarButton.onmousedown = cbMouseDown; + calendarButton.showCalendar = wnd_showCalendar; + inputContainer.appendChild(calendarButton); +} + +var calendar; + +function cbMouseOver(e) +{ + this.src = cbPathO; + var evt = (e) ? e : event; if (evt) evt.cancelBubble = true; +} + +function cbMouseOut(e) +{ + this.src = cbPath; + var evt = (e) ? e : event; if (evt) evt.cancelBubble = true; +} + +function cbMouseDown(e) +{ + this.src = cbPathA; + var evt = (e) ? e : event; if (evt) evt.cancelBubble = true; + this.showCalendar(); +} + +function wnd_showCalendar() +{ + var el = this.parentNode.firstChild; + if (calendar != null) calendar.hide(); + else + { + var calendarObject = new Calendar(false, null, dateSelected, closeHandler); + calendar = calendarObject; + calendarObject.setRange(1900, 2070); + calendarObject.create(); + } + calendar.setDateFormat(this.parentNode.firstChild.dateFormat); + calendar.parseDate(el.value); + calendar.sel = el; + calendar.showAtElement(el); + + Calendar.addEvent(document, "mousedown", checkCalendar); + return false; +} + +function dateSelected(calendarObject, date) +{ + calendarObject.sel.value = date; + calendarObject.callCloseHandler(); +} + +function closeHandler(calendarObject) +{ + calendarObject.hide(); + Calendar.removeEvent(document, "mousedown", checkCalendar); +} + +function checkCalendar(ev) +{ + var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); + + for (; el != null; el = el.parentNode) + if (el == calendar.element || el.tagName == "A") break; + + if (el == null) + { + calendar.callCloseHandler(); + Calendar.stopEvent(ev); + } +} + +function preloadImage(path) +{ + var img = new Image(); + img.src = path; + preloadImages[preloadImages.length] = img; +} + +function addScript(path) +{ + path = jsPath + path; + document.write(""); +} + +function addCss(path) +{ + path = cssPath + path; + document.write(""); +} Index: trunk/themes/default/mailing_list/unsubscribe.tpl =================================================================== diff -u --- trunk/themes/default/mailing_list/unsubscribe.tpl (revision 0) +++ trunk/themes/default/mailing_list/unsubscribe.tpl (revision 13) @@ -0,0 +1,125 @@ + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + + +

    +
    + + "> + + + + + + + + + + + + + + + + + + + + + +



     
    +

    +

    +



    +
    + " class="button"> +
    +
    + + +

    + + + + + + + + + + + + + + + +
    +
    + + + Index: trunk/admin/images/toolbar/tool_move_down.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tree/ftv2folderclosed.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_image_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_settings_in-newz.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/emailmessage.php =================================================================== diff -u --- trunk/kernel/include/emailmessage.php (revision 0) +++ trunk/kernel/include/emailmessage.php (revision 13) @@ -0,0 +1,882 @@ +clsParsedItem(); + $this->tablename = GetTablePrefix()."EmailMessage"; + $this->Item = $Item; + $this->BasePermission = "EMAIL"; + $this->id_field = "EmailMessageId"; + $this->TagPrefix = "email"; + $this->NoResourceId=1; + if($MessageId) + $this->LoadFromDatabase($MessageId); + } + + function LoadEvent($event,$language=NULL) + { + global $objConfig, $objLanguages; + + if(!strlen($language)) + $language = $objLanguages->GetPrimary(); + $sql = "SELECT * FROM ".$this->tablename." WHERE EventId = $event AND LanguageId=$language"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $data = $rs->fields; + $this->SetFromArray($data); + $this->Clean(); + return TRUE; + } + else + return FALSE; + } + function LoadFromDatabase($MessageId) + { + global $Errors; + + $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ".$this->IdField()." = '%s'",$MessageId); + $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); + return TRUE; + } + + function EditTemplate() + { + } + + /* read the template, split into peices */ + function ReadTemplate() + { + if(!$this->TemplateParsed) + { + $this->headers = array(); + $lines = explode("\n",$this->Get("Template")); + $header_end = FALSE; + $i = 0; + while(!$header_end && $isubject = $h; + } + else + $this->headers[] = $h; + } + $i++; + } + while($ibody .= $lines[$i++]; + } + $this->TemplateParsed=TRUE; + } + } + + function ParseSection($text, $parser=null) + { + global $objUsers, $objTemplate; + + $res = $this->ParseTemplateText($text); + + /* parse email class tags */ + if(!is_object($this->fromuser)) + { + $this->fromuser = $objUsers->GetItem($this->Get("FromUserId")); + $this->fromuser->TagPrefix = "fromuser"; + } + + /* parse from user object */ + if(is_object($this->fromuser)) + { + $res = $this->fromuser->ParseTemplateText($res); + } + + /* parse recipient user object */ + if(is_object($this->recipient)) + { + $res = $this->recipient->ParseTemplateText($res); + } + + //print_pre($this->Item); + if(is_object($this->Item)) + { + $res = $this->Item->ParseTemplateText($res); + } + else + { + + if(!is_object($objTemplate)) + $objTemplate = new clsTemplateList(" "); + $res = $objTemplate->ParseTemplateText($res); + } + + return $res; + } + + function SendToGroup($GroupId) + { + global $objUsers; + + $users = $objUsers->Query_GroupPortalUser("GroupId=$GroupId"); + if(is_array($users)) + { + foreach($users as $u) + { + $this->SendToUser($u->Get("PortalUserId")); + } + } + } + + function SendToAddress($EmailAddress,$name="") + { + global $objUsers, $objEmailQueue,$objConfig; + + //$this->recipient = $objUsers->GetUser($UserId); + //$this->recipient->TagPrefix="touser"; + if(strlen($EmailAddress)) + { + $to_addr = $EmailAddress; + $this->ReadTemplate(); + + $subject = $this->ParseSection($this->subject); + $body = $this->ParseSection($this->body); + + if(is_object($this->fromuser)) + { + $FromAddr = $this->fromuser->Get("Email"); + $FromName = trim($this->fromuser->Get("FirstName")." ".$this->fromuser->Get("LastName")); + } + if(!strlen($FromAddr)) + { + $FromName = $objConfig->Get("Site_Name"); + $FromAddr = $objConfig->Get("Smtp_AdminMailFrom"); + } + $charset = "ascii-us"; + if($this->Get("MessageType")=="html") + { + $objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,"",$body,$charset,NULL,$this->headers); + } + else + { + $body = nl2br($body); + $body = str_replace("
    ","\n",$body); + $objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,$body,"",$charset,NULL,$this->headers); + } + return TRUE; + } + return FALSE; + } + + + function SendToUser($UserId) + { + global $objUsers, $objEmailQueue, $objConfig; + + //echo "Handling Event ".$this->Get("Event")." for user $UserId
    \n"; + $this->recipient = new clsPortalUser($UserId); // $objUsers->GetItem($UserId); + //echo "
    ";print_r($this->recipient); echo "
    "; + $this->recipient->TagPrefix="touser"; + if($this->recipient->Get("PortalUserId")==$UserId) + { + $to_addr = $this->recipient->Get("Email"); + $To = trim($this->recipient->Get("FirstName")." ".$this->recipient->Get("LastName")); + + $this->ReadTemplate(); + + $subject = $this->ParseSection($this->subject, $this->recipient); + $body = $this->ParseSection($this->body); + + if(!is_object($this->fromuser)) + { + $this->fromuser = $objUsers->GetItem($this->Get("FromUserId")); + } + if(is_object($this->fromuser)) + { + $FromAddr = $this->fromuser->Get("Email"); + $FromName = trim($this->fromuser->Get("FirstName")." ".$this->fromuser->Get("LastName")); + + $charset = "ascii-us"; + } + + if(!strlen($FromAddr)) + { + $FromName = $objConfig->Get("Site_Name"); + $FromAddr = $objConfig->Get("Smtp_AdminMailFrom"); + } + + + if($this->Get("MessageType")=="html") + { + $objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,"",$body,$charset,NULL,$this->headers); + } + else + { + $body = nl2br($body); + $body = str_replace("
    ","\n",$body); + $objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,$body,"",$charset,NULL,$this->headers); + } + return TRUE; + } + return FALSE; + } + + function SendAdmin() + { + global $objUsers, $objConfig, $objEmailQueue; + + $this->recipient = $objUsers->GetUser($this->Get("FromUserId")); + $this->recipient->TagPrefix="touser"; + if($this->recipient->Get("PortalUserId")==$this->Get("FromUserId")) + { + $to_addr = $this->recipient->Get("Email"); + $To = trim($this->recipient->Get("FirstName")." ".$this->recipient->Get("LastName")); + $this->ReadTemplate(); + + $subject = $this->ParseSection($this->subject); + $body = $this->ParseSection($this->body); + $FromName = "System Event"; + $FromAddr = $objConfig->Get("Smtp_AdminMailFrom"); + if(strlen($FromAddr)) + { + $charset = "ascii-us"; + if($this->Get("MessageType")=="html") + { + $objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,"",$body,$charset,NULL,$this->headers); + } + else + { + $body=nl2br($body); + $body = str_replace("
    ","\n",$body); + $objEmailQueue->SendMail($FromAddr,$FromName,$to_addr,$To,$subject,$body,"",$charset,NULL,$this->headers); + } + return TRUE; + } + } + return FALSE; + } + + function ParseTemplateText($text) + { + $html = $text; + $search = "TagPrefix; + $next_tag = strpos($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->ParseElement($tagtext); + $html = $pre.$inner.$post; + } + else + { + + $OldTagStyle = ""; + + ## Try to find end of TagName + $TagNameEnd = strpos($html, " ", $next_tag); + + ## Support Old version +// $closer = strpos(strtolower($html),"",$next_tag); + if ($TagNameEnd) + { + $Tag = strtolower(substr($html, $next_tag, $TagNameEnd-$next_tag)); + $TagName = explode(":", $Tag); + if (strlen($TagName[1])) + $CloserTag = ""; + } + 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)); + //echo "PRE:". htmlentities($pre,ENT_NOQUOTES); + //echo "INNER:". htmlentities($inner,ENT_NOQUOTES); + //echo "POST:". htmlentities($post,ENT_NOQUOTES); + + $parsed = $this->ParseElement($tagtext); + if(strlen($parsed)) + { + $html = $pre.$this->ParseTemplateText($inner).$post; + } + else + $html = $pre.$post; + } + $next_tag = strpos($html,$search); + } + return $html; + } + + function ParseElement($raw, $inner_html ="") + { + $tag = new clsHtmlTag($raw); + $tag->inner_html = $inner_html; + + if($tag->parsed) + { + if($tag->name=="include" || $tag->name=="perm_include" || $tag->name=="lang_include") + { + $output = $this->Parser->IncludeTemplate($tag); + } + else + { + if (is_object($this->Item)) { + $output = $this->Item->ParseObject($tag); + } + else { + $output = $this->ParseObject($tag); + } + //echo $output."
    "; + if(substr($output,0,9)=="Undefined") + { + $output = $tag->Execute(); + // if(substr($output,0,8)="{Unknown") + // $output = $raw; + } return $output; + } + } + else + return ""; + } +} + +class clsEmailMessageList extends clsItemCollection +{ + function clsEmailMessageList() + { + $this->clsItemCollection(); + $this->classname = "clsEmailMessage"; + $this->SourceTable = GetTablePrefix()."EmailMessage"; + $this->PerPageVar = "Perpage_EmailEvents"; + $this->AdminSearchFields = array("Template","Description", "Module","Event"); + } + + function LoadLanguage($LangId=NULL) + { + global $objLanguages; + + if(!$LangId) + $LangId = $objLanguages->GetPrimary(); + + $sql = "SELECT * FROM ".$this->SourceTable." WHERE LanguageId=$LangId"; + $this->Clear(); + return $this->Query_Item($sql); + } + + function &GetMessage($EventId,$LangId,$LoadFromDB=TRUE) + { + $found=FALSE; + + if(is_array($this->Items)) + { + for($x=0;$xItems);$x++) + { + $i =& $this->GetItemRefByIndex($x); + if(is_object($i)) + { + if($i->Get("EventId")==$EventId && $i->Get("LanguageId")==$LangId) + { + $found=TRUE; + break; + } + } + } + } + if(!$found) + { + if($LoadFromDB) + { + $n = NULL; + $n = new $this->classname(); + $n->tablename = $this->SourceTable; + if($n->LoadEvent($EventId,$LangId)) + { + array_push($this->Items, $n); + $i =& $this->Items[count($this->Items)-1]; + } + else + $i = FALSE; + } + else + $i = FALSE; + } + return $i; + } + + function CreateEmptyEditTable($IdList) + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + @$this->adodbConnection->Execute("DROP TABLE $edit_table"); + $query = "SELECT * FROM ".$this->SourceTable." WHERE $idfield = -1"; + $insert = "CREATE TABLE ".$edit_table." ".$query; + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($insert,ENT_NOQUOTES)."
    \n"; + $this->adodbConnection->Execute($insert); + $this->LoadLanguage(); + $idvalue = -1; + for($i=0;$i<$this->NumItems();$i++) + { + $e =& $this->Items[$i]; + $e->SourceTable = $edit_table; + if(is_array($IdList)) + { + foreach($IdList as $id) + { + $e->UnsetIdField(); + $e->Set("EmailMessageId",$idvalue--); + $e->Set("LanguageId",$id); + $e->Set("Description",admin_language("la_desc_emailevent_".$e->Get("Event"),$id)); + $e->Create(); + } + } + else + { + $e->UnsetIdField(); + $e->Set("EmailMessageId",$idvalue--); + $e->Set("LanguageId",$IdList); + $e->Set("Description",admin_language("la_desc_emailevent_".$e->Get("Event"),$LangId)); + $e->Create(); + } + } + $this->Clear(); + } + + function CopyFromEditTable() + { + global $objSession; + + $idfield = "EmailMessageId"; + $edit_table = $objSession->GetEditTable($this->SourceTable); + $sql = "SELECT * FROM $edit_table"; + $rs = $this->adodbConnection->Execute($sql); + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $c = new $this->classname; + $c->SetFromArray($data); + //$c->idfield = $idfield; + if($c->Get($idfield)<1) + { + $old_id = $c->Get($idfield); + $c->Dirty(); + $c->UnsetIdField(); + $c->Create(); + } + else + { + $c->Dirty(); + $c->Update(); + } + $rs->MoveNext(); + } + @$this->adodbConnection->Execute("DROP TABLE $edit_table"); + } + + function PurgeEditTable() + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + @$this->adodbConnection->Execute("DROP TABLE $edit_table"); + } + + function &GetEmailEventObject($EventName,$Type=0,$LangId=NULL) + { + global $objLanguages; + + if(!$LangId) + $LangId = $objLanguages->GetPrimary(); + $EmailTable = $this->SourceTable; + $EventTable = GetTablePrefix()."Events"; + $sql = "SELECT * FROM $EventTable INNER JOIN $EmailTable ON ($EventTable.EventId = $EmailTable.EventId) "; + $sql .="WHERE Event='$EventName' AND LanguageId=$LangId AND Type=$Type"; + $result = $this->adodbConnection->Execute($sql); + + if ($result === FALSE) + { + //$Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"","clsEvent","GetEmailEventObject"); + return FALSE; + } + $data = $result->fields; + $e = new clsEmailMessage(); + $e->SetFromArray($data); + $e->Clean(); + return $e; + } + + function ReadImportTable($TableName,$Overwite=FALSE, $MaxInserts=100,$Offset=0) + { + $eml = new clsEmailMessageList(); + $this->Clear(); + $Inserts = 0; + $sql = "SELECT * FROM $TableName LIMIT $Offset,$MaxInserts"; + $this->Query_Item($sql); + if($this->NumItems()>0) + { + foreach($this->Items as $i) + { + $e = $eml->GetMessage($i->Get("EventId"),$i->Get("LanguageId")); + if(is_object($e)) + { + if($Overwrite) + { + $e->Set("MessageType",$i->Get("MessageType")); + $e->Set("Template",$i->Get("Template")); + $e->Update(); + } + } + else + { + $i->Create(); + } + $Inserts++; + } + } + $Offset = $Offset + $Inserts; + return $Offset; + } +} + +function EventEnabled($e) +{ + global $objConfig; + + $var = "Email_".$e."_Enabled"; + + return ($objConfig->Get($var)=="1"); +} + +class clsEmailQueue +{ + var $SourceTable; + var $MessagesAtOnce; + var $MessagesSent=0; + var $LogLevel = 0; + + function clsEmailQueue($SourceTable=NULL,$MessagesAtOnce=NULL) + { + global $objConfig; + + if($SourceTable) + { + $this->SourceTable=$SourceTable; + } + else + $this->SourceTable = GetTablePrefix()."EmailQueue"; + if(!$MessagesAtOnce) + $MessagesAtOnce = (int)$objConfig->Get("Email_MaxSend"); + if($MessagesAtOnce<1) + $MessagesAtOnce=1; + $this->MessagesAtOnce = $MessagesAtOnce; + $this->LogLevel = (int)$objConfig->Get("Smtp_LogLevel"); + } + + function WriteToMailLog($text) + { + global $pathtoroot,$admin; + //echo htmlentities($text)."
    \n"; + if($this->LogLevel>0) + { + $Logfile = $pathtoroot.$admin."/email/log.txt"; + if(is_writable($Logfile)) + { + $fp = fopen($Logfile,"a"); + if($fp) + { + fputs($fp,$text."\n"); + fclose($fp); + } + } + } + } + + function AllowSockets() + { + $minver = explode(".", "4.3.0"); + $curver = explode(".", phpversion()); + if (($curver[0] < $minver[0]) + || (($curver[0] == $minver[0]) + && ($curver[1] < $minver[1])) + || (($curver[0] == $minver[0]) && ($curver[1] == $minver[1]) + && ($curver[2][0] < $minver[2][0]))) + return false; + else + return true; + } + + function DeliverMail($To,$From,$Subject,$Msg,$headers, $ForceSend=0) + { + global $MessagesSent,$objConfig; + + if(($this->MessagesSent >$this->MessagesAtOnce) && !$ForceSend) + { + $this->EnqueueMail($To,$From,$Subject,$Msg,$headers); + return TRUE; + } + else + { + $this->MessagesSent++; + /* ensure headers are using \r\n instead of \n */ + $headers = str_replace("\r\n","\n",$headers); + $headers = str_replace("\n","\r\n",$headers); + + $headers = "Date: ".date("r")."\r\n".$headers; + $headers = "Return-Path: ".$objConfig->Get("Smtp_AdminMailFrom")."\r\n".$headers; + $Msg = str_replace("\r\n","\n",$Msg); + $Msg = str_replace("\n","\r\n",$Msg); + + //echo "
    "; print_r(htmlentities($headers)); echo "
    "; + //echo "
    "; print_r(htmlentities($Msg)); echo "
    "; + $ver = phpversion(); + if(substr($Subject,0,9)=="Subject: ") + $Subject = substr($Subject,9); + if(!strlen($objConfig->Get("Smtp_Server")) || !$this->AllowSockets()) + { + return mail($To,trim($Subject),$Msg,"From: $From\r\n".$headers); + } + + $headers = "Subject: ".trim($Subject)."\r\n".$headers; + + $send_params['recipients'] = array($To); // The recipients (can be multiple) + $send_params['headers'] = explode("\r\n",$headers); + $send_params['from'] = $From; // This is used as in the MAIL FROM: cmd + // It should end up as the Return-Path: header + $send_params['body'] = $Msg; // The body of the email + + $params['host'] = $objConfig->Get("Smtp_Server"); // The smtp server host/ip + + $params['port'] = 25; // The smtp server port + $params['helo'] = 'INPORTAL'; // What to use when sending the helo command. Typically, your domain/hostname + if($objConfig->Get("Smtp_Authenticate")) // Whether to use basic authentication or not + { + $params['auth'] = TRUE; + $params['user'] = $objConfig->Get("Smtp_User"); + $params['pass'] = $objConfig->get("Smtp_Pass"); + } + else + $params['auth'] = FALSE; + $this->LogLevel=0; + $SmtpServer = new smtp($params); + if($this->LogLevel>0) + { + $SmtpServer->debug=1; + foreach($params as $key=>$value) + { + $this->WriteToMailLog($key."=".$value); + } + } + else + $SmtpServer->debug = 0; + $connected = $SmtpServer->connect(); + if($connected) + { + if($this->LogLevel>1) + { + $this->WriteToMailLog("Connected to ".$params['host']); + } + $res = $SmtpServer->send($send_params); + } + $SmtpServer->disconnect(); + if($this->LogLevel>1) + { + foreach($SmtpServer->buffer as $l) + { + $this->WriteToMailLog($l); + } + } + if($this->LogLevel>0) + { + if(count($SmtpServer->errors)>0) + { + foreach($SmtpServer->errors as $e) + { + $this->WriteToMailLog($e); + } + } + else + $this->WriteToMailLog("Message to $From Delivered Successfully"); + } + unset($SmtpServer); + return $res; + } + } + + function EnqueueMail($To,$From,$Subject,$Msg,$headers) + { + global $objSession; + + $ado = GetADODBConnection(); + $To = mysql_escape_string($To); + $From = mysql_escape_string($From); + $Msg = mysql_escape_string($Msg); + $headers = mysql_escape_string($headers); + $Subject = mysql_escape_string($Subject); + $sql = "INSERT INTO ".$this->SourceTable." (toaddr,fromaddr,subject,message,headers) VALUES ('$To','$From','$Subject','$Msg','$headers')"; + $ado->Execute($sql); + } + + function SendMailQeue() + { + global $objConfig, $objSession, $TotalMessagesSent; + + $ado = GetADODBConnection(); + $MaxAllowed = $this->MessagesAtOnce; + + $del_sql = array(); + + $NumToSend = $MaxAllowed - $this->MessagesSent; + $sql = "SELECT * FROM ".$this->SourceTable." ORDER BY queued ASC LIMIT $NumToSend"; + $rs = $ado->Execute($sql); + + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $this->DeliverMail($data["toaddr"],$data["fromaddr"],$data["Subject"],$data["headers"],$data["message"],1); + + $del_sql[] = "DELETE FROM ".$this->SourceTable." WHERE queued=".$data["queued"]; + $rs->MoveNext(); + } + + $numdel = count($del_sql); + for($i=0;$i<$numdel;$i++) + { + $sql = $del_sql[$i]; + if(strlen($sql)) + $ado->Execute($sql); + if($objSession->HasSystemPermission("DEBUG.ITEM")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + } + } + function SendMail($From, $FromName, $ToAddr, $ToName, $Subject, $Text, $Html, $charset, + $FileName="",$FileLoc="",$QueueOnly=0,$extra_headers = array()) + { + $HasFile = FALSE; + $HasFile = (strlen($FileName)>0); + $OB="----=_OuterBoundary_000"; + $boundary = "-----=".md5( uniqid (rand())); + $f = "\"$FromName\" <".$From.">"; + $headers = "From: $f\r\n"; + $headers .= "MIME-Version: 1.0\r\n"; + + if($HasFile) + { + //Messages start with text/html alternatives in OB + $headers.="Content-Type: multipart/mixed;\n\tboundary=\"".$OB."\"\r\n"; + $msg ="This is a multi-part message in MIME format.\r\n"; + $msg.="\r\n--".$OB."\r\n"; + $msg.="Content-Type: multipart/alternative;\n\tboundary=\"".$boundary."\"\r\n\r\n"; + } + else + $headers .= "Content-Type: multipart/alternative; boundary=\"$boundary\""; + if(is_array($extra_headers)) + { + for($i=0;$i0) + { + $msg .= "--" . $boundary . "\r\n"; + $msg .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"; + $msg .= "Content-Transfer-Encoding: 8bit\r\n\r\n"; + $msg .= stripslashes($Html); + $msg .= "\r\n\r\n"; + } + $msg .= "--" . $boundary . "--\r\n"; + if($HasFile) + { + if(!strlen($FileLoc)) + $FileLoc = $FileName; + $FileName = basename($FileName); + $msg .= "\r\n--".$OB."\r\n"; + $msg.="Content-Type: application/octetstream;\n\tname=\"".$FileName."\"\r\n"; + $msg.="Content-Transfer-Encoding: base64\n"; + $msg.="Content-Disposition: attachment;\n\tfilename=\"".$FileName."\"\r\n\r\n"; + + //file goes here + $fd=fopen ($FileLoc, "r"); + if($fd) + { + $FileContent=fread($fd,filesize($FileLoc)); + fclose ($fd); + } + $FileContent=chunk_split(base64_encode($FileContent)); + $msg.=$FileContent; + $msg .= "\r\n--".$OB."\r\n"; + } + + if(strlen($ToName)>0) + { + $To = "\"$ToName\" <$ToAddr>"; + } + else + $To = "<".$ToAddr.">"; + $headers.="To: $To\r\n"; + if($this->MessagesSent>$this->MessagesAtOnce || $QueueOnly==1) + { + $this->EnqueueMail($To,$f,$Subject,$msg,$headers); + } + else + { + $this->DeliverMail($To,$f,$Subject,$msg,$headers); + } + } + +} +?> Index: trunk/kernel/include/adodb/adodb-ado.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-ado.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-ado.inc.php (revision 13) @@ -0,0 +1,515 @@ +_affectedRows; + } + + function _connect($argHostname, $argUsername, $argPassword, $argProvider= 'MSDASQL') + { + $u = 'UID'; + $p = 'PWD'; + + $dbc = new COM('ADODB.Connection'); + if (! $dbc) return false; + /* // handle SQL server provider specially ? no need + if ($argProvider) { + if ($argProvider == "SQLOLEDB") { // SQL Server Provider + } + }*/ + if ($argProvider) $dbc->Provider = $argProvider; + else $dbc->Provider ='MSDASQL'; + + if ($argUsername) $argHostname .= ";$u=$argUsername"; + if ($argPassword)$argHostname .= ";$p=$argPassword"; + + if ($this->debug) print "

    Host=".$argHostname."
    version=$dbc->version

    "; + // @ added below for php 4.0.1 and earlier + @$dbc->Open((string) $argHostname); + + $this->_connectionID = $dbc; + return $dbc != false; + } + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argProvider='MSDASQL') + { + $dbc = new COM("ADODB.Connection"); + if (! $dbc) return false; + + if ($argProvider) $dbc->Provider = $argProvider; + else $dbc->Provider ='MSDASQL'; + + if ($argUsername) $argHostname .= ";UID=$argUsername"; + if ($argPassword)$argHostname .= ";PWD=$argPassword"; + + if ($this->debug) print "

    Host=".$argHostname."
    version=$dbc->version

    "; + $dbc->Open((string) $argHostname); + + $this->_connectionID = $dbc; + return $dbc != false; + } + +/* + adSchemaCatalogs = 1, + adSchemaCharacterSets = 2, + adSchemaCollations = 3, + adSchemaColumns = 4, + adSchemaCheckConstraints = 5, + adSchemaConstraintColumnUsage = 6, + adSchemaConstraintTableUsage = 7, + adSchemaKeyColumnUsage = 8, + adSchemaReferentialContraints = 9, + adSchemaTableConstraints = 10, + adSchemaColumnsDomainUsage = 11, + adSchemaIndexes = 12, + adSchemaColumnPrivileges = 13, + adSchemaTablePrivileges = 14, + adSchemaUsagePrivileges = 15, + adSchemaProcedures = 16, + adSchemaSchemata = 17, + adSchemaSQLLanguages = 18, + adSchemaStatistics = 19, + adSchemaTables = 20, + adSchemaTranslations = 21, + adSchemaProviderTypes = 22, + adSchemaViews = 23, + adSchemaViewColumnUsage = 24, + adSchemaViewTableUsage = 25, + adSchemaProcedureParameters = 26, + adSchemaForeignKeys = 27, + adSchemaPrimaryKeys = 28, + adSchemaProcedureColumns = 29, + adSchemaDBInfoKeywords = 30, + adSchemaDBInfoLiterals = 31, + adSchemaCubes = 32, + adSchemaDimensions = 33, + adSchemaHierarchies = 34, + adSchemaLevels = 35, + adSchemaMeasures = 36, + adSchemaProperties = 37, + adSchemaMembers = 38 + +*/ + + function MetaTables() + { + $arr= array(); + $dbc = $this->_connectionID; + + $adors=@$dbc->OpenSchema(20);//tables + if ($adors){ + $f = $adors->Fields(2);//table/view name + $t = $adors->Fields(3);//table type + while (!$adors->EOF){ + $tt=substr($t->value,0,6); + if ($tt!='SYSTEM' && $tt !='ACCESS') + $arr[]=$f->value; + //print $f->value . ' ' . $t->value.'
    '; + $adors->MoveNext(); + } + $adors->Close(); + } + + return $arr; + } + + function MetaColumns($table) + { + $table = strtoupper($table); + $arr= array(); + $dbc = $this->_connectionID; + + $adors=@$dbc->OpenSchema(4);//tables + + if ($adors){ + $t = $adors->Fields(2);//table/view name + while (!$adors->EOF){ + + + if (strtoupper($t->Value) == $table) { + + $fld = new ADODBFieldObject(); + $c = $adors->Fields(3); + $fld->name = $c->Value; + $fld->type = 'CHAR'; // cannot discover type in ADO! + $fld->max_length = -1; + $arr[strtoupper($fld->name)]=$fld; + } + + $adors->MoveNext(); + } + $adors->Close(); + } + + return $arr; + } + + /* returns queryID or false */ + function &_query($sql,$inputarr=false) + { + + $dbc = $this->_connectionID; + + // return rs + if ($inputarr) { + $oCmd = new COM('ADODB.Command'); + $oCmd->ActiveConnection = $dbc; + $oCmd->CommandText = $sql; + $oCmd->CommandType = 1; + + foreach($inputarr as $val) { + // name, type, direction 1 = input, len, + $this->adoParameterType = 130; + $p = $oCmd->CreateParameter('name',$this->adoParameterType,1,strlen($val),$val); + //print $p->Type.' '.$p->value; + $oCmd->Parameters->Append($p); + } + $p = false; + $rs = $oCmd->Execute(); + $e = $dbc->Errors; + if ($dbc->Errors->Count > 0) return false; + return $rs; + } + + $rs = @$dbc->Execute($sql,$this->_affectedRows); + + if ($dbc->Errors->Count > 0) return false; + return $rs; + } + + + function BeginTrans() + { + $o = $this->_connectionID->Properties("Transaction DDL"); + if (!$o) return false; + @$this->_connectionID->BeginTrans(); + return true; + } + function CommitTrans() { + @$this->_connectionID->CommitTrans(); + return true; + } + function RollbackTrans() { + @$this->_connectionID->RollbackTrans(); + return true; + } + + /* Returns: the last error message from previous database operation */ + + function ErrorMsg() + { + $errc = $this->_connectionID->Errors; + if ($errc->Count == 0) return ''; + $err = $errc->Item($errc->Count-1); + return $err->Description; + } + + function ErrorNo() + { + $errc = $this->_connectionID->Errors; + if ($errc->Count == 0) return 0; + $err = $errc->Item($errc->Count-1); + return $err->NativeError; + } + + // returns true or false + function _close() + { + if ($this->_connectionID) $this->_connectionID->Close(); + $this->_connectionID = false; + return true; + } + + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_ado extends ADORecordSet { + + var $bind = false; + var $databaseType = "ado"; + var $dataProvider = "ado"; + var $_tarr = false; // caches the types + var $_flds; // and field objects + var $canSeek = true; + var $hideErrors = true; + + function ADORecordSet_ado(&$id) + { + return $this->ADORecordSet($id); + } + + + // returns the field object + function FetchField($fieldOffset = -1) { + $off=$fieldOffset+1; // offsets begin at 1 + + $o= new ADODBFieldObject(); + $rs = $this->_queryID; + $f = $rs->Fields($fieldOffset); + $o->name = $f->Name; + $o->type = $f->Type; + $o->max_length = $f->DefinedSize; + + //print "off=$off name=$o->name type=$o->type len=$o->max_length
    "; + return $o; + } + + /* Use associative array to get fields array */ + function Fields($colname) + { + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + + return $this->fields[$this->bind[strtoupper($colname)]]; + } + + + function _initrs() + { + $rs = $this->_queryID; + $this->_numOfRows = $rs->RecordCount; + + $f = $rs->Fields; + $this->_numOfFields = $f->Count; + } + + + // should only be used to move forward as we normally use forward-only cursors + function _seek($row) + { + $rs = $this->_queryID; + // absoluteposition doesn't work -- my maths is wrong ? + // $rs->AbsolutePosition->$row-2; + // return true; + if ($this->_currentRow > $row) return false; + $rs->Move((integer)$row - $this->_currentRow-1); //adBookmarkFirst + return true; + } + +/* + OLEDB types + + enum DBTYPEENUM + { DBTYPE_EMPTY = 0, + DBTYPE_NULL = 1, + DBTYPE_I2 = 2, + DBTYPE_I4 = 3, + DBTYPE_R4 = 4, + DBTYPE_R8 = 5, + DBTYPE_CY = 6, + DBTYPE_DATE = 7, + DBTYPE_BSTR = 8, + DBTYPE_IDISPATCH = 9, + DBTYPE_ERROR = 10, + DBTYPE_BOOL = 11, + DBTYPE_VARIANT = 12, + DBTYPE_IUNKNOWN = 13, + DBTYPE_DECIMAL = 14, + DBTYPE_UI1 = 17, + DBTYPE_ARRAY = 0x2000, + DBTYPE_BYREF = 0x4000, + DBTYPE_I1 = 16, + DBTYPE_UI2 = 18, + DBTYPE_UI4 = 19, + DBTYPE_I8 = 20, + DBTYPE_UI8 = 21, + DBTYPE_GUID = 72, + DBTYPE_VECTOR = 0x1000, + DBTYPE_RESERVED = 0x8000, + DBTYPE_BYTES = 128, + DBTYPE_STR = 129, + DBTYPE_WSTR = 130, + DBTYPE_NUMERIC = 131, + DBTYPE_UDT = 132, + DBTYPE_DBDATE = 133, + DBTYPE_DBTIME = 134, + DBTYPE_DBTIMESTAMP = 135 + + ADO Types + + adEmpty = 0, + adTinyInt = 16, + adSmallInt = 2, + adInteger = 3, + adBigInt = 20, + adUnsignedTinyInt = 17, + adUnsignedSmallInt = 18, + adUnsignedInt = 19, + adUnsignedBigInt = 21, + adSingle = 4, + adDouble = 5, + adCurrency = 6, + adDecimal = 14, + adNumeric = 131, + adBoolean = 11, + adError = 10, + adUserDefined = 132, + adVariant = 12, + adIDispatch = 9, + adIUnknown = 13, + adGUID = 72, + adDate = 7, + adDBDate = 133, + adDBTime = 134, + adDBTimeStamp = 135, + adBSTR = 8, + adChar = 129, + adVarChar = 200, + adLongVarChar = 201, + adWChar = 130, + adVarWChar = 202, + adLongVarWChar = 203, + adBinary = 128, + adVarBinary = 204, + adLongVarBinary = 205, + adChapter = 136, + adFileTime = 64, + adDBFileTime = 137, + adPropVariant = 138, + adVarNumeric = 139 +*/ + function MetaType($t,$len=-1) + { + switch ($t) { + case 12: // variant + case 8: // bstr + case 129: //char + case 130: //wc + case 200: // varc + case 202:// varWC + case 128: // bin + case 204: // varBin + case 72: // guid + if ($len <= $this->blobSize) return 'C'; + + case 201: + case 203: + return 'X'; + case 128: + case 204: + case 205: + return 'B'; + case 7: + case 133: return 'D'; + + case 134: + case 135: return 'T'; + + case 11: return 'L'; + + case 16:// adTinyInt = 16, + case 2://adSmallInt = 2, + case 3://adInteger = 3, + case 4://adBigInt = 20, + case 17://adUnsignedTinyInt = 17, + case 18://adUnsignedSmallInt = 18, + case 19://adUnsignedInt = 19, + case 20://adUnsignedBigInt = 21, + return 'I'; + default: return 'N'; + } + } + + // time stamp not supported yet + function _fetch($ignore_fields=false) + { + $rs = $this->_queryID; + if ($rs->EOF) return false; + $this->fields = array(); + + if (!$this->_tarr) { + $tarr = array(); + $flds = array(); + for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) { + $f = $rs->Fields($i); + $flds[] = $f; + $tarr[] = $f->Type; + } + // bind types and flds only once + $this->_tarr = $tarr; + $this->_flds = $flds; + } + $t = reset($this->_tarr); + $f = reset($this->_flds); + + if ($this->hideErrors) $olde = error_reporting(E_ERROR|E_CORE_ERROR);// sometimes $f->value be null + for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) { + + switch($t) { + + case 133:// A date value (yyyymmdd) + $val = $f->value; + $this->fields[] = substr($val,0,4).'-'.substr($val,4,2).'-'.substr($val,6,2); + break; + case 7: // adDate + $this->fields[] = date('Y-m-d',(integer)$f->value); + break; + case 1: // null + $this->fields[] = false; + break; + case 6: // currency is not supported properly; + print '
    '.$f->Name.': currency type not supported by PHP
    '; + $this->fields[] = (float) $f->value; + break; + default: + $this->fields[] = $f->value; + break; + } + //print " $f->value $t, "; + $f = next($this->_flds); + $t = next($this->_tarr); + } // for + if ($this->hideErrors) error_reporting($olde); + @$rs->MoveNext(); // @ needed for some versions of PHP! + return true; + } + + + function _close() { + $this->_flds = false; + $this->_queryID = false; + } + +} + +?> \ No newline at end of file Index: trunk/compat/ob_flush.php =================================================================== diff -u --- trunk/compat/ob_flush.php (revision 0) +++ trunk/compat/ob_flush.php (revision 13) @@ -0,0 +1,49 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: ob_flush.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace ob_flush() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/ob_flush + * @author Aidan Lister + * @author Thiemo M�ttig (http://maettig.com/) + * @version $Revision: 1.1 $ + * @since PHP 4.2.0 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('ob_flush')) +{ + function ob_flush () + { + if (@ob_end_flush()) { + return ob_start(); + } + + trigger_error("ob_flush() Failed to flush buffer. No buffer to flush.", E_USER_NOTICE); + + return false; + } +} + +?> \ No newline at end of file Index: trunk/kernel/include/adodb/drivers/adodb-db2.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-db2.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-db2.inc.php (revision 13) @@ -0,0 +1,265 @@ +curMode = SQL_CUR_USE_ODBC; +$db->Connect($dsn, $userid, $pwd); + +*/ + +if (!defined('_ADODB_ODBC_LAYER')) { + include(ADODB_DIR."/drivers/adodb-odbc.inc.php"); +} +if (!defined('ADODB_DB2')){ +define('ADODB_DB2',1); + +class ADODB_DB2 extends ADODB_odbc { + var $databaseType = "db2"; + var $concat_operator = '||'; + var $sysDate = 'CURRENT_DATE'; + var $sysTimeStamp = 'CURRENT TIMESTAMP'; + var $ansiOuter = true; + var $identitySQL = 'values IDENTITY_VAL_LOCAL()'; + + function ADODB_DB2() + { + if (strpos(PHP_OS,'WIN') !== false) $this->curmode = SQL_CUR_USE_ODBC; + $this->ADODB_odbc(); + } + + function ServerInfo() + { + //odbc_setoption($this->_connectionID,1,101 /*SQL_ATTR_ACCESS_MODE*/, 1 /*SQL_MODE_READ_ONLY*/); + $vers = $this->GetOne('select versionnumber from sysibm.sysversions'); + //odbc_setoption($this->_connectionID,1,101, 0 /*SQL_MODE_READ_WRITE*/); + return array('description'=>'DB2 ODBC driver', 'version'=>$vers); + } + + function _insertid() + { + return $this->GetOne($this->identitySQL); + } + + function RowLock($tables,$where) + { + if ($this->_autocommit) $this->BeginTrans(); + return $this->GetOne("select 1 as ignore from $tables where $where for update"); + } + + function &MetaTables($showSchema=false) + { + global $ADODB_FETCH_MODE; + + $savem = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + $qid = odbc_tables($this->_connectionID); + + $rs = new ADORecordSet_odbc($qid); + + $ADODB_FETCH_MODE = $savem; + if (!$rs) return false; + + $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change; + + //print_r($rs); + $arr =& $rs->GetArray(); + $rs->Close(); + $arr2 = array(); + //print_r($arr); + for ($i=0; $i < sizeof($arr); $i++) { + $row = $arr[$i]; + if ($row[2] && strncmp($row[1],'SYS',3) != 0) + if ($showSchema) $arr2[] = $row[1].'.'.$row[2]; + else $arr2[] = $row[2]; + } + return $arr2; + } + + // Format date column in sql string given an input format that understands Y M D + function SQLDate($fmt, $col=false) + { + // use right() and replace() ? + if (!$col) $col = $this->sysDate; + $s = ''; + + $len = strlen($fmt); + for ($i=0; $i < $len; $i++) { + if ($s) $s .= '||'; + $ch = $fmt[$i]; + switch($ch) { + case 'Y': + case 'y': + $s .= "char(year($col))"; + break; + case 'M': + $s .= "substr(monthname($col),1,3)"; + break; + case 'm': + $s .= "right(digits(month($col)),2)"; + break; + case 'D': + case 'd': + $s .= "right(digits(day($col)),2)"; + break; + case 'H': + case 'h': + if ($col != $this->sysDate) $s .= "right(digits(hour($col)),2)"; + else $s .= "''"; + break; + case 'i': + case 'I': + if ($col != $this->sysDate) + $s .= "right(digits(minute($col)),2)"; + else $s .= "''"; + break; + case 'S': + case 's': + if ($col != $this->sysDate) + $s .= "right(digits(second($col)),2)"; + else $s .= "''"; + break; + default: + if ($ch == '\\') { + $i++; + $ch = substr($fmt,$i,1); + } + $s .= $this->qstr($ch); + } + } + return $s; + } + + + function &SelectLimit($sql,$nrows=-1,$offset=-1,$arg3=false) + { + if ($offset <= 0) { + // could also use " OPTIMIZE FOR $nrows ROWS " + if ($nrows >= 0) $sql .= " FETCH FIRST $nrows ROWS ONLY "; + return $this->Execute($sql,false,$arg3); + } else { + if ($offset > 0 && $nrows < 0); + else { + $nrows += $offset; + $sql .= " FETCH FIRST $nrows ROWS ONLY "; + } + return ADOConnection::SelectLimit($sql,-1,$offset,$arg3); + } + } + +}; + + +class ADORecordSet_db2 extends ADORecordSet_odbc { + + var $databaseType = "db2"; + + function ADORecordSet_db2($id,$mode=false) + { + $this->ADORecordSet_odbc($id,$mode); + } + + function MetaType($t,$len=-1,$fieldobj=false) + { + switch (strtoupper($t)) { + case 'VARCHAR': + case 'CHAR': + case 'CHARACTER': + if ($len <= $this->blobSize) return 'C'; + + case 'LONGCHAR': + case 'TEXT': + case 'CLOB': + case 'DBCLOB': // double-byte + return 'X'; + + case 'BLOB': + case 'GRAPHIC': + case 'VARGRAPHIC': + return 'B'; + + case 'DATE': + return 'D'; + + case 'TIME': + case 'TIMESTAMP': + return 'T'; + + //case 'BOOLEAN': + //case 'BIT': + // return 'L'; + + //case 'COUNTER': + // return 'R'; + + case 'INT': + case 'INTEGER': + case 'BIGINT': + case 'SMALLINT': + return 'I'; + + default: return 'N'; + } + } +} + +} //define +?> \ No newline at end of file Index: trunk/kernel/include/itemrating.php =================================================================== diff -u --- trunk/kernel/include/itemrating.php (revision 0) +++ trunk/kernel/include/itemrating.php (revision 13) @@ -0,0 +1,169 @@ +clsItemDB(); + $this->tablename = GetTablePrefix()."ItemRating"; + $this->id_field = "RatingId"; + $this->type=-10; + if($RatingId!=NULL) + $this->LoadFromDatabase($RatingId); + } + + function Validate() + { + global $Errors; + + $dataValid = true; + if(!isset($this->m_IPAddress)) + { + $Errors->AddError("error.fieldIsRequired",'IPAddress',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if(!isset($this->m_CreatedOn)) + { + $Errors->AddError("error.fieldIsRequired",'CreatedOn',"","",get_class($this),"Validate"); + $dataValid = false; + } + + + if(!isset($this->m_VoteRating)) + { + $Errors->AddError("error.fieldIsRequired",'VoteRating',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if($this->m_VoteRating > 5 || $this->m_VoteRating < 1 || !is_int($this->m_VoteRating)) + { + $Errors->AddError("error.invalidVoteRaiting","","","",get_class($this),"Validate"); + $dataValid = false; + } + + return $dataValid; + } + + function Create() + { + global $REMOTE_ADDR; + + + $this->Set("CreatedOn",adodb_date("U")); + $this->Set("IPAddress",$REMOTE_ADDR); + if(ip_exists($this->Get("IPAddress"),$this->Get("ItemId"),$this->SourceTable)) + { + //$Errors->AddError("error.already_rated","","","","clsItemRating","Create"); + return false; + } + + parent::Create(); + + 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 ItemRating WHERE RatingId = '%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; + } + +} /*clsItemRating*/ + +class clsItemRatingList extends clsItemCollection +{ + var $ItemResourceId = 0; + + function clsItemRatingList($ItemId=NULL) + { + $this->clsItemCollection; + $this->SourceTable = GetTablePrefix()."ItemRating"; + if($ItemId) + { + $this->ItemResourceId = $ItemId; + $this->LoadItemVotes($ItemId); + } + } + + function LoadItemVotes($ItemId=NULL) + { + if(!$ItemId) + $ItemId = $this->ItemResourceId; + if($ItemId) + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE ItemId=$ItemId"; + return $this->Query_Item($sql); + } + else + return NULL; + } +} +/* +function RatingImage($n) +{ + if($n<0.25 || $n>5) + return "0"; + if($n>=0.25 && $n<0.75) + return "0_half"; + if($n>=0.75 && $n<1.25) + return "1"; + if($n>=1.25 && $n<1.75) + return "1_half"; + if($n>=1.75 && $n<2.25) + return "2"; + if($n>=2.25 && $n<2.75) + return "2_half"; + if($n>=2.75 && $n<3.25) + return "3"; + if($n>=3.25 && $n<3.75) + return "3_half"; + if($n>=3.75 && $n<4.25) + return "4"; + if($n>=4.25 && $n<4.75) + return "4_half"; + if($n>=4.75 && $n<=5) + return "5"; +} +*/ +function RatingTickImage($n, $OnImage, $OffImage) +{ + $a = array(); + for($x=1;$x<6;$x++) + { + if($n >= $x) + { + $a[$x] = $OnImage; + } + else + $a[$x] = $OffImage; + } + return $a; +} + +function RatingText($n) +{ + $text = array(language("lu_rating_0"),language("lu_rating_1"),language("lu_rating_2"),language("lu_rating_3"),language("lu_rating_4"),language("lu_rating_5")); + + $n = round($n); + return $text[$n]; +} +?> Index: trunk/admin/head.php =================================================================== diff -u --- trunk/admin/head.php (revision 0) +++ trunk/admin/head.php (revision 13) @@ -0,0 +1,129 @@ +Get("Site_Path"); + +$localURL=$rootURL."kernel/"; + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$pathtolocal = $pathtoroot; +//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"); + //print_r($objSession); + + $userid= $objSession->Get("PortalUserId"); + if($userid!=-1) + { + $userobj=$objUsers->GetItem($userid); + $loginname= $userobj->Get("Login"); + } + else + $loginname = "root"; + + $logout = $rootURL."admin/"; + $mainpage = $rootURL."admin/subitems.php?"."env=".BuildEnv()."§ion=in-portal:root"; + $objLang = $objLanguages->GetItem($m_var_list["lang"]); + +?> + + + +HEAD + + + + + + + + + +
    + + + + + + + + + + + + + + + +
    In-portalIn-portal 
    + + + " target="_parent">
    +
    + + + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_paste_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/act_forum.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/globe.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/tap67.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/my_preferences.tpl =================================================================== diff -u --- trunk/themes/default/my_preferences.tpl (revision 0) +++ trunk/themes/default/my_preferences.tpl (revision 13) @@ -0,0 +1,99 @@ + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + "> > + "> > + + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + +

    +
    + + + + + + + + + + +

      + + + + +
    +
    + + + +
    +

    +
    + + + Index: trunk/admin/images/summary/searchbox_header.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/icons/Leftover/icon46_list_conf_security.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/install_finish.php =================================================================== diff -u --- trunk/admin/install/install_finish.php (revision 0) +++ trunk/admin/install/install_finish.php (revision 13) @@ -0,0 +1,38 @@ + +  Installation Complete

    + + + + + + + +
     Installation Complete
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/images/icon_users_sm.gif =================================================================== diff -u Binary files differ Index: trunk/admin/browse/checkboxes_old.js =================================================================== diff -u --- trunk/admin/browse/checkboxes_old.js (revision 0) +++ trunk/admin/browse/checkboxes_old.js (revision 13) @@ -0,0 +1,244 @@ +var focusType = ""; +var tabIDs = new Array(); +var tabSelection = new Array(); +var LastCheckedItem = null; + +function initCheckBoxes(selChangedHandler) +{ + var checkBoxContainers = document.body.getElementsByTagName("DIV"); + for (var i = 0; i < checkBoxContainers.length; i++) + if (checkBoxContainers[i].getAttribute("isTab")) + { + if(tabIDs.length ==0) + start_tab = checkBoxContainers[i].id; + + tabIDs[tabIDs.length] = checkBoxContainers[i].id + + tabSelection[checkBoxContainers[i].id] = 0; + } + + tabSelection['categories'] = 0; + categoriesTab = document.getElementById('categories'); + var catInputs = categoriesTab.getElementsByTagName("INPUT"); + for (var i = 0; i < catInputs.length; i++) + catInputs.checked = false; + if (categoriesTab) + categoriesTab.active = true; + + for (var i = 0; i < checkBoxContainers.length; i++) + if (checkBoxContainers[i].getAttribute("inportalType")) + { + var inputs = checkBoxContainers[i].getElementsByTagName("INPUT"); + var checkBox; + for (var j = 0; j < inputs.length; j++) + if (inputs[j].type == "checkbox") + { + checkBox = inputs[j]; + break; + } + checkBox.inportalType = checkBoxContainers[i].getAttribute("inportalType"); + checkBox.onclick = checkBoxClick; + checkBox.container = checkBoxContainers[i]; + checkBox.checked = false; +// checkBoxContainers[i].className = (checkBox.checked) ? "selectedContainer" : "unselectedContainer"; + selectContainer(checkBox, checkBox.checked, true) + if (checkBox.checked) + tabSelection[checkBox.inportalType]++; + + } + tabChanged(); + selectionChanged(); +// toolbar.setTab('category'); +} + +function checkBoxClick() +{ + selectContainer(this, this.checked); + if (this.checked) + { + tabSelection[this.inportalType]++ + LastCheckedItem = this; + } + else + { + tabSelection[this.inportalType]--; + LastCheckedItem = null; + } + updateStatus(); +} + +function toggleTab(tabId) +{ + //alert('now in toggletab()'); + //alert('toggling '+tabId); + var tab = document.getElementById(tabId); + + if (!tab) + { + return; + } + //alert('found tab..'); + for (var i = 0; i < tabIDs.length; i++) + { + if (tabIDs[i] != tabId) + { + inactiveTab = document.getElementById(tabIDs[i]); + if(inactiveTab.getAttribute("isTab")) + { + unselectAll(tabIDs[i]); + inactiveTab.style.display = "none"; + inactiveTab.active = false; + } + } + } + tab.style.display = ""; + tab.active = true; + if(toolbar) + toolbar.setTab(tabId); + activeTab = tab; + tabChanged(); +} + +function toggleCategories() +{ + var tab = document.getElementById("categories"); + tab.style.display = (tab.style.display == "none") ? "" : "none"; + tab.active = (tab.style.display != "none"); + toolbar.showButton('new_cat', tab.active) + unselectAll("categories"); + tabChanged(); +} + +function selectAll(tabId) +{ + changeSelection(tabId, 0) +} + +function unselectAll(tabId) +{ + changeSelection(tabId, 1) +} + +function invert(tabId) +{ + changeSelection(tabId, 2) +} + +function changeSelection(tabId, action) +{ + if(toolbar) + { + var tab = document.getElementById(tabId); + if (!tab) return; + var inputs = tab.getElementsByTagName("INPUT"); + for (var j = 0; j < inputs.length; j++) + if ((inputs[j].type == "checkbox") && (inputs[j].inportalType)) + { + switch (action) + { + case (0) : + selectContainer(inputs[j], true, true) + break; + case (1) : + selectContainer(inputs[j], false, true) + break; + default: + selectContainer(inputs[j], (!inputs[j].checked), true) + break; + } + + } + selectionChanged(); + } +} + +function selectContainer(checkBox, value, doNotFireSelectionEvent) +{ + if (!checkBox) return; + if (checkBox.checked != value) + { + checkBox.checked = value; + if (value) + tabSelection[checkBox.inportalType]++ + else + tabSelection[checkBox.inportalType]--; + } + checkBox.container.parentNode.className = (checkBox.checked) ? "selectedContainer" : "unselectedContainer"; + checkBox.container.className = (checkBox.checked) ? "selectedContainer" : "unselectedContainer"; + if (!doNotFireSelectionEvent) + selectionChanged(); +} + +function updateStatus() +{ + var StatusString=""; + for (var i = 0; i < tabIDs.length; i++) + StatusString+= tabIDs[i] + ": " + tabSelection[tabIDs[i]] + "; "; + + StatusString+= "categories: " + tabSelection['categories'] + "; "; + window.status = StatusString; +} + + +function selectionChanged() +{ + setTimeout('selectionChangedA()', 0) +} +var activeTab; +function selectionChangedA() +{ + var categories = document.getElementById('categories'); + + for (var i = 0; i < tabIDs.length; i++) + { + var thisTab = document.getElementById(tabIDs[i]) + if (!thisTab) continue; + if (thisTab.active) + { + activeTab = thisTab; + activeTab.title = getTabTitle(tabIDs[i]); + break; + } + } + + var numCategoriesSelected = tabSelection['categories']; + var numActiveTabSelected = (activeTab) ? tabSelection[activeTab.id] : 0; + + if(toolbar) + { + //toolbar.enableButton("edit", (numCategoriesSelected + numActiveTabSelected == 1)); + var enableMiscButtons = (numCategoriesSelected + numActiveTabSelected > 0 && numCategoriesSelected * numActiveTabSelected == 0); + + toolbar.enableButton("edit", enableMiscButtons); + toolbar.enableButton("delete", enableMiscButtons); + toolbar.enableButton("approve", enableMiscButtons); + toolbar.enableButton("decline", enableMiscButtons); + toolbar.enableButton("cut", enableMiscButtons); + toolbar.enableButton("copy", enableMiscButtons); + toolbar.enableButton("paste", true); + toolbar.enableButton("move_up", enableMiscButtons); + toolbar.enableButton("move_down", enableMiscButtons); + } +} + +function tabChanged() +{ + if (activeTab) + { + //alert('now active: '+activeTab.id) + } + +// toggleMenu(); +} + +function getTabTitle(tabId) +{ + var tab = document.getElementById(tabId); + if (!tab) return; + return tab.getAttribute("tabTitle"); +} + +function isAnyChecked(tabId) +{ + return tabSelection[tabId] > 0; +} Index: trunk/themes/default/img/bgr_topsquares.jpg =================================================================== diff -u Binary files differ Index: trunk/themes/default/register/register_form.tpl =================================================================== diff -u --- trunk/themes/default/register/register_form.tpl (revision 0) +++ trunk/themes/default/register/register_form.tpl (revision 13) @@ -0,0 +1,147 @@ + + "> +
    + + + + + + + + + +
    + In-portal has successfully been installed on your server. Click the button below to log into the site administration using the root password you just configurered. +


    +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +


    (*)
    +



    *


    * 

    * 





    *


     

     

    * 

    * () 




     

     

     

      +



    +
    + " class="button"> + " class="button"> +
    + + \ No newline at end of file Index: trunk/admin/icons/icon46_list_summary.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/upload/asp/class_upload.asp =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/upload/asp/class_upload.asp (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/upload/asp/class_upload.asp (revision 13) @@ -0,0 +1,146 @@ +<% +'*************************************** +' File: Upload.asp +' Author: Jacob "Beezle" Gilley +' Email: avis7@airmail.net +' Date: 12/07/2000 +' Comments: The code for the Upload, CByteString, +' CWideString subroutines was originally +' written by Philippe Collignon...or so +' he claims. Also, I am not responsible +' for any ill effects this script may +' cause and provide this script "AS IS". +' Enjoy! +'**************************************** + +Class FileUploader + Public Files + Private mcolFormElem + + Private Sub Class_Initialize() + Set Files = Server.CreateObject("Scripting.Dictionary") + Set mcolFormElem = Server.CreateObject("Scripting.Dictionary") + End Sub + + Private Sub Class_Terminate() + If IsObject(Files) Then + Files.RemoveAll() + Set Files = Nothing + End If + If IsObject(mcolFormElem) Then + mcolFormElem.RemoveAll() + Set mcolFormElem = Nothing + End If + End Sub + + Public Property Get Form(sIndex) + Form = "" + If mcolFormElem.Exists(LCase(sIndex)) Then Form = mcolFormElem.Item(LCase(sIndex)) + End Property + + Public Default Sub Upload() + Dim biData, sInputName + Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos + Dim nPosFile, nPosBound + + biData = Request.BinaryRead(Request.TotalBytes) + nPosBegin = 1 + nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13))) + + If (nPosEnd-nPosBegin) <= 0 Then Exit Sub + + vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin) + nDataBoundPos = InstrB(1, biData, vDataBounds) + + Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--")) + + nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition")) + nPos = InstrB(nPos, biData, CByteString("name=")) + nPosBegin = nPos + 6 + nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34))) + sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin)) + nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename=")) + nPosBound = InstrB(nPosEnd, biData, vDataBounds) + + If nPosFile <> 0 And nPosFile < nPosBound Then + Dim oUploadFile, sFileName + Set oUploadFile = New UploadedFile + + nPosBegin = nPosFile + 10 + nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34))) + sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin)) + oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\")) + + nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:")) + nPosBegin = nPos + 14 + nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13))) + + oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin)) + + nPosBegin = nPosEnd+4 + nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2 + oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin) + + If oUploadFile.FileSize > 0 Then Files.Add LCase(sInputName), oUploadFile + Else + nPos = InstrB(nPos, biData, CByteString(Chr(13))) + nPosBegin = nPos + 4 + nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2 + If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin)) + End If + + nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds) + Loop + End Sub + + 'String to byte string conversion + Private Function CByteString(sString) + Dim nIndex + For nIndex = 1 to Len(sString) + CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1))) + Next + End Function + + 'Byte string to string conversion + Private Function CWideString(bsString) + Dim nIndex + CWideString ="" + For nIndex = 1 to LenB(bsString) + CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1))) + Next + End Function +End Class + +Class UploadedFile + Public ContentType + Public FileName + Public FileData + + Public Property Get FileSize() + FileSize = LenB(FileData) + End Property + + Public Sub SaveToDisk(sFilePath) + Dim oFS, oFile + Dim nIndex + + Set oFS = Server.CreateObject("Scripting.FileSystemObject") + Set oFile = oFS.CreateTextFile(sFilePath, True) + + For nIndex = 1 to LenB(FileData) + oFile.Write Chr(AscB(MidB(FileData,nIndex,1))) + Next + + oFile.Close + End Sub + + Public Sub SaveToDatabase(ByRef oField) + If LenB(FileData) = 0 Then Exit Sub + + If IsObject(oField) Then + oField.AppendChunk FileData + End If + End Sub + +End Class +%> \ No newline at end of file Index: trunk/themes/default/img/ic_confirm_big.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_searchusers.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_review_pending.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/download_license.php =================================================================== diff -u --- trunk/admin/install/download_license.php (revision 0) +++ trunk/admin/install/download_license.php (revision 13) @@ -0,0 +1,45 @@ + +  Select License

    + + + + + + + +
     Step - Select License
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/rosebud.gif =================================================================== diff -u Binary files differ Index: trunk/admin/backupdata/.cvs =================================================================== diff -u --- trunk/admin/backupdata/.cvs (revision 0) +++ trunk/admin/backupdata/.cvs (revision 13) @@ -0,0 +1 @@ \ No newline at end of file Index: trunk/kernel/admin/include/toolbar/user_list.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/user_list.php (revision 0) +++ trunk/kernel/admin/include/toolbar/user_list.php (revision 13) @@ -0,0 +1,25 @@ + + + +END; + +?> \ No newline at end of file Index: trunk/admin/icons/icon24_mailinglist.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_cut.gif =================================================================== diff -u Binary files differ Index: trunk/admin/config/edit_config.php =================================================================== diff -u --- trunk/admin/config/edit_config.php (revision 0) +++ trunk/admin/config/edit_config.php (revision 13) @@ -0,0 +1,171 @@ +Logout(); + header("Location: ".$adminURL."/login.php"); + die(); + //require_once($pathtoroot."admin/login.php"); +} + +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; + +$imagesURL = $adminURL."/images"; + +//admin only util + +$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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot.$value."admin/include/parser.php"; + if(file_exists($path)) + { + //echo ""; + @include_once($path); + } +} + +//Set Section +$section = $_GET["section"]; +$module = $_GET["module"]; +//echo $module." - ".$section."
    \n"; +//Set Environment Variable +$envar = "env=" . BuildEnv()."§ion=$section&module=$module"; + $objCatToolBar = new clsToolBar(); + $objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","if(SubmitFunc) { config_submit('edit_config'); } else document.edit_config.submit();","tool_select.gif"); + $objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","history.back();","tool_cancel.gif"); + + +$sec = $objSections->GetSection($section); +$ParentSection = $sec->Get("parent"); +$ParentSec = $objSections->GetSection($ParentSection); +$ParentUrl = $ParentSec->URL(); +if($ParentSec->Get("parent")) +{ + //$SubmitUrl = $ParentUrl."§ion=$section&module=$module"; + $SubmitUrl = $ParentUrl; + //echo "Submitting Parent ($ParentUrl) to: $SubmitUrl
    \n"; +} +else + $SubmitUrl = $_SERVER['PHP_SELF']."?".$envar; + + + +int_header($objCatToolBar,NULL,$title); +?> +
    + + + + + + + + + + + + + + +
    Domain:
    Available licenses:


    +
    + + + + + + + + + +
    +
    + +Clear(); +$objAdmin->LoadItems(TRUE); + +$headings = $objAdmin->GetHeadingList(); + +for($i=0;$i<=count($headings);$i++) +{ + $h = $headings[$i]; + if(strlen($h)) + { + int_subsection_title(prompt_language($h)); + $Items = $objAdmin->GetHeadingItems($h); + foreach($Items as $c) + { + print "\n"; + print " \n"; + print " "; + if(is_object($c->NextItem)) + { + $n = $c->NextItem; + print " "; + } + else + print " \n"; + print "\n"; + } + } +} +?> + > + + +
    ".$c->GetPrompt()."".$c->ItemFormElement()."".$n->ItemFormElement()." 
    + + + +
    + Index: trunk/admin/category/addrelation.php =================================================================== diff -u --- trunk/admin/category/addrelation.php (revision 0) +++ trunk/admin/category/addrelation.php (revision 13) @@ -0,0 +1,281 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$cssURL = $adminURL."/include"; +$browseURL = $adminURL."/browse"; + +//$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."/browse/toolbar.php"); +require_once($pathtoroot.$admin."/listview/listview.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditCat); + +$objEditCat = new clsCatList(); +$objEditCat->SourceTable = $objSession->GetEditTable("Category"); + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditCat->Query_Item("SELECT * FROM ".$objEditCat->SourceTable); +$itemcount=$objEditCat->NumItems(); +$c = $objEditCat->GetItemByIndex($en); + +unset($objEditItems); + +$objEditItems = new clsRelationshipList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Relationship"); + +if(isset($_POST["itemlist"])) +{ + if(is_array($_POST["itemlist"])) + { + $RelationId = $_POST["itemlist"][0]; + } + else + { + $RelationId = $_POST["itemlist"]; + } + + $Rel = new clsRelationship(); + $Rel->tablename = $objEditItems->SourceTable; + $Rel->LoadExpanded($RelationId); + $action = "m_edit_relation"; +} +else +{ + $Rel = new clsRelationship(); + $Rel->Set("SourceType","1"); + $Rel->Set("SourceId",$c->Get("ResourceId")); + $Rel->Set("TargetId",$_POST["TargetId"]); + $Rel->Set("TargetType",$_POST["TargetType"]); + $Rel->Set("Type","0"); + $Rel->Set("Enabled","1"); + $action = "m_add_relation"; +} + +$item = $Rel->GetTargetItemData(); + +$envar = "env=" . BuildEnv() . "&en=$en"; + + +$section = 'in-portal:editcategory_relation'; + +$ado = GetADODBConnection(); + + + +/* page header */ +print << + + In-portal + + + + + + + + + + + +END; + + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Category")." '".$c->Get("Name")."' - ".prompt_language("la_Text_Relation"); +$title .= " ".prompt_language("la_Text_to")." '".$item[$item["TitleField"]]."'"; + + +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('category','CatEditStatus','".$admin."/category/addcategory_relations.php',0);",$imagesURL."/toolbar/tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('category','CatEditStatus','".$admin."/category/addcategory_relations.php',-1);",$imagesURL."/toolbar/tool_cancel.gif"); + +int_header($objCatToolBar,NULL,$title); +if ($objSession->GetVariable("HasChanges") == 1) { +?> + + + + +
    + +
    + + + + + > + + + + + > + + + + + > + + + + + > + + + + + > + + + + + "> + "> + "> + "> + "> + + + +
    + ".$Rel->Get("RelationshipId"); ?> +  
    + () +  
    +Get("Type")=="1") + { + $Recip = " CHECKED"; + } + else + $OneWay = " CHECKED"; +?> + > + > +  
    + Get("Enabled")=="1") + { + $checked = " CHECKED"; + } + ?> + > +  
    + "> +  
    +
    + > + + + + +
    + +
    + + + + +
    + + Index: trunk/admin/images/toolbar/tool_validate_reset_f3.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/images/.cvs =================================================================== diff -u --- trunk/kernel/images/.cvs (revision 0) +++ trunk/kernel/images/.cvs (revision 13) @@ -0,0 +1 @@ \ No newline at end of file Index: trunk/admin/images/toolbar/tool_frontend_mail_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/tab_active_back3.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/images/summary/usersbox_header.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/tab2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_paste.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/itemreview.php =================================================================== diff -u --- trunk/kernel/include/itemreview.php (revision 0) +++ trunk/kernel/include/itemreview.php (revision 13) @@ -0,0 +1,615 @@ +Execute($sql); + if($rs) + { + $count = $rs->fields["DupCount"]; + } + return ($count>0); +} + +RegisterPrefix("clsItemReview","review","kernel/include/itemreview.php"); + +class clsItemReview extends clsParsedItem +{ + function clsItemReview($ReviewId=NULL,$table="ItemReview") + { + $this->clsParsedItem(); + $this->tablename = $table; + $this->id_field = "ReviewId"; + $this->type=-20; + $this->NoResourceId=1; + $this->TagPrefix = "review"; + + if($ReviewId!=NULL) + $this->LoadFromDatabase($ReviewId); + } + + function Validate() + { + global $Errors; + + $dataValid = true; + if(!isset($this->m_CreatedOn)) + { + $Errors->AddError("error.fieldIsRequired",'CreatedOn',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if(!isset($this->m_ReviewText)) + { + $Errors->AddError("error.fieldIsRequired",'ReviewText',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if(!isset($this->m_Pending)) + { + $Error->AddError("error.fieldIsRequired",'Pending',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if(!isset($this->m_IPAddress)) + { + $Error->AddError("error.fieldIsRequired",'IPAddress',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if(!isset($this->m_ItemId)) + { + $Error->AddError("error.fieldIsRequired",'ItemId',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if(!isset($this->m_CreatedById)) + { + $Error->AddError("error.fieldIsRequired",'CreatedBy',"","",get_class($this),"Validate"); + $dataValid = false; + } + + return $dataValid; + } + + function LoadFromDatabase($Id) + { + global $objSession, $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 ReviewId = '%s'",$Id); + if((int)$_GLOBALS["debuglevel"]) + echo $sql."
    "; + $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; + if(is_array($data)) + $this->SetFromArray($data); + $this->Clean(); + return TRUE; + } + + function MoveUp() + { + $this->Increment("Priority"); + } + + function MoveDown() + { + $this->Decrement("Priority"); + } + + function ParseObject($element) + { + global $objConfig, $objCatList, $rootURL, $objUsers; + + $extra_attribs = ExtraAttributes($element->attributes); + + if(strtolower($element->name)==$this->TagPrefix) + { + $field = strtolower($element->attributes["_field"]); + switch($field) + { + case "id": + /* + @field:review.id + @description: review id + */ + $ret = $this->Get("ReviewId"); + break; + case "item_id": + /* + @field:review.item_id + @description: ID of the item being reviewed + */ + $ret = inp_unescape($this->Get("ItemId")); + break; + case "text": + /* + @field:review.text + @description:Review text + */ + if($this->Get("TextFormat")==0 || $element->attribues["_textonly"]) + { + $ret = inp_escape($this->Get("ReviewText"),0); + } + else + { + $ret = $this->Get("ReviewText"); + } + break; + case "ip": + /* + @field:review.ip + @description:IP address of remote host submitting the review + */ + $ret = $this->Get("IPAddress"); + break; + case "pending": + /* + @field:review.pending + @description: Returns the review pening status + */ + $ret = $this->Get("Pending"); + break; + case "item_type": + /* + @field:review.item_type + @description:Returns the name of the reviewed item type + */ + $type =& $objItemTypes->GetItem($this->Get("ItemType")); + if(is_object($type)) + $ret = $type->Get("ItemName"); + break; + case "date": + /* + @field:review.date + @description:Returns the date/time the review was created + @attrib:_tz:bool:Convert the date to the user's local time + @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr + */ + $d = $this->Get("CreatedOn"); + if($element->attributes["_tz"]) + { + $d = GetLocalTime($d,$objSession->Get("tz")); + } + + $part = strtolower($element->attributes["_part"]); + if(strlen($part)) + { + $ret = ExtractDatePart($part,$d); + } + else + { + if($d<=0) + { + $ret = ""; + } + else + $ret = LangDate($d); + } + break; + case "reviewer": + /* + @field:revier.reviewer + @description:Parse a user tag for the user submitting the review + @attrib:_usertag::User tag to parse, defaults to the users login name + */ + $userfield = $element->attributes["_usertag"]; + if(!strlen($userfield)) + { + $userfield = "login"; + } + if($this->Get("CreatedById")>0) + { + $u =& $objUsers->GetItem($this->Get("CreatedById")); + $e = new clsHtmlTag(); + $e->name = $u->TagPrefix; + $e->attributes = $element->attributes; + $e->attributes["_field"] = $userfield; + $ret = $u->ParseObject($e); + } + else + if($userfield=="login") + $ret = "root"; + break; + default: + $tag = $this->TagPrefix."_".$field; + $ret = "Undefined: ".$tag->name; + break; + } + } + else + { + $ret = $element->Execute(); + } + return $ret; + } + + function parsetag($tag) + { + global $objConfig, $objUsers, $objItemTypes; + if(is_object($tag)) + { + $tagname = $tag->name; + } + else + $tagname = $tag; + switch($tagname) + { + case "review_id": + return $this->Get("ReviewId"); + break; + case "review_item_id": + return inp_unescape($this->Get("ItemId")); + break; + case "review_text": + return $this->Get("ReviewText"); + break; + case "review_ip_address": + return $this->Get("IPAddress"); + break; + case "review_pending": + return $this->Get("Pending"); + break; + case "review_item_type": + $type =& $objItemTypes->GetItem($this->Get("ItemType")); + $res = $type->Get("ItemName"); + return $res; + break; + case "review_created_date": + return LangDate($this->Get("CreatedOn")); + break; + case "review_created_time": + if($this->Get("CreatedOn")<=0) + return ""; + return adodb_date($objConfig->TimeFormat(), $this->Get("CreatedOn")); + break; + + case "review_created_date_month": + return adodb_date("m", $this->Get("CreatedOn")); + break; + case "review_created_date_day": + return adodb_date("d", $this->Get("CreatedOn")); + break; + case "review_created_date_year": + return adodb_date("Y", $this->Get("CreatedOn")); + break; + default: + if (substr($tagname, 0, 16) == "review_createdby") + { + /* parse the created by user */ + $u = $objUsers->GetUser($this->Get("CreatedById")); + $usertag = substr($tag,17); + return $u->parsetag($usertag); + } + else + return "Undefined:$tagname"; + break; + } + } + + function SendUserEventMail($Suffix,$ToUserId,$LangId=NULL) + { + global $objItemTypes, $objMessageList; + + $type =& $objItemTypes->GetItem($this->Get("ItemType")); + $res = $type->Get("ItemName"); + $EventName = $res.$Suffix; + + $Event =& $objMessageList->GetEmailEventObject($EventName,0,$LangId); + if(is_object($Event)) + { + if($Event->Get("Enabled")=="1") + { + $Event->Item = $this; + return $Event->SendToUser($ToUserId); + } + } + } + + function SendAdminEventMail($EventName,$LangId=NULL) + { + global $objItemTypes,$objMessageList; + + $type =& $objItemTypes->GetItem($this->Get("ItemType")); + $res = $type->Get("ItemName"); + $EventName = $res.$Suffix; + + $Event =& $objMessageList->GetEmailEventObject($EventName,1,$LangId); + if(is_object($Event)) + { + if($Event->Get("Enabled")=="1") + { + $Event->Item = $this; + return $Event->SendAdmin($ToUserId); + } + } + } +} /*clsIItemReview*/ + +class clsItemReviewList extends clsItemCollection +{ + var $itemID; + var $Page; + var $PerPageVar; + + function clsItemReviewList($id=NULL) + { + $this->clsItemCollection(); + $this->classname = "clsItemReview"; + $this->SourceTable = GetTablePrefix()."ItemReview"; + $this->Page = 1; + $this->PerPageVar = "Perpage_Review"; + if(isset($id)) + $this->itemID=$id; + $this->AdminSearchFields = array("ReviewText"); + } + + function ItemCount() + { + return $this->NumItems(); + } + + function GetReview($ID) + { + return $this->GetItem($ID); + } + + function GetReviewList($StatusWhere = "Status=1", $OrderBy=NULL) + { + $this->Clear(); + $where = "ItemId=".$this->itemID; + $sql = "SELECT * FROM ".$this->SourceTable." WHERE "; + if(strlen($StatusWhere)) + $where .= " AND ".$StatusWhere; + $sql .= $where; + if(strlen($OrderBy)) + $sql .= " ORDER BY ".$OrderBy; + $Limit = $this->GetLimitSQL(); + if(strlen($Limit)) + $sql .= " ".$Limit; + $this->QueryItemCount=TableCount($this->SourceTable,$where,0); + return $this->Query_item($sql); + } + + function GetItemReviewCount($TodayOnly = FALSE) + { + $sql = "SELECT count(*) as ItemCount FROM ".$this->SourceTable." WHERE ItemId=".$this->itemID." AND Status=1"; + if($TodayOnly) + { + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $where .= " AND CreatedOn>=$today"; + } + $rs = $this->adodbConnection->execute($sql); + $count=0; + if($rs) + $count = $rs->fields["ItemCount"]; + return (int)$count; + } + + function ip_exists($ip,$id) + { + return ip_exists($ip,id,$this->SourceTable); + } + + function GetLimitSQL() + { + global $objConfig; + if($this->Page<1) + $this->Page=1; + $PerPage = $objConfig->Get($this->PerPageVar); + if(is_numeric($PerPage)) + { + $Start = ($this->Page-1)*$PerPage; + $limit = "LIMIT ".$Start.",".$PerPage; + } + else + $limit = NULL; + return $limit; + } + + + function Query_Review($whereClause=NULL,$orderByClause=NULL) + { + global $Errors; + + $this->Clear(); + $sql = "SELECT * FROM ".$this->SourceTable." "; + + if(isset($whereClause) && strlen(trim($whereClause))>0) + $sql = sprintf("%s WHERE %s",$sql,$whereClause); + + if(isset($orderByClause) && strlen(trim($orderByClause))>0) + $sql = sprintf("%s ORDER BY %s",$sql,$orderByClause); + + return $this->Query_Item($sql); + } + + function &AddReview($CreatedOn,$ReviewText, $Status, $IPAddress, + $Priority, $ItemId,$ItemType,$CreatedById,$TextFormat=0,$Module) + { + global $objSession; + + $r = new clsItemReview(NULL,$this->SourceTable); + + $ReviewText = str_replace("env=".$objSession->GetSessionKey(), "env=",$ReviewText); + //$r->debuglevel = 1; + + $r->Set(array("CreatedOn","ReviewText","Status", "IPAddress", + "Priority","ItemId","ItemType","CreatedById","TextFormat","Module"), + array($CreatedOn,$ReviewText,$Status, $IPAddress, + $Priority, $ItemId,$ItemType,$CreatedById,$TextFormat,$Module)); + $r->Create(); + array_push($this->Items,$r); + if($Status==1) + { + $r->SendUserEventMail("REVIEW.ADD",$CreatedById); + $r->SendAdminEventMail("REVIEW.ADD"); + } + else + { + $r->SendUserEventMail("REVIEW.ADD.PENDING",$CreatedById); + $r->SendAdminEventMail("REVIEW.ADD.PENDING"); + } + + return $r; + } + + function EditReview($ReviewId,$CreatedOn,$ReviewText, $Status, + $IPAddress, $Priority, $ItemId,$ItemType,$CreatedById,$TextFormat,$Module) + { + global $objSession; + + $r = $this->GetItem($ReviewId); + if($CreatedById==0) + $CreatedById = $r->Get("CreatedById"); + $r->Set(array("ReviewId","CreatedOn","ReviewText","Status", + "IPAddress", "Priority", "ItemId","ItemType","CreatedById","TextFormat","Module"), + array($ReviewId,$CreatedOn,$ReviewText,$Status, + $IPAddress, $Priority, $ItemId,$ItemType,$CreatedById,$TextFormat,$Module)); + $r->Update(); + //$r->SendUserEventMail("REVIEW.MODIFY",$objSession->Get("PortalUserId")); + $r->SendAdminEventMail("REVIEW.MODIFY"); + return $r; + } + + function DeleteReview($ReviewId) + { + $r = $this->GetItem($ReviewId); + $r->Delete(); + } + + function CopyToItemId($OldId,$NewId) + { + $this->Clear(); + $this->Query_Review("ItemId=$OldId",""); + if($this->NumItems()>0) + { + foreach($this->Items as $i) + { + $i->Set("ItemId",$NewId); + $i->UnsetIdField(); + $i->Create(); + } + } + } + + function CopyFromEditTable($ResourceId) + { + global $objSession; + + $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["ReviewId"]>0) + { + $c->Update(); + } + else + { + $c->UnsetIdField(); + $c->Create(); + } + $idlist[] = $c->Get("ReviewId"); + $rs->MoveNext(); + } + $sql = "DELETE FROM ".$this->SourceTable." WHERE ItemId=$ResourceId AND ReviewId NOT IN (".implode(",",$idlist).")"; + $this->adodbConnection->Execute($sql); + @$this->adodbConnection->Execute("DROP TABLE ".$edit_table); + } + + + function GetPageLinkList(&$UpdateVar,$dest_template=NULL,$page = NULL,$PagesToList=10,$HideEmpty=TRUE) + { + global $objConfig, $var_list_update, $var_list; + + if(!strlen($page)) + $page = GetIndexURL(); + $PerPage = $objConfig->Get($this->PerPageVar); + if($PerPage<1) + $PerPage=20; + $NumPages = ceil($this->GetNumPages($PerPage)); + + if($NumPages==1 && $HideEmpty) + return ""; + + if(strlen($dest_template)) + { + $var_list_update["t"] = $dest_template; + } + else + $var_list_update["t"] = $var_list["t"]; + + $o = ""; + if($this->Page>$NumPages) + $this->Page=$NumPages; + + $StartPage = (int)$this->Page - ($PagesToList/2); + if($StartPage<1) + $StartPage=1; + + $EndPage = $StartPage+($PagesToList-1); + if($EndPage>$NumPages) + { + $EndPage = $NumPages; + $StartPage = $EndPage-($PagesToList-1); + if($StartPage<1) + $StartPage=1; + } + + $o = ""; + if($StartPage>1) + { + $UpdateVar["rp"] = $this->Page-$PagesToList; + $prev_url = $page."?env=".BuildEnv(); + $o .= "<<"; + } + + + for($p=$StartPage;$p<=$EndPage;$p++) + { + if($p!=$this->Page) + { + $UpdateVar["rp"]=$p; + $href = $page."?env=".BuildEnv(); + $o .= " $p "; + } + else + { + $o .= "$p"; + } + } + if($EndPage<$NumPages && $EndPage>0) + { + $UpdateVar["rp"]=$this->Page+$PagesToList; + $next_url = $page."?env=".BuildEnv(); + $o .= " >>"; + } + unset($UpdateVar,$var_list_update["t"] ); + return $o; + } + + +} /*clsItemReviewList*/ + +?> Index: trunk/admin/images/toolbar/tool_next.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_next_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemtabs/divider_dn.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/lang/portuguese.gif =================================================================== diff -u Binary files differ Index: trunk/admin/relations/item_type.php =================================================================== diff -u --- trunk/admin/relations/item_type.php (revision 0) +++ trunk/admin/relations/item_type.php (revision 13) @@ -0,0 +1,127 @@ + Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//echo "[".$_GET["mod"]."]
    \n"; + +$localURL=$rootURL.$m[$_GET["mod"]]; + +//admin only util + + +$pathtolocal = $pathtoroot.$m[$_GET["mod"]]; +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."/include/toolbar.php"); +//Set Section +$section = ''; + +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +//echo $envar."
    \n";//&mod=n&destform=ItemAddForm&destfield=ItemList + +$formaction = $localURL."admin/item_select.php?".$envar; + + +//Display header +int_header(NULL); +?> +
    +"> +"> +"> + +

    Add Item Relationship

    +Select the type of item to relate:
    + + +
    + Index: trunk/admin/templates/cat_rel_element.tpl =================================================================== diff -u --- trunk/admin/templates/cat_rel_element.tpl (revision 0) +++ trunk/admin/templates/cat_rel_element.tpl (revision 13) @@ -0,0 +1,3 @@ +"> + + Index: trunk/kernel/include/portaluser.php =================================================================== diff -u --- trunk/kernel/include/portaluser.php (revision 0) +++ trunk/kernel/include/portaluser.php (revision 13) @@ -0,0 +1,1030 @@ +clsParsedItem(); + $this->tablename=GetTablePrefix()."PortalUser"; + $this->type=6; + $this->BasePermission="USER"; + $this->id_field = "PortalUserId"; + $this->TagPrefix="user"; + + $this->Vars = array(); + $VarsLoaded = FALSE; + $this->debuglevel = 0; + if(isset($UserId)) + $this->LoadFromDatabase($UserId); + } + + function Delete() + { + global $objGroups, $objFavorites; + + $g = $objGroups->GetPersonalGroup($this->Get("Login")); + if(is_object($g)) + $g->Delete(); + $objFavorites->DeleteUser($this->Get("PortalUserId")); //delete favorites + parent::Delete(); + } + + function RemoveFromAllGroups() + { + $sql = "DELETE FROM ".GetTablePrefix()."UserGroup WHERE PortaluserId=".$this->Get("PortalUserId"); + $this->adodbConnection->Execute($sql); + } + + function RemoveFromGroup($GroupId) + { + $sql = "DELETE FROM ".GetTablePrefix()."UserGroup WHERE PortaluserId=".$this->Get("PortalUserId"); + $sql .= " AND GroupId=$GroupId"; + $this->adodbConnection->Execute($sql); + } + + function PrimaryGroup($ReturnField = "GroupId") + { + global $objGroups; + + $ret = ""; + + if(!is_object($this->PrimeGroup)) + { + if((int)$this->Get("GroupId")>0) + { + $this->PrimeGroup =& $objGroups->GetItem($this->Get("GroupId")); + } + else + { + $this->PrimeGroup = new clsPortalGroup(); + $sql = "SELECT * FROM ".GetTablePrefix()."UserGroup INNER JOIN ".GetTablePrefix()."PortalGroup ON (".GetTablePrefix()."UserGroup.GroupId=".GetTablePrefix()."PortalGroup.GroupId) WHERE PrimaryGroup = 1 AND PortalUserId=".$this->Get("PortalUserId"); + //echo $sql; + $rs = $this->adodbConnection->Execute($sql); + + if($rs && !$rs->EOF) + $this->PrimeGroup->SetFromArray($rs->fields); + } + } + $ret = $this->PrimeGroup->Get($ReturnField); + return $ret; + } + + function SetPrimaryGroup($GroupId) + { + if($this->IsInGroup($GroupId)) + { + $sql = "UPDATE ".GetTablePrefix()."UserGroup SET PrimaryGroup=0 WHERE PortalUserId=".$this->Get("PortalUserId"); + $this->adodbConnection->Execute($sql); + $sql = "UPDATE ".GetTablePrefix()."UserGroup SET PrimaryGroup=1 WHERE GroupId=$GroupId AND PortalUserId=".$this->Get("PortalUserId"); + $this->adodbConnection->Execute($sql); + } + } + + function GetGroupList() + { + $ret = array(); + $sql = "SELECT GroupId FROM %sUserGroup WHERE PortalUserId = %s ORDER BY PrimaryGroup"; + $sql = sprintf($sql, GetTablePrefix(), $this->Get("PortalUserId")); + $ret = $this->adodbConnection->GetCol($sql); + return $ret; + } + + function IsInGroup($GroupId) + { + $groups = $this->GetGroupList(); + if( $groups === false ) return false; + return in_array($GroupId, $groups) ? true : false; + } + + function GetPersonalGroup($CreateIfMissing = FALSE) + { + global $objGroups; + + $n = "_".$this->Get("Login"); + $g = $objGroups->GetItemByField("Name",$n); + if(!is_object($g) && $CreateIfMissing) + $g = $this->CreatePersonalGroup(); + return $g; + } + + function CreatePersonalGroup() + { + global $objGroups; + + $Description = $this->Get("FirstName")." ".$this->Get("LastName"); + $CreatedOn=time(); + $n = "_".$this->Get("Login"); + $g = $objGroups->Add_Group($n, $Description, $CreatedOn, 1, 0); + $g->Set("Personal",1); + $g->Set("System",0); + $g->Set("Enabled",1); + $g->Update(); + if(is_object($g)) + $g->AddUser($this->Get("PortalUserId")); + return $g; + } + + function Validate() + { + global $Errors; + + $dataValid = true; + if(!strlen($this->Get("Login"))) + { + $Errors->AddError("error.fieldIsRequired",'Login',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if(!strlen($this->Get("Email"))) + { + $Errors->AddError("error.fieldIsRequired",'Email',"","",get_class($this),"Validate"); + $dataValid = false; + } + + return $dataValid; + } + + function Approve() + { + $this->Set("Status", 1); + $this->Update(); + $this->SendUserEventMail("USER.APPROVE",$this->Get("PortalUserId")); + $this->SendAdminEventMail("USER.APPROVE"); + } + + function Deny($IsBanned = 0) + { + $this->Set( Array('Status','IsBanned'), Array(0,$IsBanned) ); + $this->Update(); + $this->SendUserEventMail("USER.DENY",$this->Get("PortalUserId")); + $this->SendAdminEventMail("USER.DENY"); + } + + function HasSystemPermission($PermissionName) + { + global $objGroups; + + $GroupList = $this->GetGroupList(); + for($i=0;$iGetItem($GroupList[$i]); + $value = $g->HasSystemPermission($PermissionName); + if($value != -1) + break; + } + return $value; + } + + function LoadFromDatabase($id) + { + global $objSession,$Errors; + + if(!isset($id)) + { + $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"","clsPortalUser","LoadFromDatabase"); + return FALSE; + } + if($id) + { + $utable = $this->tablename; + $gtable = GetTablePrefix()."UserGroup"; + $sql = "SELECT * FROM $utable "; //LEFT JOIN $gtable ON ($utable.PortalUserId=$gtable.PortalUserId)"; + $sql .=" WHERE PortalUserId=$id"; + //echo $sql."
    \n"; + $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; + if(is_array($data)) + { + $this->SetFromArray($data); + $this->Clean(); + } + else + return FALSE; + return TRUE; + } + else + return FALSE; + } + + function LoadPersistantVars() + { + unset($this->Vars); + $this->Vars = array(); + $user_id = $this->HasField('PortalUserId') ? $this->Get('PortalUserId') : 0; + $sql = "SELECT VariableName, VariableValue FROM ".GetTablePrefix()."PersistantSessionData WHERE PortalUserId = 0 OR PortalUserId = ".$user_id." ORDER BY PortalUserId ASC"; + $result = $this->adodbConnection->Execute($sql); + while ($result && !$result->EOF) + { + $data = $result->fields; + $this->Vars[$data["VariableName"]] = $data["VariableValue"]; + $result->MoveNext(); + } + $this->VarsLoaded=TRUE; + } + + function SetPersistantVariable($variableName, $variableValue) + { + global $objConfig; + + if(!$this->VarsLoaded) + $this->LoadPersistantVars(); + $userid = $this->Get("PortalUserId"); + $objConfig->Set($variableName,$variableValue,1); + $fields = array_keys($this->Vars); + + if(strlen($variableValue)>0) + { + if(in_array($variableName,$fields)) + { + $sql = "UPDATE ".GetTablePrefix()."PersistantSessionData SET VariableValue='$variableValue' WHERE VariableName='$variableName' AND PortalUserId=$userid"; + } + else + $sql = "INSERT INTO ".GetTablePrefix()."PersistantSessionData (VariableName,VariableValue,PortalUserId) VALUES ('$variableName','$variableValue',$userid)"; + } + else + $sql = "DELETE FROM ".GetTablePrefix()."PersistantSessionData WHERE VariableName='$variableName' AND PortalUserId=$userid"; + + $this->Vars[$variableName] = $variableValue; + +// echo "
    SQL: $sql
    "; + + $this->adodbConnection->Execute($sql); + } + + function GetPersistantVariable($variableName) + { + global $objConfig; + + if(!$this->VarsLoaded) + $this->LoadPersistantVars(); + + $fields = array_keys($this->Vars); + + if(in_array($variableName,$fields)) + { + $val = $this->Vars[$variableName]; + } + else + $val = $objConfig->Get($variableName); + + return $val; + } + + function GetAllPersistantVars() + { + if(!$this->VarsLoaded) + $this->LoadPersistantVars(); + + return $this->Vars; + } + + function GetIcon() + { + } + + function StatusIcon() + { + global $imagesURL; + + $url = $imagesURL."/itemicons/icon16_user"; + if($this->Get("Status")==0) + { + $url .= "_disabled"; + } + else + if($this->Get("Status")==2) + { + $url .= "_pending"; + } + $url .= ".gif"; + return $url; + } + + function IsFriend($UserId) + { + $ftable = GetTablePrefix()."Favorites"; + $sql = "SELECT count(*) as FriendCount FROM $ftable WHERE PortalUserId=$UserId AND ResourceId="; + $sql .=$this->Get("ResourceId")." AND ItemTypeId=6"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + return ($rs->fields["FriendCount"]>0); + return FALSE; + } + + function GetUserTime($timestamp) + { + if(is_numeric($this->Get("tz"))) + { + return GetLocalTime($timestamp,$this->Get("tz")); + } + else + return GetLocalTime($timestamp); + } + + function ParseObject($element) + { + global $objConfig, $objUsers, $objCatList,$objSession, $var_list_update, $var_list, $m_var_list_update; + //echo "
    "; print_r($element); echo "
    "; + + if (strtolower($element->name) == 'touser') { + $this->TagPrefix = "touser"; + } + + $extra_attribs = ExtraAttributes($element->attributes); + if(strtolower($element->name)==$this->TagPrefix) + { + $field = strtolower($element->attributes["_field"]); + if(substr($field,0,3)=="pp_") + { + $perm = $objSession->GetPersistantVariable($field); + if($perm) + { + $field = substr($field,3); + } + else + $field = ""; + } + switch($field) + { + /* + @field:user.login + @description:User's login name + */ + case "username": + case "login": + $ret = $this->Get("Login"); + break; + case "firstname": + $ret = $this->Get("FirstName"); + break; + case "lastname": + $ret = $this->Get("LastName"); + break; + case "password": + /* + @field:user.password + @description:User password + */ + $ret = $this->Get("Password"); + break; + case "email": + $ret = $this->Get("Email"); + break; + case "street": + $ret = $this->Get("Street"); + break; + case "city": + $ret = $this->Get("City"); + break; + case "state": + $ret = $this->Get("State"); + break; + case "zip": + $ret = $this->Get("Zip"); + break; + case "phone": + $ret = $this->Get("Phone"); + break; + case "country": + $ret = $this->Get("Country"); + break; + case "primarygroup": + /* + @field:user.primarygroup + @description:Parses a field from the user's primary group + @attrib:_groupfield::group field name to parse, defaults to group name + */ + $groupfield = $element->attributes["_groupfield"]; + if(!strlen($groupfield)) + $groupfield="Name"; + $ret = $this->PrimaryGroup($groupfield); + break; + case "date": + /* + @field:user.date + @description:Returns the date/time the user was created + @attrib:_tz:bool:Convert the date to the user's local time + @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr + */ + $d = $this->Get("CreatedOn"); + if($element->attributes["_tz"]) + { + $d = GetLocalTime($d,$objSession->Get("tz")); + } + + $part = strtolower($element->attributes["_part"]); + if(strlen($part)) + { + $ret = ExtractDatePart($part,$d); + } + else + { + if($d<=0) + { + $ret = ""; + } + else + $ret = LangDate($d); + } + break; + case "dob": + /* + @field:user.dob + @description:Returns the date/time of the users date of birth + @attrib:_tz:bool:Convert the date to the user's local time + @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr + */ + $d = $this->Get("dob"); + if($element->attributes["_tz"]) + { + $d = GetLocalTime($d,$objSession->Get("tz")); + } + $part = strtolower($element->attributes["_part"]); + if(strlen($part)) + { + $ret = ExtractDatePart($part,$d); + } + else + { + if($d<=0) + { + $ret = ""; + } + else + $ret = LangDate($d); + } + break; + + case "modified": + /* + @field:user.modified + @description:Returns the date/time the user was last modified + @attrib:_tz:bool:Convert the date to the user's local time + @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr + */ + $d = $this->Get("Modified"); + if($d<=0) + $d = $this->Get("CreatedOn"); + + if($element->attributes["_tz"]) + { + $d = GetLocalTime($d,$objSession->Get("tz")); + } + $part = strtolower($element->attributes["_part"]); + if(strlen($part)) + { + $ret = ExtractDatePart($part,$d); + } + else + { + if($d<=0) + { + $ret = ""; + } + else + $ret = LangDate($d); + } + break; + case "profile_link": + /* + @field:user.profile_link + @description:Create a link to the user's profile + @attrib:_template:tpl:template the link should point to + */ + $t = $element->attributes["_template"]; + if(strlen($t)) + { + $var_list_update["t"] = $t; + } + else + $var_list_update["t"] = $var_list["t"]; + $ret = GetIndexURL()."?env=" . BuildEnv()."&UserId=".$this->Get("PortalUserId"); + break; + case "add_friend_link": + /* + @field:user.add_friend_link + @description:link to add a user to the friends list + @attrib:_template:tpl:Template link shoukd point to + */ + if($element->attributes["_force"] || !$this->IsFriend($objSession->Get("PortalUserId")) && + $this->Get("PortalUserId") != $objSession->Get("PortalUserId")) + { + $t = $element->attributes["_template"]; + if(strlen($t)) + { + $var_list_update["t"] = $t; + } + else + $var_list_update["t"] = $var_list["t"]; + $action = "m_add_friend"; + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=".$action."&UserId=".$this->Get("PortalUserId"); + } + else + $ret = ""; + break; + case "del_friend_link": + /* + @field:user.del_friend_link + @description:link to remove a user from the friends list + @attrib:_template:tpl:Template link shoukd point to + */ + if($element->attributes["_force"] || $this->IsFriend($objSession->Get("PortalUserId")) && + $this->Get("PortalUserId") != $objSession->Get("PortalUserId")) + { + $t = $element->attributes["_template"]; + if(strlen($t)) + { + $var_list_update["t"] = $t; + } + else + $var_list_update["t"] = $var_list["t"]; + $action = "m_del_friend"; + $ret = GetIndexURL()."?env=" . BuildEnv()."&Action=".$action."&UserId=".$this->Get("PortalUserId"); + } + else + $ret = ""; + break; + case "icon": + $ret = $this->GetIcon(); + break; + case "image": + /* + @field:user.image + @description:Return an image associated with the user + @attrib:_default:bool:If true, will return the default image if the requested image does not exist + @attrib:_name::Return the image with this name + @attrib:_thumbnail:bool:If true, return the thumbnail version of the image + @attrib:_imagetag:bool:If true, returns a complete image tag. exta html attributes are passed to the image tag + */ + $default = $element->attributes["_primary"]; + $name = $element->attributes["_name"]; + if(strlen($name)) + { + $img = $this->GetImageByName($name); + // echo "
    ";print_r($img); echo "
    "; + } + else + { + if($default) + $img = $this->GetDefaultImage(); + } + if($img) + { + if($element->attributes["_thumbnail"]) + { + $url = $img->parsetag("thumb_url"); + } + else + $url = $img->parsetag("image_url"); + } + else + { + $url = $element->attributes["_defaulturl"]; + } + + if($element->attributes["_imagetag"]) + { + if(strlen($url)) + { + $ret = ""; + } + else + $ret = ""; + } + else + $ret = $url; + break; + + case "custom": + /* + @field:cat.custom + @description:Returns a custom field + @attrib:_customfield::field name to return + @attrib:_default::default value + */ + $field = $element->attributes["_customfield"]; + $default = $element->attributes[" + "]; + $ret = $this->GetPersistantVariable($field); + if(!strlen($ret)) + $ret = $this->GetCustomFieldValue($field,$default); + break; + } + } + else + { + $ret = $this->parsetag($element->name); + } + return $ret; + } + + function parsetag($tag) + { + global $m_var_list_update, $var_list_update, $var_list, $objConfig; + if(is_object($tag)) + { + $tagname = $tag->name; + } + else + $tagname = $tag; + switch($tagname) + { + case "user_id": + return $this->Get("ResourceId"); + break; + case "user_login": + return $this->Get("Login"); + break; + case "user_group": + return $this->Get("PrimaryGroupName"); + break; + case "user_firstname": + return $this->Get("FirstName"); + break; + case "user_lastname": + return $this->Get("LastName"); + break; + case "user_email": + return $this->Get("Email"); + break; + case "user_date": + return LangDate($this->Get("CreatedOn")); + break; + case "user_dob": + return LangDate($this->Get("dob")); + break; + + case "user_password": + return $this->Get("Password"); + break; + case "user_phone": + return $this->Get("Phone"); + break; + case "user_street": + return $this->Get("Street"); + break; + case "user_city": + return $this->Get("City"); + break; + case "user_state": + return $this->Get("State"); + break; + case "user_zip": + return $this->Get("Zip"); + break; + case "user_country": + return $this->Get("Country"); + break; + case "user_resourceid": + return $this->Get("ResourceId"); + break; + case "user_icon": + return $this->GetIcon(); + break; + case "user_profile_link": + $var_list_update["t"] = "user_profile"; + $m_var_list_update["action"] = $this->Get("UserId"); + $ret = GetIndexURL()."?env=" . BuildEnv(); + unset($m_var_list_update["action"], $var_list_update["t"]); + return $ret; + break; + case "user_messages": + return $this->NewMessages(); + break; + case "user_messages_link": + $var_list_update["t"] = "inbulletin/bb_private_msg_list"; + return GetIndexURL()."?env=" . BuildEnv(); + unset($var_list_update); + break; + default: + return "Undefined:$tagname"; + break; + } + } + +} /* class clsPortalUser*/ + + +class clsUserManager extends clsItemCollection +{ + /*this class wraps common user-related functions */ + var $Page; + + function clsUserManager() + { + $this->clsItemCollection(); + $this->classname = "clsPortalUser"; + $this->SourceTable = GetTablePrefix()."PortalUser"; + $this->AdminSearchFields = array("Login","FirstName","LastName","Email","Street","City","State","Zip","Country","Phone"); + } + + function GetPageLinkList($dest_template=NULL,$link_template=NULL,$page = "") + { + global $objConfig, $m_var_list_update, $var_list_update, $var_list; + + if(!strlen($page)) + $page = GetIndexURL(); + $NumPages = $this->GetNumPages($objConfig->Get("Perpage_Topics")); + if(strlen($dest_template)>0) + { + $var_list_update["t"]=$dest_template; + } + else + { + $var_list_update["t"] = $var_list["t"]; + } + $o = ""; + if($this->Page>1) + { + $m_var_list_update["p"]=$this->Page-1; + $prev_url = $page."?env=".BuildEnv(); + } + if($this->Page<$NumPages) + { + $m_var_list_update["p"]=$this->Page+1; + $next_url = $page."?env=".BuildEnv(); + } + + for($p=1;$p<=$NumPages;$p++) + { + $t = template($link_template); + if($p!=$this->Page) + { + $m_var_list_update["p"]=$p; + $href = $page."?env=".BuildEnv(); + $t = str_replace("<%page_link%>", $href, $t); + $t = str_replace("<%page_number%>",$p,$t); + $t = str_replace("<%prev_url%>",$prev_url,$t); + $t = str_replace("<%next_url%>",$next_url,$t); + $o .= $t; + } + else + { + $o .= "$p"; + } + } + return $o; + } + + + function GetUser($ID) + { + $u = $this->GetItem($ID); + return $u; + } + + function GetUserName($Id) + { + $rs = $this->adodbConnection->Execute("SELECT Login from ".$this->SourceTable." where PortalUserId=$Id"); + return $rs->fields["Login"]; + } + + function GetUserId($Login) + { + $rs = $this->adodbConnection->Execute("SELECT PortalUserId from ".$this->SourceTable." where Login LIKE '$Login'"); + return $rs->fields["PortalUserId"]; + } + + + function GetTotalUsers() + { + return $this->UserCount("1"); + } + + + function GetLatestUser() + { + global $Errors; + + $sql = "SELECT max(CreatedOn) as LastDate FROM ".$this->SourceTable; + $result = $this->adodbConnection->Execute($sql); + if ($result === false || !is_object($result)) + { + $Errors->AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"",get_class($this),"GetLatestUser"); + return false; + } + $sql = "SELECT PortalUserId FROM ".$this->SourceTable." WHERE CreatedOn >= ".$result->fields["LastDate"]; + $result = $this->adodbConnection->Execute($sql); + if (!rs || $rs->EOF) + { + $Errors->AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"",get_class($this),"GetLatestUser"); + return false; + } + $u = $this->GetUser($result->fields["PortalUserId"]); + return $u; + } + + function &Add_User($Login, $Password, $Email, $CreatedOn, $FirstName="", $LastName="", $Status=2, + $Phone="", $Street="", $City="", $State="", $Zip="", $Country="", $dob=0, $ip="", $CheckBanned=FALSE) + { + $u = new clsPortalUser(NULL); + $u->tablename = $this->SourceTable; + //echo "Creating User..
    \n"; + $u->Set(array("Login", "Password", "FirstName", "LastName", "Email", "Status", + "Phone","Street", "City", "State", "Zip", "Country", "CreatedOn","dob"), + array($Login, $Password, $FirstName, $LastName, $Email, $Status, + $Phone, $Street, $City, $State, $Zip, $Country, $CreatedOn, $dob)); + if($CheckBanned) + { + $BrokenRule = $u->CheckBanned(); + } + + if(!$BrokenRule) + { + $u->Create(); + return $u; + + } + return $BrokenRule; + /*md5($Password)*/ + } + + function &Edit_User($UserId, $Login, $Password, $Email, $CreatedOn, $FirstName="", $LastName="", + $Status=2, $Phone="", $Street="", $City="", $State="", $Zip="", $Country="", $dob=0) + { + $u =& $this->GetItem($UserId); + + if(!$CreatedOn) + $CreatedOn = $u->Get("CreatedOn"); + +// $u->debuglevel=1; + + if (is_object($u)) + { + $IsBanned = $u->Get('IsBanned'); + if($Status == 1) $IsBanned = 0; + $u->Set(array("Login", "FirstName", "LastName", "Email", "Status", + "Phone", "Street", "City", "State", "Zip", "Country", "CreatedOn","dob","IsBanned"), + array($Login, $FirstName, $LastName, $Email, $Status, + $Phone, $Street, $City, $State, $Zip, $Country, $CreatedOn,$dob,$IsBanned)); + if(strlen($Password)) + $u->Set("Password",$Password); + $u->Update(); + } + return $u; + } + + function Delete_User($UserId) + { + $u = $this->GetItemByField("ResourceId",$UserId); + if(is_object($u)) + { + $u->RemoveFromAllGroups(); + $u->Delete(); + } + } + + + function LoadUsers($where = "",$orderBy = "") + { + global $objConfig; + + $this->Clear(); + if($this->Page<1) + $this->Page=1; + + if(is_numeric($objConfig->Get("Perpage_Users"))) + { + $Start = ($this->Page-1)*$objConfig->Get("Perpage_Users"); + $limit = "LIMIT ".$Start.",".$objConfig->Get("Perpage_Users"); + } + else + $limit = NULL; + + $where = trim($where); + $orderBy = trim($orderBy); + if(!strlen($where)) + $where = "1"; + + $this->QueryItemCount=TableCount($this->SourceTable,$where,0); + + if($this->QueryItemCount>0) + { + if ($orderBy!="") + { + $this->Query_PortalUser($where,$orderBy,$limit); + } + else + { + $this->Query_PortalUser($where,"Login DESC",$limit); + } + } + } + + function Query_PortalUser($whereClause,$orderByClause="", $limitClause="") + { + global $m_var_list,$Errors, $objSession; + + $resultSet = array(); + + $utable = $this->SourceTable; + $gtable = GetTablePrefix()."UserGroup"; + $sql = "SELECT * FROM $utable LEFT JOIN $gtable ON ($utable.PortalUserId=$gtable.PortalUserId)"; + + if(isset($whereClause)) + $sql = sprintf('%s WHERE %s',$sql,$whereClause); + + if(isset($orderByClause)) + if(strlen(trim($orderByClause))>0) + $sql = sprintf('%s ORDER BY %s',$sql,$orderByClause); + + if(isset($limitClause)) + $sql = sprintf('%s %s',$sql,$limitClause); + + return $this->Query_Item($sql); + } + + function Query_GroupPortalUser($whereClause,$orderByClause) + { + global $m_var_list,$objSession,$Errors; + + $resultSet = array(); + + + $table = $this->SourceTable; + $sql = "SELECT * FROM $table LEFT JOIN ".GetTablePrefix()."UserGroup USING (PortalUserId) "; + + if(isset($whereClause)) + $sql = sprintf('%s WHERE %s',$sql,$whereClause); + + if(isset($orderByClause)) + $sql = sprintf('%s ORDER BY %s',$sql,$orderByClause); + + return $this->query_item($sql); + } + + function UserCount($whereClause) + { + $count = TableCount($this->SourceTable,$whereClause,0); + return $count; + } + + function CountActive() + { + return $this->UserCount("Status=1"); + } + + function CountPending() + { + return $this->UserCount("Status=2"); + } + + function CountDisabled() + { + return $this->UserCount("Status=0"); + } + + function CopyFromEditTable($idfield) + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + $sql = "SELECT * FROM $edit_table"; + $rs = $this->adodbConnection->Execute($sql); + +// echo $sql."
    "; + + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $c = new $this->classname; + $c->SetFromArray($data); + $c->idfield = $idfield; + $c->Dirty(); + if($c->Get($idfield)<1) + { + $old_id = $c->Get($idfield); + $c->UnsetIdField(); + $c->Create(); + $sql = "UPDATE ".GetTablePrefix()."UserGroup SET PortalUserId=".$c->Get("PortalUserId"); + $sql .=" WHERE PortalUserId=0"; + $this->adodbConnection->Execute($sql); + } + else + $c->Update(); + unset($c); + $rs->MoveNext(); + } + @$this->adodbConnection->Execute("DROP TABLE $edit_table"); + } + + function PurgeEditTable() + { + parent::PurgeEditTable(); + $sql = "DELETE FROM ".GetTablePrefix()."UserGroup WHERE PortalUserId=0"; + $this->adodbConnection->Execute($sql); + } +} /*clsUserManager*/ +?> Index: trunk/kernel/include/adodb/drivers/adodb-vfp.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-vfp.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-vfp.inc.php (revision 13) @@ -0,0 +1,98 @@ +ADODB_odbc(); + } + + function BeginTrans() { return false;} + + // quote string to be sent back to database + function qstr($s,$nofixquotes=false) + { + if (!$nofixquotes) return "'".str_replace("\r\n","'+chr(13)+'",str_replace("'",$this->replaceQuote,$s))."'"; + return "'".$s."'"; + } + + + // TOP requires ORDER BY for VFP + function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$arg3=false,$secs2cache=0) + { + if (!preg_match('/ORDER[ \t\r\n]+BY/is',$sql)) $sql .= ' ORDER BY 1'; + return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$arg3,$secs2cache); + } + + +}; + + +class ADORecordSet_vfp extends ADORecordSet_odbc { + + var $databaseType = "vfp"; + + + function ADORecordSet_vfp($id,$mode=false) + { + return $this->ADORecordSet_odbc($id,$mode); + } + + function MetaType($t,$len=-1) + { + if (is_object($t)) { + $fieldobj = $t; + $t = $fieldobj->type; + $len = $fieldobj->max_length; + } + switch (strtoupper($t)) { + case 'C': + if ($len <= $this->blobSize) return 'C'; + case 'M': + return 'X'; + + case 'D': return 'D'; + + case 'T': return 'T'; + + case 'L': return 'L'; + + case 'I': return 'I'; + + default: return 'N'; + } + } +} + +} //define +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/msn/regular_smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/icon_warning.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_e-mail_f2.gif =================================================================== diff -u Binary files differ Index: trunk/compat/ob_get_flush.php =================================================================== diff -u --- trunk/compat/ob_get_flush.php (revision 0) +++ trunk/compat/ob_get_flush.php (revision 13) @@ -0,0 +1,49 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: ob_get_flush.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace ob_get_flush() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/ob_get_flush + * @author Aidan Lister + * @author Thiemo M�ttig (http://maettig.com/) + * @version $Revision: 1.1 $ + * @since PHP 4.3.0 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('ob_get_flush')) +{ + function ob_get_flush () + { + $contents = ob_get_contents(); + + if ($contents !== false) { + ob_end_flush(); + } + + return $contents; + } +} + +?> \ No newline at end of file Index: trunk/admin/import/status.php =================================================================== diff -u --- trunk/admin/import/status.php (revision 0) +++ trunk/admin/import/status.php (revision 13) @@ -0,0 +1,201 @@ +0) + $percent=round(($start/$total)*100); + else + $percent=0; + switch ($section) + { + case "users": + $section = "Users"; + $uservalue=$percent; + $catvalue=0; + $linksvalue=0; + $customvalue=0; + $relcatvalue=0; + break; + case "cats": + $section = "Categories"; + $uservalue=100; + $catvalue=$percent; + $linksvalue=0; + $customvalue=0; + $relcatvalue=0; + break; + case "links": + $section = "Links"; + $uservalue=100; + $catvalue=100; + $linksvalue=$percent; + $customvalue=0; + $relcatvalue=0; + break; + case "custom": + $section = "Custom Fields"; + $uservalue=100; + $catvalue=100; + $linksvalue=100; + $customvalue=$percent; + $relcatvalue=0; + break; + case "relcat": + $section = "Relative Categories"; + $uservalue=100; + $catvalue=100; + $linksvalue=100; + $customvalue=100; + $relcatvalue=$percent; + break; + case "terminate": + $section = "Complete"; + $uservalue=100; + $catvalue=100; + $linksvalue=100; + $customvalue=100; + $relcatvalue=100; + #callexit(); + break; + default: + $section = "Initializing"; + $uservalue=0; + $catvalue=0; + $linksvalue=0; + $customvalue=0; + $relcatvalue=0; + break; + } + displayheader(); + displaytablestart(); + displayrow1("Importing In-Link to In-Portal:"," "); + displayrow2("Users:",$uservalue."%"); + displayrow1("Categories:",$catvalue."%"); + displayrow2("Links (Including Reviews and Images):",$linksvalue."%"); + displayrow1("Custom Fields:",$customvalue."%"); + displayrow2("Category Relations:",$relcatvalue."%"); + displayrow1("Importing:",$section); + displaytableover(); + displaytablestart(); + displaybar($percent); + displaytableover(); + displayfooter(); + + if ($section == "Complete") { + $ado = GetADODBConnection(); + $TablePrefix = "ses_".$objSession->GetSessionKey()."_".GetTablePrefix(); + + $query="DROP TABLE IF EXISTS ".$TablePrefix."import, ".$TablePrefix."importcat"; + $ado->Execute($query); + } + } + function callexit() #In case importing is over + { + /* global $pathtoroot; + require_once ($pathtoroot."admin/import/exit.php"); + displaytablestart(); + displayrow1("Importing In-Link to In-Portal:"," "); + displayrow2("Users:",$uservalue."%"); + displayrow1("Categories:",$catvalue."%"); + displayrow2("Links (Including Reviews and Images):",$linksvalue."%"); + displayrow1("Custom Fields:",$customvalue."%"); + displayrow2("Category Relations:",$relcatvalue."%"); + displayrow1("Importing:",$section); + displaytableover(); + displaytablestart(); + displaybar($percent); + displaytableover(); + displayfooter(); +*/ + } + function displayheader() + { + global $title; + + int_header($objCatToolBar,NULL,$title); + //echo ''; + //echo ''; + //echo 'Importing In-Link to In-Portal '; + //echo ''; + //echo ''; + //echo ''; + } + function displaytablestart() + { + echo ''; + + } + function displaytableover() + { + echo "
    "; + } + function displayfooter() + { + echo ""; + echo ""; + } + function displayrow1($name,$value) + { + echo ''; + echo $name; + echo ''; + echo $value; + echo ''; + } + function displayrow2($name,$value) + { + echo ''; + echo $name; + echo ''; + echo $value; + echo ''; + } + + function displaybar($percent) + { + global $rootURL, $title; + + $o .=""; + + echo "\n"; + $o .= int_subsection_title_ret(admin_language("la_performing_import")." - ".$percent."%"); + $o .= "

    "; + $o .= " "; + $o .=" "; + $comp_pct = 100-$percent; + $o .= " "; + $o .= "
     
    "; + //$o .= "
    "; + echo $o."\n"; + echo "
    "; + +/* if ($percent == 0) + { + echo ""; + echo "$percent"; + echo "%"; + } + else if ($percent < 60) + { + echo ""; + $row2 = 100-$percent; + echo " $percent"; + echo "%"; + } + else if ($percent == 100) + { + echo "$percent%"; + } + else + { + echo "$percent%"; + $row2 = 100-$percent; + echo " "; + }*/ + } +?> \ No newline at end of file Index: trunk/admin/images/toolbar/tool_new_user.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_search_b.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_permission.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tools/sql_query.php =================================================================== diff -u --- trunk/admin/tools/sql_query.php (revision 0) +++ trunk/admin/tools/sql_query.php (revision 13) @@ -0,0 +1,140 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; + +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"); + +$envar = "env=" . BuildEnv(); +$section = 'in-portal:sql_query'; +$sec = $objSections->GetSection($section); + +$parent = $objSections->GetSection($sec->Get("parent")); + +//$title = admin_language("la_tab_QueryDB"); + +//$saveURL = $admin."/browse.php"; +$saveURL = $admin."/tools/sql_result.php"; +$ParentUrl = $parent->URL(); + +if(strlen($ParentUrl)>0) +{ + $cancelUrl = $ParentUrl; +} +else + $cancelUrl = $_SERVER['PHP_SELF']."?".$envar; + +$cancelUrl = $admin."/subitems.php?section=in-portal:tools&".$envar; + +$action = "m_sql_query"; + +$sql_query = trim($objSession->GetVariable("LastSQLquery")); + +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('sqlform','','$saveURL',1,'');","tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('sqlform','','$cancelUrl',2,'');","tool_cancel.gif"); + +int_header($objCatToolBar,NULL,$title); +?> + + + + + > + + + +> + + + + + + +
    + +  
    + \ No newline at end of file Index: trunk/admin/install/get_license.php =================================================================== diff -u --- trunk/admin/install/get_license.php (revision 0) +++ trunk/admin/install/get_license.php (revision 13) @@ -0,0 +1,46 @@ + +  Select License

    + + + + + + + +
     Step 2 - Select License
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/lang/nl.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/nl.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/nl.js (revision 13) @@ -0,0 +1,197 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * nl.js: Dutch support. + * + * Authors: + * Tuurlijk (fck@monosock.org) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Knippen" ; +lang["Copy"] = "Kopieren" ; +lang["Paste"] = "Plakken" ; +lang["PasteText"] = "Plakken als onopgemaakte tekst" ; +lang["PasteWord"] = "Plakken uit Word" ; +lang["Find"] = "Zoek" ; +lang["SelectAll"] = "Selecteer Alles" ; +lang["RemoveFormat"] = "Verwijder Opmaak" ; +lang["InsertLink"] = "Hyperlink Invoegen/Bewerken" ; +lang["RemoveLink"] = "Hyperlink Verwijderen" ; +lang["InsertImage"] = "Afbeelding Invoegen/Bewerken" ; +lang["InsertTable"] = "Tabel Invoegen/Bewerken" ; +lang["InsertLine"] = "Horizontale lijn Invoegen" ; +lang["InsertSpecialChar"] = "Speciaale Tekens" ; +lang["InsertSmiley"] = "Smiley Invoegen" ; +lang["About"] = "Over FCKeditor" ; + +lang["Bold"] = "Vet" ; +lang["Italic"] = "Cursief" ; +lang["Underline"] = "Onderstrepen" ; +lang["StrikeThrough"] = "Doorhalen" ; +lang["Subscript"] = "Subscript" ; +lang["Superscript"] = "Superscript" ; +lang["LeftJustify"] = "Links Uitlijnen" ; +lang["CenterJustify"] = "Centreren" ; +lang["RightJustify"] = "Rechts Uitlijnen" ; +lang["BlockJustify"] = "Uitvullen" ; +lang["DecreaseIndent"] = "Inspringing Verkleinen" ; +lang["IncreaseIndent"] = "Inspringing Vergroten" ; +lang["Undo"] = "Ongedaan Maken" ; +lang["Redo"] = "Opnieuw Uitvoeren" ; +lang["NumberedList"] = "Genummerde Opsomming" ; +lang["BulettedList"] = "Opsomming" ; + +lang["ShowTableBorders"] = "Toon Tabel Kaders" ; +lang["ShowDetails"] = "Toon Details" ; + +lang["FontStyle"] = "Stijl" ; +lang["FontFormat"] = "Opmaak" ; +lang["Font"] = "Lettertype" ; +lang["FontSize"] = "Grootte" ; +lang["TextColor"] = "Tekst Kleur" ; +lang["BGColor"] = "Achtergrond Kleur" ; +lang["Source"] = "Bron" ; + +// Context Menu + +lang["EditLink"] = "Bewerk Hyperlink" ; +lang["InsertRow"] = "Invoegen Rij" ; +lang["DeleteRows"] = "Verwijder Rijen" ; +lang["InsertColumn"] = "Invoegen Kolom" ; +lang["DeleteColumns"] = "Verwijder Kolommen" ; +lang["InsertCell"] = "Invoegen Cel" ; +lang["DeleteCells"] = "Verwijder Cellen" ; +lang["MergeCells"] = "Samenvoegen Cellen" ; +lang["SplitCell"] = "Splitsen Cel" ; +lang["CellProperties"] = "Cel Eigenschappen" ; +lang["TableProperties"] = "Tabel Eigenschappen" ; +lang["ImageProperties"] = "Afbeelding Eigenschappen" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Verwerking van XHTML. Even geduld aub..." ; +lang["Done"] = "Klaar" ; +lang["PasteWordConfirm"] = "De tekst die je wilt plakken lijkt te zijn opgemaakt in Word. Wil je voor het plakken de tekst opschonen?" ; +lang["NotCompatiblePaste"] = "Dit commando is beschikbaar voor Internet Explorer 5.5 of hoger. Wil je plakken zonder op te schonen?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Annuleren" ; +lang["DlgBtnClose"] = "Sluit" ; + +// Afbeelding Dialog +lang["DlgImgTitleInsert"] = "Invoegen Afbeelding" ; +lang["DlgImgTitleEdit"] = "Bewerk Afbeelding" ; +lang["DlgImgBtnUpload"] = "Stuur naar Server" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Uploaden" ; +lang["DlgImgBtnBrowse"] = "Bladeren op Server" ; +lang["DlgImgAlt"] = "Alternatieve Tekst" ; +lang["DlgImgWidth"] = "Breedte" ; +lang["DlgImgHeight"] = "Hoogte" ; +lang["DlgImgLockRatio"] = "Verhouding Vergrendelen" ; +lang["DlgBtnResetSize"] = "Originele Grootte" ; +lang["DlgImgBorder"] = "Kader" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Uitlijning" ; +lang["DlgImgAlignLeft"] = "Links" ; +lang["DlgImgAlignAbsBottom"] = "Abs Onder" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Midden" ; +lang["DlgImgAlignBaseline"] = "Baseline" ; +lang["DlgImgAlignBottom"] = "Onder" ; +lang["DlgImgAlignMiddle"] = "Midden" ; +lang["DlgImgAlignRight"] = "Rechts" ; +lang["DlgImgAlignTextTop"] = "Tekst Top" ; +lang["DlgImgAlignTop"] = "Boven" ; +lang["DlgImgPreview"] = "Voorbeeld" ; +lang["DlgImgMsgWrongExt"] = "Het spijt me, echt waar, het is alleen toegestaan de volgende bestandstypen te uploaden:\n\n" + config.ImageUploadAllowedExtensions + "\n\nBewerking afgebroken." ; +lang["DlgImgAlertSelect"] = "Please select an image to upload." ; // TODO + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; // TODO +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Uploaden" ; +lang["DlgLnkTarget"] = "Target" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Nieuw Venster (_blank)" ; +lang["DlgLnkTargetParent"] = "Parent Venster (_parent)" ; +lang["DlgLnkTargetSelf"] = "Zelfde Venster (_self)" ; +lang["DlgLnkTargetTop"] = "Bovenste Venster (_top)" ; +lang["DlgLnkTitle"] = "Titel" ; +lang["DlgLnkBtnUpload"] = "Stuur naar Server" ; +lang["DlgLnkBtnBrowse"] = "Bladeren op Server" ; +lang["DlgLnkMsgWrongExtA"] = "Het spijt me, echt waar, het is alleen toegestaan de volgende bestandstypen te uploaden:\n\n" + config.LinkUploadAllowedExtensions + "\n\nBewerking afgebroken." ; +lang["DlgLnkMsgWrongExtD"] = "Het spijt me, echt waar, het is niet toegestaan de volgende bestandstypen te uploaden:\n\n" + config.LinkUploadDeniedExtensions + "\n\nBewerking afgebroken." ; + +// Kleur Dialog +lang["DlgColorTitle"] = "Kies Kleur" ; +lang["DlgColorBtnClear"] = "Wis" ; +lang["DlgColorHighlight"] = "Kies" ; +lang["DlgColorSelected"] = "Geselecteerd" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Smiley Invoegen" ; + +// Speciaal Karakter Dialog +lang["DlgSpecialCharTitle"] = "Speciaal Karakter Invoegen" ; + +// Tabel Dialog +lang["DlgTableTitleInsert"] = "Invoegen Tabel" ; +lang["DlgTableTitleEdit"] = "Bewerk Tabel" ; +lang["DlgTableRows"] = "Rijen" ; +lang["DlgTableColumns"] = "Kolommen" ; +lang["DlgTableBorder"] = "Kader" ; +lang["DlgTableAlign"] = "Uitlijning" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Links" ; +lang["DlgTableAlignCenter"] = "Centreren" ; +lang["DlgTableAlignRight"] = "Rechts" ; +lang["DlgTableWidth"] = "Breedte" ; +lang["DlgTableWidthPx"] = "pixels" ; +lang["DlgTableWidthPc"] = "procent" ; +lang["DlgTableHeight"] = "Hoogte" ; +lang["DlgTableCellSpace"] = "Cel tussenruimte" ; +lang["DlgTableCellPad"] = "Cel padding" ; +lang["DlgTableCaption"] = "Kopregel" ; + +// Tabel Cel Dialog +lang["DlgCellTitle"] = "Cel Eigenschappen" ; +lang["DlgCellWidth"] = "Breedte" ; +lang["DlgCellWidthPx"] = "pixels" ; +lang["DlgCellWidthPc"] = "procent" ; +lang["DlgCellHeight"] = "Hoogte" ; +lang["DlgCellWordWrap"] = "Automatische Terugloop" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Ja" ; +lang["DlgCellWordWrapNo"] = "Nee" ; +lang["DlgCellHorAlign"] = "Horizontale Uitlijning" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Links" ; +lang["DlgCellHorAlignCenter"] = "Centreren" ; +lang["DlgCellHorAlignRight"] = "Rechts" ; +lang["DlgCellVerAlign"] = "Verticale Uitlijning" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Boven" ; +lang["DlgCellVerAlignMiddle"] = "Midden" ; +lang["DlgCellVerAlignBottom"] = "Beneden" ; +lang["DlgCellVerAlignBaseline"] = "Baseline" ; +lang["DlgCellRowSpan"] = "Rij Bereik" ; +lang["DlgCellCollSpan"] = "Kolomm Bereik" ; +lang["DlgCellBackColor"] = "Achtergrond Kleur" ; +lang["DlgCellBorderColor"] = "Kader Kleur" ; +lang["DlgCellBtnSelect"] = "Kies..." ; + +// About Dialog +lang["DlgAboutVersion"] = "versie" ; +lang["DlgAboutLicense"] = "Licentie: GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "Voor meer informatie" ; Index: trunk/admin/install/restore_run.php =================================================================== diff -u --- trunk/admin/install/restore_run.php (revision 0) +++ trunk/admin/install/restore_run.php (revision 13) @@ -0,0 +1,128 @@ +0) + { + $pct=round(($myprogress/ $totalnum)*100); + } + else + $pct = 100; + + $o .=' "; +} + +function reload($url) +{ + print ""; + //echo "Next "; +} + +$TotalSize = filesize($backupfile); + +$MaxLines = 200; + +$PageTitle = "Restore In Progress"; +$CancelURL = $rootURL ."admin/install.php"; + +stats($PageTitle,$FileOffset,$TotalSize); + +if($FileOffset < $TotalSize) +{ + $FileOffset = RunRestoreFile($ado,$backupfile,$FileOffset,$MaxLines); + if($FileOffset>-1) + { + if ($_POST['next_step']) { + $next_step = $_POST['next_step']; + } + else if ($_GET['next_step']) { + $next_step = $_GET['next_step']; + } + //$next_step--; + if($FileOffset ==0) + $FileOffset = $TotalSize; + $backupfile = SuperStrip($backupfile); + $url = $_SERVER['PHP_SELF']."?Offset=$FileOffset&File=$backupfile&state=restore_run&next_step=$next_step&install_type=$install_type&show_prev=1"; + } + else + { + switch($FileOffset) + { + case -1: + $error = prompt_language("la_restore_file_error"); + break; + case -2: + $error = prompt_language("la_restore_read_error"); + break; + default: + $error = "(".$FileOffset.") ".prompt_language("la_restore_unknown_error"); + break; + } + echo $error; + die(); + } +} +else { + if ($_POST['next_step']) { + $next_step = $_POST['next_step']; + } + else if ($_GET['next_step']) { + $next_step = $_GET['next_step']; + } + + $url = $_SERVER['PHP_SELF']."?state=finish&next_step=$next_step&install_type=$install_type"; +} + +reload($url); + +?> + Index: trunk/admin/images/box.gif =================================================================== diff -u Binary files differ Index: trunk/compat.php =================================================================== diff -u --- trunk/compat.php (revision 0) +++ trunk/compat.php (revision 13) @@ -0,0 +1,18 @@ + \ No newline at end of file Index: trunk/admin/images/menu_dot.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/css/fck_editorarea.php =================================================================== diff -u --- trunk/admin/editor/FCKeditor/css/fck_editorarea.php (revision 0) +++ trunk/admin/editor/FCKeditor/css/fck_editorarea.php (revision 13) @@ -0,0 +1,100 @@ +Get("Site_Path"); +if(!is_object($CurrentTheme)) +{ + $CurrentTheme = $objThemes->GetItem($m_var_list["theme"]); + $theme = $CurrentTheme->Get("Name"); +} +if(is_object($CurrentTheme)) +{ + +} +else +{ + $theme = "default"; +} +$csspath .= $theme."/incs/style.css"; +//echo "Reading $csspath
    \n"; + +if(file_exists($csspath)) +{ + readfile($csspath); +} + +?> \ No newline at end of file Index: trunk/admin/icons/icon46_mailinglist.gif =================================================================== diff -u Binary files differ Index: trunk/compat/array_udiff.php =================================================================== diff -u --- trunk/compat/array_udiff.php (revision 0) +++ trunk/compat/array_udiff.php (revision 13) @@ -0,0 +1,84 @@ + | +// | Aidan Lister | +// +----------------------------------------------------------------------+ +// +// $Id: array_udiff.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace array_udiff() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.array_udiff + * @author Stephan Schmidt + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('array_udiff')) +{ + function array_udiff () + { + $args = func_get_args(); + + if (count($args) < 3) { + trigger_error('Wrong parameter count for array_udiff()', E_USER_WARNING); + return null; + } + + // Get compare function + $compare_func = array_pop($args); + if (!is_callable($compare_func)) { + if (is_array($compare_func)) { + $compare_func = $compare_func[0] . '::' . $compare_func[1]; + } + trigger_error('array_udiff() Not a valid callback ' . $compare_func, E_USER_WARNING); + return null; + } + + // Check arrays + $cnt = count($args); + for ($i = 0; $i < $cnt; $i++) { + if (!is_array($args[$i])) { + trigger_error('array_udiff() Argument #' . ($i + 1). ' is not an array', E_USER_WARNING); + return null; + } + } + + $diff = array (); + // Traverse values of the first array + foreach ($args[0] as $key => $value) { + // Check all arrays + for ($i = 1; $i < $cnt; $i++) { + foreach ($args[$i] as $cmp_value) { + $result = call_user_func($compare_func, $value, $cmp_value); + if ($result === 0) { + continue 3; + } + } + } + $diff[$key] = $value; + } + return $diff; + } +} + +?> \ No newline at end of file Index: trunk/admin/images/toolbar/tool_primary_user_group_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_hot.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/tab_left.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_cat_settings.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_banlist.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/profile.tpl =================================================================== diff -u --- trunk/themes/default/profile.tpl (revision 0) +++ trunk/themes/default/profile.tpl (revision 13) @@ -0,0 +1,102 @@ + + + + +
    + + + + + + + + + + + + + + + + + +
    Login / E-mail:
    Password:
    Forgot password


    +
    + + + + + + + +
    +
    +  '.$caption.'

    + + + + + + + +
     Step 2 - '.$caption."-".$pct.'%
    + + + + + + +
    Next Category 
    + + + + + "; + + //$o .= ""; + //$o .= "
    '; + + echo "\n"; + + $o .= " + +

    + + "; + $comp_pct = 100-$pct; + $o .= " "; + $o .= "
     

    +

    "; + //$o .= " "; + //$o .=" "; + //$comp_pct = 100-$pct; + //$o .= " "; + //$o .= "
     
    "; + //$o .= "
    "; + echo $o."\n"; + //echo "
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

      + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + +

    + +
    + + + + +
    + + + + + +

    +
    + + + + + +
    + +
    + +
    +

    +
    + + + + Index: trunk/admin/editor/FCKeditor/images/smiley/msn/heart.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/logout.png =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_user_group.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/advsearch/advsearch_type.tpl =================================================================== diff -u --- trunk/themes/default/advsearch/advsearch_type.tpl (revision 0) +++ trunk/themes/default/advsearch/advsearch_type.tpl (revision 13) @@ -0,0 +1,34 @@ +
    "> + + + + + + + + + + + + + + + + + + + + + + + +

    * +
    +
     
    + " class="button"> + " class="button"> +


    + +
    \ No newline at end of file Index: trunk/admin/images/itemicons/icon16_cat_disabled.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_rule_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/fckeditor.cfm =================================================================== diff -u --- trunk/admin/editor/FCKeditor/fckeditor.cfm (revision 0) +++ trunk/admin/editor/FCKeditor/fckeditor.cfm (revision 13) @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: trunk/kernel/admin/include/toolbar/edituser_items.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/edituser_items.php (revision 0) +++ trunk/kernel/admin/include/toolbar/edituser_items.php (revision 13) @@ -0,0 +1,315 @@ +NumItems(); $i++) +{ + if($objItemTypes->Items[$i]->Get("PrimaryItem")=="1") + $Item_AllValue += pow(2,++$NumItems); +} + +$ItemView = $objConfig->Get("UserItem_View"); +if(!is_numeric($ItemView)) +{ + $ItemView = $Item_AllValue; +} +else +{ + $Bit = 1; + $index = 1; + for($i=1;$i<=$objItemTypes->NumItems(); $i++) + { + if($objItemTypes->Items[$i-1]->Get("PrimaryItem")=="1") + { + if($ItemView & $Bit) + { + $Filters[] = "ItemType=".$objItemTypes->Items[$i-1]->Get("ItemType"); + } + $index++; + $Bit = pow(2,$index); + } + } + + if(count($Filters)) + { + $itemFilter = implode(" OR ",$Filters); + } + else + $itemFilter = "ImageType = -1"; +} + +$SortField = $objConfig->Get("UserItem_LV_Sortfield"); +if(!strlen($SortField)) + $SortField = "ItemType"; + +$SortOrder = $objConfig->Get("UserItem_LV_Sortorder"); +if(!strlen($SortOrder)) + $SortOrder = "desc"; + +$Perpage_Items = (int)$objConfig->Get("Perpage_Items"); +if(!$Perpage_Items) + $Perpage_Items = 20; + +$lang_Alt = language("la_prompt_AltName"); +$lang_Types = language("la_Text_Types"); +$lang_Type = language("la_Text_Type"); +$lang_Items = language("la_Text_Items"); + +print<< + + + +END; +?> Index: trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/browsefile.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/browsefile.html (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/browsefile.html (revision 13) @@ -0,0 +1,54 @@ + + + + FCKeditor - Image Browser + + + + + + + + + +
    + Select a file to link
    +
    +
    + + + + + + + + + + +
    EditorSample.doc132 kb
    ThisIsAPresentation.ppt532 kb
    Test.doc1.231 kb
    MyFile.doc82 kb
    Anothersample.txt4.532 kb
    LastReport.xsl49 kb
    LastRelease.html783 kb
    LastFile.ppt632 kb
    License.txt2.432 kb
    +
    + + Index: trunk/themes/default/img/ic_folder.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_tool_backup.gif =================================================================== diff -u Binary files differ Index: trunk/admin/include/subitems/listitems.js =================================================================== diff -u --- trunk/admin/include/subitems/listitems.js (revision 0) +++ trunk/admin/include/subitems/listitems.js (revision 13) @@ -0,0 +1,28 @@ +var liClassName = "liTR"; +var liClassNameO = "liTRO"; + +function initListItems() +{ + var TRs = document.getElementsByTagName("TR"); + var numLIsFound = 0; + for (var i = 0; i < TRs.length; i++) + if (TRs[i].getAttribute("isListItem")) + { + TRs[i].className = liClassName + (numLIsFound % 2); + TRs[i].oriClassName = liClassName + (numLIsFound % 2); + //TRs[i].onmouseover = function() { this.className = liClassNameO; } + //TRs[i].onmouseout = function() { this.className = this.oriClassName; } + var As = TRs[i].getElementsByTagName("A"); + if (As.length < 1) continue; + var IMGs = TRs[i].getElementsByTagName("IMG"); + if (IMGs.length < 1) continue; + IMGs[0].className = "imgButton"; + IMGs[0].a = As[0]; + + IMGs[0].onclick = function() + { + document.location = this.a.getAttribute("href"); + } + numLIsFound++; + } +} \ No newline at end of file Index: trunk/admin/browse/checkboxes_002.css =================================================================== diff -u --- trunk/admin/browse/checkboxes_002.css (revision 0) +++ trunk/admin/browse/checkboxes_002.css (revision 13) @@ -0,0 +1,3 @@ +.unselectedContainer {} +.selectedContainer {background-color:#C6D6EF} + Index: trunk/themes/default/img/bgr_post2.jpg =================================================================== diff -u Binary files differ Index: trunk/themes/default/forgotpw_confirm.tpl =================================================================== diff -u --- trunk/themes/default/forgotpw_confirm.tpl (revision 0) +++ trunk/themes/default/forgotpw_confirm.tpl (revision 13) @@ -0,0 +1,118 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

      + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + + + +

    +
    + + "> + + + + + + + + + + + + + + + + + + + + + +



     
    +

    +

    +



    +
    + "> + " class="button"> + +
    +
    + + +

    + + +
    +
    + + + Index: trunk/kernel/include/category.php =================================================================== diff -u --- trunk/kernel/include/category.php (revision 0) +++ trunk/kernel/include/category.php (revision 13) @@ -0,0 +1,2288 @@ +clsItem(TRUE); + //$this->adodbConnection = GetADODBConnection(); + $this->tablename = GetTablePrefix()."Category"; + $this->type=1; + $this->BasePermission ="CATEGORY"; + $this->id_field = "CategoryId"; + $this->TagPrefix = "cat"; + + $this->debuglevel=0; + /* keyword highlighting */ + $this->OpenTagVar = "Category_Highlight_OpenTag"; + $this->CloseTagVar = "Category_Highlight_CloseTag"; + + if($CategoryId!=NULL) + { + $this->LoadFromDatabase($CategoryId); + $this->Permissions = new clsPermList($CategoryId,$objSession->Get("GroupId")); + + } + else + { + $this->Permissions = new clsPermList(); + + } + } + + function ClearCacheData() + { + $env = "':m".$this->Get("CategoryId")."%'"; + DeleteTagCache("m_itemcount","Category%"); + DeleteTagCache("m_list_cats","",$env); + } + + + function Delete() + { + global $CatDeleteList; + + if(!is_array($CatDeleteList)) + $CatDeleteList = array(); + if($this->UsingTempTable()==FALSE) + { + $this->Permissions->Delete_CatPerms($this->Get("CategoryId")); + $sql = "DELETE FROM ".GetTablePrefix()."CountCache WHERE CategoryId=".$this->Get("CategoryId"); + $this->adodbConnection->Execute($sql); + $CatDeleteList[] = $this->Get("CategoryId"); + if($this->Get("CreatedById")>0) + $this->SendUserEventMail("CATEGORY.DELETE",$this->Get("CreatedById")); + $this->SendAdminEventMail("CATEGORY.DELETE"); + + parent::Delete(); + $this->ClearCacheData(); + } + else + { + parent::Delete(); + } + } + + + function Update($UpdatedBy=NULL) + { + parent::Update($UpdatedBy); + if($this->tablename==GetTablePrefix()."Category") + $this->ClearCacheData(); + } + + function Create() + { + if((int)$this->Get("CreatedOn")==0) + $this->Set("CreatedOn",date("U")); + parent::Create(); + if($this->tablename==GetTablePrefix()."Category") + $this->ClearCacheData(); + } + + function SetParentId($value) + { + //Before we set a parent verify that propsed parent is not our child. + //Otherwise it will cause recursion. + + $id = $this->Get("CategoryId"); + $path = $this->Get("ParentPath"); + $sql = sprintf("SELECT CategoryId From ".GetTablePrefix()."Category WHERE ParentPath LIKE '$path%' AND CategoryId = %d ORDER BY ParentPath",$value); + $rs = $this->adodbConnection->SelectLimit($sql,1,0); + if(!$rs->EOF) + { + return; + } + $this->Set("ParentId",$value); + } + + function Approve() + { + global $objSession; + + if($this->Get("CreatedById")>0) + $this->SendUserEventMail("CATEGORY.APPROVE",$this->Get("CreatedById")); + $this->SendAdminEventMail("CATEGORY.APPROVE"); + $this->Set("Status", 1); + $this->Update(); + } + + function Deny() + { + global $objSession; + + if($this->Get("CreatedById")>0) + $this->SendUserEventMail("CATEGORY.DENY",$this->Get("CreatedById")); + $this->SendAdminEventMail("CATEGORY.DENY"); + + $this->Set("Status", 0); + $this->Update(); + } + + + function IsEditorsPick() + { + return $this->Is("EditorsPick"); + } + + function SetEditorsPick($value) + { + $this->Set("EditorsPick", $value); + } + + function GetSubCats($limit=NULL, $target_template=NULL, $separator=NULL, $anchor=NULL, $ending=NULL, $class=NULL) + { + global $m_var_list, $m_var_list_update, $var_list, $var_list_update; + + $sql = "SELECT CategoryId, Name from ".GetTablePrefix()."Category where ParentId=".$this->Get("CategoryId")." AND Status=1 ORDER BY Priority"; + if(isset($limit)) + { + $rs = $this->adodbConnection->SelectLimit($sql, $limit, 0); + } + else + { + $rs = $this->adodbConnection->Execute($sql); + } + $count=1; + + $class_name = is_null($class)? "catsub" : $class; + + + while($rs && !$rs->EOF) + { + + if(!is_null($target_template)) + { + $var_list_update["t"] = $target_template; + } + $m_var_list_update["cat"] = $rs->fields["CategoryId"]; + $m_var_list_update["p"] = "1"; + $cat_name = $rs->fields['Name']; + if (!is_null($anchor)) + $ret .= "$cat_name"; + else + $ret .= "$cat_name"; + + $rs->MoveNext(); + if(!$rs->EOF) + { + $ret.= is_null($separator)? ", " : $separator; + } + } + if(strlen($ret)) + $ret .= is_null($ending)? " ..." : $ending; + + unset($var_list_update["t"], $m_var_list_update["cat"], $m_var_list_update["p"]); + + return $ret; + } + + function Validate() + { + global $objSession; + + $dataValid = true; + if(!isset($this->m_Type)) + { + $Errors->AddError("error.fieldIsRequired",'Type',"","","clsCategory","Validate"); + $dataValid = false; + } + + if(!isset($this->m_Name)) + { + $Errors->AddError("error.fieldIsRequired",'Name',"","","clsCategory","Validate"); + $dataValid = false; + } + + if(!isset($this->m_Description)) + { + $Errors->AddError("error.fieldIsRequired",'Description',"","","clsCategory","Validate"); + $dataValid = false; + } + + if(!isset($this->m_Visible)) + { + $Errors->AddError("error.fieldIsRequired",'Visible',"","","clsCategory","Validate"); + $dataValid = false; + } + + if(!isset($this->m_CreatedById)) + { + $Errors->AddError("error.fieldIsRequired",'CreatedBy',"","","clsCategory","Validate"); + $dataValid = false; + } + return $dataValid; + } + + function UpdateCachedPath() + { + if($this->UsingTempTable()==TRUE) + return; + $Id = $this->Get("CategoryId"); + $Id2 = $Id; + $NavPath = ""; + $path = array(); + do + { + $rs = $this->adodbConnection->Execute("SELECT ParentId,Name from ".$this->tablename." where CategoryId='$Id2'"); + $path[] = $Id2; + $nav[] = $rs->fields["Name"]; + if ($rs && !$rs->EOF) + { + //echo $path; + $Id2 = $rs->fields["ParentId"]; + + } + else + $Id2="0"; //to prevent infinite loop + } while ($Id2 != "0"); + $parentpath = "|".implode("|",array_reverse($path))."|"; + $NavBar = implode(">",array_reverse($nav)); + //echo "
    \n"; + //$rs = $this->adodbConnection->Execute("update Category set ParentPath='$path' where CategoryId='$Id'"); + if($this->Get("ParentPath")!=$parentpath || $this->Get("CachedNavbar")!=$NavBar) + { + $this->Set("ParentPath",$parentpath); + $this->Set("CachedNavbar",$NavBar); + $this->Update(); + } + } + + function GetCachedNavBar() + { + $res = $this->Get("CachedNavbar"); + if(!strlen($res)) + { + $this->UpdateCachedPath(); + $res = $this->Get("CachedNavbar"); + } + return $res; + } + function Increment_Count() + { + $this->Increment("CachedDescendantCatsQty"); + } + + function Decrement_Count() + { + $this->Decrement("CachedDescendantCatsQty"); + $this->Update(); + } + + function LoadFromDatabase($Id) + { + global $objSession, $Errors, $objConfig; + if($Id==0) + return FALSE; + + 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 CategoryId = '%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; + if(is_array($data)) + { + $this->SetFromArray($data); + $this->Clean(); + } + else + return false; + return true; + } + + function SetNewItem() + { + global $objConfig; + + $value = $this->Get("CreatedOn"); + + $cutoff = adodb_date("U") - ($objConfig->Get("Category_DaysNew") * 86400); + $this->IsNew = FALSE; + if($value>$cutoff) + $this->IsNew = TRUE; + return $this->IsNew; + } + + + function LoadFromResourceId($Id) + { + global $objSession, $Errors; + if(!isset($Id)) + { + $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromResourceId"); + return false; + } + $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ResourceId = '%s'",$Id); + $result = $this->adodbConnection->Execute($sql); + if ($result === false) + { + $Errors->AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromResourceId"); + return false; + } + $data = $result->fields; + if(is_array($data)) + $this->SetFromArray($data); + else + return false; + return true; + } + + function GetParentField($fieldname,$skipvalue,$default) + { + /* this function moves up the category tree until a value for $field other than + $skipvalue is returned. if no matches are made, then $default is returned */ + + $path = $this->Get("ParentPath"); + $path = substr($path,1,-1); //strip off the first & last tokens + $aPath = explode("|",$path); + $aPath = array_slice($aPath,0,-1); + $ParentPath = implode("|",$aPath); + $sql = "SELECT $fieldname FROM category WHERE $fieldname != '$skipvalue' AND ParentPath LIKE '$ParentPath' ORDER BY ParentPath DESC"; + $rs = $this->adodbConnection->execute($sql); + if($rs && !$rs->EOF) + { + $ret = $rs->fields[$fieldname]; + } + else + $ret = $default; + $update = "UPDATE ".$this->SourceTable." SET $fieldname='$ret' WHERE CategoryId=".$this->Get("CategoryId"); + $this->adodbConnection->execute($update); + return $ret; + } + + + + function GetCustomField($fieldName) + { + global $objSession, $Errors; + + if(!isset($this->m_CategoryId)) + { + $Errors->AddError("error.appError","Get field is required in order to set custom field values","","",get_class($this),"GetCustomField"); + return false; + } + + return GetCustomFieldValue($this->m_CategoryId,"category",$fieldName); + } + + function SetCustomField($fieldName, $value) + { + global $objSession, $Errors; + + if(!isset($this->m_CategoryId)) + { + $Errors->AddError("error.appError","Set field is required in order to set custom field values","","",get_class($this),"SetCustomField"); + return false; + } + return SetCustomFieldValue($this->m_CategoryId,"category",$fieldName,$value); + } + + function LoadPermissions($first=1) + { + /* load all permissions for group on this category */ + $this->Permissions->CatId=$this->Get("CategoryId"); + if($this->Permissions->NumItems()==0) + { + $cats = explode("|",substr($this->Get("ParentPath"),1,-1)); + if(is_array($cats)) + { + $cats = array_reverse($cats); + $cats[] = 0; + foreach($cats as $catid) + { + $this->Permissions->LoadCategory($catid); + } + } + } + if($this->Permissions->NumItems()==0) + { + if($first==1) + { + $this->Permissions->GroupId=NULL; + $this->LoadPermissions(0); + } + } + } + + function PermissionObject() + { + return $this->Permissions; + } + + function PermissionItemObject($PermissionName) + { + $p = $this->Permissions->GetPermByName($PermissionName); + return $p; + } + + function HasPermission($PermissionName,$GroupID) + { + global $objSession; + + $perm = $this->PermissionValue($PermissionName,$GroupID); +// echo "Permission $PermissionName for $GroupID is $perm in ".$this->Get("CategoryId")."
    \n"; + if(!$perm) + { + $perm=$objSession->HasSystemPermission("ROOT"); + } + return ($perm==1); + } + + function PermissionValue($PermissionName,$GroupID) + { + //$this->LoadPermissions(); + $ret=NULL; + //echo "Looping though ".count($this->Permissions)." permissions Looking for $PermissionName of $GroupID
    \n"; + if($this->Permissions->GroupId != $GroupID) + { + $this->Permissions->Clear(); + $this->Permissions->GroupId = $GroupID; + } + + $this->Permissions->CatId=$this->Get("CategoryId"); + $ret = $this->Permissions->GetPermissionValue($PermissionName); + if($ret == NULL) + { + $cats = explode("|",substr($this->Get("ParentPath"),1,-1)); + + if(is_array($cats)) + { + $cats = array_reverse($cats); + $cats[] = 0; + foreach($cats as $catid) + { + $this->Permissions->LoadCategory($catid); + $ret = $this->Permissions->GetPermissionValue($PermissionName); + if(is_numeric($ret)) + break; + } + } + } + return $ret; + } + + function SetPermission($PermName,$GroupID,$Value,$Type=0) + { + global $objSession, $objPermissions, $objGroups; + + if($this->Permissions->GroupId != $GroupID) + { + $this->Permissions->Clear(); + $this->Permissions->GroupId = $GroupID; + } + + if($objSession->HasSystemPermission("GRANT")) + { + $current = $this->PermissionValue($PermName,$GroupID); + + if($current == NULL) + { + $this->Permissions->Add_Permission($this->Get("CategoryId"),$GroupId,$PermName,$Value,$Type); + } + else + { + $p = $this->Permissions->GetPermByName($PermName); + if($p->Inherited==FALSE) + { + $p->Set("PermissionValue",$Value); + $p->Update(); + } + else + $this->Permissions->Add_Permission($this->Get("CategoryId"),$GroupId,$PermName,$Value,$Type); + } + if($PermName == "CATEGORY.VIEW") + { + $Groups = $objGroups->GetAllGroupList(); + $ViewList = $this->Permissions->GetGroupPermList($this,"CATEGORY.VIEW",$Groups); + $this->SetViewPerms("CATEGORY.VIEW",$ViewList,$Groups); + $this->Update(); + } + } + } + + function SetViewPerms($PermName,$acl,$allgroups) + { + global $objPermCache; + + $dacl = array(); + if(!is_array($allgroups)) + { + global $objGroups; + $allgroups = $objGroups->GetAllGroupList(); + } + + for($i=0;$iPermissions->GetPermId($PermName); + $pc = $objPermCache->GetPerm($this->Get("CategoryId"),$PermId); + if(is_object($pc)) + { + $pc->Set("ACL",$aval); + $pc->Set("DACL",$dval); + $pc->Update(); + } + else + $objPermCache->AddPermCache($this->Get("CategoryId"),$PermId,$aval,$dval); + + //$this->Update(); + } + + function GetACL($PermName) + { + global $objPermCache; + + $ret = ""; + $PermId = $this->Permissions->GetPermId($PermName); + $pc = $objPermCache->GetPerm($this->Get("CategoryId"),$PermId); + if(is_object($pc)) + { + $ret = $this->Get("ACL"); + } + return $ret; + } + + + function UpdateACL() + { + global $objGroups, $objPermCache; + + $glist = $objGroups->GetAllGroupList(); + + $ViewList = $this->Permissions->GetGroupPermList($this,"CATEGORY.VIEW",$glist); + $perms = $this->Permissions->GetAllViewPermGroups($this,$glist); + //echo "
    ";print_r($perms); echo "
    "; + foreach($perms as $PermName => $l) + { + $this->SetViewPerms($PermName,$l,$glist); + } + } + + function Cat_Link() + { + global $m_var_list_update; + + $m_var_list_update["cat"] = $this->Get("CategoryId"); + $ret = GetIndexURL()."?env=".BuildEnv(); + unset($m_var_list_update["cat"]); + return $ret; + } + + function Parent_Link() + { + global $m_var_list_update; + + $m_var_list_update["cat"] = $this->Get("ParentId"); + $ret = GetIndexURL()."?env=".BuildEnv(); + unset($m_var_list_update["cat"]); + return $ret; + } + + function Admin_Parent_Link($page=NULL) + { + global $m_var_list_update; + + if(!strlen($page)) + $page = $_SERVER["PHP_SELF"]; + $m_var_list_update["cat"] = $this->Get("ParentId"); + $ret = $page."?env=".BuildEnv(); + unset($m_var_list_update["cat"]); + return $ret; + } + + function StatusIcon() + { + global $imagesURL; + + $ret = $imagesURL."/itemicons/"; + + switch($this->Get("Status")) + { + case STATUS_DISABLED: + $ret .= "icon16_cat_disabled.gif"; + break; + case STATUS_PENDING: + $ret .= "icon16_cat_pending.gif"; + break; + case STATUS_ACTIVE: + $img = "icon16_cat.gif"; + if($this->IsPopItem()) + $img = "icon16_cat_pop.gif"; + if($this->IsHotItem()) + $img = "icon16_cat_hot.gif"; + if($this->IsNewItem()) + $img = "icon16_cat_new.gif"; + if($this->Is("EditorsPick")) + $img = "icon16_car_pick.gif"; + $ret .= $img; + break; + } + return $ret; + } + + function SubCatCount() + { + $ret = $this->Get("CachedDescendantCatsQty"); + + $sql = "SELECT COUNT(*) as SubCount FROM ".$this->tablename." WHERE ParentPath LIKE '".$this->Get("ParentPath")."%' AND CategoryId !=".$this->Get("CategoryId"); + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $val = $rs->fields["SubCount"]; + if($val != $this->Get("CachedDescendantCatsQty")) + { + $this->Set("CachedDescendantCatsQty",$val); + $this->Update(); + } + $ret = $this->Get("CachedDescendantCatsQty"); + } + return $ret; + } + + function GetSubCatIds() + { + $sql = "SELECT CategoryId FROM ".$this->tablename." WHERE ParentPath LIKE '".$this->Get("ParentPath")."%' AND CategoryId !=".$this->Get("CategoryId"); + $rs = $this->adodbConnection->Execute($sql); + $ret = array(); + while($rs && !$rs->EOF) + { + $ret[] = $rs->fields["CategoryId"]; + $rs->MoveNext(); + } + return $ret; + } + + function GetParentIds() + { + $Parents = array(); + $ParentPath = $this->Get("ParentPath"); + if(strlen($ParentPath)) + { + $ParentPath = substr($ParentPath,1,-1); + $Parents = explode("|",$ParentPath); + } + return $Parents; + } + + function ItemCount($ItemType="") + { + global $objItemTypes,$objCatList,$objCountCache; + + if(!is_numeric($ItemType)) + { + $TypeId = $objItemTypes->GetItemTypeValue($ItemType); + } + else + $TypeId = (int)$ItemType; + + //$path = $this->Get("ParentPath"); + //$path = substr($path,1,-1); + //$path = str_replace("|",",",$path); + $path = implode(",",$this->GetSubCatIds()); + if(strlen($path)) + { + $path = $this->Get("CategoryId").",".$path; + } + else + $path = $this->Get("CategoryId"); + + $res = TableCount(GetTablePrefix()."CategoryItems","CategoryId IN ($path)",FALSE); + + return $res; + } + + function ParseObject($element) + { + global $objConfig, $objCatList, $rootURL, $var_list, $var_list_update, $m_var_list_update, $objItemTypes,$objCountCache; + $extra_attribs = ExtraAttributes($element->attributes); + + //print_r($element); + if(strtolower($element->name)==$this->TagPrefix) + { + $field = strtolower( $element->GetAttributeByName('_field') ); + switch($field) + { + case "name": + /* + @field:cat.name + @description:Category name + */ + $ret = $this->HighlightField("Name"); + break; + case "description": + /* + @field:cat.description + @description:Category Description + */ + $ret = inp_unescape($this->Get("Description")); + $ret = $this->HighlightText($ret); + break; + case "cachednavbar": + /* + @field:cat.cachednavbar + @description: Category cached navbar + */ + $ret = $this->HighlightField("CachedNavbar"); + if(!strlen($ret)) + { + $this->UpdateCachedPath(); + $ret = $this->HighlightField("CachedNavbar"); + } + break; + case "image": + /* + @field:cat.image + @description:Return an image associated with the category + @attrib:_default:bool:If true, will return the default image if the requested image does not exist + @attrib:_name::Return the image with this name + @attrib:_thumbnail:bool:If true, return the thumbnail version of the image + @attrib:_imagetag:bool:If true, returns a complete image tag. exta html attributes are passed to the image tag + */ + $default = $element->GetAttributeByName('_primary'); + $name = $element->GetAttributeByName('_name'); + if(strlen($name)) + { + $img = $this->GetImageByName($name); + } + else + { + if($default) + $img = $this->GetDefaultImage(); + } + if($img) + { + if( $element->GetAttributeByName('_thumbnail') ) + { + $url = $img->parsetag("thumb_url"); + } + else + $url = $img->parsetag("image_url"); + + } + else + { + $url = $element->GetAttributeByName('_defaulturl'); + } + + if( $element->GetAttributeByName('_imagetag') ) + { + if(strlen($url)) + { + $ret = ""; + } + else + $ret = ""; + } + else + $ret = $url; + break; + case "createdby": + /* + @field:cat.createdby + @description:parse a user field of the user that created the category + @attrib:_usertag::User field to return (defaults to login ID) + */ + $field = $element->GetAttributeByName('_usertag'); + if(!strlen($field)) + { + $field = "user_login"; + } + $u = $objUsers->GetUser($this->Get("CreatedById")); + $ret = $u->parsetag($field); + break; + case "custom": + /* + @field:cat.custom + @description:Returns a custom field + @attrib:_customfield::field name to return + @attrib:_default::default value + */ + $field = $element->GetAttributeByName('_customfield'); + $default = $element->GetAttributeByName('_default'); + $ret = $this->GetCustomFieldValue($field,$default); + break; + + case "catsubcats": + /* + @field:cat.catsubcats + @description:Returns a list of subcats of current category + @attrib:_limit:int:Number of categories to return + @attrib:_separator::Separator between categories + @attrib:_anchor:bool:Make an anchor (only if template is not specified) + @attrib:_TargetTemplate:tpl:Target template + @attrib:_Ending::Add special text at the end of subcategory list + @attrib:_Class::Specify stly sheet class for anchors (if used) or "span" object + */ + $limit = ((int)$element->attributes["_limit"]>0)? $element->attributes["_limit"] : NULL; + $separator = $element->attributes["_separator"]; + $anchor = (int)($element->attributes["_anchor"])? 1 : NULL; + $template = strlen($element->attributes["_TargetTemplate"])? $element->attributes["_TargetTemplate"] : NULL; + $ending = strlen($element->attributes["_ending"])? $element->attributes["_ending"] : NULL; + $class = strlen($element->attributes["_class"])? $element->attributes["_class"] : NULL; + + $ret = $this->GetSubCats($limit, $template, $separator, $anchor, $ending, $class); + + break; + + case "date": + /* + @field:cat.date + @description:Returns the date/time the category was created + @attrib:_tz:bool:Convert the date to the user's local time + @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr + */ + $d = $this->Get("CreatedOn"); + + if( $element->GetAttributeByName('_tz') ) + { + $d = GetLocalTime($d,$objSession->Get("tz")); + } + + $part = strtolower( $element->GetAttributeByName('_part') ); + if(strlen($part)) + { + $ret = ExtractDatePart($part,$d); + } + else + { + if(!is_numeric($d)) + { + $ret = ""; + } + else + $ret = LangDate($d); + } + break; + case "link": + /* + @field:cat.link + @description:Returns a URL setting the category to the current category + @attrib:_template:tpl:Template URL should point to + @attrib:_mod_template:tpl:Template INSIDE a module to which the category belongs URL should point to + */ + if ( strlen( $element->GetAttributeByName('_mod_template') ) ){ + //will prefix the template with module template root path depending on category + $ids = $this->GetParentIds(); + $tpath = GetModuleArray("template"); + $roots = GetModuleArray("rootcat"); + + // get template path of module, by searching for moudle name + // in this categories first parent category + // and then using found moudle name as a key for module template paths array + $path = $tpath[array_search ($ids[0], $roots)]; + $t = $path . $element->GetAttributeByName('_mod_template'); + } + else + $t = $element->GetAttributeByName('_template'); + + + if(strlen($t)) + { + $var_list_update["t"] = $t; + } + else + $var_list_update["t"] = $var_list["t"]; + $m_var_list_update["cat"] = $this->Get("CategoryId"); + $ret = GetIndexURL()."?env=" . BuildEnv(); + unset($m_var_list_update["cat"], $var_list_update["t"]); + break; + case "adminlink": + $m_var_list_update["cat"] = $this->Get("CategoryId"); + $m_var_list_update["p"] = 1; + $ret = $_SERVER["PHP_SELF"]."?env=" . BuildEnv(); + unset($m_var_list_update["cat"]); + unset($m_var_list_update["p"]); + return $ret; + break; + case "customlink": + $t = $this->GetCustomFieldValue("indextemplate",""); + if(strlen($t)) + { + $var_list_update["t"] = $t; + } + else + $var_list_update["t"] = $var_list["t"]; + $m_var_list_update["cat"] = $this->Get("CategoryId"); + $ret = GetIndexURL()."?env=" . BuildEnv(); + unset($m_var_list_update["cat"], $var_list_update["t"]); + break; + case "link_selector": + $m_var_list_update["cat"] = $this->Get("CategoryId"); + $ret = $_SERVER["PHP_SELF"]."?env=" . BuildEnv(); + + // pass through selector + if( isset($_REQUEST['Selector']) ) $ret .= '&Selector='.$_REQUEST['Selector']; + + // pass new status + if( isset($_REQUEST['new']) ) $ret .= '&new='.$_REQUEST['new']; + + unset($m_var_list_update["cat"]); + return $ret; + break; + case "admin_icon": + if( $element->GetAttributeByName('fulltag') ) + { + $ret = "StatusIcon()."\">"; + } + else + $ret = $this->StatusIcon(); + break; + case "subcats": + /* + @field:cat.subcats + @description: Loads category's subcategories into a list and renders using the m_list_cats global tag + @attrib:_subcattemplate:tpl:Template used to render subcategory list elements + @attrib: _columns:int: Numver of columns to display the categories in (defaults to 1) + @attrib: _maxlistcount:int: Maximum number of categories to list + @attrib: _FirstItemTemplate:tpl: Template used for the first category listed + @attrib: _LastItemTemplate:tpl: Template used for the last category listed + @attrib: _NoTable:bool: If set to 1, the categories will not be listed in a table. If a table is used, all HTML attributes are passed to the TABLE tag + */ + $attr = array(); + $attr["_catid"] = $this->Get("CategoryId"); + $attr["_itemtemplate"] = $element->GetAttributeByName('_subcattemplate'); + if( $element->GetAttributeByName('_notable') ) + $attr["_notable"]=1; + $ret = m_list_cats($attr); + break; + case "subcatcount": + /* + @field:cat.subcatcount + @description:returns number of subcategories + */ + $GroupOnly = $element->GetAttributeByName('_grouponly') ? 1 : 0; + $txt = "Get("CategoryId")."\" _SubCats=\"1\" "; + $txt .="_CategoryCount=\"1\" _ItemType=\"1\" _GroupOnly=\"$GroupOnly\" />"; + $tag = new clsHtmlTag($txt); + $ret = $tag->Execute(); + break; + case "itemcount": + /* + @field:cat.itemcount + @description:returns the number of items in the category + @attrib:_itemtype::name of item type to count, or all items if not set + */ + $typestr = $element->GetAttributeByName('_itemtype'); + if(strlen($typestr)) + { + $type = $objItemTypes->GetTypeByName($typestr); + if(is_object($type)) + { + $TypeId = $type->Get("ItemType"); + $GroupOnly = $element->GetAttributeByName('_grouponly') ? 1 : 0; + $txt = "Get("CategoryId")."\" _SubCats=\"1\" "; + $txt .=" _ListType=\"category\" _CountCurrent=\"1\" _ItemType=\"$TypeId\" _GroupOnly=\"$GroupOnly\" />"; + $tag = new clsHtmlTag($txt); + $ret = $tag->Execute(); + } + else + $ret = ""; + } + else + { + $ret = (int)$objCountCache->GetCatListTotal($this->Get("CategoryId")); + } + break; + case "totalitems": + /* + @field:cat.totalitems + @description:returns the number of items in the category and all subcategories + */ + $ret = $this->ItemCount(); + break; + case "itemdate": + /* + @field:cat.itemdate + @description:Returns the date the cache count was last updated + @attrib:_itemtype:Item name to check + @attrib:_tz:bool:Convert the date to the user's local time + @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr + */ + $typestr = $element->GetAttributeByName('_itemtype'); + $type = $objItemTypes->GetTypeByName($typestr); + if(is_object($type)) + { + $TypeId = $type->Get("ItemType"); + $cc = $objCountCache->GetCountObject(1,$TypeId,$this->get("CategoryId"),0); + if(is_object($cc)) + { + $date = $cc->Get("LastUpdate"); + } + else + $date = ""; + + //$date = $this->GetCacheCountDate($TypeId); + if( $element->GetAttributeByName('_tz') ) + { + $date = GetLocalTime($date,$objSession->Get("tz")); + } + + $part = strtolower($element->GetAttributeByName('_part') ); + if(strlen($part)) + { + $ret = ExtractDatePart($part,$date); + } + else + { + if($date<=0) + { + $ret = ""; + } + else + $ret = LangDate($date); + } + } + else + $ret = ""; + break; + case "new": + /* + @field:cat.new + @description:returns text if category's status is "new" + @attrib:_label:lang: Text to return if status is new + */ + if($this->IsNewItem()) + { + $ret = $element->GetAttributeByName('_label'); + if(!strlen($ret)) + $ret = "lu_new"; + $ret = language($ret); + } + else + $ret = ""; + break; + + case "pick": + /* + @field:cat.pick + @description:returns text if article's status is "hot" + @attrib:_label:lang: Text to return if status is "hot" + */ + if($this->Get("EditorsPick")==1) + { + $ret = $element->GetAttributeByName('_label'); + if(!strlen($ret)) + $ret = "lu_pick"; + $ret = language($ret); + } + else + $ret = ""; + break; + + case "parsetag": + /* + @field:cat.parsetag + @description:returns a tag output with this categoriy set as a current category + @attrib:_tag:: tag name + */ + + $tag = new clsHtmlTag(); + $tag->name = $element->GetAttributeByName('_tag'); + $tag->attributes = $element->attributes; + $tag->attributes["_catid"] = $this->Get("CategoryId"); + $ret = $tag->Execute(); + break; + + + /* + @field:cat.relevance + @description:Displays the category relevance in search results + @attrib:_displaymode:: How the relevance should be displayed
    +
      +
    • "Numerical": Show the decimal value +
    • "Bar": Show the HTML representing the relevance. Returns two HTML cells ≶td< with specified background colors +
    • "Graphical":Show image representing the relevance +
    + @attrib:_onimage::Zero relevance image shown in graphical display mode. Also used as prefix to build other images (i.e. prefix+"_"+percentage+".file_extension" + @attrib:_OffBackGroundColor::Off background color of HTML cell in bar display mode + @attrib:_OnBackGroundColor::On background color of HTML cell in bar display mode + */ + + } + if( !isset($ret) ) $ret = parent::ParseObject($element); + + } + return $ret; + } + + + function parsetag($tag) + { + global $objConfig,$objUsers, $m_var_list, $m_var_list_update; + if(is_object($tag)) + { + $tagname = $tag->name; + } + else + $tagname = $tag; + + switch($tagname) + { + case "cat_id": + return $this->Get("CategoryId"); + break; + case "cat_parent": + return $this->Get("ParentId"); + break; + case "cat_fullpath": + return $this->Get("CachedNavbar"); + break; + case "cat_name": + return inp_unescape($this->Get("Name")); + break; + case "cat_desc": + return inp_unescape($this->Get("Description")); + break; + case "cat_priority": + if($this->Get("Priority")!=0) + { + return (int)$this->Get("Priority"); + } + else + return ""; + break; + case "cat_pick": + if ($this->Get("EditorsPick")) + return "pick"; + break; + case "cat_status": + return $this->Get("Status"); + break; + case "cat_Pending": + return $this->Get("Name"); + break; + + case "cat_pop": + if($this->IsPopItem()) + return "pop"; + break; + case "cat_new": + if($this->IsNewItem()) + return "new"; + break; + case "cat_hot": + if($this->IsHotItem()) + return "hot"; + break; + case "cat_metakeywords": + return inp_unescape($this->Get("MetaKeywords")); + break; + case "cat_metadesc": + return inp_unescape($this->Get("MetaDescription")); + break; + case "cat_createdby": + return $objUsers->GetUserName($this->Get("CreatedById")); + break; + case "cat_resourceid": + return $this->Get("ResourceId"); + break; + case "cat_sub_cats": + return $this->GetSubCats($objConfig->Get("SubCat_ListCount")); + break; + case "cat_link": + return $this->Cat_Link(); + break; + case "subcat_count": + return $this->SubCatCount(); + break; + case "cat_itemcount": + return (int)$this->GetTotalItemCount(); + break; + case "cat_link_admin": + $m_var_list_update["cat"] = $this->Get("CategoryId"); + $m_var_list_update["p"] = 1; + $ret = $_SERVER["PHP_SELF"]."?env=" . BuildEnv(); + unset($m_var_list_update["cat"]); + unset($m_var_list_update["p"]); + return $ret; + break; + case "cat_admin_icon": + $ret = $this->StatusIcon(); + return $ret; + break; + case "cat_link_selector": + $m_var_list_update["cat"] = $this->Get("CategoryId"); + $ret = $_SERVER["PHP_SELF"]."?env=" . BuildEnv(); + unset($m_var_list_update["cat"]); + return $ret; + break; + + case "cat_link_edit": + $m_var_list_update["id"] = $this->Get("CategoryId"); + $ret = "addcategory.php?env=" . BuildEnv(); + unset($m_var_list_update["id"]); + return $ret; + break; + + case "cat_date": + return LangDate($this->Get("CreatedOn")); + break; + case "cat_num_cats": + return $this->Get("CachedDescendantCatsQty"); + break; + case "cell_back": + if ($m_var_list_update["cat_cell"]=="#cccccc") + { + $m_var_list_update["cat_cell"]="#ffffff"; + return "#ffffff"; + } + else + { + $m_var_list_update["cat_cell"]="#cccccc"; + return "#cccccc"; + } + break; + default: + return "Undefined:$tagname"; + } + } + + function ParentNames() + { + global $objCatList; + + if(strlen($this->Get("CachedNavbar"))==0) + { + $nav = ""; + //echo "Rebuilding Navbar..
    \n"; + if(strlen($this->Get("ParentPath"))==0) + { + $this->UpdateCachedPath(); + } + $cats = explode("|",substr($this->Get("ParentPath"),1,-1)); + + foreach($cats as $catid) + { + $cat =& $objCatList->GetCategory($catid); + if(is_object($cat)) + { + if(strlen($cat->Get("Name"))) + $names[] = $cat->Get("Name"); + + } + } + $nav = implode(">", $names); + $this->Set("CachedNavbar",$nav); + $this->Update(); + } + $res = explode(">",$this->Get("CachedNavbar")); + return $res; + } + + function UpdateCacheCounts() + { + global $objItemTypes; + + $CatId = $this->Get("CategoryId"); + + if($CatId>0) + { + //echo "Updating count for ".$this->Get("CachedNavbar")."
    \n"; + UpdateCategoryCount(0,$CatId); + } + } + +} + +class clsCatList extends clsItemCollection +{ +// var $Categories; +// var $adodbConnection; + var $Page; + var $PerPageVar; + + function clsCatList() + { + global $m_var_list; + $this->clsItemCollection(); + $this->classname="clsCategory"; + $this->Page=(int)$m_var_list["p"]; + $this->PerPageVar = "Perpage_Category"; + $this->SourceTable = GetTablePrefix()."Category"; + $this->BasePermission="CATEGORY"; + } + + function GetCountSQL($PermName,$CatId=NULL, $GroupId=NULL, $AdditonalWhere="") + { + global $objSession, $objPermissions, $objCatList; + + $ltable = $this->SourceTable; + $acl = $objSession->GetACLClause(); + $cattable = GetTablePrefix()."CategoryItems"; + $CategoryTable = GetTablePrefix()."Category"; + $ptable = GetTablePrefix()."PermCache"; + $VIEW = $objPermissions->GetPermId($PermName); + + $sql = "SELECT count(*) as CacheVal FROM $ltable "; + $sql .="INNER JOIN $ptable ON ($ltable.CategoryId=$ptable.CategoryId) "; + $sql .="WHERE ($acl AND PermId=$VIEW AND $ltable.Status=1) "; + + if(strlen($AdditonalWhere)>0) + { + $sql .= "AND (".$AdditonalWhere.")"; + } + return $sql; + } + + function CountCategories($attribs) + { + global $objSession; + + $cat = $attribs["_catid"]; + if(!is_numeric($cat)) + { + $cat = $this->CurrentCategoryID(); + } + if((int)$cat>0) + $c = $this->GetCategory($cat); + + if($attribs["_subcats"] && $cat>0) + { + $ParentWhere = "(ParentPath LIKE '".$c->Get("ParentPath")."%' AND ".$this->SourceTable.".CategoryId != $cat)"; + } + if($attribs["_today"]) + { + $today = mktime(0,0,0,date("m"),date("d"),date("Y")); + $TodayWhere = "(CreatedOn>=$today)"; + } + if($attribs["_grouponly"]) + { + $GroupList = $objSession->Get("GroupList"); + } + else + $GroupList = NULL; + + $where = ""; + if(strlen($ParentWhere)) + { + $where = $ParentWhere; + } + if(strlen($TodayWhere)) + { + if(strlen($where)) + $where .=" AND "; + $where .= $TodayWhere; + } + $sql = $this->GetCountSQL("CATEGORY.VIEW",$cat,$GroupList,$where); + +// echo "SQL: ".$sql."
    "; + + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $ret = $rs->fields["CacheVal"]; + } + else + $ret = 0; + + return $ret; + } + + function CurrentCategoryID() + { + global $m_var_list; + return (int)$m_var_list["cat"]; + } + + function NumCategories() + { + return $this->NumItems(); + } + + function &CurrentCat() + { + //return $this->GetCategory($this->CurrentCategoryID()); + return $this->GetItem($this->CurrentCategoryID()); + } + + function &GetCategory($CatID) + { + return $this->GetItem($CatID); + } + + function GetByResource($ResId) + { + return $this->GetItemByField("ResourceId",$ResId); + } + + function QueryOrderByClause($EditorsPick=FALSE,$Priority=FALSE,$UseTableName=FALSE) + { + global $objSession; + + if($UseTableName) + { + $TableName = $this->SourceTable."."; + } + else + $TableName = ""; + + $Orders = array(); + + if($EditorsPick) + { + $Orders[] = $TableName."EditorsPick DESC"; + } + if($Priority) + { + $Orders[] = $TableName."Priority DESC"; + } + + $FieldVar = "Category_Sortfield"; + $OrderVar = "Category_Sortorder"; + + if(is_object($objSession)) + { + if(strlen($objSession->GetPersistantVariable($FieldVar))>0) + { + $Orders[] = trim($TableName.$objSession->GetPersistantVariable($FieldVar) . " ". + $objSession->GetPersistantVariable($OrderVar)); + } + } + + $FieldVar = "Category_Sortfield2"; + $OrderVar = "Category_Sortorder2"; + + if(is_object($objSession)) + { + if(strlen($objSession->GetPersistantVariable($FieldVar))>0) + { + $Orders[] = trim($TableName.$objSession->GetPersistantVariable($FieldVar) . " ". + $objSession->GetPersistantVariable($OrderVar)); + } + } + + + if(count($Orders)>0) + { + $OrderBy = "ORDER BY ".implode(", ",$Orders); + } + else + $OrderBy=""; + return $OrderBy; + } + + + function LoadCategories($where="",$orderBy = "") + { + global $objConfig; + $PerPage = $objConfig->Get($this->PerPageVar); + if(!is_numeric($PerPage)) + $PerPage = 10; + + $this->QueryItemCount=TableCount($this->SourceTable,$where,0); + //echo $this->QueryItemCount." Items Loaded
    \n"; + if(is_numeric($objConfig->Get($this->PerPageVar))) + { + $Start = ($this->Page-1)*$PerPage; + $limit = "LIMIT ".$Start.",".$PerPage; + + } + else + $limit = NULL; + + $limit = NULL; + + return $this->Query_Category($where,$orderBy,$limit); + } + + function Query_Category($whereClause="",$orderByClause="",$limit=NULL) + { + global $m_var_list, $objSession, $Errors, $objPermissions; + $GroupID = $objSession->Get("GroupID"); + + $resultset = array(); + + $table = $this->SourceTable; + $ptable = GetTablePrefix()."PermCache"; + $CAT_VIEW = $objPermissions->GetPermId("CATEGORY.VIEW"); + if(!$objSession->HasSystemPermission("ADMIN")) + { + $sql = "SELECT * FROM $table INNER JOIN $ptable ON ($ptable.CategoryId=$table.CategoryId)"; + $acl_where = $objSession->GetACLClause(); + if(strlen($whereClause)) + { + $sql .= " WHERE ($acl_where) AND PermId=$CAT_VIEW AND ".$whereClause; + } + else + $sql .= " WHERE ($acl_where) AND PermId=$CAT_VIEW "; + } + else + { + $sql ="SELECT * FROM $table WHERE $whereClause"; + } + $sql .=" ".$orderByClause; + + if(isset($limit) && strlen(trim($limit))) + $sql .= " ".$limit; + if($objSession->HasSystemPermission("DEBUG.LIST")) + echo $sql; + return $this->Query_item($sql); + } + + function CountPending() + { + return TableCount($this->SourceTable,"Status=".STATUS_PENDING,0); + } + + function GetPageLinkList($dest_template=NULL,$page="",$PagesToList=10,$HideEmpty=TRUE) + { + global $objConfig, $m_var_list_update, $var_list_update, $var_list; + + if(!strlen($page)) + $page = GetIndexURL(); + + $NumPages = ceil($this->GetNumPages($objConfig->Get($this->PerPageVar))); + + $PerPage = $objConfig->Get($this->PerPageVar); + if($PerPage<1) + $PerPage=20; + + $NumPages = ceil($this->GetNumPages($PerPage)); + + if($NumPages==1 && $HideEmpty) + return ""; + + if(strlen($dest_template)) + { + $var_list_update["t"] = $dest_template; + } + else + $var_list_update["t"] = $var_list["t"]; + + $o = ""; + if($this->Page>$NumPages) + $this->Page=$NumPages; + + $StartPage = (int)$this->Page - ($PagesToList/2); + if($StartPage<1) + $StartPage=1; + + $EndPage = $StartPage+($PagesToList-1); + if($EndPage>$NumPages) + { + $EndPage = $NumPages; + $StartPage = $EndPage-($PagesToList-1); + if($StartPage<1) + $StartPage=1; + } + + $o = ""; + if($StartPage>1) + { + $m_var_list_update["p"] = $this->Page-$PagesToList; + $prev_url = $page."?env=".BuildEnv(); + $o .= "<<"; + } + + + for($p=$StartPage;$p<=$EndPage;$p++) + { + if($p!=$this->Page) + { + $m_var_list_update["p"]=$p; + $href = $page."?env=".BuildEnv(); + $o .= " $p "; + } + else + { + $o .= "$p"; + } + } + if($EndPage<$NumPages && $EndPage>0) + { + $m_var_list_update["p"]=$this->Page+$PagesToList; + $next_url = $page."?env=".BuildEnv(); + $o .= " >>"; + } + unset($m_var_list_update,$var_list_update["t"] ); + return $o; + } + + + function GetAdminPageLinkList($url) + { + global $objConfig, $m_var_list_update, $var_list_update, $var_list; + + $PerPage = $objConfig->Get($this->PerPageVar); + if(!is_numeric($PerPage)) + $PerPage = 10; + + $NumPages = ceil($this->GetNumPages($PerPage)); + $o = ""; + + if($this->Page>1) + { + $m_var_list_update["p"]=$this->Page-1; + $prev_url = $url."?env=".BuildEnv(); + unset($m_var_list_update["p"]); + $o .= "<<"; + } + + if($this->Page<$NumPages) + { + $m_var_list_update["p"]=$this->Page+1; + $next_url = $url."?env=".BuildEnv(); + unset($m_var_list_update["p"]); + } + + for($p=1;$p<=$NumPages;$p++) + { + if($p!=$this->Page) + { + $m_var_list_update["p"]=$p; + $href = $url."?env=".BuildEnv(); + unset($m_var_list_update["p"]); + $o .= "-$p-"; + } + else + { + $o .= "$p"; + } + } + if($this->Page<$NumPages) + { + $o .= ">>"; + } + + return $o; + } + + function Search_Category($orderByClause) + { + global $objSession, $objConfig, $Errors; + + $Start = ($this->Page-1)*$objConfig->Get("Perpage_Category"); + $objResults = new clsSearchResults("Category","clsCategory"); + $this->Clear(); + $this->Categories = $objResults->LoadSearchResults($Start,$objConfig->Get("Perpage_Category")); + + return $this->Categories; + } + + + function GetSubCats($ParentCat) + { + return $this->Query_Category("ParentId=".$ParentCat,""); + } + + function AllSubCats($ParentCat) + { + $c =& $this->GetCategory($ParentCat); + $sql = "SELECT * FROM ".$this->SourceTable." WHERE ParentPath LIKE '".$c->Get("ParentPath")."%'"; + $rs = $this->adodbConnection->Execute($sql); + $subcats = array(); + while($rs && !$rs->EOF) + { + if($rs->fields["CategoryId"]!=$ParentCat) + { + $subcats[] = $rs->fields["CategoryId"]; + } + $rs->MoveNext(); + } + if($ParentCat>0) + { + if($c->Get("CachedDescendantCatsQty")!=count($subcats)) + { + $c->Set("CachedDescendantCatsQty",count($subcats)); + } + } + return $subcats; + } + + function cat_navbar($admin=0, $cat, $target_template, $separator = " > ", $LinkLeaf = FALSE, + $root = 0,$RootTemplate="",$modcat=0, $ModTemplate="", $LinkRoot = FALSE) + { + // draw category navigation bar (at top) + global $Errors, $var_list_update, $var_list, $m_var_list_update, $m_var_list, $objConfig; + + $selector = isset($_REQUEST['Selector']) ? '&Selector='.$_REQUEST['Selector'] : ''; + $new = isset($_REQUEST['new']) ? '&new='.$_REQUEST['new'] : ''; + + $nav = ""; + $m_var_list_update["p"]=1; + if(strlen($target_template)==0) + $target_template = $var_list["t"]; + + + if($cat == 0) + { + $cat_name = language($objConfig->Get("Root_Name")); + if ($LinkRoot) + { + $var_list_update["t"] = strlen($RootTemplate)? $RootTemplate : $target_template; + $nav = "$cat_name"; } + else + $nav = "$cat_name"; + } + else + { + $nav = array(); + $c =& $this->GetCategory($cat); + $nav_unparsed = $c->Get("ParentPath"); + if(strlen($nav_unparsed)==0) + { + $c->UpdateCachedPath(); + $nav_unparsed = $c->Get("ParentPath"); + } + //echo " Before $nav_unparsed "; + if($root) + { + $r =& $this->GetCategory($root); + $rpath = $r->Get("ParentPath"); + $nav_unparsed = substr($nav_unparsed,strlen($rpath),-1); + $cat_name = $r->Get("Name"); + $m_var_list_update["cat"] = $root; + if($cat == $catid && !$LinkLeaf) + { + $nav[] = "".$cat_name.""; //href=\"browse.php?env=". BuildEnv() ."\" + } + else + { + if ($admin == 1) + { + $nav[] = "".$cat_name.""; + } + else + { + if(strlen($RootTemplate)) + { + $var_list_update["t"] = $RootTemplate; + } + else + { + $var_list_update["t"] = $target_template; + } + $nav[] = "".$cat_name.""; + } + } + } + else + { + $nav_unparsed = substr($nav_unparsed,1,-1); + $cat_name = language($objConfig->Get("Root_Name")); + $m_var_list_update["cat"] = 0; + if($cat == 0) + { + $nav[] = "".$cat_name.""; //href=\"browse.php?env=". BuildEnv() ."\" + } + else + { + if ($admin == 1) + { + $nav[] = "".$cat_name.""; + } + else + { + if(strlen($RootTemplate)) + { + $var_list_update["t"] = $RootTemplate; + } + else + $var_list_update["t"] = $target_template; + $nav[] = "".$cat_name.""; + } + } + + } + //echo " After $nav_unparsed
    \n"; + if(strlen($target_template)==0) + $target_template = $var_list["t"]; + + $cats = explode("|", $nav_unparsed); + foreach($cats as $catid) + { + if($catid) + { + $c =& $this->GetCategory($catid); + if(is_object($c)) + { + $cat_name = $c->Get("Name"); + + $m_var_list_update["cat"] = $catid; + if($catid==$modcat && strlen($ModTemplate)>0) + { + $t = $ModTemplate; + } + else + $t = $target_template; + if($cat == $catid && !$LinkLeaf) + { + $nav[] = "".$cat_name.""; + } + else + { + if ($admin == 1) + { + $nav[] = "".$cat_name.""; + } + else + { + $var_list_update["t"] = $t; + $nav[] = "".$cat_name.""; + unset($var_list_update["t"]); + } + } + unset($m_var_list_update["cat"]); + } + } + } + $nav = implode($separator, $nav); + } + return $nav; + } + + function &Add($ParentId, $Name, $Description, $CreatedOn, $EditorsPick, $Status, $Hot, $New, $Pop, + $Priority, $MetaKeywords,$MetaDesc) + { + global $objSession; + + $UserId = $objSession->Get("UserId"); + + $d = new clsCategory(NULL); + $d->tablename = $this->SourceTable; + if($d->UsingTempTable()) + $d->Set("CategoryId",-1); + $d->idfield = "CategoryId"; + $d->Set(array("ParentId", "Name", "Description", "CreatedOn", "EditorsPick", "Status", "HotItem", + "NewItem","PopItem", "Priority", "MetaKeywords", "MetaDescription", "CreatedById"), + array($ParentId, $Name, $Description, $CreatedOn, $EditorsPick, $Status, $Hot, $New, + $Pop, $Priority, $MetaKeywords,$MetaDesc, $UserId)); + + $d->Create(); + if($Status==1) + { + $d->SendUserEventMail("CATEGORY.ADD",$objSession->Get("PortalUserId")); + $d->SendAdminEventMail("CATEGORY.ADD"); + } + else + { + $d->SendUserEventMail("CATEGORY.ADD.PENDING",$objSession->Get("PortalUserId")); + $d->SendAdminEventMail("CATEGORY.ADD.PENDING"); + } + $d->UpdateCachedPath(); + //RunUp($ParentId, "Increment_Count"); + + return $d; + } + + function &Edit_Category($CategoryId, $Name, $Description, $CreatedOn, $EditorsPick, $Status, $Hot, + $NewItem, $Pop, $Priority, $MetaKeywords,$MetaDesc) + { + $d =& $this->GetCategory($CategoryId); + $d->Set(array("Name", "Description", "CreatedOn", "EditorsPick", "Status", "HotItem", + "NewItem", "PopItem", "Priority", "MetaKeywords","MetaDescription"), + array($Name, $Description, $CreatedOn, $EditorsPick, $Status, $Hot, $NewItem, + $Pop, $Priority, $MetaKeywords,$MetaDesc)); + $d->Update(); + $d->UpdateCachedPath(); + return $d; + + } + + function Move_Category($Id, $ParentTo) + { + global $objCatList; + + $d =& $this->GetCategory($Id); + $oldparent = $d->Get("ParentId"); + $ChildList = $d->GetSubCatIds(); + + /* + echo "Target Parent Id: $ParentTo
    \n"; + echo "
    ";print_r($ChildList); echo "
    "; + echo "Old Parent: $oldparent
    \n"; + echo "ID: $Id
    \n"; + */ + /* sanity checks */ + + if(!in_array($ParentTo,$ChildList) && $oldparent != $ParentTo && $oldparent != $Id && + $Id != $ParentTo) + { + $d->Set("ParentId", $ParentTo); + $d->Update(); + $d->UpdateCachedPath(); + RunUp($oldparent, "Decrement_Count"); + RunUp($ParentTo, "Increment_Count"); + RunDown($ParentTo, "UpdateCachedPath"); + return TRUE; + } + else + { + global $Errors; + $Errors->AddAdminUserError("la_error_move_subcategory"); + return FALSE; + } + die(); + } + + function Copy_CategoryTree($Id, $ParentTo) + { + global $PastedCatIds; + + $new = $this->Copy_Category($Id, $ParentTo); + if($new) + { + $PastedCatIds[$Id] = $new; + $sql = "SELECT CategoryId from ".GetTablePrefix()."Category where ParentId=$Id"; + $result = $this->adodbConnection->Execute($sql); + if ($result && !$result->EOF) + { + while(!$result->EOF) + { + $this->Copy_CategoryTree($result->fields["CategoryId"], $new); + $result->MoveNext(); + } + } + } + return $new; + } + + function Copy_Category($Id, $ParentTo) + { + global $objGroups; + + + $src = $this->GetCategory($Id); + $Children = $src->GetSubCatIds(); + if($Id==$ParentTo || in_array($ParentTo,$Children)) + { + /* sanity error here */ + global $Errors; + $Errors->AddAdminUserError("la_error_copy_subcategory"); + return 0; + } + $dest = $src; + $dest->Set("ParentId", $ParentTo); + if ($src->get("ParentId") == $ParentTo) + { + $OldName = $src->Get("Name"); + if(substr($OldName,0,5)=="Copy ") + { + $parts = explode(" ",$OldName,4); + if($parts[2]=="of" && is_numeric($parts[1])) + { + $Name = $parts[3]; + } + else + if($parts[1]=="of") + { + $Name = $parts[2]." ".$parts[3]; + } + else + $Name = $OldName; + } + else + $Name = $OldName; + //echo "New Name: $Name
    "; + $dest->Set("Name", $Name); + $Names = CategoryNameCount($ParentTo,$Name); + //echo "Names Count: ".count($Names)."
    "; + if(count($Names)>0) + { + $NameCount = count($Names); + $found = FALSE; + $NewName = "Copy of $Name"; + + if(!in_array($NewName,$Names)) + { + //echo "Matched on $NewName in:
    \n"; + $found = TRUE; + } + else + { + for($x=2;$x<$NameCount+2;$x++) + { + + $NewName = "Copy ".$x." of ".$Name; + if(!in_array($NewName,$Names)) + { + $found = TRUE; + break; + } + + } + } + if(!$found) + { + $NameCount++; + $NewName = "Copy $NameCount of $Name"; + } + //echo "New Name: $NewName
    "; + $dest->Set("Name",$NewName); + } + + } + $dest->UnsetIdField(); + $dest->Set("CachedDescendantCatsQty",0); + $dest->Set("ResourceId",NULL); + $dest->Create(); + $dest->UpdateCachedPath(); + $p = new clsPermList(); + $p->Copy_Permissions($src->Get("CategoryId"),$dest->Get("CategoryId")); + $glist = $objGroups->GetAllGroupList(); + $view = $p->GetGroupPermList($dest, "CATEGORY.VIEW", $glist); + $dest->SetViewPerms("CATEGORY.VIEW",$view,$glist); + RunUp($ParentTo, "Increment_Count"); + return $dest->Get("CategoryId"); + } + + function Delete_Category($Id) + { + global $objSession; + + $d =& $this->GetCategory($Id); + + if(is_object($d)) + { + if($d->Get("CategoryId")==$Id) + { + $d->SendUserEventMail("CATEGORY.DELETE",$objSession->Get("PortalUserId")); + $d->SendAdminEventMail("CATEGORY.DELETE"); + $p =& $this->GetCategory($d->Get("ParentId")); + RunDown($d->Get("CategoryId"), "Delete"); + RunUp($p->Get("CategoryId"), "Decrement_Count"); + RunUp($d->Get("CategoryId"),"ClearCacheData"); + + } + } + } + + function PasteFromClipboard($TargetCat) + { + global $objSession; + + $clip = $objSession->GetVariable("ClipBoard"); + if(strlen($clip)) + { + $ClipBoard = ParseClipboard($clip); + $IsCopy = (substr($ClipBoard["command"],0,4)=="COPY") || ($ClipBoard["source"] == $TargetCat); + + $item_ids = explode(",",$ClipBoard["ids"]); + for($i=0;$iGetItem($item_ids[$i]); + if(!$IsCopy) + { + $this->Move_Category($ItemId, $TargetCat); + $clip = str_replace("CUT","COPY",$clip); + $objSession->SetVariable("ClipBoard",$clip); + } + else + { + $this->Copy_CategoryTree($ItemId,$TargetCat); + } + } + } + } + + + function NumChildren($ParentID) + { + $cat_filter = "m_cat_filter"; + global $$cat_filter; + + $filter = $$cat_filter; + $adodbConnection = GetADODBConnection(); + + $sql = "SELECT COUNT(Name) as children from ".$this->SourceTable." where ParentId=" . $ParentID . $filter; + $result = $adodbConnection->Execute($sql); + return $result->fields["children"]; + } + + function UpdateMissingCacheData() + { + $rs = $this->adodbConnection->Execute("SELECT * FROM ".$this->SourceTable." WHERE ParentPath IS NULL or ParentPath=''"); + while($rs && !$rs->EOF) + { + $c = new clsCategory(NULL); + $data = $rs->fields; + $c->SetFromArray($data); + $c->UpdateCachedPath(); + $rs->MoveNext(); + } + + $rs = $this->adodbConnection->Execute("SELECT * FROM ".$this->SourceTable." WHERE CachedNavbar IS NULL or CachedNavBar=''"); + while($rs && !$rs->EOF) + { + $c = new clsCategory(NULL); + $data = $rs->fields; + $c->SetFromArray($data); + $c->UpdateCachedPath(); + $rs->MoveNext(); + } + } + + function CopyFromEditTable($idfield) + { + global $objGroups, $objSession, $objPermList; + + $objPermList = new clsPermList(); + $edit_table = $objSession->GetEditTable($this->SourceTable); + + $sql = "SELECT * FROM $edit_table"; + $rs = $this->adodbConnection->Execute($sql); + + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $c = new $this->classname; + $c->SetFromArray($data); + $c->Dirty(); + + if($c->Get("CategoryId")>0) + { + $c->Update(); + } + else + { + $c->UnsetIdField(); + $c->Create(); + $sql = "UPDATE ".GetTablePrefix()."Permissions SET CatId=".$c->Get("CategoryId")." WHERE CatId=-1"; + $this->adodbConnection->Execute($sql); + } + $c->UpdateCachedPath(); + $c->UpdateACL(); + $c->SendUserEventMail("CATEGORY.MODIFY",$objSession->Get("PortalUserId")); + $c->SendAdminEventMail("CATEGORY.MODIFY"); + $c->Related = new clsRelationshipList(); + if(is_object($c->Related)) + { + $r = $c->Related; + $r->CopyFromEditTable($c->Get("ResourceId")); + } + + //RunDown($c->Get("CategoryId"),"UpdateCachedPath"); + //RunDown($c->Get("CategoryId"),"UpdateACL"); + unset($c); + unset($r); + $rs->MoveNext(); + } + @$this->adodbConnection->Execute("DROP TABLE $edit_table"); + + //$this->UpdateMissingCacheData(); + } + + function PurgeEditTable($idfield) + { + parent::PurgeEditTable($idfield); + $sql = "DELETE FROM ".GetTablePrefix()."Permissions WHERE CatId=-1"; + $this->adodbConnection->Execute($sql); + } + + function GetExclusiveType($CatId) + { + global $objItemTypes, $objConfig; + + $itemtype = NULL; + $c =& $this->GetItem($CatId); + $path = $c->Get("ParentPath"); + foreach($objItemTypes->Items as $Type) + { + $RootVar = $Type->Get("ItemName")."_Root"; + $RootId = $objConfig->Get($RootVar); + if((int)$RootId) + { + $rcat = $this->GetItem($RootId); + $rpath = $rcat->Get("ParentPath"); + $p = substr($path,0,strlen($rpath)); + //echo $rpath." vs. .$p [$path]
    \n"; + if($rpath==$p) + { + $itemtype = $Type; + break; + } + } + } + return $itemtype; + } +} + +function RunUp($Id, $function, $Param=NULL) +{ + global $objCatList; + + $d = $objCatList->GetCategory($Id); + $ParentId = $d->Get("ParentId"); + if ($ParentId == 0) + { + if($Param == NULL) + { + $d->$function(); + } + else + { + $d->$function($Param); + } + } + else + { + RunUp($ParentId, $function, $Param); + if($Param == NULL) + { + $d->$function(); + } + else + { + $d->$function($Param); + } + + } + +} + +function RunDown($Id, $function, $Param=NULL) +{ + global $objCatList; + + $adodbConnection = GetADODBConnection(); + $sql = "select CategoryId from ".GetTablePrefix()."Category where ParentId='$Id'"; + $rs = $adodbConnection->Execute($sql); + //echo $sql."
    \n"; + + while($rs && !$rs->EOF) + { + RunDown($rs->fields["CategoryId"], $function, $Param); + $rs->MoveNext(); + } + $d = $objCatList->GetCategory($Id); + if($Param == NULL) + { + $d->$function(); + } + else + $d->$function($Param); +} +?> Index: trunk/admin/icons/icon46_list_settings_output.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/tuffgong.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_help.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_cat.gif =================================================================== diff -u Binary files differ Index: trunk/compat/file_get_contents.php =================================================================== diff -u --- trunk/compat/file_get_contents.php (revision 0) +++ trunk/compat/file_get_contents.php (revision 13) @@ -0,0 +1,61 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: file_get_contents.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace file_get_contents() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.file_get_contents + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @internal resource_context is not supported + * @since PHP 5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('file_get_contents')) +{ + function file_get_contents ($filename, $incpath = false, $resource_context = null) + { + if (false === $fh = fopen($filename, 'rb', $incpath)) { + trigger_error('file_get_contents() failed to open stream: No such file or directory', E_USER_WARNING); + return false; + } + + clearstatcache(); + if ($fsize = filesize($filename)) { + $data = fread($fh, $fsize); + } + + else { + while (!feof($fh)) { + $data .= fread($fh, 8192); + } + } + + fclose($fh); + + return $data; + } +} + +?> \ No newline at end of file Index: trunk/admin/icons/icon46_list_community.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_review_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_cat_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.insertunorderedlist.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/shocked.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.pastetext.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_button.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/icon24_link_user.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-datadict.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-datadict.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-datadict.inc.php (revision 13) @@ -0,0 +1,582 @@ +$str

    "; +$a= Lens_ParseArgs($str); +print "
    ";
    +print_r($a);
    +print "
    "; +} +//Lens_ParseTest(); + +/** + Parse arguments, treat "text" (text) and 'text' as quotation marks. + To escape, use "" or '' or )) + + @param endstmtchar Character that indicates end of statement + @param tokenchars Include the following characters in tokens apart from A-Z and 0-9 + @returns 2 dimensional array containing parsed tokens. +*/ +function Lens_ParseArgs($args,$endstmtchar=',',$tokenchars='_.-') +{ + $pos = 0; + $intoken = false; + $stmtno = 0; + $endquote = false; + $tokens = array(); + $tokens[$stmtno] = array(); + $max = strlen($args); + $quoted = false; + + while ($pos < $max) { + $ch = substr($args,$pos,1); + switch($ch) { + case ' ': + case "\t": + case "\n": + case "\r": + if (!$quoted) { + if ($intoken) { + $intoken = false; + $tokens[$stmtno][] = implode('',$tokarr); + } + break; + } + + $tokarr[] = $ch; + break; + + case '(': + case ')': + case '"': + case "'": + + if ($intoken) { + if (empty($endquote)) { + $tokens[$stmtno][] = implode('',$tokarr); + if ($ch == '(') $endquote = ')'; + else $endquote = $ch; + $quoted = true; + $intoken = true; + $tokarr = array(); + } else if ($endquote == $ch) { + $ch2 = substr($args,$pos+1,1); + if ($ch2 == $endquote) { + $pos += 1; + $tokarr[] = $ch2; + } else { + $quoted = false; + $intoken = false; + $tokens[$stmtno][] = implode('',$tokarr); + $endquote = ''; + } + } else + $tokarr[] = $ch; + + }else { + + if ($ch == '(') $endquote = ')'; + else $endquote = $ch; + $quoted = true; + $intoken = true; + $tokarr = array(); + } + break; + + default: + + if (!$intoken) { + if ($ch == $endstmtchar) { + $stmtno += 1; + $tokens[$stmtno] = array(); + break; + } + + $intoken = true; + $quoted = false; + $endquote = false; + $tokarr = array(); + + } + + if ($quoted) $tokarr[] = $ch; + else if (ctype_alnum($ch) || strpos($tokenchars,$ch) !== false) $tokarr[] = $ch; + else { + if ($ch == $endstmtchar) { + $tokens[$stmtno][] = implode('',$tokarr); + $stmtno += 1; + $tokens[$stmtno] = array(); + $intoken = false; + $tokarr = array(); + break; + } + $tokens[$stmtno][] = implode('',$tokarr); + $tokens[$stmtno][] = $ch; + $intoken = false; + } + } + $pos += 1; + } + + return $tokens; +} + + +class ADODB_DataDict { + var $connection; + var $debug = false; + var $dropTable = "DROP TABLE %s"; + var $addCol = ' ADD'; + var $alterCol = ' ALTER COLUMN'; + var $dropCol = ' DROP COLUMN'; + var $schema = false; + var $serverInfo = array(); + var $autoIncrement = false; + var $dataProvider; + var $blobSize = 100; /// any varchar/char field this size or greater is treated as a blob + /// in other words, we use a text area for editting. + + function GetCommentSQL($table,$col) + { + return false; + } + + function SetCommentSQL($table,$col,$cmt) + { + return false; + } + + function &MetaTables() + { + return $this->connection->MetaTables(); + } + + function &MetaColumns($tab) + { + return $this->connection->MetaColumns($tab); + } + + function &MetaPrimaryKeys($tab,$owner=false,$intkey=false) + { + return $this->connection->MetaPrimaryKeys($tab.$owner,$intkey); + } + + function MetaType($t,$len=-1,$fieldobj=false) + { + return ADORecordSet::MetaType($t,$len,$fieldobj); + } + + // Executes the sql array returned by GetTableSQL and GetIndexSQL + function ExecuteSQLArray($sql, $continueOnError = true) + { + $rez = 2; + $conn = &$this->connection; + $saved = $conn->debug; + foreach($sql as $line) { + + if ($this->debug) $conn->debug = true; + $ok = $conn->Execute($line); + $conn->debug = $saved; + if (!$ok) { + if ($this->debug) ADOConnection::outp($conn->ErrorMsg()); + if (!$continueOnError) return 0; + $rez = 1; + } + } + return 2; + } + + /* + Returns the actual type given a character code. + + C: varchar + X: CLOB (character large object) or largest varchar size if CLOB is not supported + C2: Multibyte varchar + X2: Multibyte CLOB + + B: BLOB (binary large object) + + D: Date + T: Date-time + L: Integer field suitable for storing booleans (0 or 1) + I: Integer + F: Floating point number + N: Numeric or decimal number + */ + + function ActualType($meta) + { + return $meta; + } + + function CreateDatabase($dbname,$options=false) + { + $options = $this->_Options($options); + $s = 'CREATE DATABASE '.$dbname; + if (isset($options[$this->upperName])) $s .= ' '.$options[$this->upperName]; + $sql[] = $s; + return $sql; + } + + /* + Generates the SQL to create index. Returns an array of sql strings. + */ + function CreateIndexSQL($idxname, $tabname, $flds, $idxoptions = false) + { + if ($this->schema) $tabname = $this->schema.'.'.$tabname; + return $this->_IndexSQL($idxname, $tabname, $flds, $this->_Options($idxoptions)); + } + + function SetSchema($schema) + { + $this->schema = $schema; + } + + function AddColumnSQL($tabname, $flds) + { + if ($this->schema) $tabname = $this->schema.'.'.$tabname; + $sql = array(); + list($lines,$pkey) = $this->_GenFields($flds); + foreach($lines as $v) { + $sql[] = "ALTER TABLE $tabname $this->addCol $v"; + } + return $sql; + } + + function AlterColumnSQL($tabname, $flds) + { + if ($this->schema) $tabname = $this->schema.'.'.$tabname; + $sql = array(); + list($lines,$pkey) = $this->_GenFields($flds); + + foreach($lines as $v) { + $sql[] = "ALTER TABLE $tabname $this->alterCol $v"; + } + return $sql; + } + + function DropColumnSQL($tabname, $flds) + { + if ($this->schema) $tabname = $this->schema.'.'.$tabname; + if (!is_array($flds)) $flds = explode(',',$flds); + $sql = array(); + foreach($flds as $v) { + $sql[] = "ALTER TABLE $tabname $this->dropCol $v"; + } + return $sql; + } + + function DropTableSQL($tabname) + { + if ($this->schema) $tabname = $this->schema.'.'.$tabname; + $sql[] = sprintf($this->dropTable,$tabname); + return $sql; + } + + /* + Generate the SQL to create table. Returns an array of sql strings. + */ + function CreateTableSQL($tabname, $flds, $tableoptions=false) + { + if (!$tableoptions) $tableoptions = array(); + + list($lines,$pkey) = $this->_GenFields($flds); + + $taboptions = $this->_Options($tableoptions); + if ($this->schema) $tabname = $this->schema.'.'.$tabname; + $sql = $this->_TableSQL($tabname,$lines,$pkey,$taboptions); + + $tsql = $this->_Triggers($tabname,$taboptions); + foreach($tsql as $s) $sql[] = $s; + + return $sql; + } + + function _GenFields($flds) + { + if (is_string($flds)) { + $padding = ' '; + $txt = $flds.$padding; + $flds = array(); + $flds0 = Lens_ParseArgs($txt,','); + $hasparam = false; + foreach($flds0 as $f0) { + $f1 = array(); + foreach($f0 as $token) { + switch (strtoupper($token)) { + case 'CONSTRAINT': + case 'DEFAULT': + $hasparam = $token; + break; + default: + if ($hasparam) $f1[$hasparam] = $token; + else $f1[] = $token; + $hasparam = false; + break; + } + } + $flds[] = $f1; + + } + } + $this->autoIncrement = false; + $lines = array(); + $pkey = array(); + foreach($flds as $fld) { + $fld = _array_change_key_case($fld); + + $fname = false; + $fdefault = false; + $fautoinc = false; + $ftype = false; + $fsize = false; + $fprec = false; + $fprimary = false; + $fnoquote = false; + $fdefts = false; + $fdefdate = false; + $fconstraint = false; + $fnotnull = false; + $funsigned = false; + + //----------------- + // Parse attributes + foreach($fld as $attr => $v) { + if ($attr == 2 && is_numeric($v)) $attr = 'SIZE'; + else if (is_numeric($attr) && $attr > 1 && !is_numeric($v)) $attr = strtoupper($v); + + switch($attr) { + case '0': + case 'NAME': $fname = $v; break; + case '1': + case 'TYPE': $ty = $v; $ftype = $this->ActualType(strtoupper($v)); break; + case 'SIZE': $dotat = strpos($v,'.'); + if ($dotat === false) $fsize = $v; + else { + $fsize = substr($v,0,$dotat); + $fprec = substr($v,$dotat+1); + } + break; + case 'UNSIGNED': $funsigned = true; break; + case 'AUTOINCREMENT': + case 'AUTO': $fautoinc = true; $fnotnull = true; break; + case 'KEY': + case 'PRIMARY': $fprimary = $v; $fnotnull = true; break; + case 'DEF': + case 'DEFAULT': $fdefault = $v; break; + case 'NOTNULL': $fnotnull = $v; break; + case 'NOQUOTE': $fnoquote = $v; break; + case 'DEFDATE': $fdefdate = $v; break; + case 'DEFTIMESTAMP': $fdefts = $v; break; + case 'CONSTRAINT': $fconstraint = $v; break; + } //switch + } // foreach $fld + + //-------------------- + // VALIDATE FIELD INFO + if (!strlen($fname)) { + if ($this->debug) ADOConnection::outp("Undefined NAME"); + return false; + } + + if (!strlen($ftype)) { + if ($this->debug) ADOConnection::outp("Undefined TYPE for field '$fname'"); + return false; + } else { + $ftype = strtoupper($ftype); + } + + $ftype = $this->_GetSize($ftype, $ty, $fsize, $fprec); + + if ($ty == 'X' || $ty == 'X2' || $ty == 'B') $fnotnull = false; // some blob types do not accept nulls + + if ($fprimary) $pkey[] = $fname; + + // some databases do not allow blobs to have defaults + if ($ty == 'X') $fdefault = false; + + //-------------------- + // CONSTRUCT FIELD SQL + if ($fdefts) { + if (substr($this->connection->databaseType,0,5) == 'mysql') { + $ftype = 'TIMESTAMP'; + } else { + $fdefault = $this->connection->sysTimeStamp; + } + } else if ($fdefdate) { + if (substr($this->connection->databaseType,0,5) == 'mysql') { + $ftype = 'TIMESTAMP'; + } else { + $fdefault = $this->connection->sysDate; + } + } else if (strlen($fdefault) && !$fnoquote) + if ($ty == 'C' or $ty == 'X' or + ( substr($fdefault,0,1) != "'" && !is_numeric($fdefault))) + if (strlen($fdefault) != 1 && substr($fdefault,0,1) == ' ' && substr($fdefault,strlen($fdefault)-1) == ' ') + $fdefault = trim($fdefault); + else if (strtolower($fdefault) != 'null') + $fdefault = $this->connection->qstr($fdefault); + $suffix = $this->_CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned); + + $fname = str_pad($fname,16); + $lines[] = "$fname $ftype$suffix"; + + if ($fautoinc) $this->autoIncrement = true; + } // foreach $flds + + + return array($lines,$pkey); + } + /* + GENERATE THE SIZE PART OF THE DATATYPE + $ftype is the actual type + $ty is the type defined originally in the DDL + */ + function _GetSize($ftype, $ty, $fsize, $fprec) + { + if (strlen($fsize) && $ty != 'X' && $ty != 'B' && strpos($ftype,'(') === false) { + $ftype .= "(".$fsize; + if ($fprec) $ftype .= ",".$fprec; + $ftype .= ')'; + } + return $ftype; + } + + + // return string must begin with space + function _CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint) + { + $suffix = ''; + if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; + if ($fnotnull) $suffix .= ' NOT NULL'; + if ($fconstraint) $suffix .= ' '.$fconstraint; + return $suffix; + } + + function _IndexSQL($idxname, $tabname, $flds, $idxoptions) + { + if (isset($idxoptions['REPLACE'])) $sql[] = "DROP INDEX $idxname"; + if (isset($idxoptions['UNIQUE'])) $unique = ' UNIQUE'; + else $unique = ''; + + if (is_array($flds)) $flds = implode(', ',$flds); + $s = "CREATE$unique INDEX $idxname ON $tabname "; + if (isset($idxoptions[$this->upperName])) $s .= $idxoptions[$this->upperName]; + $s .= "($flds)"; + $sql[] = $s; + + return $sql; + } + + function _DropAutoIncrement($tabname) + { + return false; + } + + function _TableSQL($tabname,$lines,$pkey,$tableoptions) + { + $sql = array(); + + if (isset($tableoptions['REPLACE'])) { + $sql[] = sprintf($this->dropTable,$tabname); + if ($this->autoIncrement) { + $sInc = $this->_DropAutoIncrement($tabname); + if ($sInc) $sql[] = $sInc; + } + } + $s = "CREATE TABLE $tabname (\n"; + $s .= implode(",\n", $lines); + if (sizeof($pkey)>0) { + $s .= ",\n PRIMARY KEY ("; + $s .= implode(", ",$pkey).")"; + } + if (isset($tableoptions['CONSTRAINTS'])) + $s .= "\n".$tableoptions['CONSTRAINTS']; + + if (isset($tableoptions[$this->upperName.'_CONSTRAINTS'])) + $s .= "\n".$tableoptions[$this->upperName.'_CONSTRAINTS']; + + $s .= "\n)"; + if (isset($tableoptions[$this->upperName])) $s .= $tableoptions[$this->upperName]; + $sql[] = $s; + + return $sql; + } + + /* + GENERATE TRIGGERS IF NEEDED + used when table has auto-incrementing field that is emulated using triggers + */ + function _Triggers($tabname,$taboptions) + { + return array(); + } + + /* + Sanitize options, so that array elements with no keys are promoted to keys + */ + function _Options($opts) + { + if (!is_array($opts)) return array(); + $newopts = array(); + foreach($opts as $k => $v) { + if (is_numeric($k)) $newopts[strtoupper($v)] = $v; + else $newopts[strtoupper($k)] = $v; + } + return $newopts; + } + + +/* +"Florian Buzin [ easywe ]" + +This function changes/adds new fields to your table. You + dont have to know if the col is new or not. It will check on its +own. + +*/ + function ChangeTableSQL($tablename, $flds) + { + if ($this->schema) $tabname = $this->schema.'.'.$tablename; + else $tabname = $tablename; + + $conn = &$this->connection; + if (!$conn) return false; + + $colarr = $conn->MetaColumns($tabname); + if (!$colarr) return $this->CreateTableSQL($tablename,$flds); + foreach($colarr as $col) $cols[strtoupper($col->name)] = " ALTER "; + + $sql = array(); + list($lines,$pkey) = $this->_GenFields($flds); + + foreach($lines as $v) { + $f = explode(" ",$v); + if(!empty($cols[strtoupper($f[0])])){ + $sql[] = "ALTER TABLE $tabname $this->alterCol $v"; + }else{ + $sql[] = "ALTER TABLE $tabname $this->addCol $v"; + } + } + return $sql; + } +} // class +?> \ No newline at end of file Index: trunk/themes/default/img/lang/french.gif =================================================================== diff -u Binary files differ Index: trunk/admin/tree/ftv2doc.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_banlist.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/tohtml.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/tohtml.inc.php (revision 0) +++ trunk/kernel/include/adodb/tohtml.inc.php (revision 13) @@ -0,0 +1,154 @@ + +*/ + +// specific code for tohtml +GLOBAL $gSQLMaxRows,$gSQLBlockRows; + +$gSQLMaxRows = 1000; // max no of rows to download +$gSQLBlockRows=20; // max no of rows per table block + +// RecordSet to HTML Table +//------------------------------------------------------------ +// Convert a recordset to a html table. Multiple tables are generated +// if the number of rows is > $gSQLBlockRows. This is because +// web browsers normally require the whole table to be downloaded +// before it can be rendered, so we break the output into several +// smaller faster rendering tables. +// +// $rs: the recordset +// $ztabhtml: the table tag attributes (optional) +// $zheaderarray: contains the replacement strings for the headers (optional) +// +// USAGE: +// include('adodb.inc.php'); +// $db = ADONewConnection('mysql'); +// $db->Connect('mysql','userid','password','database'); +// $rs = $db->Execute('select col1,col2,col3 from table'); +// rs2html($rs, 'BORDER=2', array('Title1', 'Title2', 'Title3')); +// $rs->Close(); +// +// RETURNS: number of rows displayed +function rs2html(&$rs,$ztabhtml=false,$zheaderarray=false,$htmlspecialchars=true) +{ +$s ='';$rows=0;$docnt = false; +GLOBAL $gSQLMaxRows,$gSQLBlockRows; + + if (!$rs) { + printf(ADODB_BAD_RS,'rs2html'); + return false; + } + + if (! $ztabhtml) $ztabhtml = "BORDER='1' WIDTH='98%'"; + //else $docnt = true; + $typearr = array(); + $ncols = $rs->FieldCount(); + $hdr = "\n\n"; + for ($i=0; $i < $ncols; $i++) { + $field = $rs->FetchField($i); + if ($zheaderarray) $fname = $zheaderarray[$i]; + else $fname = htmlspecialchars($field->name); + $typearr[$i] = $rs->MetaType($field->type,$field->max_length); + //print " $field->name $field->type $typearr[$i] "; + + if (strlen($fname)==0) $fname = ' '; + $hdr .= ""; + } + + print $hdr."\n\n"; + // smart algorithm - handles ADODB_FETCH_MODE's correctly! + $numoffset = isset($rs->fields[0]); + + while (!$rs->EOF) { + + $s .= "\n"; + + for ($i=0, $v=($numoffset) ? $rs->fields[0] : reset($rs->fields); + $i < $ncols; + $i++, $v = ($numoffset) ? @$rs->fields[$i] : next($rs->fields)) { + + $type = $typearr[$i]; + switch($type) { + case 'T': + $s .= " \n"; + break; + case 'D': + $s .= " \n"; + break; + case 'I': + case 'N': + $s .= " \n"; + + break; + default: + if ($htmlspecialchars) $v = htmlspecialchars($v); + $s .= " \n"; + + } + } // for + $s .= "\n\n"; + + $rows += 1; + if ($rows >= $gSQLMaxRows) { + $rows = "

    Truncated at $gSQLMaxRows

    "; + break; + } // switch + + $rs->MoveNext(); + + // additional EOF check to prevent a widow header + if (!$rs->EOF && $rows % $gSQLBlockRows == 0) { + + //if (connection_aborted()) break;// not needed as PHP aborts script, unlike ASP + print $s . "
    $fname
    ".$rs->UserTimeStamp($v,"D d, M Y, h:i:s") ." ".$rs->UserDate($v,"D d, M Y") ." ".stripslashes((trim($v))) ." ". str_replace("\n",'
    ',stripslashes((trim($v)))) ." 
    \n\n"; + $s = $hdr; + } + } // while + + print $s."\n\n"; + + if ($docnt) print "

    ".$rows." Rows

    "; + + return $rows; + } + +// pass in 2 dimensional array +function arr2html(&$arr,$ztabhtml='',$zheaderarray='') +{ + if (!$ztabhtml) $ztabhtml = 'BORDER=1'; + + $s = "";//';print_r($arr); + + if ($zheaderarray) { + $s .= ''; + for ($i=0; $i\n"; + } else $s .= " \n"; + $s .= "\n\n"; + } + $s .= '
     
    '; + print $s; +} + + Index: trunk/kernel/include/adodb/adodb-session-clob.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-session-clob.php (revision 0) +++ trunk/kernel/include/adodb/adodb-session-clob.php (revision 13) @@ -0,0 +1,431 @@ +\$HTTP_SESSION_VARS['AVAR']={$HTTP_SESSION_VARS['AVAR']}

    "; + +To force non-persistent connections, call adodb_session_open first before session_start(): + + GLOBAL $HTTP_SESSION_VARS; + include('adodb.inc.php'); + include('adodb-session.php'); + adodb_session_open(false,false,false); + session_start(); + session_register('AVAR'); + $HTTP_SESSION_VARS['AVAR'] += 1; + print "

    \$HTTP_SESSION_VARS['AVAR']={$HTTP_SESSION_VARS['AVAR']}

    "; + + + Installation + ============ + 1. Create this table in your database (syntax might vary depending on your db): + + create table sessions ( + SESSKEY char(32) not null, + EXPIRY int(11) unsigned not null, + EXPIREREF varchar(64), + DATA CLOB, + primary key (sesskey) + ); + + + 2. Then define the following parameters in this file: + $ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase'; + $ADODB_SESSION_CONNECT='server to connect to'; + $ADODB_SESSION_USER ='user'; + $ADODB_SESSION_PWD ='password'; + $ADODB_SESSION_DB ='database'; + $ADODB_SESSION_TBL = 'sessions' + $ADODB_SESSION_USE_LOBS = false; (or, if you wanna use CLOBS (= 'CLOB') or ( = 'BLOB') + + 3. Recommended is PHP 4.0.6 or later. There are documented + session bugs in earlier versions of PHP. + + 4. If you want to receive notifications when a session expires, then + you can tag a session with an EXPIREREF, and before the session + record is deleted, we can call a function that will pass the EXPIREREF + as the first parameter, and the session key as the second parameter. + + To do this, define a notification function, say NotifyFn: + + function NotifyFn($expireref, $sesskey) + { + } + + Then define a global variable, with the first parameter being the + global variable you would like to store in the EXPIREREF field, and + the second is the function name. + + In this example, we want to be notified when a user's session + has expired, so we store the user id in $USERID, and make this + the value stored in the EXPIREREF field: + + $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn'); +*/ + +if (!defined('_ADODB_LAYER')) { + include (dirname(__FILE__).'/adodb.inc.php'); +} + +if (!defined('ADODB_SESSION')) { + + define('ADODB_SESSION',1); + + /* if database time and system time is difference is greater than this, then give warning */ + define('ADODB_SESSION_SYNCH_SECS',60); + +/****************************************************************************************\ + Global definitions +\****************************************************************************************/ +GLOBAL $ADODB_SESSION_CONNECT, + $ADODB_SESSION_DRIVER, + $ADODB_SESSION_USER, + $ADODB_SESSION_PWD, + $ADODB_SESSION_DB, + $ADODB_SESS_CONN, + $ADODB_SESS_LIFE, + $ADODB_SESS_DEBUG, + $ADODB_SESSION_EXPIRE_NOTIFY, + $ADODB_SESSION_CRC; + $ADODB_SESSION_USE_LOBS; + + + $ADODB_SESS_LIFE = ini_get('session.gc_maxlifetime'); + if ($ADODB_SESS_LIFE <= 1) { + // bug in PHP 4.0.3 pl 1 -- how about other versions? + //print "

    Session Error: PHP.INI setting session.gc_maxlifetimenot set: $ADODB_SESS_LIFE

    "; + $ADODB_SESS_LIFE=1440; + } + $ADODB_SESSION_CRC = false; + //$ADODB_SESS_DEBUG = true; + + ////////////////////////////////// + /* SET THE FOLLOWING PARAMETERS */ + ////////////////////////////////// + + if (empty($ADODB_SESSION_DRIVER)) { + $ADODB_SESSION_DRIVER='mysql'; + $ADODB_SESSION_CONNECT='localhost'; + $ADODB_SESSION_USER ='root'; + $ADODB_SESSION_PWD =''; + $ADODB_SESSION_DB ='xphplens_2'; + } + + if (empty($ADODB_SESSION_EXPIRE_NOTIFY)) { + $ADODB_SESSION_EXPIRE_NOTIFY = false; + } + // Made table name configurable - by David Johnson djohnson@inpro.net + if (empty($ADODB_SESSION_TBL)){ + $ADODB_SESSION_TBL = 'sessions'; + } + + + // defaulting $ADODB_SESSION_USE_LOBS + if (!isset($ADODB_SESSION_USE_LOBS) || empty($ADODB_SESSION_USE_LOBS)) { + $ADODB_SESSION_USE_LOBS = false; + } + + /* + $ADODB_SESS['driver'] = $ADODB_SESSION_DRIVER; + $ADODB_SESS['connect'] = $ADODB_SESSION_CONNECT; + $ADODB_SESS['user'] = $ADODB_SESSION_USER; + $ADODB_SESS['pwd'] = $ADODB_SESSION_PWD; + $ADODB_SESS['db'] = $ADODB_SESSION_DB; + $ADODB_SESS['life'] = $ADODB_SESS_LIFE; + $ADODB_SESS['debug'] = $ADODB_SESS_DEBUG; + + $ADODB_SESS['debug'] = $ADODB_SESS_DEBUG; + $ADODB_SESS['table'] = $ADODB_SESS_TBL; + */ + +/****************************************************************************************\ + Create the connection to the database. + + If $ADODB_SESS_CONN already exists, reuse that connection +\****************************************************************************************/ +function adodb_sess_open($save_path, $session_name,$persist=true) +{ +GLOBAL $ADODB_SESS_CONN; + if (isset($ADODB_SESS_CONN)) return true; + +GLOBAL $ADODB_SESSION_CONNECT, + $ADODB_SESSION_DRIVER, + $ADODB_SESSION_USER, + $ADODB_SESSION_PWD, + $ADODB_SESSION_DB, + $ADODB_SESS_DEBUG; + + // cannot use & below - do not know why... + $ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER); + if (!empty($ADODB_SESS_DEBUG)) { + $ADODB_SESS_CONN->debug = true; + ADOConnection::outp( " conn=$ADODB_SESSION_CONNECT user=$ADODB_SESSION_USER pwd=$ADODB_SESSION_PWD db=$ADODB_SESSION_DB "); + } + if ($persist) $ok = $ADODB_SESS_CONN->PConnect($ADODB_SESSION_CONNECT, + $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB); + else $ok = $ADODB_SESS_CONN->Connect($ADODB_SESSION_CONNECT, + $ADODB_SESSION_USER,$ADODB_SESSION_PWD,$ADODB_SESSION_DB); + + if (!$ok) ADOConnection::outp( "

    Session: connection failed

    ",false); +} + +/****************************************************************************************\ + Close the connection +\****************************************************************************************/ +function adodb_sess_close() +{ +global $ADODB_SESS_CONN; + + if ($ADODB_SESS_CONN) $ADODB_SESS_CONN->Close(); + return true; +} + +/****************************************************************************************\ + Slurp in the session variables and return the serialized string +\****************************************************************************************/ +function adodb_sess_read($key) +{ +global $ADODB_SESS_CONN,$ADODB_SESSION_TBL,$ADODB_SESSION_CRC; + + $rs = $ADODB_SESS_CONN->Execute("SELECT data FROM $ADODB_SESSION_TBL WHERE sesskey = '$key' AND expiry >= " . time()); + if ($rs) { + if ($rs->EOF) { + $v = ''; + } else + $v = rawurldecode(reset($rs->fields)); + + $rs->Close(); + + // new optimization adodb 2.1 + $ADODB_SESSION_CRC = strlen($v).crc32($v); + + return $v; + } + + return ''; // thx to Jorma Tuomainen, webmaster#wizactive.com +} + +/****************************************************************************************\ + Write the serialized data to a database. + + If the data has not been modified since adodb_sess_read(), we do not write. +\****************************************************************************************/ +function adodb_sess_write($key, $val) +{ + global + $ADODB_SESS_CONN, + $ADODB_SESS_LIFE, + $ADODB_SESSION_TBL, + $ADODB_SESS_DEBUG, + $ADODB_SESSION_CRC, + $ADODB_SESSION_EXPIRE_NOTIFY, + $ADODB_SESSION_DRIVER, // added + $ADODB_SESSION_USE_LOBS; // added + + $expiry = time() + $ADODB_SESS_LIFE; + + // crc32 optimization since adodb 2.1 + // now we only update expiry date, thx to sebastian thom in adodb 2.32 + if ($ADODB_SESSION_CRC !== false && $ADODB_SESSION_CRC == strlen($val).crc32($val)) { + if ($ADODB_SESS_DEBUG) echo "

    Session: Only updating date - crc32 not changed

    "; + $qry = "UPDATE $ADODB_SESSION_TBL SET expiry=$expiry WHERE sesskey='$key' AND expiry >= " . time(); + $rs = $ADODB_SESS_CONN->Execute($qry); + return true; + } + $val = rawurlencode($val); + + $arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val); + if ($ADODB_SESSION_EXPIRE_NOTIFY) { + $var = reset($ADODB_SESSION_EXPIRE_NOTIFY); + global $$var; + $arr['expireref'] = $$var; + } + + + if ($ADODB_SESSION_USE_LOBS === false) { // no lobs, simply use replace() + $rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL,$arr, 'sesskey',$autoQuote = true); + if (!$rs) { + $err = $ADODB_SESS_CONN->ErrorMsg(); + } + } else { + // what value shall we insert/update for lob row? + switch ($ADODB_SESSION_DRIVER) { + // empty_clob or empty_lob for oracle dbs + case "oracle": + case "oci8": + case "oci8po": + case "oci805": + $lob_value = sprintf("empty_%s()", strtolower($ADODB_SESSION_USE_LOBS)); + break; + + // null for all other + default: + $lob_value = "null"; + break; + } + + // do we insert or update? => as for sesskey + $res = $ADODB_SESS_CONN->Execute("select count(*) as cnt from $ADODB_SESSION_TBL where sesskey = '$key'"); + if ($res && ($res->fields["CNT"] > 0)) { + $qry = sprintf("update %s set expiry = %d, data = %s where sesskey = '%s'", $ADODB_SESSION_TBL, $expiry, $lob_value, $key); + } else { + // insert + $qry = sprintf("insert into %s (sesskey, expiry, data) values ('%s', %d, %s)", $ADODB_SESSION_TBL, $key, $expiry, $lob_value); + } + + $err = ""; + $rs1 = $ADODB_SESS_CONN->Execute($qry); + if (!$rs1) { + $err .= $ADODB_SESS_CONN->ErrorMsg()."\n"; + } + $rs2 = $ADODB_SESS_CONN->UpdateBlob($ADODB_SESSION_TBL, 'data', $val, "sesskey='$key'", strtoupper($ADODB_SESSION_USE_LOBS)); + if (!$rs2) { + $err .= $ADODB_SESS_CONN->ErrorMsg()."\n"; + } + $rs = ($rs1 && $rs2) ? true : false; + } + + if (!$rs) { + ADOConnection::outp( '

    Session Replace: '.nl2br($err).'

    ',false); + } else { + // bug in access driver (could be odbc?) means that info is not commited + // properly unless select statement executed in Win2000 + if ($ADODB_SESS_CONN->databaseType == 'access') + $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'"); + } + return !empty($rs); +} + +function adodb_sess_destroy($key) +{ + global $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY; + + if ($ADODB_SESSION_EXPIRE_NOTIFY) { + reset($ADODB_SESSION_EXPIRE_NOTIFY); + $fn = next($ADODB_SESSION_EXPIRE_NOTIFY); + $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM); + $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE sesskey='$key'"); + $ADODB_SESS_CONN->SetFetchMode($savem); + if ($rs) { + $ADODB_SESS_CONN->BeginTrans(); + while (!$rs->EOF) { + $ref = $rs->fields[0]; + $key = $rs->fields[1]; + $fn($ref,$key); + $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'"); + $rs->MoveNext(); + } + $ADODB_SESS_CONN->CommitTrans(); + } + } else { + $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE sesskey = '$key'"; + $rs = $ADODB_SESS_CONN->Execute($qry); + } + return $rs ? true : false; +} + +function adodb_sess_gc($maxlifetime) +{ + global $ADODB_SESS_DEBUG, $ADODB_SESS_CONN, $ADODB_SESSION_TBL,$ADODB_SESSION_EXPIRE_NOTIFY; + + if ($ADODB_SESSION_EXPIRE_NOTIFY) { + reset($ADODB_SESSION_EXPIRE_NOTIFY); + $fn = next($ADODB_SESSION_EXPIRE_NOTIFY); + $savem = $ADODB_SESS_CONN->SetFetchMode(ADODB_FETCH_NUM); + $rs = $ADODB_SESS_CONN->Execute("SELECT expireref,sesskey FROM $ADODB_SESSION_TBL WHERE expiry < " . time()); + $ADODB_SESS_CONN->SetFetchMode($savem); + if ($rs) { + $ADODB_SESS_CONN->BeginTrans(); + while (!$rs->EOF) { + $ref = $rs->fields[0]; + $key = $rs->fields[1]; + $fn($ref,$key); + $del = $ADODB_SESS_CONN->Execute("DELETE FROM $ADODB_SESSION_TBL WHERE sesskey='$key'"); + $rs->MoveNext(); + } + $ADODB_SESS_CONN->CommitTrans(); + } + } else { + $qry = "DELETE FROM $ADODB_SESSION_TBL WHERE expiry < " . time(); + $ADODB_SESS_CONN->Execute($qry); + + if ($ADODB_SESS_DEBUG) ADOConnection::outp("

    Garbage Collection: $qry

    "); + } + // suggested by Cameron, "GaM3R" + if (defined('ADODB_SESSION_OPTIMIZE')) { + global $ADODB_SESSION_DRIVER; + + switch( $ADODB_SESSION_DRIVER ) { + case 'mysql': + case 'mysqlt': + $opt_qry = 'OPTIMIZE TABLE '.$ADODB_SESSION_TBL; + break; + case 'postgresql': + case 'postgresql7': + $opt_qry = 'VACUUM '.$ADODB_SESSION_TBL; + break; + } + if (!empty($opt_qry)) { + $ADODB_SESS_CONN->Execute($opt_qry); + } + } + + $rs = $ADODB_SESS_CONN->SelectLimit('select '.$ADODB_SESS_CONN->sysTimeStamp.' from '. $ADODB_SESSION_TBL,1); + if ($rs && !$rs->EOF) { + + $dbt = reset($rs->fields); + $rs->Close(); + $dbt = $ADODB_SESS_CONN->UnixTimeStamp($dbt); + $t = time(); + if (abs($dbt - $t) >= ADODB_SESSION_SYNCH_SECS) { + global $HTTP_SERVER_VARS; + $msg = "adodb-session.php: Server time for webserver {$HTTP_SERVER_VARS['HTTP_HOST']} not in synch: database=$dbt, webserver=".$t; + error_log($msg); + if ($ADODB_SESS_DEBUG) ADOConnection::outp("

    $msg

    "); + } + } + + return true; +} + +session_module_name('user'); +session_set_save_handler( + "adodb_sess_open", + "adodb_sess_close", + "adodb_sess_read", + "adodb_sess_write", + "adodb_sess_destroy", + "adodb_sess_gc"); +} + +/* TEST SCRIPT -- UNCOMMENT */ + +if (0) { +GLOBAL $HTTP_SESSION_VARS; + + session_start(); + session_register('AVAR'); + $HTTP_SESSION_VARS['AVAR'] += 1; + ADOConnection::outp( "

    \$HTTP_SESSION_VARS['AVAR']={$HTTP_SESSION_VARS['AVAR']}

    ",false); +} + +?> Index: trunk/admin/images/toolbar/tool_validate_reset_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/sep.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/adduser_custom.php =================================================================== diff -u --- trunk/admin/users/adduser_custom.php (revision 0) +++ trunk/admin/users/adduser_custom.php (revision 13) @@ -0,0 +1,238 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +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"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} +unset($objEditItems); +$objEditItems = new clsUserManager(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); +$objEditItems->EnablePaging = FALSE; +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); + +$c = $objEditItems->GetItemByIndex($en); + +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_edit_user"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:edituser_custom'; + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_User")." '".$c->Get("Login")."' - ".prompt_language("la_tab_Custom"); + +$formaction = $adminURL."/user/adduser_custom.php?".$envar; + +//Display header +$sec = $objSections->GetSection($section); +$objListToolbar = new clsToolBar(); +$objListToolbar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('edituser','UserEditStatus','".$admin."/users/user_list.php',1);","tool_select.gif"); +$objListToolbar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('edituser','UserEditStatus','".$admin."/users/user_list.php',2);","tool_cancel.gif"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/adduser_custom.php"; + $StatusField = "UserEditStatus"; + $form = "edituser"; + MultiEditButtons($objListToolbar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevUser','la_NextUser'); +} + +int_header($objListToolbar,NULL,$title); + +?> +
    +Query_CustomField("Type=6"); + + + $objCustomDataList->SourceTable = $objSession->GetEditTable("CustomMetaData"); + $objCustomDataList->LoadResource($c->Get("ResourceId")); + + for($i=0;$i<$objCustomFields->NumItems(); $i++) + { + $field =& $objCustomFields->GetItemRefByIndex($i); + $fieldid = $field->Get("CustomFieldId"); + + $f = $objCustomDataList->GetDataItem($fieldid); + $fieldname = "CustomData[$fieldid]"; + if(is_object($f)) + { + $val_field = "Get("Value")."\" name=\"$fieldname\">"; + $field->Set("Value", $val_field); + $field->Set("DataId",$f->Get("CustomDataId")); + } + else + { + $val_field = ""; + $field->Set("Value", $val_field); + $field->Set("DataId",0); + } + } + $objCustomFields->SortField = $objConfig->Get("CustomData_LV_Sortfield");; + $objCustomFields->SortItems($objConfig->Get("CustomData_LV_Sortorder")!="desc"); + + $objListView = new clsListView($objListToolbar,$objCustomFields); + $objListView->IdField = "DataId"; + + $order = $objConfig->Get("CustomData_LV_Sortfield"); + $SortOrder=0; + if($objConfig->Get("CustomData_LV_Sortorder")=="asc") + $SortOrder=1; + + $objListView->ColumnHeaders->Add("FieldName",admin_language("la_ColHeader_FieldName"),1,0,$order,"width=\"30%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","FieldName"); + $objListView->ColumnHeaders->Add("FieldLabel",admin_language("la_ColHeader_FieldLabel"),1,0,$order,"width=\"30%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","FieldLabel"); + $objListView->ColumnHeaders->Add("Value",admin_language("la_ColHeader_Value"),1,0,$order,"width=\"40%\"","CustomData_LV_Sortfield","CustomData_LV_Sortorder","Value"); + + $objListView->ColumnHeaders->SetSort($objConfig->Get("CustomData_LV_Sortfield"), $objConfig->Get("CustomData_LV_Sortorder")); + + $objListView->PrintToolBar = FALSE; + $objListView->checkboxes = FALSE; + $objListView->PageURL = "javascript:page_submit('edituser','".$adminURL."/users/adduser_custom.php',0,'{TargetPage}');"; + + $objListView->CurrentPageVar = "Page_CustomData"; + $objListView->PerPageVar = "Perpage_CustomData"; + //$objListView->CheckboxName = "itemlist[]"; + + for($i=0;$iItems);$i++) + { + $objListView->RowIcons[] = $imagesURL."/itemicons/icon16_custom.gif"; + } + + $objListView->PageLinks = $objListView->PrintPageLinks(); + + $objListView->SliceItems(); + print $objListView->PrintList(); +?> + "> + + + + + +
    + > + + + +
    + +
    " name="viewmenu"> + + + + +
    + + + Index: trunk/themes/default/img/bgr_categories.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.bold.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_frontend_mail_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/rasta2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/borg.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/tab_active_back2.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_conf.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_ban_user_f3.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-mssql.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-mssql.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-mssql.inc.php (revision 13) @@ -0,0 +1,277 @@ +Execute('select @@identity'); + if ($rs == false || $rs->EOF) return false; + $id = $rs->fields[0]; + $rs->Close(); + return $id; + } + // might require begintrans -- committrans + function _affectedrows() + { + $rs = $this->Execute('select @@rowcount'); + if ($rs == false || $rs->EOF) return false; + $id = $rs->fields[0]; + $rs->Close(); + return $id; + } + function BeginTrans() + { + $this->_hastrans = true; + $this->Execute('BEGIN TRAN'); + return true; + } + // Reserved for future expansion + function CommitTrans() + { + $this->_hastrans = false; + $this->Execute('COMMIT TRAN'); + return true; + } + // Reserved for future expansion + function RollbackTrans() + { + $this->_hastrans = false; + $this->Execute('ROLLBACK TRAN'); + return true; + } + + + //From: Fernando Moreira + function MetaDatabases() { + if(@mssql_select_db("master")) { + $qry="select name from sysdatabases where name <> 'master'"; + if($rs=@mssql_query($qry)){ + $tmpAr=$ar=array(); + while($tmpAr=@mssql_fetch_row($rs)) + $ar[]=$tmpAr[0]; + @mssql_select_db($this->databaseName); + if(sizeof($ar)) + return($ar); + else + return(false); + } else { + @mssql_select_db($this->databaseName); + return(false); + } + } + return(false); + } + + function SelectDB($dbName) { + $this->databaseName = $dbName; + if ($this->_connectionID) { + return @mssql_select_db($dbName); + } + else return false; + } + /* Returns: the last error message from previous database operation + Note: This function is NOT available for Microsoft SQL Server. */ + function ErrorMsg() + { + $this->_errorMsg = mssql_get_last_message(); + return $this->_errorMsg; + } + + function ErrorNo() + { + $id = mssql_query("select @@ERROR",$this->_connectionID); + if (!$id) return false; + $arr = mssql_fetch_array($id); + @mssql_free_result($id); + if (is_array($arr)) return $arr[0]; + else return -1; + } + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = mssql_connect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + //$this->Execute('SET DATEFORMAT ymd'); + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = mssql_pconnect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + //$this->Execute('SET DATEFORMAT ymd'); + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + // returns query ID if successful, otherwise false + function _query($sql,$inputarr) + { + $val= mssql_query($sql,$this->_connectionID); + return $val; + } + + // returns true or false + function _close() + { + if ($this->_hastrans) $this->RollbackTrans(); + return @mssql_close($this->_connectionID); + } + + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ +global $ADODB_mssql_mths; +$ADODB_mssql_mths = array('JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12); + +class ADORecordset_mssql extends ADORecordSet { + + var $databaseType = "mssql"; + var $canSeek = true; + // _mths works only in non-localised system + + function ADORecordset_mssql($id) + { + return $this->ADORecordSet($id); + } + + + /* Use associative array to get fields array */ + function Fields($colname) + { + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + + return $this->fields[$this->bind[strtoupper($colname)]]; + } + + /* Returns: an object containing field information. + Get column information in the Recordset object. fetchField() can be used in order to obtain information about + fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by + fetchField() is retrieved. */ + + function FetchField($fieldOffset = -1) + { + if ($fieldOffset != -1) { + return @mssql_fetch_field($this->_queryID, $fieldOffset); + } + else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */ + return @mssql_fetch_field($this->_queryID); + } + return null; + } + + function _initrs() + { + GLOBAL $ADODB_COUNTRECS; + $this->_numOfRows = ($ADODB_COUNTRECS)? @mssql_num_rows($this->_queryID):-1; + $this->_numOfFields = @mssql_num_fields($this->_queryID); + } + + function _seek($row) + { + return @mssql_data_seek($this->_queryID, $row); + } + + // INSERT UPDATE DELETE returns false even if no error occurs in 4.0.4 + // also the date format has been changed from YYYY-mm-dd to dd MMM YYYY in 4.0.4. Idiot! + function _fetch($ignore_fields=false) + { + $this->fields = @mssql_fetch_array($this->_queryID); + //print_r($this->fields); + return (!empty($this->fields)); + } + + /* close() only needs to be called if you are worried about using too much memory while your script + is running. All associated result memory for the specified result identifier will automatically be freed. */ + + function _close() { + return @mssql_free_result($this->_queryID); + } + + // mssql uses a default date like Dec 30 2000 12:00AM + function UnixDate($v) + { + global $ADODB_mssql_mths; + + //Dec 30 2000 12:00AM + if (!ereg( "([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4}))" + ,$v, $rr)) return parent::UnixDate($v); + + if ($rr[3] <= 1970) return 0; + + $themth = substr(strtoupper($rr[1]),0,3); + $themth = $ADODB_mssql_mths[$themth]; + if ($themth <= 0) return false; + // h-m-s-MM-DD-YY + return mktime(0,0,0,$themth,$rr[2],$rr[3]); + } + + function UnixTimeStamp($v) + { + global $ADODB_mssql_mths; + + //Dec 30 2000 12:00AM + if (!ereg( "([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})" + ,$v, $rr)) return parent::UnixTimeStamp($v); + if ($rr[3] <= 1970) return 0; + + $themth = substr(strtoupper($rr[1]),0,3); + $themth = $ADODB_mssql_mths[$themth]; + if ($themth <= 0) return false; + + if (strtoupper($rr[6]) == 'P') { + if ($rr[4]<12) $rr[4] += 12; + } else { + if ($rr[4]==12) $rr[4] = 0; + } + // h-m-s-MM-DD-YY + return mktime($rr[4],$rr[5],0,$themth,$rr[2],$rr[3]); + } +} +?> \ No newline at end of file Index: trunk/admin/icons/icon46_list_tool_backup.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/cwm14.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.unlink.gif =================================================================== diff -u Binary files differ Index: trunk/admin/logs/session_list.php =================================================================== diff -u --- trunk/admin/logs/session_list.php (revision 0) +++ trunk/admin/logs/session_list.php (revision 13) @@ -0,0 +1,290 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$adminURL = $rootURL.$admin; +$localURL=$rootURL."kernel/"; + +$imagesURL = $adminURL."/images"; + +//admin only includes +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"); + +$pathtolocal = $pathtoroot; + +/* -------------------------------------- Section configuration ------------------------------------------- */ +$section = 'in-portal:sessionlog'; +$envar = "env=" . BuildEnv(); + +$SortFieldVar = "Session_SortField"; +$SortOrderVar = "Session_SortOrder"; +$DefaultSortField = "UserName"; +$PerPageVar = "Perpage_Sessions"; +$CurrentPageVar = "Page_Sessions"; +$CurrentFilterVar = "Session_View"; + +$ListForm = "sessionlistform"; +$CheckClass = "UserChecks"; + +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$objListToolBar = new clsToolBar(); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("log_refresh", "la_ToolTip_Refresh","#","swap('log_refresh','toolbar/tool_refresh_f2.gif');", + "swap('log_refresh', 'toolbar/tool_refresh.gif');","window.location.reload(true);", + "tool_refresh.gif"); + +$objListToolBar->Add("log_reset","la_ToolTip_Reset","#", "if (UserChecks.itemChecked()) swap('log_reset','toolbar/tool_disconnect_f2.gif');", + "if (UserChecks.itemChecked()) swap('log_reset', 'toolbar/tool_disconnect.gif');","if (UserChecks.itemChecked()) $CheckClass.check_submit('session_list', 'm_session_delete');", + "tool_disconnect.gif",TRUE,TRUE); + +$listImages[] = "$CheckClass.addImage('log_reset','$imagesURL/toolbar/tool_disconnect.gif','$imagesURL/toolbar/tool_disconnect_f3.gif',1);\n "; + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("user_print", "la_ToolTip_Print","#","swap('user_print','toolbar/tool_print_f2.gif');", + "swap('user_print', 'toolbar/tool_print.gif');","window.print();","tool_print.gif"); + +$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();"); + +/* ----------------------------------------- Set the View Filter ---------------------------------------- */ + +/* bit place holders for category view menu */ +$Bit_Active=1; +$Bit_Inactive=2; +$Bit_Guest=4; +$Bit_All = 7; + +$FilterLabels = array(); + +$FilterLabels[0] = admin_language("la_Text_Active"); +$FilterLabels[1] = admin_language("la_Text_Expired"); +$FilterLabels[2] = admin_language("la_Text_Guest"); + +if($_GET["resetpage"]==1) + $objSession->SetVariable("Page_Sessions","1"); + +/* determine current view menu settings */ +$SessionView = $objConfig->Get("Session_View"); + +if(!is_numeric($SessionView)) +{ + $SessionView = $Bit_All; //Set all bits ON + $SessionFilter = ""; +} + +$filter = array(); +$status=array(); + +if($SessionView & $Bit_Active) +{ + $status[] = 1; +} +if($SessionView & Bit_Inactive) +{ + $status[] = 0; +} +if(count($status>0)) +{ + $filter[] = "us.Status IN (".join($status,",").")"; +} + +if(!($SessionView & $Bit_Guest)) + $filter[] = "p.Login IS NOT NULL"; + +$SessionFilter = join(" AND ",$filter); + + +$order = $objConfig->Get("Session_SortOrder"); +$SearchWords = $objSession->GetVariable("SessionSearchWord"); +if(strlen($SearchWords)) +{ + $where = $objSession->AdminSearchWhereClause($SearchWords); +} +else + $where = ""; + +if(strlen($SessionFilter)>0) +{ + if(strlen($where)) + $where.= " AND "; + $where.=$SessionFilter; +} + +//echo $where; + +$sql = "SELECT us.*,if (p.Login IS NULL,'".admin_language("la_Text_Guest")."',p.Login) as UserName, "; +$sql .="if(g.Name IS NULL,'".admin_language("la_Text_GuestUsers")."',g.Name) as GroupName, "; +$sql .="ELT(us.Status+1,'".admin_language("la_Text_Expired")."','".admin_language("la_Text_Active")."') as SessionStatus, "; +$sql .="FROM_UNIXTIME(us.LastAccessed,'%m-%d-%Y') as DateCreated "; +$sql .="FROM ".GetTablePrefix()."UserSession "; +$sql .=" as us LEFT JOIN ".GetTablePrefix()."PortalUser as p USING (PortalUserId) "; +$sql .="LEFT JOIN ".GetTablePrefix()."UserGroup as u ON (p.PortalUserId=u.PortalUserId AND u.PrimaryGroup=1) "; +$sql .="LEFT JOIN ".GetTablePrefix()."PortalGroup as g ON (u.GroupId=g.GroupId) "; +$sql .= " WHERE us.Status = 1 "; +if(strlen($where)) { + $sql .= "AND ".$where; +} + +$orderBy = trim($objConfig->Get("Session_SortField")." ".$objConfig->Get("Session_SortOrder")); +if(strlen($orderBy)) + $sql .=" ORDER BY ".$orderBy; + +$sql .=" ".GetLimitSQL($objSession->GetVariable("Page_Sessionlist"),$objConfig->Get("Perpage_Sessionlist")); + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + +$objUsers->Query_Item($sql); +$itemcount = TableCount(GetTablePrefix()."UserSession", $where,0); + +$objListView = new clsListView($objListToolBar,$objUsers); +$objListView->IdField = "SessionKey"; +$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl"; + +$objListView->ColumnHeaders->Add("UserName",admin_language("la_prompt_Username"),1,0,$order,"width=\"35%\"","Session_SortField","Session_SortOrder","UserName"); +$objListView->ColumnHeaders->Add("GroupName",admin_language("la_prompt_PrimaryGroup"),1,0,$order,"width=\"20%\"","Session_SortField","Session_SortOrder","GroupName"); +$objListView->ColumnHeaders->Add("SessionStatus",admin_language("la_prompt_Status"),1,0,$order,"width=\"10%\"","Session_SortField","Session_SortOrder","SessionStatus"); +$objListView->ColumnHeaders->Add("IpAddress",admin_language("la_prompt_IPAddress"),1,0,$order,"width=\"15%\"","Session_SortField","Session_SortOrder","IPAddress"); +$objListView->ColumnHeaders->Add("DateCreated",admin_language("la_prompt_CreatedOn"),1,0,$order,"width=\"20%\"","Session_SortField","Session_SortOrder","us.LastAccessed"); +$objListView->ColumnHeaders->SetSort($objConfig->Get("Session_SortField"),$order); + +$objListView->PrintToolBar = FALSE; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_session_search"; +$objListView->CurrentPageVar = "Page_Sessionlist"; +$objListView->PerPageVar = "Perpage_Sessionlist"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->TotalItemCount = $itemcount; + + $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, + $CurrentFilterVar,$SessionView,$Bit_All); + + foreach($FilterLabels as $Bit=>$Label) + { + $objListView->AddViewMenuFilter($Label,$Bit); + } + +$title = admin_language("la_Show_Log")." (".$objUsers->NumItems().")"; +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
    +PrintList(); +?> + +
    + + +
    + + + + +
    +
    + + +
    + + + + + Index: trunk/admin/editor/FCKeditor/js/fck_toolbaritems.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_toolbaritems.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_toolbaritems.js (revision 13) @@ -0,0 +1,72 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_toolbaritems.js: Defines all the available toolbar items. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +// This class holds the available toolbar items definitions +function TBI() {} + +// Standard +TBI.prototype.Cut = new TBButton("Cut" , lang["Cut"] , DECMD_CUT) ; +TBI.prototype.Copy = new TBButton("Copy" , lang["Copy"] , DECMD_COPY) ; +TBI.prototype.Paste = new TBButton("Paste" , lang["Paste"] , DECMD_PASTE) ; +TBI.prototype.PasteText = new TBButton("PasteText" , lang["PasteText"] , "pastePlainText()" , TBCMD_CUSTOM, "checkDecCommand(DECMD_PASTE)") ; +TBI.prototype.PasteWord = new TBButton("PasteWord" , lang["PasteWord"] , "pasteFromWord()" , TBCMD_CUSTOM, "checkDecCommand(DECMD_PASTE)") ; +TBI.prototype.Find = new TBButton("Find" , lang["Find"] , DECMD_FINDTEXT) ; +TBI.prototype.SelectAll = new TBButton("SelectAll" , lang["SelectAll"] , DECMD_SELECTALL) ; +TBI.prototype.RemoveFormat = new TBButton("RemoveFormat" , lang["RemoveFormat"] , DECMD_REMOVEFORMAT) ; +TBI.prototype.Link = new TBButton("Link" , lang["InsertLink"] , "dialogLink()" , TBCMD_CUSTOM, "checkDecCommand(DECMD_HYPERLINK)") ; +TBI.prototype.RemoveLink = new TBButton("Unlink" , lang["RemoveLink"] , DECMD_UNLINK) ; +TBI.prototype.Image = new TBButton("Image" , lang["InsertImage"] , "dialogImage()" , TBCMD_CUSTOM) ; +TBI.prototype.Table = new TBButton("Table" , lang["InsertTable"] , "dialogTable()" , TBCMD_CUSTOM) ; +TBI.prototype.Rule = new TBButton("Rule" , lang["InsertLine"] , "InsertHorizontalRule" , TBCMD_DOC) ; +TBI.prototype.SpecialChar = new TBButton("SpecialChar" , lang["InsertSpecialChar"] , "insertSpecialChar()" , TBCMD_CUSTOM) ; +TBI.prototype.Smiley = new TBButton("Smiley" , lang["InsertSmiley"] , "insertSmiley()" , TBCMD_CUSTOM) ; +TBI.prototype.About = new TBButton("About" , lang["About"] , "about()" , TBCMD_CUSTOM) ; + +// Formatting +TBI.prototype.Bold = new TBButton("Bold" , lang["Bold"] , DECMD_BOLD) ; +TBI.prototype.Italic = new TBButton("Italic" , lang["Italic"] , DECMD_ITALIC) ; +TBI.prototype.Underline = new TBButton("Underline" , lang["Underline"] , DECMD_UNDERLINE) ; +TBI.prototype.StrikeThrough = new TBButton("StrikeThrough" , lang["StrikeThrough"] , "strikethrough" , TBCMD_DOC) ; +TBI.prototype.Subscript = new TBButton("Subscript" , lang["Subscript"] , "subscript" , TBCMD_DOC) ; +TBI.prototype.Superscript = new TBButton("Superscript" , lang["Superscript"] , "superscript" , TBCMD_DOC) ; +TBI.prototype.JustifyLeft = new TBButton("JustifyLeft" , lang["LeftJustify"] , DECMD_JUSTIFYLEFT) ; +TBI.prototype.JustifyCenter = new TBButton("JustifyCenter" , lang["CenterJustify"] , DECMD_JUSTIFYCENTER) ; +TBI.prototype.JustifyRight = new TBButton("JustifyRight" , lang["RightJustify"] , DECMD_JUSTIFYRIGHT) ; +TBI.prototype.JustifyFull = new TBButton("JustifyFull" , lang["BlockJustify"] , "JustifyFull" , TBCMD_DOC) ; +TBI.prototype.Outdent = new TBButton("Outdent" , lang["DecreaseIndent"] , DECMD_OUTDENT) ; +TBI.prototype.Indent = new TBButton("Indent" , lang["IncreaseIndent"] , DECMD_INDENT) ; +TBI.prototype.Undo = new TBButton("Undo" , lang["Undo"] , DECMD_UNDO) ; +TBI.prototype.Redo = new TBButton("Redo" , lang["Redo"] , DECMD_REDO) ; +TBI.prototype.InsertOrderedList = new TBButton("InsertOrderedList" , lang["NumberedList"], "insertList('ol')" , TBCMD_CUSTOM, "checkDecCommand(DECMD_ORDERLIST)") ; +TBI.prototype.InsertUnorderedList = new TBButton("InsertUnorderedList", lang["BulettedList"], "insertList('ul')" , TBCMD_CUSTOM, "checkDecCommand(DECMD_UNORDERLIST)") ; + +// Options +TBI.prototype.ShowTableBorders = new TBButton("ShowTableBorders" , lang["ShowTableBorders"] , "showTableBorders()", TBCMD_CUSTOM, "checkShowTableBorders()") ; +TBI.prototype.ShowDetails = new TBButton("ShowDetails" , lang["ShowDetails"] , "showDetails()", TBCMD_CUSTOM, "checkShowDetails()") ; +TBI.prototype.Zoom = new TBCombo( "Zoom" , "doZoom(this)" , "Zoom", "100%;50%;75%;100%;125%;150%;175%;200%", "100;50;75;100;125;150;175;200") ; +TBI.prototype.SpellCheck = new TBButton("SpellCheck" , "SpellCheck" , "SpellCheck()" , TBCMD_CUSTOM) ; + +// Font +TBI.prototype.FontStyle = new TBCombo( "FontStyle" , "doStyle(this)" , lang["FontStyle"] , config.StyleNames, config.StyleValues, 'CheckStyle("cmbFontStyle")') ; +TBI.prototype.FontFormat = new TBCombo( "FontFormat" , "doFormatBlock(this)" , lang["FontFormat"], config.BlockFormatNames, config.BlockFormatNames, 'CheckFontFormat("cmbFontFormat")') ; +TBI.prototype.Font = new TBCombo( "Font" , "doFontName(this)" , lang["Font"] , config.ToolbarFontNames, config.ToolbarFontNames, 'CheckFontName("cmbFont")') ; +TBI.prototype.FontSize = new TBCombo( "FontSize" , "doFontSize(this)" , lang["FontSize"] , ';xx-small;x-small;small;medium;large;x-large;xx-large', ';1;2;3;4;5;6;7', 'CheckFontSize("cmbFontSize")') ; +TBI.prototype.TextColor = new TBButton("TextColor" , lang["TextColor"] , "foreColor()" , TBCMD_CUSTOM) ; +TBI.prototype.BGColor = new TBButton("BGColor" , lang["BGColor"] , "backColor()" , TBCMD_CUSTOM) ; +TBI.prototype.EditSource = new TBCheckBox("EditSource" , "switchEditMode()" , lang["Source"] , "onViewMode") ; + +// This is the object that holds the available toolbar items +var oTB_Items = new TBI() ; \ No newline at end of file Index: trunk/themes/default/categories.tpl =================================================================== diff -u --- trunk/themes/default/categories.tpl (revision 0) +++ trunk/themes/default/categories.tpl (revision 13) @@ -0,0 +1,59 @@ + + + +
    + + + + + + +


    :  
    + + + +
    + + + + + +

    + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + +


    + +

    +





    + + +
    + + +
    + + Index: trunk/admin/images/toolbar/tool_next_f2.gif =================================================================== diff -u Binary files differ Index: trunk/compat/ob_clean.php =================================================================== diff -u --- trunk/compat/ob_clean.php (revision 0) +++ trunk/compat/ob_clean.php (revision 13) @@ -0,0 +1,49 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: ob_clean.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace ob_clean() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/ob_clean + * @author Aidan Lister + * @author Thiemo M�ttig (http://maettig.com/) + * @version $Revision: 1.1 $ + * @since PHP 4.2.0 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('ob_clean')) +{ + function ob_clean () + { + if (@ob_end_clean()) { + return ob_start(); + } + + trigger_error("ob_clean() failed to delete buffer. No buffer to delete.", E_USER_NOTICE); + + return false; + } +} + +?> \ No newline at end of file Index: trunk/kernel/include/adodb/adodb-oracle.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-oracle.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-oracle.inc.php (revision 13) @@ -0,0 +1,242 @@ +fmtDate,$d).",'YYYY-MM-DD')"; + } + + // format and return date string in database timestamp format + function DBTimeStamp($ts) + { + return 'TO_DATE('.date($this->fmtTimeStamp,$ts).",'YYYY-MM-DD, HH:RR:SSAM')"; + } + + function BeginTrans() + { + $this->autoCommit = false; + ora_commitoff($this->_connectionID); + return true; + } + + function CommitTrans() + { + $ret = ora_commit($this->_connectionID); + ora_commiton($this->_connectionID); + return $ret; + } + + function RollbackTrans() + { + $ret = ora_rollback($this->_connectionID); + ora_commiton($this->_connectionID); + return $ret; + } + + function SelectDB($dbName) { + return false; + } + + /* there seems to be a bug in the oracle extension -- always returns ORA-00000 - no error */ + function ErrorMsg() { + $this->_errorMsg = @ora_error($this->_curs); + if (!$this->_errorMsg) $this->_errorMsg = @ora_error($this->_connectionID); + return $this->_errorMsg; + } + + function ErrorNo() { + $err = @ora_errorcode($this->_curs); + if (!$err) return @ora_errorcode($this->_connectionID); + } + + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + if ($argHostname) putenv("ORACLE_HOME=$argHostname"); + //if ($argHostname) print "

    Connect: 1st argument should be left blank for $this->databaseType

    "; + $this->_connectionID = ora_logon($argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($this->autoCommit) ora_commiton($this->_connectionID); + if ($this->_initdate) $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'"); + + return true; + } + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + if ($argHostname) putenv("ORACLE_HOME=$argHostname"); + //if ($argHostname) print "

    PConnect: 1st argument should be left blank for $this->databaseType

    "; + $this->_connectionID = ora_plogon($argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($this->autoCommit) ora_commiton($this->_connectionID); + if ($this->_initdate) $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'"); + + return true; + } + + // returns query ID if successful, otherwise false + function _query($sql,$inputarr) + { + $curs = ora_open($this->_connectionID); + + if ($curs === false) return false; + $this->_curs = $curs; + if (!ora_parse($curs,$sql)) return false; + if (ora_exec($curs)) return $curs; + + @ora_close($curs); + return false; + } + + // returns true or false + function _close() + { + if (!$this->autoCommit) ora_rollback($this->_connectionID); + return @ora_close($this->_connectionID); + } + + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordset_oracle extends ADORecordSet { + + var $databaseType = "oracle"; + var $bind = false; + + function ADORecordset_oracle($queryID) + { + $this->_queryID = $queryID; + + $this->_inited = true; + $this->fields = array(); + if ($queryID) { + $this->_currentRow = 0; + $this->EOF = !$this->_fetch(); + @$this->_initrs(); + } else { + $this->_numOfRows = 0; + $this->_numOfFields = 0; + $this->EOF = true; + } + + return $this->_queryID; + } + + + + /* Returns: an object containing field information. + Get column information in the Recordset object. fetchField() can be used in order to obtain information about + fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by + fetchField() is retrieved. */ + + function FetchField($fieldOffset = -1) + { + $fld = new ADODBFieldObject; + $fld->name = ora_columnname($this->_queryID, $fieldOffset); + $fld->type = ora_columntype($this->_queryID, $fieldOffset); + $fld->max_length = ora_columnsize($this->_queryID, $fieldOffset); + return $fld; + } + + /* Use associative array to get fields array */ + function Fields($colname) + { + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + + return $this->fields[$this->bind[strtoupper($colname)]]; + + } + + function _initrs() + { + $this->_numOfRows = -1; + $this->_numOfFields = @ora_numcols($this->_queryID); + } + + + function _seek($row) + { + return false; + } + + function _fetch($ignore_fields=false) { + // should remove call by reference, but ora_fetch_into requires it in 4.0.3pl1 + return @ora_fetch_into($this->_queryID,&$this->fields,ORA_FETCHINTO_NULLS); + } + + /* close() only needs to be called if you are worried about using too much memory while your script + is running. All associated result memory for the specified result identifier will automatically be freed. */ + + function _close() { + return @ora_close($this->_queryID); + } + + function MetaType($t,$len=-1) + { + switch (strtoupper($t)) { + case 'VARCHAR': + case 'VARCHAR2': + case 'CHAR': + case 'VARBINARY': + case 'BINARY': + if ($len <= $this->blobSize) return 'C'; + case 'LONG': + case 'LONG VARCHAR': + case 'CLOB': + return 'X'; + case 'LONG RAW': + case 'LONG VARBINARY': + case 'BLOB': + return 'B'; + + case 'DATE': return 'D'; + + //case 'T': return 'T'; + + case 'BIT': return 'L'; + case 'INT': + case 'SMALLINT': + case 'INTEGER': return 'I'; + default: return 'N'; + } + } +} +?> \ No newline at end of file Index: trunk/themes/default/favorite_error.tpl =================================================================== diff -u --- trunk/themes/default/favorite_error.tpl (revision 0) +++ trunk/themes/default/favorite_error.tpl (revision 13) @@ -0,0 +1,109 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + +

    +
    + + + + + + + + + + + + + + + + + + + + + +



     
    + +

    +



    +
    + " class="button" onClick="javascript:history.back();"> +
    +
    + + +

    +
    + + + \ No newline at end of file Index: trunk/admin/icons/icon46_tool_backup.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-xmlschema.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-xmlschema.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-xmlschema.inc.php (revision 13) @@ -0,0 +1,722 @@ +tableName = $name; + } + + /** + * Adds a field to a table object + * + * $name is the name of the table to which the field should be added. + * $type is an ADODB datadict field type. The following field types + * are supported as of ADODB 3.40: + * - C: varchar + * - X: CLOB (character large object) or largest varchar size + * if CLOB is not supported + * - C2: Multibyte varchar + * - X2: Multibyte CLOB + * - B: BLOB (binary large object) + * - D: Date (some databases do not support this, and we return a datetime type) + * - T: Datetime or Timestamp + * - L: Integer field suitable for storing booleans (0 or 1) + * - I: Integer (mapped to I4) + * - I1: 1-byte integer + * - I2: 2-byte integer + * - I4: 4-byte integer + * - I8: 8-byte integer + * - F: Floating point number + * - N: Numeric or decimal number + * + * @param string $name Name of the table to which the field will be added. + * @param string $type ADODB datadict field type. + * @param string $size Field size + * @param array $opts Field options array + * @return array Field specifier array + */ + function addField( $name, $type, $size = NULL, $opts = NULL ) { + + // Set the field index so we know where we are + $this->currentField = $name; + + // Set the field type (required) + $this->fieldSpec[$name]['TYPE'] = $type; + + // Set the field size (optional) + if( isset( $size ) ) { + $this->fieldSpec[$name]['SIZE'] = $size; + } + + // Set the field options + if( isset( $opts ) ) $this->fieldSpec[$name]['OPTS'] = $opts; + + // Return array containing field specifier + return $this->fieldSpec; + } + + /** + * Adds a field option to the current field specifier + * + * This method adds a field option allowed by the ADOdb datadict + * and appends it to the given field. + * + * @param string $field Field name + * @param string $opt ADOdb field option + * @param mixed $value Field option value + * @return array Field specifier array + */ + function addFieldOpt( $field, $opt, $value = NULL ) { + + // Add the option to the field specifier + if( $value === NULL ) { // No value, so add only the option + $this->fieldSpec[$field]['OPTS'][] = $opt; + } else { // Add the option and value + $this->fieldSpec[$field]['OPTS'][] = array( "$opt" => "$value" ); + } + + // Return array containing field specifier + return $this->fieldSpec; + } + + /** + * Adds an option to the table + * + *This method takes a comma-separated list of table-level options + * and appends them to the table object. + * + * @param string $opt Table option + * @return string Option list + */ + function addTableOpt( $opt ) { + + $optlist = &$this->tableOpts; + $optlist ? $optlist .= ", $opt" : $optlist = $opt; + + // Return the options list + return $optlist; + } + + /** + * Generates the SQL that will create the table in the database + * + * Returns SQL that will create the table represented by the object. + * + * @param object $dict ADOdb data dictionary + * @return array Array containing table creation SQL + */ + function create( $dict ) { + + // Loop through the field specifier array, building the associative array for the field options + $fldarray = array(); + $i = 0; + + foreach( $this->fieldSpec as $field => $finfo ) { + $i++; + + // Set an empty size if it isn't supplied + if( !isset( $finfo['SIZE'] ) ) $finfo['SIZE'] = ''; + + // Initialize the field array with the type and size + $fldarray[$i] = array( $field, $finfo['TYPE'], $finfo['SIZE'] ); + + // Loop through the options array and add the field options. + $opts = $finfo['OPTS']; + if( $opts ) { + foreach( $finfo['OPTS'] as $opt ) { + + if( is_array( $opt ) ) { // Option has an argument. + $key = key( $opt ); + $value = $opt[key( $opt ) ]; + $fldarray[$i][$key] = $value; + } else { // Option doesn't have arguments + array_push( $fldarray[$i], $opt ); + } + } + } + } + + // Build table array + $sqlArray = $dict->CreateTableSQL( $this->tableName, $fldarray, $this->tableOpts ); + + // Return the array containing the SQL to create the table + return $sqlArray; + } + + /** + * Destructor + */ + function destroy() { + unset( $this ); + } +} + +/** +* Creates an index object in ADOdb's datadict format +* +* This class stores information about a database index. As charactaristics +* of the index are loaded from the external source, methods and properties +* of this class are used to build up the index description in ADOdb's +* datadict format. +* +* @package xmlschema +* @access private +*/ +class dbIndex { + + /** + * @var string Index name + */ + var $indexName; + + /** + * @var string Name of the table this index is attached to + */ + var $tableName; + + /** + * @var array Indexed fields: Table columns included in this index + */ + var $fields; + + /** + * Constructor. Initialize the index and table names. + * + * @param string $name Index name + * @param string $table Name of indexed table + */ + function dbIndex( $name, $table ) { + $this->indexName = $name; + $this->tableName = $table; + } + + /** + * Adds a field to the index + * + * This method adds the specified column to an index. + * + * @param string $name Field name + * @return string Field list + */ + function addField( $name ) { + $fieldlist = &$this->fields; + $fieldlist ? $fieldlist .=" , $name" : $fieldlist = $name; + + // Return the field list + return $fieldlist; + } + + /** + * Generates the SQL that will create the index in the database + * + * Returns SQL that will create the index represented by the object. + * + * @param object $dict ADOdb data dictionary object + * @return array Array containing index creation SQL + */ + function create( $dict ) { + + // Build table array + $sqlArray = $dict->CreateIndexSQL( $this->indexName, $this->tableName, $this->fields ); + + // Return the array containing the SQL to create the table + return $sqlArray; + } + + /** + * Destructor + */ + function destroy() { + unset( $this ); + } +} + +/** +* Creates the SQL to execute a list of provided SQL queries +* +* This class compiles a list of SQL queries specified in the external file. +* +* @package xmlschema +* @access private +*/ +class dbQuerySet { + + /** + * @var array List of SQL queries + */ + var $querySet; + + /** + * @var string String used to build of a query line by line + */ + var $query; + + /** + * Constructor. Initializes the queries array + */ + function dbQuerySet() { + $this->querySet = array(); + $this->query = ''; + } + + /** + * Appends a line to a query that is being built line by line + * + * $param string $data Line of SQL data or NULL to initialize a new query + */ + function buildQuery( $data = NULL ) { + isset( $data ) ? $this->query .= " " . trim( $data ) : $this->query = ''; + } + + /** + * Adds a completed query to the query list + * + * @return string SQL of added query + */ + function addQuery() { + + // Push the query onto the query set array + $finishedQuery = $this->query; + array_push( $this->querySet, $finishedQuery ); + + // Return the query set array + return $finishedQuery; + } + + /** + * Creates and returns the current query set + * + * @return array Query set + */ + function create() { + return $this->querySet; + } + + /** + * Destructor + */ + function destroy() { + unset( $this ); + } +} + + +/** +* Loads and parses an XML file, creating an array of "ready-to-run" SQL statements +* +* This class is used to load and parse the XML file, to create an array of SQL statements +* that can be used to build a database, and to build the database using the SQL array. +* +* @package xmlschema +*/ +class adoSchema { + + /** + * @var array Array containing SQL queries to generate all objects + */ + var $sqlArray; + + /** + * @var object XML Parser object + */ + var $xmlParser; + + /** + * @var object ADOdb connection object + */ + var $dbconn; + + /** + * @var string Database type (platform) + */ + var $dbType; + + /** + * @var object ADOdb Data Dictionary + */ + var $dict; + + /** + * @var object Temporary dbTable object + * @access private + */ + var $table; + + /** + * @var object Temporary dbIndex object + * @access private + */ + var $index; + + /** + * @var object Temporary dbQuerySet object + * @access private + */ + var $querySet; + + /** + * @var string Current XML element + * @access private + */ + var $currentElement; + + /** + * @var long Original Magic Quotes Runtime value + * @access private + */ + var $mgq; + + /** + * Constructor. Initializes the xmlschema object + * + * @param object $dbconn ADOdb connection object + */ + function adoSchema( $dbconn ) { + + // Initialize the environment + $this->mgq = get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + + $this->dbconn = &$dbconn; + $this->dbType = $dbconn->databaseType; + $this->sqlArray = array(); + + // Create an ADOdb dictionary object + $this->dict = NewDataDictionary( $dbconn ); + } + + /** + * Loads and parses an XML file + * + * This method accepts a path to an xmlschema-compliant XML file, + * loads it, parses it, and uses it to create the SQL to generate the objects + * described by the XML file. + * + * @param string $file XML file + * @return array Array of SQL queries, ready to execute + */ + function ParseSchema( $file ) { + + // Create the parser + $this->xmlParser = &$xmlParser; + $xmlParser = xml_parser_create(); + xml_set_object( $xmlParser, &$this ); + + // Initialize the XML callback functions + xml_set_element_handler( $xmlParser, "_xmlcb_startElement", "_xmlcb_endElement" ); + xml_set_character_data_handler( $xmlParser, "_xmlcb_cData" ); + + // Open the file + if( !( $fp = fopen( $file, "r" ) ) ) { + die( "Unable to open file" ); + } + + // Process the file + while( $data = fread( $fp, 4096 ) ) { + if( !xml_parse( $xmlParser, $data, feof( $fp ) ) ) { + die( sprint( "XML error: %s at line %d", + xml_error_string( xml_get_error_code( $xmlParser ) ), + xml_get_current_line_number( $xmlParser ) ) ); + } + } + + // Return the array of queries + return $this->sqlArray; + } + + /** + * Loads a schema into the database + * + * Accepts an array of SQL queries generated by the parser + * and executes them. + * + * @param array $sqlArray Array of SQL statements + * @param boolean $continueOnErr Don't fail out if an error is encountered + * @return integer 0 if failed, 1 if errors, 2 if successful + */ + function ExecuteSchema( $sqlArray, $continueOnErr = TRUE ) { + $err = $this->dict->ExecuteSQLArray( $sqlArray, $continueOnErr ); + + // Return the success code + return $err; + } + + /** + * XML Callback to process start elements + * + * @access private + */ + function _xmlcb_startElement( $parser, $name, $attrs ) { + + $dbType = $this->dbType; + if( isset( $this->table ) ) $table = &$this->table; + if( isset( $this->index ) ) $index = &$this->index; + if( isset( $this->querySet ) ) $querySet = &$this->querySet; + $this->currentElement = $name; + + // Process the element. Ignore unimportant elements. + if( in_array( trim( $name ), array( "SCHEMA", "DESCR", "COL", "CONSTRAINT" ) ) ) { + return FALSE; + } + + switch( $name ) { + + case "TABLE": // Table element + if( $this->supportedPlatform( $attrs['PLATFORM'] ) ) { + $this->table = new dbTable( $attrs['NAME'] ); + } else { + unset( $this->table ); + } + break; + + case "FIELD": // Table field + if( isset( $this->table ) ) { + $fieldName = $attrs['NAME']; + $fieldType = $attrs['TYPE']; + isset( $attrs['SIZE'] ) ? $fieldSize = $attrs['SIZE'] : $fieldSize = NULL; + isset( $attrs['OPTS'] ) ? $fieldOpts = $attrs['OPTS'] : $fieldOpts = NULL; + $this->table->addField( $fieldName, $fieldType, $fieldSize, $fieldOpts ); + } + break; + + case "KEY": // Table field option + if( isset( $this->table ) ) { + $this->table->addFieldOpt( $this->table->currentField, 'KEY' ); + } + break; + + case "NOTNULL": // Table field option + if( isset( $this->table ) ) { + $this->table->addFieldOpt( $this->table->currentField, 'NOTNULL' ); + } + break; + + case "AUTOINCREMENT": // Table field option + if( isset( $this->table ) ) { + $this->table->addFieldOpt( $this->table->currentField, 'AUTOINCREMENT' ); + } + break; + + case "DEFAULT": // Table field option + if( isset( $this->table ) ) { + $this->table->addFieldOpt( $this->table->currentField, 'DEFAULT', $attrs['VALUE'] ); + } + break; + + case "INDEX": // Table index + if( $this->supportedPlatform( $attrs['PLATFORM'] ) ) { + $this->index = new dbIndex( $attrs['NAME'], $attrs['TABLE'] ); + } else { + if( isset( $this->index ) ) unset( $this->index ); + } + break; + + case "SQL": // Freeform SQL queryset + if( $this->supportedPlatform( $attrs['PLATFORM'] ) ) { + $this->querySet = new dbQuerySet( $attrs ); + } else { + if( isset( $this->querySet ) ) unset( $this->querySet ); + } + break; + + case "QUERY": // Queryset SQL query + if( isset( $this->querySet ) ) { + // Ignore this query set if a platform is specified and it's different than the + // current connection platform. + if( $this->supportedPlatform( $attrs['PLATFORM'] ) ) { + $this->querySet->buildQuery(); + } else { + if( isset( $this->querySet->query ) ) unset( $this->querySet->query ); + } + } + break; + + default: + print "OPENING ELEMENT '$name'
    \n"; + } + } + + /** + * XML Callback to process cDATA elements + * + * @access private + */ + function _xmlcb_cData( $parser, $data ) { + + $element = &$this->currentElement; + + if( trim( $data ) == "" ) return; + + // Process the data depending on the element + switch( $element ) { + + case "COL": // Index column + if( isset( $this->index ) ) $this->index->addField( $data ); + break; + + case "DESCR": // Description element + // Display the description information + if( isset( $this->table ) ) { + $name = "({$this->table->tableName}): "; + } elseif( isset( $this->index ) ) { + $name = "({$this->index->indexName}): "; + } else { + $name = ""; + } + print "
  • $name $data\n"; + break; + + case "QUERY": // Query SQL data + if( isset( $this->querySet ) and isset( $this->querySet->query ) ) $this->querySet->buildQuery( $data ); + break; + + case "CONSTRAINT": // Table constraint + if( isset( $this->table ) ) $this->table->addTableOpt( $data ); + break; + + default: + print "
    • CDATA ($element) $data
    \n"; + } + } + + /** + * XML Callback to process end elements + * + * @access private + */ + function _xmlcb_endElement( $parser, $name ) { + + // Process the element. Ignore unimportant elements. + if( in_array( trim( $name ), + array( "SCHEMA", "DESCR", "KEY", "AUTOINCREMENT", "FIELD", + "DEFAULT", "NOTNULL", "CONSTRAINT", "COL" ) ) ) { + return FALSE; + } + + switch( trim( $name ) ) { + + case "TABLE": // Table element + if( isset( $this->table ) ) { + $tableSQL = $this->table->create( $this->dict ); + array_push( $this->sqlArray, $tableSQL[0] ); + $this->table->destroy(); + } + break; + + case "INDEX": // Index element + if( isset( $this->index ) ) { + $indexSQL = $this->index->create( $this->dict ); + array_push( $this->sqlArray, $indexSQL[0] ); + $this->index->destroy(); + } + break; + + case "QUERY": // Queryset element + if( isset( $this->querySet ) and isset( $this->querySet->query ) ) $this->querySet->addQuery(); + break; + + case "SQL": // Query SQL element + if( isset( $this->querySet ) ) { + $querySQL = $this->querySet->create(); + $this->sqlArray = array_merge( $this->sqlArray, $querySQL );; + $this->querySet->destroy(); + } + break; + + default: + print "
  • CLOSING $name\n"; + } + } + + /** + * Checks if element references a specific platform + * + * Returns TRUE is no platform is specified or if we are currently + * using the specified platform. + * + * @param string $platform Requested platform + * @return boolean TRUE if platform check succeeds + * + * @access private + */ + function supportedPlatform( $platform = NULL ) { + + $dbType = $this->dbType; + $regex = "/^(\w*\|)*" . $dbType . "(\|\w*)*$/"; + + if( !isset( $platform ) or + preg_match( $regex, $platform ) ) { + return TRUE; + } else { + return FALSE; + } + } + + /** + * Destructor + */ + function Destroy() { + xml_parser_free( $this->xmlParser ); + set_magic_quotes_runtime( $this->mgq ); + unset( $this ); + } +} +?> Index: trunk/admin/images/itemicons/icon16_custom_disabled.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ed_list_subbullet.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_search_a.gif =================================================================== diff -u Binary files differ Index: trunk/admin/templates/group_element.tpl =================================================================== diff -u --- trunk/admin/templates/group_element.tpl (revision 0) +++ trunk/admin/templates/group_element.tpl (revision 13) @@ -0,0 +1,8 @@ + + + + + + + + Index: trunk/kernel/include/adodb/adodb-lib.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-lib.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-lib.inc.php (revision 13) @@ -0,0 +1,456 @@ + $value) + $new_array[strtoupper($key)] = $value; + + return $new_array; + } + + return $an_array; +} + +// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM +function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false, + $size=0, $selectAttr='',$compareFields0=true) +{ + $hasvalue = false; + + if ($multiple or is_array($defstr)) { + if ($size==0) $size=5; + $attr = " multiple size=$size"; + if (!strpos($name,'[]')) $name .= '[]'; + } else if ($size) $attr = " size=$size"; + else $attr =''; + + $s = "\n"; +} + +/* + Count the number of records this sql statement will return by using + query rewriting techniques... + + Does not work with UNIONs. +*/ +function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0) +{ + if (preg_match("/^\s*SELECT\s+DISTINCT/is", $sql) || preg_match('/\s+GROUP\s+BY\s+/is',$sql)) { + // ok, has SELECT DISTINCT or GROUP BY so see if we can use a table alias + // but this is only supported by oracle and postgresql... + if ($zthis->dataProvider == 'oci8') { + + $rewritesql = preg_replace('/(\sORDER\s+BY\s.*)/is','',$sql); + $rewritesql = "SELECT COUNT(*) FROM ($rewritesql)"; + + } else if ( $zthis->databaseType == 'postgres' || $zthis->databaseType == 'postgres7') { + + $info = $zthis->ServerInfo(); + if (substr($info['version'],0,3) >= 7.1) { // good till version 999 + $rewritesql = preg_replace('/(\sORDER\s+BY\s.*)/is','',$sql); + $rewritesql = "SELECT COUNT(*) FROM ($rewritesql) _ADODB_ALIAS_"; + } + } + } else { + // now replace SELECT ... FROM with SELECT COUNT(*) FROM + + $rewritesql = preg_replace( + '/^\s*SELECT\s.*\s+FROM\s/Uis','SELECT COUNT(*) FROM ',$sql); + + // fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails + // with mssql, access and postgresql. Also a good speedup optimization - skips sorting! + $rewritesql = preg_replace('/(\sORDER\s+BY\s.*)/is','',$rewritesql); + } + + if (isset($rewritesql) && $rewritesql != $sql) { + if ($secs2cache) { + // we only use half the time of secs2cache because the count can quickly + // become inaccurate if new records are added + $qryRecs = $zthis->CacheGetOne($secs2cache/2,$rewritesql,$inputarr); + + } else { + $qryRecs = $zthis->GetOne($rewritesql,$inputarr); + } + if ($qryRecs !== false) return $qryRecs; + } + + // query rewrite failed - so try slower way... + $rewritesql = preg_replace('/(\sORDER\s+BY\s.*)/is','',$sql); + $rstest = &$zthis->Execute($rewritesql); + if ($rstest) { + $qryRecs = $rstest->RecordCount(); + if ($qryRecs == -1) { + global $ADODB_EXTENSION; + // some databases will return -1 on MoveLast() - change to MoveNext() + if ($ADODB_EXTENSION) { + while(!$rstest->EOF) { + adodb_movenext($rstest); + } + } else { + while(!$rstest->EOF) { + $rstest->MoveNext(); + } + } + $qryRecs = $rstest->_currentRow; + } + $rstest->Close(); + if ($qryRecs == -1) return 0; + } + + return $qryRecs; +} + +/* + Code originally from "Cornel G" + + This code will not work with SQL that has UNION in it + + Also if you are using CachePageExecute(), there is a strong possibility that + data will get out of synch. use CachePageExecute() only with tables that + rarely change. +*/ +function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page, + $inputarr=false, $arg3=false, $secs2cache=0) +{ + $atfirstpage = false; + $atlastpage = false; + $lastpageno=1; + + // If an invalid nrows is supplied, + // we assume a default value of 10 rows per page + if (!isset($nrows) || $nrows <= 0) $nrows = 10; + + $qryRecs = false; //count records for no offset + + $qryRecs = _adodb_getcount($zthis,$sql,$inputarr,$secs2cache); + $lastpageno = (int) ceil($qryRecs / $nrows); + $zthis->_maxRecordCount = $qryRecs; + + // If page number <= 1, then we are at the first page + if (!isset($page) || $page <= 1) { + $page = 1; + $atfirstpage = true; + } + + // ***** Here we check whether $page is the last page or + // whether we are trying to retrieve + // a page number greater than the last page number. + if ($page >= $lastpageno) { + $page = $lastpageno; + $atlastpage = true; + } + + // We get the data we want + $offset = $nrows * ($page-1); + if ($secs2cache > 0) + $rsreturn = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr, $arg3); + else + $rsreturn = &$zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $arg3, $secs2cache); + + + // Before returning the RecordSet, we set the pagination properties we need + if ($rsreturn) { + $rsreturn->_maxRecordCount = $qryRecs; + $rsreturn->rowsPerPage = $nrows; + $rsreturn->AbsolutePage($page); + $rsreturn->AtFirstPage($atfirstpage); + $rsreturn->AtLastPage($atlastpage); + $rsreturn->LastPageNo($lastpageno); + } + return $rsreturn; +} + +// Iv�n Oliva version +function &_adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr=false, $arg3=false, $secs2cache=0) +{ + + $atfirstpage = false; + $atlastpage = false; + + if (!isset($page) || $page <= 1) { // If page number <= 1, then we are at the first page + $page = 1; + $atfirstpage = true; + } + if ($nrows <= 0) $nrows = 10; // If an invalid nrows is supplied, we assume a default value of 10 rows per page + + // ***** Here we check whether $page is the last page or whether we are trying to retrieve a page number greater than + // the last page number. + $pagecounter = $page + 1; + $pagecounteroffset = ($pagecounter * $nrows) - $nrows; + if ($secs2cache>0) $rstest = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr, $arg3); + else $rstest = &$zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $arg3, $secs2cache); + if ($rstest) { + while ($rstest && $rstest->EOF && $pagecounter>0) { + $atlastpage = true; + $pagecounter--; + $pagecounteroffset = $nrows * ($pagecounter - 1); + $rstest->Close(); + if ($secs2cache>0) $rstest = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr, $arg3); + else $rstest = &$zthis->SelectLimit($sql, $nrows, $pagecounteroffset, $inputarr, $arg3, $secs2cache); + } + if ($rstest) $rstest->Close(); + } + if ($atlastpage) { // If we are at the last page or beyond it, we are going to retrieve it + $page = $pagecounter; + if ($page == 1) $atfirstpage = true; // We have to do this again in case the last page is the same as the first + //... page, that is, the recordset has only 1 page. + } + + // We get the data we want + $offset = $nrows * ($page-1); + if ($secs2cache > 0) $rsreturn = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr, $arg3); + else $rsreturn = &$zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $arg3, $secs2cache); + + // Before returning the RecordSet, we set the pagination properties we need + if ($rsreturn) { + $rsreturn->rowsPerPage = $nrows; + $rsreturn->AbsolutePage($page); + $rsreturn->AtFirstPage($atfirstpage); + $rsreturn->AtLastPage($atlastpage); + } + return $rsreturn; +} + +function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq=false) +{ + if (!$rs) { + printf(ADODB_BAD_RS,'GetUpdateSQL'); + return false; + } + + $fieldUpdatedCount = 0; + $arrFields = _array_change_key_case($arrFields); + + // Get the table name from the existing query. + preg_match("/FROM\s+".ADODB_TABLE_REGEX."/is", $rs->sql, $tableName); + + // Get the full where clause excluding the word "WHERE" from + // the existing query. + preg_match('/\sWHERE\s(.*)/is', $rs->sql, $whereClause); + + $discard = false; + // not a good hack, improvements? + if ($whereClause) + preg_match('/\s(LIMIT\s.*)/is', $whereClause[1], $discard); + + if ($discard) + $whereClause[1] = substr($whereClause[1], 0, strlen($whereClause[1]) - strlen($discard[1])); + + // updateSQL will contain the full update query when all + // processing has completed. + $updateSQL = "UPDATE " . $tableName[1] . " SET "; + + $hasnumeric = isset($rs->fields[0]); + + // Loop through all of the fields in the recordset + for ($i=0, $max=$rs->FieldCount(); $i < $max; $i++) { + + // Get the field from the recordset + $field = $rs->FetchField($i); + + // If the recordset field is one + // of the fields passed in then process. + $upperfname = strtoupper($field->name); + if (isset($arrFields[$upperfname])) { + + // If the existing field value in the recordset + // is different from the value passed in then + // go ahead and append the field name and new value to + // the update query. + + if ($hasnumeric) $val = $rs->fields[$i]; + else if (isset($rs->fields[$upperfname])) $val = $rs->fields[$upperfname]; + else $val = ''; + + if ($forceUpdate || strcmp($val, $arrFields[$upperfname])) { + // Set the counter for the number of fields that will be updated. + $fieldUpdatedCount++; + + // Based on the datatype of the field + // Format the value properly for the database + $mt = $rs->MetaType($field->type); + + // "mike" patch and "Ryan Bailey" + //PostgreSQL uses a 't' or 'f' and therefore needs to be processed as a string ('C') type field. + if ((strncmp($zthis->databaseType,"postgres",8) === 0) && ($mt == "L")) $mt = "C"; + // is_null requires php 4.0.4 + if (/*is_null($arrFields[$fieldname]) ||*/ $arrFields[$upperfname] === 'null') + $updateSQL .= $field->name . " = null, "; + else + switch($mt) { + case 'null': + case "C": + case "X": + case 'B': + $updateSQL .= $field->name . " = " . $zthis->qstr($arrFields[$upperfname],$magicq) . ", "; + break; + case "D": + $updateSQL .= $field->name . " = " . $zthis->DBDate($arrFields[$upperfname]) . ", "; + break; + case "T": + $updateSQL .= $field->name . " = " . $zthis->DBTimeStamp($arrFields[$upperfname]) . ", "; + break; + default: + $val = $arrFields[$upperfname]; + if (!is_numeric($val)) $val = (float) $val; + $updateSQL .= $field->name . " = " . $val . ", "; + break; + }; + }; + }; + }; + + // If there were any modified fields then build the rest of the update query. + if ($fieldUpdatedCount > 0 || $forceUpdate) { + // Strip off the comma and space on the end of the update query. + $updateSQL = substr($updateSQL, 0, -2); + + // If the recordset has a where clause then use that same where clause + // for the update. + if ($whereClause[1]) $updateSQL .= " WHERE " . $whereClause[1]; + + return $updateSQL; + } else { + return false; + }; +} + +function _adodb_getinsertsql(&$zthis,&$rs,$arrFields,$magicq=false) +{ + $values = ''; + $fields = ''; + $arrFields = _array_change_key_case($arrFields); + if (!$rs) { + printf(ADODB_BAD_RS,'GetInsertSQL'); + return false; + } + + $fieldInsertedCount = 0; + + // Get the table name from the existing query. + preg_match("/FROM\s+".ADODB_TABLE_REGEX."/is", $rs->sql, $tableName); + + // Loop through all of the fields in the recordset + for ($i=0, $max=$rs->FieldCount(); $i < $max; $i++) { + + // Get the field from the recordset + $field = $rs->FetchField($i); + // If the recordset field is one + // of the fields passed in then process. + $upperfname = strtoupper($field->name); + if (isset($arrFields[$upperfname])) { + + // Set the counter for the number of fields that will be inserted. + $fieldInsertedCount++; + + // Get the name of the fields to insert + $fields .= $field->name . ", "; + + $mt = $rs->MetaType($field->type); + + // "mike" patch and "Ryan Bailey" + //PostgreSQL uses a 't' or 'f' and therefore needs to be processed as a string ('C') type field. + if ((strncmp($zthis->databaseType,"postgres",8) === 0) && ($mt == "L")) $mt = "C"; + + // Based on the datatype of the field + // Format the value properly for the database + if (/*is_null($arrFields[$fieldname]) ||*/ $arrFields[$upperfname] === 'null') + $values .= "null, "; + else + switch($mt) { + case "C": + case "X": + case 'B': + $values .= $zthis->qstr($arrFields[$upperfname],$magicq) . ", "; + break; + case "D": + $values .= $zthis->DBDate($arrFields[$upperfname]) . ", "; + break; + case "T": + $values .= $zthis->DBTimeStamp($arrFields[$upperfname]) . ", "; + break; + default: + $val = $arrFields[$upperfname]; + if (!is_numeric($val)) $val = (float) $val; + $values .= $val . ", "; + break; + }; + }; + }; + + // If there were any inserted fields then build the rest of the insert query. + if ($fieldInsertedCount > 0) { + + // Strip off the comma and space on the end of both the fields + // and their values. + $fields = substr($fields, 0, -2); + $values = substr($values, 0, -2); + + // Append the fields and their values to the insert query. + $insertSQL = "INSERT INTO " . $tableName[1] . " ( $fields ) VALUES ( $values )"; + + return $insertSQL; + + } else { + return false; + }; +} +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/beaute.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/rate_access_denied.tpl =================================================================== diff -u --- trunk/themes/default/rate_access_denied.tpl (revision 0) +++ trunk/themes/default/rate_access_denied.tpl (revision 13) @@ -0,0 +1,56 @@ + + + +
    "> + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    *
     
    *
     
      + ">
    +
    + " class="button"> +
     


    +
    +

    + +


    ">
    +
    +
    + + Index: trunk/themes/default/img/noimage_thumb.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_login.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/msn/broken_heart.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-informix.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-informix.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-informix.inc.php (revision 13) @@ -0,0 +1,30 @@ +ADORecordset_informix72($id,$mode); + } +} +?> \ No newline at end of file Index: trunk/kernel/include/syscache.php =================================================================== diff -u --- trunk/kernel/include/syscache.php (revision 0) +++ trunk/kernel/include/syscache.php (revision 13) @@ -0,0 +1,247 @@ +clsItemDB(); + $this->tablename = GetTablePrefix()."SysCache"; + $this->type=12; + $this->BasePermission=""; + $this->id_field = "SysCacheId"; + $this->NoResourceId=1; + $this->debuglevel=0; + + if($id != NULL) + { + if(is_numeric($id)) + { + $this->LoadFromDatabase($id); + } + else + $this->LoadByName($name); + } + } + + function LoadFromDatabase($Id) + { + global $Errors; + + $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ".$this->id_field."='%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 LoadByName($name) + { + global $Errors; + + $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE Name ='%s'",$name); + + $result = $this->adodbConnection->Execute($sql); + if ($result === false || $result->EOF) + { + $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadByName"); + return false; + } + + $data = $result->fields; + $this->SetFromArray($data); + $this->Clean(); + return true; + } +} + +class clsSysCacheList extends clsItemCollection +{ + + function clsSysCacheList() + { + $this->clsItemCollection(); + $this->SourceTable=GetTablePrefix()."SysCache"; + $this->classname = "clsSysCacheItem"; + + } + + function &GetItemByModule($name, $module, $GroupList="", $LoadFromDB=TRUE) + { + $found=FALSE; + + if(is_array($this->Items)) + { + foreach($this->Items as $i) + { + if($i->Get("Name")==$name && $i->Get("Module")==$module) + { + $found = TRUE; + break; + } + } + } + if(!$found && $LoadFromDB==TRUE) + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE Name = '$name' AND Module='$module' AND GroupList='$GroupList'"; + //echo $sql; + $res = $this->adodbConnection->Execute($sql); + + if($res && !$res->EOF) + { + $i = $this->AddItemFromArray($res->fields); + $i->tablename = $this->SourceTable; + $i->Clean(); + $found = TRUE; + } + else + $i = FALSE; + } + if(!$found) + { + unset($i); + $i = FALSE; + } + return $i; + } + + function &GetContextItem($name,$module,$context, $GroupList="", $LoadFromDB=TRUE) + { + $found=FALSE; + + if(is_array($this->Items)) + { + foreach($this->Items as $i) + { + if($i->Get("Name")==$name && $i->Get("Module")==$module && $i->Get("Context")==$context) + { + $found = TRUE; + break; + } + } + } + + + if(!$found && $LoadFromDB==TRUE) + { + unset($i); + $sql = "SELECT * FROM ".$this->SourceTable." WHERE Name = '$name' AND Module='$module' AND Context='$context' AND GroupList='$GroupList'"; + //echo $sql."
    \n"; + $res = $this->adodbConnection->Execute($sql); + + if($res && !$res->EOF) + { + $i = $this->AddItemFromArray($res->fields); + $i->tablename = $this->SourceTable; + $i->Clean(); + $found = TRUE; + } + else + $i = FALSE; + } + if(!$found) + { + unset($i); + $i = FALSE; + } + return $i; + } + + function &AddCacheItem($name,$value,$module="",$expire=0,$context="",$GroupList="") + { + $i = new clsSysCacheItem(); + + $i->tablename = $this->SourceTable; + $i->Set(array("Name","Value","Expire","GroupList"),array($name,$value,$expire, $GroupList)); + if(strlen($module)) + $i->Set("Module",$module); + $i->Set("Context",$context); + $i->Create(); + return $i; + } + + function &EditCacheItem($name,$value,$module="",$expire=0,$context="",$GroupList="") + { + if(strlen($context)) + { + $i =& $this->GetItemByModule($name,$module, $GroupList,TRUE); + } + else + $i =& $this->GetContextItem($name,$module,$context,$GroupList); + if(is_object($i)) + { + if($i->Get("Value")!=$value && $name==$i->Get("Name") && $i->Get("Context")==$context && + $GroupList==$i->Get("GroupList")) + { + $i->Set(array("Name","Value","Expire","GroupList"),array($name,$value,$expire, $GroupList)); + if(strlen($module)) + $i->Set("Module",$module); + $i->Set("Context",$context); + + $i->Update(); + } + else + { + $this->AddCacheItem($name,$value,$module,$expire, $context, $GroupList); + } + } + else + { + $this->AddCacheItem($name,$value,$module,$expire, $context, $GroupList); + } + } + + function DeleteCacheItem($name,$module="") + { + $i =& $this->GetItemByModule($name,$module,TRUE); + if(is_object($i)) + { + $i->Delete(); + } + } + + function GetContextValue($Name,$Module,$Context="",$GroupList="") + { + $ret = ""; + $i =& $this->GetContextItem($Name,$Module,$Context, $GroupList); + if(is_object($i)) + $ret = $i->Get("Value"); + return $ret; + } + + function GetValue($Name,$Module="",$GroupList="") + { + $ret = ""; + $i =& $this->GetItemByModule($Name,$Module,$GroupList); + if(is_object($i)) + $ret = $i->Get("Value"); + return $ret; + } + + function PurgeExpired() + { + $sql = "DELETE FROM ".$this->SourceTable." WHERE Expire>0 AND Expire <".date("U"); + $this->adodbConnection->Execute($sql); + } + + function PurgeCategory($CatId) + { + $sql = "DELETE FROM ".$this->SourceTable." WHERE Context LIKE ':m".$CatId."-%'"; + $this->adodbConnection->Execute($sql); + } + + function DeleteCachedItem($where) + { + $sql = "DELETE FROM ".$this->SourceTable; + if(strlen($where)) + $sql .= " WHERE $where"; + $this->adodbConnection->Execute($sql); + //echo $sql."
    \n"; + } +} +?> Index: trunk/admin/editor/frametest.htm =================================================================== diff -u --- trunk/admin/editor/frametest.htm (revision 0) +++ trunk/admin/editor/frametest.htm (revision 13) @@ -0,0 +1,12 @@ + + + Editor Test -- Frame + + + + + + + + + Index: trunk/admin/images/progress_bar_segment.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/css/fck_editorarea.css =================================================================== diff -u --- trunk/admin/editor/FCKeditor/css/fck_editorarea.css (revision 0) +++ trunk/admin/editor/FCKeditor/css/fck_editorarea.css (revision 13) @@ -0,0 +1,54 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_editorarea.css: Styles used in the editor area. The final user + * should customize it for his web site needs. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +body +{ + font-size: 12px; + font-family: Arial; +} + +/* To avoid automatic paragraphs spaces: */ +/* +P, UL, OL { margin-top: 0px; margin-bottom: 0px; } +*/ + +.MainHeader +{ + font-weight: bold; + text-transform: uppercase; + color: #990066; +} + +.BlueTitle +{ + font-weight: bold; + text-transform: capitalize; + color: #0099cc; +} + +.CenteredTitle +{ + font-weight: bold; + color: #ff0033; + text-align: center; +} + +.AlexTest +{ + text-decoration: underline; + color: red; +} \ No newline at end of file Index: trunk/themes/default/recommend/recommend_confirm.tpl =================================================================== diff -u --- trunk/themes/default/recommend/recommend_confirm.tpl (revision 0) +++ trunk/themes/default/recommend/recommend_confirm.tpl (revision 13) @@ -0,0 +1,112 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + + +

    +
    + + "> + + + + + + + + + + + + + + + + + + + + + +



     
    +

    + +




    +
    + " class="button"> +
    +
    + + +

    +
    + + + Index: trunk/admin/editor/FCKeditor/images/smiley/msn/confused_smile.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-mysql.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-mysql.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-mysql.inc.php (revision 13) @@ -0,0 +1,333 @@ +_connectionID); + } + + function _affectedrows() + { + return mysql_affected_rows($this->_connectionID); + } + + // See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html + // Reference on Last_Insert_ID on the recommended way to simulate sequences + var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);"; + var $_genSeqSQL = "create table %s (id int not null)"; + var $_genSeq2SQL = "insert into %s values (0)"; + + function GenID($seqname='adodbseq') + { + if (!$this->hasGenID) return false; + + $getnext = sprintf($this->_genIDSQL,$seqname); + $rs = @$this->Execute($getnext); + if (!$rs) { + $u = strtoupper($seqname); + $this->Execute(sprintf($this->_genSeqSQL,$seqname)); + $this->Execute(sprintf($this->_genSeq2SQL,$seqname)); + $rs = $this->Execute($getnext); + } + $this->genID = mysql_insert_id($this->_connectionID); + + if ($rs) $rs->Close(); + + return $this->genID; + } + + function &MetaDatabases() + { + $qid = mysql_list_dbs($this->_connectionID); + $arr = array(); + $i = 0; + $max = mysql_num_rows($qid); + while ($i < $max) { + $arr[] = mysql_tablename($qid,$i); + $i += 1; + } + return $arr; + } + + // returns concatenated string + function Concat() + { + $s = ""; + $arr = func_get_args(); + $first = true; + /* + foreach($arr as $a) { + if ($first) { + $s = $a; + $first = false; + } else $s .= ','.$a; + }*/ + + // suggestion by andrew005@mnogo.ru + $s = implode(',',$arr); + if (strlen($s) > 0) return "CONCAT($s)"; + else return ''; + } + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword); + if ($this->_connectionID === false) return false; + if ($argDatabasename) return $this->SelectDB($argDatabasename); + return true; + } + + function &MetaColumns($table) + { + if ($this->metaColumnsSQL) { + + $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table)); + + if ($rs === false) return false; + + $retarr = array(); + while (!$rs->EOF){ + $fld = new ADODBFieldObject(); + $fld->name = $rs->fields[0]; + $fld->type = $rs->fields[1]; + + // split type into type(length): + if (preg_match("/^(.+)\((\d+)\)$/", $fld->type, $query_array)) { + $fld->type = $query_array[1]; + $fld->max_length = $query_array[2]; + } else { + $fld->max_length = -1; + } + $fld->not_null = ($rs->fields[2] != 'YES'); + $fld->primary_key = ($rs->fields[3] == 'PRI'); + $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false); + $fld->binary = (strpos($fld->type,'blob') !== false); + + $retarr[strtoupper($fld->name)] = $fld; + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + return false; + } + + // returns true or false + function SelectDB($dbName) + { + $this->databaseName = $dbName; + if ($this->_connectionID) { + return @mysql_select_db($dbName,$this->_connectionID); + } + else return false; + } + + // parameters use PostgreSQL convention, not MySQL + function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $arg3=false,$secs=0) + { + $offsetStr =($offset>=0) ? "$offset," : ''; + + return ($secs) ? $this->CacheExecute($secs,$sql." LIMIT $offsetStr$nrows",$inputarr,$arg3) + : $this->Execute($sql." LIMIT $offsetStr$nrows",$inputarr,$arg3); + + } + + // returns queryID or false + function _query($sql,$inputarr) + { + global $ADODB_COUNTRECS; + + if($ADODB_COUNTRECS) + $r= @mysql_query($sql,$this->_connectionID); + else + $r = @mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6 + + return $r; + } + + /* Returns: the last error message from previous database operation */ + function ErrorMsg() + { + $this->_errorMsg = @mysql_error($this->_connectionID); + return $this->_errorMsg; + } + + /* Returns: the last error number from previous database operation */ + function ErrorNo() + { + return @mysql_errno($this->_connectionID); + } + + // returns true or false + function _close() + { + return @mysql_close($this->_connectionID); + } + +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordSet_mysql extends ADORecordSet{ + + var $databaseType = "mysql"; + var $canSeek = true; + var $fetchMode; + + function ADORecordSet_mysql($queryID) { + GLOBAL $ADODB_FETCH_MODE; + + switch ($ADODB_FETCH_MODE) + { + case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break; + case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break; + default: + case ADODB_FETCH_DEFAULT: + case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break; + } + + $this->ADORecordSet($queryID); + } + + function _initrs() + { + GLOBAL $ADODB_COUNTRECS; + $this->_numOfRows = ($ADODB_COUNTRECS) ? @mysql_num_rows($this->_queryID):-1; + $this->_numOfFields = @mysql_num_fields($this->_queryID); + } + + function &FetchField($fieldOffset = -1) { + if ($fieldOffset != -1) { + $o = @mysql_fetch_field($this->_queryID, $fieldOffset); + $f = @mysql_field_flags($this->_queryID,$fieldOffset); + $o->max_length = @mysql_field_len($this->_queryID,$fieldOffset); // suggested by: Jim Nicholson (jnich@att.com) + //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable + $o->binary = (strpos($f,'binary')!== false); + } + else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */ + $o = @mysql_fetch_field($this->_queryID); + $o->max_length = @mysql_field_len($this->_queryID); // suggested by: Jim Nicholson (jnich@att.com) + //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable + } + + return $o; + } + + function _seek($row) + { + return @mysql_data_seek($this->_queryID,$row); + } + + // 10% speedup to move MoveNext to child class + function MoveNext($ignore_fields=false) + { + if ($this->_numOfRows != 0 && !$this->EOF) { + $this->_currentRow++; + // using & below slows things down by 20%! + $this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode); + + if (is_array($this->fields)) return true; + } + $this->EOF = true; + return false; + } + + function _fetch($ignore_fields=false) + { + $this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode); + return (is_array($this->fields)); + } + + function _close() { + return @mysql_free_result($this->_queryID); + } + + function MetaType($t,$len=-1,$fieldobj=false) + { + $len = -1; // mysql max_length is not accurate + switch (strtoupper($t)) { + case 'STRING': + case 'CHAR': + case 'VARCHAR': + case 'TINYBLOB': + case 'TINYTEXT': + case 'ENUM': + case 'SET': + if ($len <= $this->blobSize) return 'C'; + + case 'TEXT': + case 'LONGTEXT': + case 'MEDIUMTEXT': + return 'X'; + + // php_mysql extension always returns 'blob' even if 'text' + // so we have to check whether binary... + case 'IMAGE': + case 'LONGBLOB': + case 'BLOB': + case 'MEDIUMBLOB': + return !empty($fieldobj->binary) ? 'B' : 'X'; + + case 'DATE': return 'D'; + + case 'DATETIME': + case 'TIMESTAMP': return 'T'; + + case 'INT': + case 'INTEGER': + case 'BIGINT': + case 'TINYINT': + case 'MEDIUMINT': + case 'SMALLINT': + + if (!empty($fieldobj->primary_key)) return 'R'; + else return 'I'; + + default: return 'N'; + } + } + +} +} +?> \ No newline at end of file Index: trunk/admin/images/summary/overviewbox_bg.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_reset.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_conf.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_rule_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_tool_restore.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/browse.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/browse.html (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/browse.html (revision 13) @@ -0,0 +1,71 @@ + + + + + FCKeditor - Image Browser + + + + + + + + + + + + +
    + + + + + +
    + Select the image to load
    +
    + Nature
    + Money
    + Pen
    + Spanner
    + Tech Cable
    + Tech PCB
    + +
    +
    +      +
    +
    + + Index: trunk/themes/default/img/lang/finnish.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/logo_bg_in-bulletin.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_prev_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/email/log.txt =================================================================== diff -u --- trunk/admin/email/log.txt (revision 0) +++ trunk/admin/email/log.txt (revision 13) @@ -0,0 +1,224 @@ +host=mx1.intechnic.com +port=25 +helo=INPORTAL +auth= +Connected to mx1.intechnic.com +GET: 220 mx1.intechnic.com ESMTP + + +SEND: HELO INPORTAL + +GET: 250 mx1.intechnic.com + + +SEND: MAIL FROM:<"In-Portal Development" > + +GET: 250 ok + + +SEND: RCPT TO:<"Test Guy" > + +GET: 250 ok + + +SEND: DATA + +GET: 354 go ahead + + +SEND: Subject: Subject: You have been approved +Return-Path: chris@intechnic.com +Date: Fri, 16 Jul 2004 08:55:06 -0500 +From: "In-Portal Development" +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="-----=815a5d07052bc2bc0b14d9351c5547b7" +To: "Test Guy" + +SEND: + +SEND: -------=815a5d07052bc2bc0b14d9351c5547b7 +Content-Type: text/plain; charset="ascii-us" +Content-Transfer-Encoding: 8bit + +Welcome to In-portal! + +Your user registration has been approved. Your user name is "tester". + +-------=815a5d07052bc2bc0b14d9351c5547b7-- + + +SEND: +. + +GET: 250 ok 1089986107 qp 28252 + + +Message to "In-Portal Development" Delivered Successfully +host=mx1.intechnic.com +port=25 +helo=INPORTAL +auth= +Connected to mx1.intechnic.com +GET: 220 mx1.intechnic.com ESMTP + + +SEND: HELO INPORTAL + +GET: 250 mx1.intechnic.com + + +SEND: MAIL FROM:<"In-Portal Development" > + +GET: 250 ok + + +SEND: RCPT TO:<"Test Guy" > + +GET: 250 ok + + +SEND: DATA + +GET: 354 go ahead + + +SEND: Subject: You have been approved +Return-Path: chris@intechnic.com +Date: Fri, 16 Jul 2004 08:57:47 -0500 +From: "In-Portal Development" +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="-----=93ebb602f383fb1cf52028f8c504f67a" +To: "Test Guy" + +SEND: + +SEND: -------=93ebb602f383fb1cf52028f8c504f67a +Content-Type: text/plain; charset="ascii-us" +Content-Transfer-Encoding: 8bit + +Welcome to In-portal! + +Your user registration has been approved. Your user name is "tester". + +-------=93ebb602f383fb1cf52028f8c504f67a-- + + +SEND: +. + +GET: 250 ok 1089986268 qp 28512 + + +Message to "In-Portal Development" Delivered Successfully +host=mx1.intechnic.com +port=25 +helo=INPORTAL +auth= +Connected to mx1.intechnic.com +GET: 220 mx1.intechnic.com ESMTP + + +SEND: HELO INPORTAL + +GET: 250 mx1.intechnic.com + + +SEND: MAIL FROM:<"In-Portal Development" > + +GET: 250 ok + + +SEND: RCPT TO:<"Test Guy" > + +GET: 250 ok + + +SEND: DATA + +GET: 354 go ahead + + +SEND: Subject: You have been approved +Return-Path: chris@intechnic.com +Date: Fri, 16 Jul 2004 08:58:38 -0500 +From: "In-Portal Development" +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="-----=0ad82d0b8cba7e49a2027040a212e108" +To: "Test Guy" + +SEND: + +SEND: -------=0ad82d0b8cba7e49a2027040a212e108 +Content-Type: text/plain; charset="ascii-us" +Content-Transfer-Encoding: 8bit + +Welcome to In-portal! + +Your user registration has been approved. Your user name is "tester". + +-------=0ad82d0b8cba7e49a2027040a212e108-- + + +SEND: +. + +GET: 250 ok 1089986319 qp 28618 + + +Message to "In-Portal Development" Delivered Successfully +host=mx1.intechnic.com +port=25 +helo=INPORTAL +auth= +Connected to mx1.intechnic.com +GET: 220 mx1.intechnic.com ESMTP + + +SEND: HELO INPORTAL + +GET: 250 mx1.intechnic.com + + +SEND: MAIL FROM:"In-Portal Development" + +GET: 250 ok + + +SEND: RCPT TO:"Test Guy" + +GET: 250 ok + + +SEND: DATA + +GET: 354 go ahead + + +SEND: Subject: You have been approved +Return-Path: chris@intechnic.com +Date: Fri, 16 Jul 2004 09:02:10 -0500 +From: "In-Portal Development" +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="-----=f0a151bf3e5de4733cdfeb983e31b217" +To: "Test Guy" + +SEND: + +SEND: -------=f0a151bf3e5de4733cdfeb983e31b217 +Content-Type: text/plain; charset="ascii-us" +Content-Transfer-Encoding: 8bit + +Welcome to In-portal! + +Your user registration has been approved. Your user name is "tester". + +-------=f0a151bf3e5de4733cdfeb983e31b217-- + + +SEND: +. + +GET: 250 ok 1089986531 qp 29038 + + +Message to "In-Portal Development" Delivered Successfully Index: trunk/admin/editor/FCKeditor/js/fck_config.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_config.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_config.js (revision 13) @@ -0,0 +1,182 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_config.js: Holds all configurations. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +//## +//## "config" is the global object that holds all configurations +//## +var config = new Object() ; + +//## +//## Editor Base Path +//## +config.BasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('/')+1) ; + +//## +//## Style File to be used the the editor +//## + +config.EditorAreaCSS = config.BasePath + 'css/fck_editorarea.css' ; + + +//## +//## Base URL used to set relative links +//## +config.BaseUrl = document.location.protocol + '//' + document.location.host + '/' ; + +//## +//## Enable XHTML support +//## +config.EnableXHTML = false ; + +//## +//## Miscelaneous +//## +config.StartupShowBorders = false ; +config.StartupShowDetails = false ; + +//## +//## Cut and Paste options +//## +config.ForcePasteAsPlainText = false ; +config.AutoDetectPasteFromWord = true ; + +//## +//## When the user presses inserts a
    tag instead of a

    +//## +config.UseBROnCarriageReturn = false ; + +//## Spaces ( ) to add on TAB +config.TabSpaces = 4 ; + +//## +//## Language settings +//## +config.AutoDetectLanguage = true ; +config.DefaultLanguage = "en" ; + +// ## Spell Checker download - http://www.iespell.com/download.php +config.SpellCheckerDownloadUrl = "http://www.rochen.com/ieSpellSetup201325.exe" ; + +//## +//## Sets the toolbar icons path +//## +config.ToolbarImagesPath = config.BasePath + "images/toolbar/" ; + +//## +//## Toolbar Buttons Sets +//## +config.ToolbarSets = new Object() ; +config.ToolbarSets["Default"] = [ + ['EditSource','-','Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck','Find','-','Undo','Redo','-','SelectAll','RemoveFormat','-','Link','RemoveLink','-','Image','Table','Rule','SpecialChar','Smiley','-','About'] , + ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','InsertOrderedList','InsertUnorderedList','-','Outdent','Indent','-','ShowTableBorders','ShowDetails','-','Zoom'] , + ['FontStyle','-','FontFormat','-','Font','-','FontSize','-','TextColor','BGColor'] +] ; + +config.ToolbarSets["Source"] = [ + ['EditSource'] +] ; + +config.ToolbarSets["Accessibility"] = [ + ['EditSource','-','Cut','Copy','Paste','-','SelectAll','RemoveFormat','-','Link','RemoveLink','-','Image','Rule','-','About'] , + ['FontStyle','-','Bold','Italic','Underline','-','InsertOrderedList','InsertUnorderedList','-','Undo','Redo'] +] ; + +config.ToolbarSets["Basic"] = [ + ['Bold','Italic','-','InsertOrderedList','InsertUnorderedList','-','Link','RemoveLink','-','About'] +] ; + +//## +//## Style Names +//## +config.StyleNames = ';Main Header;Blue Title;Centered Title;Alex Test' ; +config.StyleValues = ';MainHeader;BlueTitle;CenteredTitle;AlexTest' ; + +//## +//## Font Names +//## +config.ToolbarFontNames = ';Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ; + +//## +//## Link: Target Windows +//## +config.LinkShowTargets = true ; +config.LinkTargets = '_blank;_parent;_self;_top' ; +config.LinkDefaultTarget = '' ; + +//## +//## Image Browsing +//## +config.ImageBrowser = true ; +// Custom Page URL +//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_html/browse.html" ; +config.ImageBrowserURL = config.BasePath + "filemanager/browse/inportal/browse.php" ; +//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_jsp/browse.jsp?type=img" ; +// Image browsing window sizes +config.ImageBrowserWindowWidth = 400 ; +config.ImageBrowserWindowHeight = 250 ; + +//## +//## Image Upload +//## +config.ImageUpload = true ; +// Page that effectivelly upload the image. +config.ImageUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ; +//config.ImageUploadURL = config.BasePath + "filemanager/upload/aspx/upload.aspx" ; +//config.ImageUploadURL = config.BasePath + "filemanager/upload/cfm/upload.cfm" ; +//config.ImageUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ; +//config.ImageUploadURL = config.BasePath + "filemanager/upload/jsp/upload.jsp" ; +// Image upload window sizes +config.ImageUploadWindowWidth = 300 ; +config.ImageUploadWindowHeight = 150 ; +config.ImageUploadAllowedExtensions = ".gif .jpg .jpeg .png" ; + +//## +//## Link Browsing +//## +config.LinkBrowser = true ; +// Custom Page URL +config.LinkBrowserURL = config.BasePath + "filemanager/browse/sample_html/browsefile.html" ; +//config.LinkBrowserURL = config.BasePath + "filemanager/browse/sample_jsp/browse.jsp?type=doc" ; +// Link browsing window sizes +config.LinkBrowserWindowWidth = 400 ; +config.LinkBrowserWindowHeight = 250 ; + +//## +//## Link Upload +//## +config.LinkUpload = true ; +// Page that effectivelly upload the Link file. +config.LinkUploadURL = config.BasePath + "filemanager/upload/asp/upload.asp" ; +//config.LinkUploadURL = config.BasePath + "filemanager/upload/aspx/upload.aspx" ; +//config.LinkUploadURL = config.BasePath + "filemanager/upload/cfm/upload.cfm" ; +//config.LinkUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ; +//config.LinkUploadURL = config.BasePath + "filemanager/upload/jsp/upload.jsp" ; +// Link upload window sizes +config.LinkUploadWindowWidth = 300 ; +config.LinkUploadWindowHeight = 150 ; +config.LinkUploadAllowedExtensions = "*" ; // * or empty for all +config.LinkUploadDeniedExtensions = ".exe .asp .php .aspx .js .cfm .dll" ; // empty for no one + +//## +//## Smiley Dialog +//## +//config.SmileyPath = config.BasePath + "images/smiley/fun/" ; +//config.SmileyImages = ["aiua.gif","ak.gif","alien.gif","alien2.gif","angry.gif","angry1.gif","apophys.gif","assjani.gif","asthanos.gif","bazuzeus.gif","beaute.gif","bigsmile.gif","blush.gif","boid.gif","bonk.gif","bored.gif","borg.gif","capo.gif","confused.gif","cool.gif","crazy.gif","cwm14.gif","demis_roussos.gif","devil.gif","devil2.gif","double0smile.gif","eek3.gif","eltaf.gif","gele.gif","halm.gif","happy.gif","icon12.gif","icon23.gif","icon26.gif","icon_angel.gif","icon_bandit.gif","icon_bravo.gif","icon_clown.gif","jesors.gif","jesors1.gif","lol3.gif","love.gif","mad.gif","megaphone.gif","mmm.gif","music.gif","notify.gif","nuts.gif","obanon.gif","ouaip.gif","pleure.gif","plugin.gif","question.gif","question2.gif","rasta2.gif","rastapop.gif","rosebud.gif","sad.gif","sad2.gif","shocked.gif","sick.gif","sick2.gif","slaap.gif","sleep.gif","smile.gif","smiley_peur.gif","sors.gif","sovxx.gif","spamafote.gif","tap67.gif","thumbdown.gif","thumbup.gif","tigi.gif","toad666.gif","tongue.gif","tuffgong.gif","urgeman.gif","vanadium.gif","wink.gif","worship.gif","wouaf.gif","wow.gif","xp1700.gif","yltype.gif","yopyopyop.gif","youpi.gif","zoor.gif"] ; +config.SmileyPath = config.BasePath + "images/smiley/msn/" ; +config.SmileyImages = ["regular_smile.gif","sad_smile.gif","wink_smile.gif","teeth_smile.gif","confused_smile.gif","tounge_smile.gif","embaressed_smile.gif","omg_smile.gif","whatchutalkingabout_smile.gif","angry_smile.gif","angel_smile.gif","shades_smile.gif","devil_smile.gif","cry_smile.gif","lightbulb.gif","thumbs_down.gif","thumbs_up.gif","heart.gif","broken_heart.gif","kiss.gif","envelope.gif"] ; +config.SmileyColumns = 7 ; +config.SmileyWindowWidth = 500 ; +config.SmileyWindowHeight = 200 ; \ No newline at end of file Index: trunk/admin/install/dbinfo.php =================================================================== diff -u --- trunk/admin/install/dbinfo.php (revision 0) +++ trunk/admin/install/dbinfo.php (revision 13) @@ -0,0 +1,76 @@ + +  Database Configuration

    + + + + + + + +
     Step - Database Configuration
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/ouaip.gif =================================================================== diff -u Binary files differ Index: trunk/admin/category/addimage.php =================================================================== diff -u --- trunk/admin/category/addimage.php (revision 0) +++ trunk/admin/category/addimage.php (revision 13) @@ -0,0 +1,355 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$cssURL = $adminURL."/include"; +$browseURL = $adminURL."/browse"; + +//$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."/browse/toolbar.php"); +require_once($pathtoroot.$admin."/listview/listview.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditCat); + +$objEditCat = new clsCatList(); +$objEditCat->SourceTable = $objSession->GetEditTable("Category"); + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditCat->Query_Item("SELECT * FROM ".$objEditCat->SourceTable); +$itemcount=$objEditCat->NumItems(); +$c = $objEditCat->GetItemByIndex($en); + +unset($objEditItems); + +$objEditItems = new clsImageList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Images"); + +if(isset($_POST["itemlist"])) +{ + if(is_array($_POST["itemlist"])) + { + $ImageId = $_POST["itemlist"][0]; + } + else + { + $ImageId = $_POST["itemlist"]; + } + $img = $objEditItems->GetItem($ImageId); + $img->Pending=TRUE; + $action = "m_img_edit"; + $name = $img->Get("Name"); +} +else +{ + $img = new clsImage(); + $img->Set("ResourceId",$c->Get("ResourceId")); + $img->Set("ImageId",$img->FieldMin("ImageId")-1); + $img->Pending=TRUE; + $img->tablename = $objEditItems->SourceTable; + $action = "m_img_add"; + $name = "'New Image'"; + +} + +$envar = "env=" . BuildEnv() . "&en=$en"; +$section = 'in-portal:cat_imageedit'; +$ado = GetADODBConnection(); + +/* page header */ +print << + + In-portal + + + + + + + + + + + +END; + +$objListToolBar = new clsToolBar(); + +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('category','CatEditStatus','".$admin."/category/addcategory_images.php',0);",$imagesURL."/toolbar/tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('category','CatEditStatus','".$admin."/category/addcategory_images.php',-1);", $imagesURL."/toolbar/tool_cancel.gif"); + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Category")." '".$c->Get("Name")."' - ".prompt_language("la_Text_Image"); +$title .= " '".$name."'"; +int_header($objListToolBar,NULL,$title); +if ($objSession->GetVariable("HasChanges") == 1) { +?> +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Server Type: + +
    Hostname: + +
    Database Name: + +
    Databse User Name: + +
    Database User Password: + +
    Table Name Prefix: + +


    +
    + + +
    +
    + + + +
    + +
    + + + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + + > + + + + + + + + + > + + Get("LocalThumb")==1 || strlen($img->Get("LocalThumb"))==0) + { + $local="checked"; + $remote = ""; + } + else + { + $remote="checked"; + $local = ""; + } + ?> + + + + + + + + +> + + Get("SameImages")=="1") || !$img->Get("ImageId") || ($img->Get("ImageId") == "-1")) + { + + $checked = "CHECKED"; + $disabled = "DISABLED=\"true\""; + } + ?> + + + +> + + Get("LocalImage")==1 || strlen($img->Get("LocalImage"))==0) + { + $local="checked"; + $remote = ""; + } + else + { + $remote="checked"; + $local = ""; + } + ?> + + + + + + + "> + "> + +
    Get("ImageId") != -1) echo $img->Get("ImageId"); ?>
    ">
    ">
    + Get("Enabled")==1) echo "CHECKED"; ?> VALUE="1"> + Get("Enabled")==0) echo "CHECKED"; ?> VALUE="0"> +
    Get("DefaultImg")==1) echo "CHECKED"; ?> VALUE="1">
    ">
    + + + + + + + + + +
    + VALUE="1">: + +
    +
    + VALUE="0"> : + +
    +
    +
    + +
    ONCLICK="enableFullImage(this);">
    + + + + + + + + + +
    + VALUE="1">: + +
    +
    + VALUE="0"> : + +
    +
    +
    + +
    + + +

    + + + + +
    + + + + Index: trunk/admin/images/itemicons/icon16_language.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_login_big.gif =================================================================== diff -u Binary files differ Index: trunk/admin/config/config_general.php =================================================================== diff -u --- trunk/admin/config/config_general.php (revision 0) +++ trunk/admin/config/config_general.php (revision 13) @@ -0,0 +1,116 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//admin only util + +//$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."/include/toolbar.php"); + +$section = 'in-portal:configure'; + +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +if(strlen($_GET["module"])==0) +{ + $config_module="In-Portal"; +} +else +{ + $config_module=$_GET["module"]; +} +if(strlen($_GET["section"])==0) +{ + $config_section="System"; +} +else +{ + $config_section=$_GET["section"]; +} +int_header(); +?> +
    + + + + Execute($sql); + while($rs & !$rs->EOF) + { + if($rs->fields["Section"]==$config_section) + { + $divleftimage=$imagesURL."/divider_left_sel.gif"; + $tab_bg="#E9D4CE"; + + $divrightimage=$imagesURL."/divider_sel_right.gif"; + } + else + { + $divleftimage=$imagesURL."/divider_dn.gif"; + $tab_bg="#E0E0DA"; + $divrightimage=$imagesURL."/divider_right.gif"; + } + $url="config_general.php?env=$envar&module=$config_module§ion=".$rs->fields["Section"]; + ?> + + + + + moveNext(); + } + ?> + + +
    fields["Section"]; ?>
    + + + + + +Execute($sql); + while($rs & !$rs->EOF) + { + echo " "; + echo ""; + echo ""; + echo ""; + echo "\n"; + $rs->moveNext(); + } +?> + > + + +
    +
    ".$rs->fields["Prompt"]."fields["VariableName"]."\" VALUE=\"".$rs->fields["VariableValue"]."\">".$rs->fields["Description"]."
    + + + + +
    +
    + + Index: trunk/admin/images/toolbar/tool_apply_rules_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/addgroup_users.php =================================================================== diff -u --- trunk/admin/users/addgroup_users.php (revision 0) +++ trunk/admin/users/addgroup_users.php (revision 13) @@ -0,0 +1,325 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +unset($objEditItems); + +$objEditItems = new clsGroupList(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalGroup"); +$objEditItems->EnablePaging = FALSE; + +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); +$c = $objEditItems->GetItemByIndex($en); + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_edit_group"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +/* -------------------------------------- Section configuration ------------------------------------------- */ +$section = 'in-portal:editgroup_users'; +$sec = $objSections->GetSection($section); +$SortFieldVar = "User_SortField"; +$SortOrderVar = "User_SortOrder"; +$DefaultSortField = "Login"; +$PerPageVar = "Perpage_User"; +$CurrentPageVar = "Page_UserList"; +$CurrentFilterVar = "User_View"; + +$ListForm = "editgroup"; +$CheckClass = "UserChecks"; + +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$objListToolBar = new clsToolBar(); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('editgroup','GroupEditStatus','".$admin."/users/user_groups.php',1);","tool_select.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('editgroup','GroupEditStatus','".$admin."/users/user_groups.php',2);","tool_cancel.gif"); +if($itemcount == 1) $objListToolBar->Add("divider"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/addgroup_users.php"; + $StatusField = "GroupEditStatus"; + $form = "editgroup"; + MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevGroup','la_NextGroup'); + $objListToolBar->Add("divider"); +} + + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("new_group", "la_ToolTip_AddUserToGroup","","swap('new_group','toolbar/tool_usertogroup_f2.gif');", + "swap('new_group', 'toolbar/tool_usertogroup.gif');", + "OpenUserSelector('','','$envar&source=addgroup_users&GroupId=".$c->Get("GroupId")."&destform=popup&destfield=userlist&Selector=radio&dosubmit=1');", + "tool_usertogroup.gif"); + +$objListToolBar->Add("user_del","la_ToolTip_RemoveUserFromGroup","#", "if (UserChecks.itemChecked()) swap('user_del','toolbar/tool_delete_f2.gif');", + "if (UserChecks.itemChecked()) swap('user_del', 'toolbar/tool_delete.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('addgroup_users', 'm_group_removeuser');", + "tool_delete.gif"); +$listImages[] = "UserChecks.addImage('user_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("user_print", "la_ToolTip_Print","#","swap('user_print','toolbar/tool_print_f2.gif');", + "swap('user_print', 'toolbar/tool_print.gif');","window.print();","tool_print.gif"); + +$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();"); + +/* ----------------------------------------- Set the View Filter ---------------------------------------- */ + +/* bit place holders for category view menu */ +$Bit_Pending=4; +$Bit_Disabled=2; +$Bit_Valid=1; +$Bit_All = 7; + +$FilterLabels = array(); + +$FilterLabels[0] = admin_language("la_Text_Enabled"); +$FilterLabels[1] = admin_language("la_Text_Disabled"); +$FilterLabels[2] = admin_language("la_Text_Pending"); + +/* determine current view menu settings */ +$UserView = $objConfig->Get("User_View"); + +if(!is_numeric($UserView)) +{ + $UserView = $Bit_All; //Set all bits ON + $UserFilter = ""; +} + if($UserView & $Bit_Valid) + $Status[] = 1; + + if($UserView & $Bit_Disabled) + $Status[] = 0; + + if($UserView & $Bit_Pending) + $Status[] = 2; + + if(count($Status)>0) + { + $UserFilter = "Status IN (".implode(",",$Status).")"; + } + else + $UserFilter = "Status = -1"; + + +$GroupUsers = $c->GetUserList(); +if(count($GroupUsers)>0) +{ + $list = implode(",",$GroupUsers); + $where = "u.PortalUserId IN ($list) "; +} +else + $where = "u.PortalUserId = -1 "; + +$order = $objConfig->Get("User_SortOrder"); +$SearchWords = $objSession->GetVariable("UserGroupSearchWord"); +if(strlen($SearchWords)) +{ + $where .= $objUsers->AdminSearchWhereClause($SearchWords); +} + +$sql = "SELECT u.*,g.Name as GroupName,ELT(u.status+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ','".admin_language("la_Text_Pending")."') as UserStatus, "; +$sql .="FROM_UNIXTIME(u.CreatedOn,'%m-%d-%Y') as DateCreated FROM ".GetTablePrefix()."PortalUser as u "; +$sql .="LEFT JOIN ".GetTablePrefix()."UserGroup as ug ON (u.PortalUserId=ug.PortalUserId) "; +$sql .="LEFT JOIN ".GetTablePrefix()."PortalGroup as g ON (ug.GroupId=g.GroupId) WHERE ug.PrimaryGroup!=0"; +if(strlen($where)) + $sql .= " AND ".$where; +$sql .=" ".GetLimitSQL($objSession->GetVariable("Page_Userlist"),$objConfig->Get("Perpage_User")); + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + +$objUsers->Query_Item($sql); +$itemcount = TableCount(GetTablePrefix()."PortalUser","PortalUserId IN ($list)",0); + +$objListView = new clsListView($objListToolBar,$objUsers); +$objListView->IdField = "ResourceId"; +$objListView->PageLinkTemplate = $pathtoroot. $admin."/templates/user_page_link.tpl"; + +$objListView->ColumnHeaders->Add("Login",admin_language("la_prompt_Username"),1,0,$order,"width=\"15%\"","User_SortField","User_SortOrder","Login"); +$objListView->ColumnHeaders->Add("LastName",admin_language("la_prompt_Last_Name"),1,0,$order,"width=\"15%\"","User_SortField","User_SortOrder","LastName"); +$objListView->ColumnHeaders->Add("FirstName",admin_language("la_prompt_First_Name"),1,0,$order,"width=\"15%\"","User_SortField","User_SortOrder","FirstName"); +$objListView->ColumnHeaders->Add("Email",admin_language("la_prompt_Email"),1,0,$order,"width=\"20%\"","User_SortField","User_SortOrder","Email"); +$objListView->ColumnHeaders->Add("GroupName",admin_language("la_prompt_PrimaryGroup"),1,0,$order,"width=\"20%\"","User_SortField","User_SortOrder","GroupName"); +$objListView->ColumnHeaders->Add("DateCreated",admin_language("la_prompt_CreatedOn"),1,0,$order,"width=\"15%\"","User_SortField","User_SortOrder","DateCreated"); +$objListView->ColumnHeaders->SetSort($objConfig->Get("User_SortField"),$order); + +$objListView->PrintToolBar = FALSE; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_usergroup_search"; +$objListView->CurrentPageVar = "Page_Userlist"; +$objListView->PerPageVar = "Perpage_User"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->TotalItemCount = $itemcount; + +for($i=0;$iItems);$i++) +{ + $u =& $objUsers->GetItemRefByIndex($i); + $objListView->RowIcons[] = $u->StatusIcon(); +} + $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, + $CurrentFilterVar,$UserView,$Bit_All); + + foreach($FilterLabels as $Bit=>$Label) + { + $objListView->AddViewMenuFilter($Label,$Bit); + } + + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Group")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Users"); +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
    +PrintList(); +?> + +"> + +
    + + + + +
    + + + + +
    +
    + + +
    +
    + > + + + + + +
    + + + + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_new_theme.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/tabnav_dots.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/lang/english.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/arrow_down.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/usersession.php =================================================================== diff -u --- trunk/kernel/include/usersession.php (revision 0) +++ trunk/kernel/include/usersession.php (revision 13) @@ -0,0 +1,1110 @@ +m_Errors = new clsErrorManager(); + $this->adodbConnection = GetADODBConnection(); + + $this->PermCache = array(); + $this->PermCacheGroups =""; + $this->UseTempKeys = $TempKeys; + if(!$this->UseTempKeys || strlen($id)==0) + { + //echo "with cookies"; + if( !isset($_SERVER['HTTP_REFERER']) ) $_SERVER['HTTP_REFERER'] = ''; + if(strlen($id) && (strstr($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'].$objConfig->Get("Site_Path")) || $_GET['destform'] == 'popup' || $_GET['continue_sess'] == 1)) + { + $this->Set("SessionKey",$id); + return $this->LoadFromDatabase($id); + } + else + { + $this->Set("PortalUserId", 0); + $this->Set("Language", $objLanguages->GetPrimary()); + $ThemeId = $m_var_list["theme"]; + $this->SetThemeName($ThemeId); + //$this->Set("Theme", $objConfig->Get("Default_Theme")); + $this->Set("GroupList",0); + $this->Set("SessionKey",""); + $this->Set("GroupList",$objConfig->Get("User_GuestGroup")); + } + } + else + { + //echo "without cookies"; + return $this->LoadFromTempKey($id); + } + } + + function CopyToNewSession() + { + $OldKey = $this->GetSessionKey(); + $this->GetNewSession(); + if($OldKey != $this->GetSessionKey()) + { + $this->Set("PortalUserId",$this->Get("PortalUserId")); + $this->Set("GroupId",$this->Get("GroupId")); + $this->Set("GroupList",$this->Get("GroupList")); + $this->Set("Language",$this->Get("Language")); + $this->Set("tz",$this->Get("tz")); + $this->Set("LastAccessed",date("U")); + $this->Update(); + } + } + + function Get($name) + { + $var = "m_" . $name; + return isset($this->$var) ? $this->$var : ''; + } + + function Set($name, $value) + { + if (is_array($name)) + { + for ($i=0; $i$var = $value[$i]; + $this->m_dirtyFieldsMap[$name[$i]] = $value[$i]; + } + } + else + { + $var = "m_" . $name; + $this->$var = $value; + $this->m_dirtyFieldsMap[$name] = $value; + //echo "Set: $var = $value
    \n"; + } + } + + function Validate() + { + $dataValid = true; + if(!isset($this->m_LastAccessed)) + { + $this->m_Errors->AddError("error.fieldIsRequired",'LastAccessed',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if(!isset($this->m_PortalUserId)) + { + $this->m_Errors->AddError("error.fieldIsRequired",'PortalUserId',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if(!isset($this->m_Language)) + { + $this->m_Errors->AddError("error.fieldIsRequired",'Language',"","",get_class($this),"Validate"); + $dataValid = false; + } + + if(!isset($this->m_Theme)) + { + $this->m_Errors->AddError("error.fieldIsRequired",'Theme',"","",get_class($this),"Validate"); + $dataValid = false; + } + + return $dataValid; + } + + function Delete() + { + if(!isset($this->m_SessionKey)) + { + $this->m_Errors->AddError("error.AppError",NULL,'Internal error: Delete requires set id',"",get_class($this),"Delete"); + return false; + } + //Delete associated adata first + $sql = sprintf("DELETE FROM ".GetTablePrefix()."SessionData WHERE SessionKey = '%s'", $this->Get("SessionKey")); + $this->adodbConnection->Execute($sql); + $sql = sprintf("DROP TABLE %s%s_search",GetTablePrefix(), $this->Get("SessionKey")); + $this->adodbConnection->Execute($sql); + $sql = sprintf("DELETE FROM ".GetTablePrefix()."UserSession WHERE SessionKey = '%s'", $this->Get("SessionKey")); + $this->adodbConnection->Execute($sql); + if ($this->adodbConnection->Execute($sql) === false) + { + $this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Delete"); + return false; + } + $this->Set("SessionKey",""); + $this->Set("SessionDataLoaded",false); + return true; + } + + function Update() + { + global $objConfig; + + //$this->Set("LastAccessed",date("U")); + $this->Set("IpAddress",$_SERVER["REMOTE_ADDR"]); + if(!isset($this->m_SessionKey)) + { + $this->m_Errors->AddError("error.AppError",NULL,'Internal error: Update requires set id',"",get_class($this),"Update"); + return false; + } + if(!is_numeric($this->Get("PortalUserId"))) + { + $this->Set("PortalUserId",0); + } + if(!strlen($this->Get("GroupList"))) + { + $this->Set("GroupList",$objConfig->Get("User_GuestGroup")); + } + if(count($this->m_dirtyFieldsMap) == 0) + return true; + $sql = "UPDATE ".GetTablePrefix()."UserSession SET "; + $first = 1; + foreach ($this->m_dirtyFieldsMap as $key => $value) + { + if($first) + { + $sql = sprintf("%s %s=%s",$sql,$key,$this->adodbConnection->qstr($value)); + $first = 0; + } + else + { + $sql = sprintf("%s, %s=%s",$sql,$key,$this->adodbConnection->qstr($value)); + } + } + $sql = sprintf("%s WHERE SessionKey = '%s'",$sql, $this->Get("SessionKey")); + //echo $sql; + if ($this->adodbConnection->Execute($sql) === false) + { + $this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Update"); + return false; + } + return true; + } + + function Create() + { + global $objConfig; + + $this->Set("LastAccessed", time()); + if(!is_numeric($this->Get("PortalUserId"))) + { + $this->Set("PortalUserId",0); + } + if(!strlen($this->Get("GroupList"))) + { + $this->Set("GroupList",$objConfig->Get("User_GuestGroup")); + } + $sql = "INSERT INTO ".GetTablePrefix()."UserSession ("; + $first = 1; + foreach ($this->m_dirtyFieldsMap as $key => $value) + { + if($first) + { + $sql = sprintf("%s %s",$sql,$key); + $first = 0; + } + else + { + $sql = sprintf("%s, %s",$sql,$key); + } + } + $sql = sprintf('%s ) VALUES (',$sql); + $first = 1; + foreach ($this->m_dirtyFieldsMap as $key => $value) + { + if($first) + { + $sql = sprintf("%s %s",$sql,$this->adodbConnection->qstr($value)); + $first = 0; + } + else + { + $sql = sprintf("%s, %s",$sql,$this->adodbConnection->qstr($value)); + } + } + $sql = sprintf('%s)',$sql); + //echo $sql."
    \n"; + if ($this->adodbConnection->Execute($sql) === false) + { + $this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Create"); + return false; + } + return true; + } + + function LoadFromTempKey($id=NULL) + { + global $objLanguages, $objConfig,$m_var_list; + $referer = $_SERVER["HTTP_REFERER"]; + //echo "Referer: $referer
    \n"; + if(strlen($referer) && strpos($referer,"env=")) + { + $keystart = strpos($referer,"env=")+4; + $referer = substr($referer,$keystart); + $keyend = strpos($referer,"-"); + $LastKey = substr($referer,0,$keyend); + if(strlen($LastKey)) + { + $sql = "SELECT * FROM ".GetTablePrefix()."UserSession WHERE (CurrentTempKey = '$id' OR PrevTempKey='$id' OR CurrentTempKey='$LastKey' OR PrevTempKey='$LastKey') "; + } + else + $sql = "SELECT * FROM ".GetTablePrefix()."UserSession WHERE CurrentTempKey = '$id' AND PrevTempKey IS NULL"; + } + else + $sql = "SELECT * FROM ".GetTablePrefix()."UserSession WHERE CurrentTempKey = '$id' AND PrevTempKey IS NULL"; + + $result = $this->adodbConnection->Execute($sql); + if ($result === false) + { + $this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase"); + return false; + } + $data = $result->fields; + if (is_array($data)) + { + foreach($data as $field => $value) + { + $mname = "m_" . $field; + $this->$mname = $data[$field]; + } + + if($this->Get("CurrentTempKey")) { + $this->Set("PrevTempKey",$this->Get("CurrentTempKey")); + $this->UseTempKeys=TRUE; + } + + if (!$this->Get("CurrentTempKey") || !strstr($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'].$objConfig->Get("Site_Path"))) { + //$this->Set("PrevTempKey",$this->Get("CurrentTempKey")); + //$this->Set("CurrentTempKey",$this->GetUniqueKey()); + $this->UseTempKeys=FALSE; + $this->Set("PortalUserId", 0); + $this->Set("Language", $objLanguages->GetPrimary()); + $ThemeId = $m_var_list["theme"]; + $this->SetThemeName($ThemeId); + //$this->Set("Theme", $objConfig->Get("Default_Theme")); + $this->Set("GroupList",0); + $this->Set("SessionKey",""); + $this->Set("GroupList",$objConfig->Get("User_GuestGroup")); + } + //$this->UseTempKeys=TRUE; + $this->Update(); + return true; + } + else + { + $this->Set("PortalUserId", 0); + $this->Set("Language", $objLanguages->GetPrimary()); + $ThemeId = $m_var_list["theme"]; + $this->SetThemeName($ThemeId); + //$this->Set("Theme", $objConfig->Get("Default_Theme")); + $this->Set("GroupList",0); + $this->Set("SessionKey",""); + $this->Set("GroupList",$objConfig->Get("User_GuestGroup")); + $this->Set("CurrentTempKey",$this->GetUniqueKey()); + return false; + } + } + + function LoadFromDatabase($id) + { + if(!isset($id)) + { + $this->m_Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase"); + return false; + } + $sql = sprintf("SELECT * FROM ".GetTablePrefix()."UserSession WHERE SessionKey = '%s'",$id); + + $result = $this->adodbConnection->Execute($sql); + if ($result === false) + { + $this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase"); + return false; + } + $data = $result->fields; + if (is_array($data)) + { + foreach($data as $field => $value) + { + $mname = "m_" . $field; + $this->$mname = $data[$field]; + } + return true; + } + else + { + return false; + } + } + + function Login($userLogin, $userPassword) + { + global $expired, $objConfig; + + if($userLogin=="root") + { + $rootpass = $objConfig->Get("RootPass"); + if($rootpass!=$userPassword) + { + return FALSE; + } + else + { + if(!strlen($this->GetSessionKey())) + $this->GetNewSession(); + $this->Set("PortalUserId",-1); + $this->Update(); + return TRUE; + } + } + else + { + $pre = GetTablePrefix(); + $sql = "SELECT *,MD5(".$pre."PortalUser.Password) as md5pw FROM ".$pre."PortalUser LEFT JOIN ".$pre."UserGroup USING (PortalUserId) " + ."LEFT JOIN ".$pre."PortalGroup ON (".$pre."UserGroup.GroupId=".$pre."PortalGroup.GroupId) + WHERE + ".$pre."PortalUser.Login='$userLogin' AND ".$pre."PortalUser.Status=1 + AND (".$pre."PortalUser.Password='$userPassword' OR MD5(".$pre."PortalUser.Password)='$userPassword' OR ".$pre."PortalUser.Password='".md5($userPassword)."') + ORDER BY ".$pre."UserGroup.PrimaryGroup DESC, ".$pre."PortalGroup.Personal DESC"; +//echo $sql."
    \n"; + $result = $this->adodbConnection->Execute($sql); + + if ($result === false) + { + $this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Login"); + return false; + } + if($result->EOF) + return false; + } + if(!strlen($this->GetSessionKey())) + { + $this->GetNewSession(); + } + + $this->Set("PortalUserId", $result->fields["PortalUserId"]); + if(strlen($result->fields["tz"])>0) + $this->Set("tz",$result->fields["tz"]); + $PrimaryGroup=0; + $PersonalGroup=0; + $GroupList = array(); + while($result && !$result->EOF) + { + $skipadd=0; + $g = $result->fields["GroupId"]; + + if($result->fields["PrimaryGroup"]==1) + { + $PrimaryGroup = $g; + $skipadd=1; + } + if($result->fields["Personal"]==1) + { + $PersonalGroup=$g; + $skipadd=0; + } + if(!$skipadd) + $GroupList[] = $g; + $result->MoveNext(); + } + $extra_groups = implode(",",$GroupList); + if($PrimaryGroup) + $extra_groups = $PrimaryGroup.",".$extra_groups; + if($PersonalGroup) + { + $this->Set("GroupId",$PersonalGroup); + //$extra_groups .= ",".$PersonalGroup; + } + else + { + $this->Set("GroupId",$PrimaryGroup); + } + + $this->Set("GroupList", $extra_groups); + $this->Set("LastAccessed",date("U")); + $this_login = $this->GetPersistantVariable("ThisLogin"); + $this->SetPersistantVariable("LastLogin", $this_login); + $this->SetPersistantVariable("ThisLogin", time()); + $this->ResetSysPermCache(); + $this->PermCache = array(); + $this->Update(); + return true; + } + + function Logout() + { + global $objConfig; + + $this->Set("PortalUserId", 0); + $this->Set("GroupId", $objConfig->Get("User_GuestGroup")); + #$this->SetPersistantVariable("LastLogin", time()); + $this->Set("GroupList",$objConfig->Get("User_GuestGroup")); + $this->Set("IpAddress",$_SERVER['REMOTE_ADDR']); + $this->DeleteSessionData($this->GetSessionKey()); + $this->Update(); + $this->Delete(); + $this->ResetSysPermCache(); + $this->PermCache = array(); + } + + function SetVariable( $variableName, $variableValue) + { + global $objConfig, $FrontEnd; + + $objConfig->Set($variableName,$variableValue,2); + + //if(!(int)$FrontEnd==1) + //{ + $sessionkey = $this->GetSessionKey(); + $sql = "SELECT * FROM ".GetTablePrefix()."SessionData WHERE VariableName='$variableName' AND SessionKey='$sessionkey'"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $sql = "UPDATE ".GetTablePrefix()."SessionData SET VariableValue='$variableValue' WHERE VariableName='$variableName' AND SessionKey='$sessionkey'"; + } + else + $sql = "INSERT INTO ".GetTablePrefix()."SessionData (VariableName,VariableValue,SessionKey) VALUES ('$variableName','$variableValue','$sessionkey')"; + + $this->adodbConnection->Execute($sql); +// echo "
    UPDATE: $sql
    "; + //} + } + + function SetPersistantVariable($variableName, $variableValue) + { + global $objConfig; + + $userid = (int)$this->Get("PortalUserId"); + + if($userid > 0) + { + if(!is_object($this->CurrentUser)) + $this->CurrentUser = $objUsers->GetItem($this->Get("PortalUserId")); + if(!$this->CurrentUser->VarsLoaded) + $this->CurrentUser->LoadPersistantVars(); + + $this->CurrentUser->SetPersistantVariable($variableName, $variableValue); + } + else + $this->SetVariable($variableName,$variableValue); + } + + function GetPersistantVariable($variableName) + { + global $objConfig, $objUsers; + + if(is_numeric($this->Get("PortalUserId"))) + { + if(!is_object($this->CurrentUser)) + $this->CurrentUser = $objUsers->GetItem($this->Get("PortalUserId")); + if(!$this->CurrentUser->VarsLoaded) + $this->CurrentUser->LoadPersistantVars(); + $val = $this->CurrentUser->GetPersistantVariable($variableName); + } + if(!strlen($val)) + $val = $objConfig->Get($variableName); + return $val; + } + + function GetVariable($variableName) + { + global $objConfig; + + return $objConfig->Get($variableName); + } + + function LoadSessionData() + { + global $objConfig, $objUsers; + + if(is_numeric($this->Get("PortalUserId"))) + { + if(!is_object($this->CurrentUser)) + $this->CurrentUser = $objUsers->GetItem($this->Get("PortalUserId")); + if(!$this->CurrentUser->VarsLoaded) + $this->CurrentUser->LoadPersistantVars(); + + $sql = "SELECT VariableName, VariableValue FROM ".GetTablePrefix()."SessionData where SessionKey='" . $this->Get("SessionKey") . "'"; + //echo $sql."
    \n"; + $result = $this->adodbConnection->Execute($sql); + while ($result && !$result->EOF) + { + $data = $result->fields; + //echo "
    "; print_r($data); echo "
    "; + $objConfig->Set($data["VariableName"],$data["VariableValue"],FALSE); + $result->MoveNext(); + } + } + if((int)$this->GetPersistantVariable("Language")) + $this->Set("Language",$objConfig->Get("Language")); + $this->DeleteExpiredSessions(); + return true; + } + + function DeleteSessionData($key) + { + $sql = "DELETE FROM ".GetTablePrefix()."SessionData WHERE SessionKey='$key'"; + $this->adodbConnection->Execute($sql); + } + + function SaveSessionData() + { + global $objConfig; + + //echo "Saving Session Data..
    \n"; + if($this->SessionEnabled()) + { + $data = $objConfig->GetDirtySessionValues(2); //session data + //echo "
    "; print_r($data); echo "
    "; + $sessionkey = $this->GetSessionKey(); + foreach($data as $field=>$value) + { + $sql = "UPDATE ".GetTablePrefix()."SessionData SET VariableValue='$value' WHERE VariableName='$field' AND SessionKey='$sessionkey'"; + $this->adodbConnection->Execute($sql); + //echo $sql."
    \n"; + + if($this->adodbConnection->Affected_Rows()==0) + { + $sql = "INSERT INTO ".GetTablePrefix()."SessionData (VariableName,VariableValue,SessionKey) VALUES ('$field','$value','$sessionkey')"; + $this->adodbConnection->Execute($sql); + } + // echo $sql."
    \n"; + } + } + } + + function DeleteEditTables() + { + $tables = $this->adodbConnection->MetaTables(); + $sql = "SHOW TABLES"; + //echo "
    ";print_r($tables); echo "
    "; + for($i=0;$i0) + { + $key = "AD".strtoupper(substr($t,strlen($p),strpos($t,"FD_")-strlen($p)))."FD"; + $sql = "SELECT * FROM ".GetTablePrefix()."UserSession WHERE SessionKey='$key'"; + //echo $sql."
    \n"; + $rs = $this->adodbConnection->Execute($sql); + if(!$rs || $rs->EOF) + { + //echo "Dropping Table $tables[$i]
    \n"; + @$this->adodbConnection->Execute("DROP TABLE ".$tables[$i]); + } + } + } + } + + function DeleteExpiredSessions() + { + global $objConfig; + + $cutoff = time()-$objConfig->Get("SessionTimeout"); + $thiskey = $this->GetSessionKey(); + $sql = "SELECT SessionKey from ".GetTablePrefix()."UserSession WHERE LastAccessed<$cutoff AND SessionKey != '$thiskey'"; + $result = $this->adodbConnection->Execute($sql); + $keys = array(); + while ($result && !$result->EOF) + { + $keys[] = "SessionKey='" . $result->fields["SessionKey"] . "'"; + $result->MoveNext(); + } + if(count($keys)>0) + { + $keywhere = implode(" OR ", $keys); + $sql = "DELETE FROM ".GetTablePrefix()."SessionData WHERE $keywhere"; + //echo $sql; + $this->adodbConnection->Execute($sql); + $this->adodbConnection->Execute("DELETE FROM ".GetTablePrefix()."UserSession WHERE LastAccessed<$cutoff"); + $this->DeleteEditTables(); + } + } + + function SetSysPermCache() + { + unset($this->SysPermCache); + $GroupList = $this->Get("GroupList"); + + if(strlen($GroupList) && $GroupList !="0") + { + $this->SysPermCache = array(); + $sql = "SELECT * FROM ".GetTablePrefix()."Permissions WHERE Type=1 AND PermissionValue=1 AND GroupId IN (".$GroupList.")"; + //echo $sql."
    \n"; + $rs = $this->adodbConnection->Execute($sql); + + while($rs && !$rs->EOF) + { + $val = $rs->fields["PermissionValue"]; + if($val==1) + $this->SysPermCache[$rs->fields["Permission"]] = 1; + $PermList[] = $rs->fields["Permission"]; + $rs->MoveNext(); + } + if( isset($PermList) && count($PermList) > 0) // I think this is never issued (comment by Alex) + $this->SetVariable("SysPerm",implode(",",$PermList)); + } + } + + function GetSysPermCache() + { + $perms = trim($this->GetVariable("SysPerm")); + if(!strlen($perms)) + { + $this->SetSysPermCache(); + } + else + { + $p = explode(",",$perms); + + $this->SysPermCache = array(); + for($i=0;$iSysPermCache[$n]=1; + } + } + } + + function SysPermCacheLoaded() + { + return (isset($this->SysPermCache)); + } + + function ResetSysPermCache() + { + // echo "Resetting Perm Cache
    \n"; + $this->SetVariable("SysPerm",""); + unset($this->SysPermCache); + //$this->SysPermCache=array(); + } + + function HasSystemPermission($PermissionName) + { + global $objGroups; + + if($this->Get("PortalUserId")==-1 && ($PermissionName=="ADMIN" || $PermissionName=="LOGIN")) + return TRUE; + //echo "Looking up $PermissionName:".$this->Get("GroupList")."
    \n"; + //echo $this->Get("GroupList")." - ".$this->PermCacheGroups; + $GroupList = $this->Get("GroupList"); + if(substr($GroupList,-1)==",") + { + $GroupList = substr($GroupList,0,-1); + $this->Set("GroupList",$GroupList); + } + if($this->Get("GroupList")!=$this->PermCacheGroups) + $this->ResetSysPermCache(); + if(!$this->SysPermCacheLoaded()) + { + //echo "Loading Perm Cache
    \n"; + $this->GetSysPermCache(); + $this->PermCacheGroups = $this->Get("GroupList"); + } + //echo "SysPerm $PermissionName: ". $this->SysPermCache[$PermissionName]."
    \n"; + return isset($this->SysPermCache[$PermissionName]) ? $this->SysPermCache[$PermissionName] == 1 : false; + } + + function HasCatPermission($PermissionName,$CatId=NULL) + { + global $objCatList, $objUsers; + + $PermSet =FALSE; + $Value = 0; + if($this->Get("PortalUserId")==-1) + return TRUE; + if(!strlen($PermissionName)) + return FALSE; + $GroupList = $this->Get("GroupList"); + if(substr($GroupList,-1)==",") + { + $GroupList = substr($GroupList,0,-1); + $this->Set("GroupList",$GroupList); + } + if(!strlen($this->Get("SessionKey"))) + $this->Set("GroupId",0); + if(strlen(trim($GroupList))) + { + if(strlen($this->Get("GroupId"))) + { + $GroupList = $this->Get("GroupId").",".$GroupList; + } + } + else + { + $GroupList = $this->Get("GroupId"); + } + + if($CatId == NULL) + { + $CatId = $objCatList->CurrentCategoryID(); + } + + $Cat = &$objCatList->GetCategory($CatId); + + $Value=""; + for($p=0;$pPermCache);$p++) + { + $pItem = $this->PermCache[$p]; + if($pItem["perm"]==$PermissionName && $pItem["cat"]==$CatId) + { + $Value=$pItem["value"]; + break; + } + } + if(is_object($Cat) && !is_numeric($Value)) + { + $Value = 0; + $CatList = $Cat->Get("ParentPath"); + $CatList = substr($CatList,1,-1); + $CatList = str_replace("|",",",$CatList); + if(strlen($CatList)) + { + $CatList ="0,".$CatList; + } + else + $CatList = "0"; + $sql = "SELECT * FROM ".GetTablePrefix()."Permissions WHERE Permission LIKE '$PermissionName' AND CatId IN ($CatList) AND GroupId IN ($GroupList)"; +// echo $sql."
    \n"; + $rs = $this->adodbConnection->Execute($sql); + $PermValue = array(); + while($rs && !$rs->EOF) + { + $index = $rs->fields["CatId"]; + if(!is_numeric($PermValue[$index])) + $PermValue[$index] = $rs->fields["PermissionValue"]; + $rs->MoveNext(); + } + $cats = array_reverse(explode(",",$CatList)); + for($c=0;$cPermCache, $perm); + } + //echo $GroupList." Has Permission $PermissionName = $Value
    \n"; + return $Value; + } + + function HasCatPermInList($PermList,$CatId=NULL, $System=FALSE) + { + $value = 0; + if(strlen($PermList)) + { + $plist = explode(",",$PermList); + $value=0; + for($p=0;$pHasCatPermission($plist[$p])) + { + $value = 1; + break; + } + else + { + if($System) + { + if($this->HasSystemPermission($plist[$p])) + { + $value = 1; + break; + } + } + } + } + } + return $value; + } + + function GetACLClause() + { + $GroupList = $this->Get("GroupList"); + if(strlen($GroupList)) + $Groups = explode(",",$GroupList); + $acl_where = ""; + if(@count($Groups)>0 && is_array($Groups)) + { + $acl_where = array(); + for($i=0;$i0) + $acl_where[] = "(FIND_IN_SET($g,acl) OR ((NOT FIND_IN_SET($g,dacl)) AND acl='')) "; + } + if(count($acl_where)) + { + $acl_where = "(".implode(" OR ",$acl_where).")"; + } + else + $acl_where = "(FIND_IN_SET(0,acl))"; + } + else + $acl_where = "(FIND_IN_SET(0,acl))"; + return $acl_where; + } + + function GetEditTable($base_table) + { + $prefix = GetTablePrefix(); + if(strlen($prefix)) + { + if(substr($base_table,0,strlen($prefix))!=$prefix) + $base_table = $prefix.$base_table; + } + $table = $prefix."ses_".$this->GetSessionKey()."_edit_".$base_table; + //echo "Table: $table
    \n"; + return $table; + } + + function GetSessionTable($base_table,$name) + { + $prefix = GetTablePrefix(); + if(strlen($prefix)) + { + if(substr($base_table,0,strlen($prefix))!=$prefix) + $base_table = $prefix.$base_table; + } + $table = $prefix."ses_".$this->GetSessionKey()."_".$name.$base_table; + //echo "Table: $table
    \n"; + return $table; + } + + function GetSearchTable($base_table="") + { + $prefix = GetTablePrefix(); + if(strlen($base_table)) + { + if(strlen($prefix)) + { + if(substr($base_table,0,strlen($prefix))!=$prefix) + $base_table = $prefix.$base_table; + } + $table = $prefix."ses_".$this->GetSessionKey()."_search_".$base_table; + } + else + $table = $prefix."ses_".$this->GetSessionKey()."_search"; + return $table; + } + + function GetTotalSessions() + { + # $time = time() - 900; + $sql = "SELECT count(*) as SesCount FROM ".GetTablePrefix()."UserSession"; + $result = $this->adodbConnection->Execute($sql); + if ($result === false) + { + $this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"GetTotalSessions"); + return false; + } + return $result->fields["SesCount"]; + } + + function Query_UserSession($whereClause,$orderByClause) + { + $resultSet = array(); + $sql = "SELECT ".GetTablePrefix()."* FROM ".GetTablePrefix()."UserSession "; + if(isset($whereClause)) + $sql = sprintf('%s WHERE %s',$sql,$whereClause); + if(isset($orderByClause)) + $sql = sprintf('%s ORDER BY %s',$sql,$orderByClause); + $result = $this->adodbConnection->Execute($sql); + if ($result === false) + { + $this->m_Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"Query_UserSession"); + return false; + } + while (!$result->EOF) + { + $item = new clsUserSession(NULL); + $item->Set("SessionKey",$result->fields["SessionKey"]); + $item->Set("LastAccessed", $result->fields["LastAccessed"]); + $item->Set("PortalUserId", $result->fields["PortalUserId"]); + $item->Set("Language", $result->fields["Language"]); + $item->Set("Theme" , $result->fields["Theme"]); + array_push($resultSet,$item); + $result->MoveNext(); + } + return $resultSet; + } + + function GetUniqueKey() + { + while(true) + { + /* create the new session key here */ + mt_srand(100000000*(double)microtime()); + $sessionId=strtoupper(sprintf("AD%xFD",mt_rand(100000000,999999999))); //9 digit hex session id + $query = "select SessionKey from ".GetTablePrefix()."UserSession "; + $query .= "where SessionKey='$sessionId' OR CurrentTempKey='$sessionId' OR PrevTempKey='$sessionId'"; + $rs = $this->adodbConnection->Execute($query); + if($rs->EOF) + break; + if($i>100) + { + return ""; + } + $i++; + } + //echo "Getting Unique Key: $sessionId
    "; + return $sessionId; + } + + function GetNewSession() + { + global $sessionId, $objConfig, $objLanguages, $m_var_list; + + $i=0; + + if($this->Get("PortalUserId")>0 || $objConfig->Get("GuestSessions")==1) + { + //echo "Creating Session
    \n"; + $sessionId = $this->GetUniqueKey(); + $this->Set("SessionKey", $sessionId); + $this->Set("CurrentTempKey",$sessionId); + if($m_var_list["lang"]) + { + $this->Set("Language",$m_var_list["lang"]); + } + else + $this->Set("Language", $objLanguages->GetPrimary()); + $this->SetThemeName(); + //$this->Set("Theme", $objConfig->Get("Default_Theme")); + $this->UpdateAccessTime(); + $this->Set("IpAddress", $_SERVER['REMOTE_ADDR'] ); + $this->Create(); + } + else + $this->Set("SessionKey",""); + } + + function SessionEnabled() + { + $res = FALSE; + $key = $this->GetSessionKey(); + if(strlen($key)>0) + $res = TRUE; + return $res; + } + + function GetSessionKey() + { + return $this->Get("SessionKey"); + } + + function SetThemeName($id=0) + { + global $objThemes; + + if($id==0) + $id = $objThemes->GetPrimaryTheme(); + + $Theme = $objThemes->GetItem($id); + $name = $Theme->Get("Name"); + $this->Set("Theme",$name); + //$this->Update(); + } + + function ValidSession($SessionKey=NULL) + { + global $objConfig; + + $a = $this->Get("LastAccessed"); + $cutoff = time()-$objConfig->Get("SessionTimeout"); + //echo $a." ".$cutoff."
    "; + //$ip = ($_SERVER['REMOTE_ADDR'] == $this->Get("IpAddress")); + //echo $this->Get("IpAddress"); + //$ip = TRUE; + if ($a < $cutoff) { + //$this->UpdateAccessTime(); + } + return ($a >= $cutoff); + + + } + + function UpdateAccessTime() + { + $now = time(); + $this->Set("LastAccessed",$now); + } + + function InSpamControl($ResourceId,$DataType=NULL) + { + static $ClearStat; + + if(!$ClearStat) + $this->PurgeSpamControl(); + $ClearStat=1; + if(strlen($DataType)) + $DataType="'".$DataType."'"; + $sql = "SELECT count(*) as SpamCount FROM ".GetTablePrefix()."SpamControl WHERE ItemResourceId=$ResourceId AND DataType=$DataType"; + if($this->Get("PortalUserId")==0) + { + $sql .= " AND PortalUserId=0 AND IPaddress='".$_SERVER["REMOTE_ADDR"]."'"; + } + else + { + $sql .= " AND PortalUserId=".$this->Get("PortalUserId"); + } + $rs = $this->adodbConnection->Execute($sql); + $value = (int)$rs->fields["SpamCount"]; + if($value>0) + { + return TRUE; + } + else + return FALSE; + } + + function AddToSpamControl($ResourceId,$secstoexpire,$DataType=NULL) + { + $expire = adodb_date("U") + $secstoexpire; + if(strlen($DataType)) + $DataType = "'".$DataType."'"; + $sql = "INSERT INTO ".GetTablePrefix()."SpamControl (ItemResourceId,IPaddress,Expire,PortalUserId,DataType) VALUES ("; + $sql .= $ResourceId.",'".$_SERVER["REMOTE_ADDR"]."',$expire,".$this->Get("PortalUserId").",$DataType)"; + //echo $sql; + $this->adodbConnection->Execute($sql); + } + + function PurgeSpamControl() + { + $sql = "DELETE FROM ".GetTablePrefix()."SpamControl WHERE Expire<".adodb_date("U"); + + $this->adodbConnection->Execute($sql); + } + +}/* clsUserSession */ + +?> Index: trunk/admin/editor/FCKeditor/images/smiley/fun/sick2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/dialog/fck_about/logo_fredck_bottom.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/Leftover/icon24_products.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/misc/form_error.tpl =================================================================== diff -u --- trunk/themes/default/misc/form_error.tpl (revision 0) +++ trunk/themes/default/misc/form_error.tpl (revision 13) @@ -0,0 +1 @@ +
    Index: trunk/admin/images/itemicons/icon16_search.gif =================================================================== diff -u Binary files differ Index: trunk/compat/ob_get_clean.php =================================================================== diff -u --- trunk/compat/ob_get_clean.php (revision 0) +++ trunk/compat/ob_get_clean.php (revision 13) @@ -0,0 +1,49 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: ob_get_clean.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace ob_get_clean() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/ob_get_clean + * @author Aidan Lister + * @author Thiemo M�ttig (http://maettig.com/) + * @version $Revision: 1.1 $ + * @since PHP 4.3.0 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('ob_get_clean')) +{ + function ob_get_clean () + { + $contents = ob_get_contents(); + + if ($contents !== false) { + ob_end_clean(); + } + + return $contents; + } +} + +?> \ No newline at end of file Index: trunk/admin/browse/checkboxes.css =================================================================== diff -u --- trunk/admin/browse/checkboxes.css (revision 0) +++ trunk/admin/browse/checkboxes.css (revision 13) @@ -0,0 +1,21 @@ +.unselectedContainer {} + +.selectedContainer {background-color:#C6D6EF} + + + +.active_tab {width:138px; height:22px; cursor:hand; overflow:hidden} + +.inactive_tab {width:138px; height:22px; cursor:hand; overflow:hidden} + + + +.ini_tab {border: 0 solid green; position: relative; background-color: #ffffff; visibility: hidden} + +/*background-color: #ffffff; visibility: hidden*/ + + + +.perm_active {color: #20569A} + +.perm_inactive {color: #999999} \ No newline at end of file Index: trunk/admin/images/toolbar/tool_new_review_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/adduser.php =================================================================== diff -u --- trunk/admin/users/adduser.php (revision 0) +++ trunk/admin/users/adduser.php (revision 13) @@ -0,0 +1,370 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +//$pathtolocal = $pathtoroot."in-news/"; +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"); + +unset($objEditItems); +$objEditItems = new clsUserManager(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalUser"); +$objEditItems->EnablePaging = FALSE; +$objCustomFields = new clsCustomFieldList(6); +$objRelList = new clsRelationshipList(); +$objImages = new clsImageList(); +//$objUserGroupsList = new clsUserGroupList(); + +//Multiedit init +if ($_GET["new"] == 1) +{ + $c = new clsPortalUser(NULL); + $c->Set("CreatedOn", time()); + $c->Set("Status", 2); + $en = 0; + $action = "m_add_user"; + $objUsers->CreateEmptyEditTable("PortalUserId"); + $objRelList->CreateEmptyEditTable("RelationshipId"); + $objCustomDataList->CreateEmptyEditTable("CustomDataId"); + $objImages->CreateEmptyEditTable("ResourceId"); + //$objUserGroupsList->CreateEmptyEditTable("PortalUserId"); +} +else +{ + $en = (int)$_GET["en"]; + if (isset($_POST["itemlist"])) + { + $objUsers->CopyToEditTable("ResourceId",$_POST["itemlist"]); + } + $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); + $first=1; + foreach($objEditItems->Items as $u) + { + $objItemTypes->BuildUserItemTable($u->Get("PortalUserId"),$first); + $first=0; + } + + if(isset($_POST["itemlist"])) + { + /* make a copy of the relationship records */ + $ids = $objEditItems->GetResourceIDList(); + $objRelList->CopyToEditTable("SourceId",$ids); + $objCustomDataList->CopyToEditTable("ResourceId",$ids); + $objImages->CopyToEditTable("ResourceId",$ids); + //$objUserGroupsList->CopyToEditTable("PortalUserId", $ids); + } + + $itemcount=$objEditItems->NumItems(); + $c = $objEditItems->GetItemByIndex($en); + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_edit_user"; +} + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:edituser_general'; + +if (strlen($c->Get("Login"))) + $editing_title = "'".$c->Get("Login")."' "; +else + $editing_title = ""; + + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_User")." $editing_title- ".prompt_language("la_tab_General"); + +//Display header +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('edituser','UserEditStatus','".$admin."/users/user_list.php',1);","tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('edituser','UserEditStatus','".$admin."/users/user_list.php',2);","tool_cancel.gif"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/users/adduser.php"; + $StatusField = "UserEditStatus"; + $form = "edituser"; + MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"),'','la_PrevUser','la_NextUser'); +} + +int_header($objCatToolBar,NULL,$title); +?> + + + + + + + + > + + + + + > + + + + + > + + + + + + + + > + + + + + > + + + + + + > + + + + + > + + + + + + > + + + + + + > + + + + + > + + + + + > + + + + + > + + + + + > + + + + + + > + + + + + > + + + + +GetFieldUIList(TRUE); +if($CustomFieldUI->NumItems()>0) +{ + if((int)$c->Get("ResourceId")>0) + { + $objCustomDataList->LoadResource($c->Get("ResourceId")); + } + $headings = $CustomFieldUI->GetHeadingList(); + //echo "
    ";print_r($objCustomFields); echo "
    "; + for($i=0;$i<=count($headings);$i++) + { + $h = $headings[$i]; + if(strlen($h)) + { + int_subsection_title(prompt_language($h)); + $Items = $CustomFieldUI->GetHeadingItems($h); + foreach($Items as $f) + { + $n = substr($f->name,1); + $cfield = $objCustomFields->GetItemByField("FieldName",$n,FALSE); + if(is_object($cfield)) + { + $cv = $objCustomDataList->GetDataItem($cfield->Get("CustomFieldId")); + if(is_object($cv)) + { + $f->default_value = $cv->Get("Value"); + } + } + print "\n"; + print " \n"; + print " "; + if(is_object($f->NextItem)) + { + $n = $f->NextItem; + print " "; + } + else + print " \n"; + print "\n"; + } + } + } +} +?> + > + + + + +
    + "> +
    + + +
    + +
    + "> +
    + "> +
    + "> +  
    + "> +
    + "> +  
    + "> +  
    + "> +  
    + "> +  
    + "> +  
    + "> +  
    + Get("Status") == 1) echo "checked"; ?>> + Get("Status") == 2) echo "checked"; ?>> + Get("Status") == 0) echo "checked"; ?>> +  
    + "> +
    ".$f->GetPrompt()."".$f->ItemFormElement()."".$n->ItemFormElement()." 
    + + "> + +
    + + + + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_new_cat_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/subitems.php =================================================================== diff -u --- trunk/admin/subitems.php (revision 0) +++ trunk/admin/subitems.php (revision 13) @@ -0,0 +1,186 @@ +Get("Site_Path"); + + +$admin = $objConfig->Get("AdminDirectory"); +//echo "Admin: $admin
    \n"; +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL=$rootURL.$admin; +$imagesURL = $adminURL."/images"; + +$cssURL = $adminURL."/include"; +$jsURL = $adminURL."/include/subitems"; +//admin only util + +$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"); +$section = $_GET["section"]; + +$sectionname = explode(":", $section); +$sectionname = $sectionname[sizeof($sectionname)-1]; + +$incs = array(); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $inc = $pathtoroot.$value."admin/include/summary/".$sectionname.".php"; + //echo "
    ". $inc ."

    "; + if(file_exists($inc)) + $incs[] = $inc; +} + +$envar = BuildEnv(); +print << + + In-portal + + + + +END; + +require_once($pathtoroot.$admin."/include/mainscript.php"); + +print << + + + + + + +END; + int_SectionHeader(); + +?> + + + +0) +{ +?> + + + + +
    + +GetSection($section); + $sub = $objSections->GetSection($parent->Get("child")); + while(is_object($sub)) + { + echo "\n"; + echo " "; + echo " \n"; + echo "\n"; + $sub = $objSections->GetSection($sub->Get("right")); + } +?> +
    "; + echo " IconURL(2)."\" border=\"0\">"; + echo " URL()."\" class=\"dLink\">"; + $lang_tag = "la_Description_".$sub->Get("key"); + echo admin_language($sub->Get("name")).""; + echo prompt_language($lang_tag); //$sub->Get("description"); + echo "
    +
    + +
    +0) +{ +?> + + +
    + + + + +
    + Index: trunk/admin/install/restore_select.php =================================================================== diff -u --- trunk/admin/install/restore_select.php (revision 0) +++ trunk/admin/install/restore_select.php (revision 13) @@ -0,0 +1,110 @@ +read()) + { + if ($entry != "." && $entry != "..") + { + if (!is_dir($dirName.$path_char.$entry) && eregi("dump",$entry)) + { + $shortversion=chopchop($entry); + $filedate[]=$shortversion; + + } + } + } + $d->close(); + rsort($filedate); + + return $filedate; + +} + +function chopchop ($filename) +{ + eregi(BACKUP_NAME, $filename, $rets); + return $rets[1]; +} +?> + + $value) + { + $sel = ($value == $_REQUEST['backupdate']) ? ' checked' : ''; + $options .= ""; + $options .= ""; + $options .= '"; + $count++; + if($count>10) + break; + } + } + else { + $tmp_step = 2; + $next_step = 3; + $restore_error = "No backup files found or directory does not exist!"; + } + + if ($_POST["state"]=="restore_select") { + $tmp_step = 2; + $next_step = 3; + } + ?> + + +  Select Backup File

    + + + + + + + +
     Step - Select Backup File
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/images/spacer.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/inportal_schema.sql =================================================================== diff -u --- trunk/admin/install/inportal_schema.sql (revision 0) +++ trunk/admin/install/inportal_schema.sql (revision 13) @@ -0,0 +1,500 @@ +CREATE TABLE BanRules ( + RuleId int(11) NOT NULL auto_increment, + RuleType tinyint(4) NOT NULL default '0', + ItemField varchar(255) default NULL, + ItemVerb tinyint(4) NOT NULL default '0', + ItemValue varchar(255) NOT NULL default '', + ItemType int(11) NOT NULL default '0', + Priority int(11) NOT NULL default '0', + Status tinyint(4) NOT NULL default '1', + ErrorTag varchar(255) default NULL, + PRIMARY KEY (RuleId) +) +# -------------------------------------------------------- +CREATE TABLE Category ( + CategoryId int(11) NOT NULL auto_increment, + Type int(11) NOT NULL default '0', + ParentId int(11) NOT NULL default '0', + Name varchar(255) NOT NULL default '', + Description text NOT NULL, + CreatedOn double NOT NULL default '0', + EditorsPick tinyint(4) default NULL, + Status tinyint(4) NOT NULL default '0', + Pop tinyint(4) default NULL, + Priority int(11) default NULL, + MetaKeywords varchar(255) default NULL, + CachedDescendantCatsQty int(11) default NULL, + CachedNavbar text NOT NULL, + CreatedById int(11) NOT NULL default '0', + ResourceId int(11) default NULL, + ParentPath text NOT NULL, + MetaDescription varchar(255) default NULL, + HotItem int(11) NOT NULL default '2', + NewItem int(11) NOT NULL default '2', + PopItem int(11) NOT NULL default '2', + Modified double NOT NULL default '0', + ModifiedById int(11) NOT NULL default '0', + PRIMARY KEY (CategoryId), + KEY ParentId (ParentId), + KEY ResourceId (ResourceId), + KEY Modified (Modified), + KEY Priority (Priority), + KEY sorting (Name,Priority) +) +# -------------------------------------------------------- +CREATE TABLE CategoryItems ( + CategoryId int(11) NOT NULL default '0', + ItemResourceId int(11) NOT NULL default '0', + PrimaryCat tinyint(4) NOT NULL default '0', + PRIMARY KEY (CategoryId,ItemResourceId), + KEY ItemResourceId (ItemResourceId), + KEY PrimaryCat (PrimaryCat) +) +# -------------------------------------------------------- +CREATE TABLE ConfigurationAdmin ( + VariableName varchar(80) NOT NULL default '', + heading varchar(255) default NULL, + prompt varchar(255) default NULL, + element_type varchar(20) NOT NULL default '', + validation varchar(255) default NULL, + ValueList varchar(255) default NULL, + DisplayOrder int(11) NOT NULL default '0', + Install int(11) NOT NULL default '1', + PRIMARY KEY (VariableName) +) +# -------------------------------------------------------- +CREATE TABLE ConfigurationValues ( + VariableName varchar(255) NOT NULL default '', + VariableValue varchar(255) default NULL, + ModuleOwner varchar(20) default 'In-Portal', + Section varchar(255) NOT NULL default '', + PRIMARY KEY (VariableName) +) +# -------------------------------------------------------- +CREATE TABLE CountCache ( + ListType int(11) NOT NULL default '0', + ItemType int(11) NOT NULL default '-1', + Value int(11) NOT NULL default '0', + CountCacheId int(11) NOT NULL auto_increment, + LastUpdate int(11) NOT NULL default '0', + ExtraId varchar(50) default NULL, + TodayOnly tinyint(4) NOT NULL default '0', + PRIMARY KEY (CountCacheId) +) +# -------------------------------------------------------- +CREATE TABLE CustomField ( + CustomFieldId int(11) NOT NULL auto_increment, + Type int(11) NOT NULL default '0', + FieldName varchar(255) NOT NULL default '', + FieldLabel varchar(40) default NULL, + Heading varchar(60) default NULL, + Prompt varchar(60) default NULL, + ElementType varchar(50) NOT NULL default '', + ValueList varchar(255) default NULL, + DisplayOrder int(11) NOT NULL default '0', + OnGeneralTab tinyint(4) NOT NULL default '0', + PRIMARY KEY (CustomFieldId), + KEY Type (Type) +) +# -------------------------------------------------------- +CREATE TABLE CustomMetaData ( + CustomDataId int(11) NOT NULL auto_increment, + ResourceId int(11) NOT NULL default '0', + CustomFieldId int(11) NOT NULL default '0', + Value text NOT NULL, + PRIMARY KEY (CustomDataId) +) +# -------------------------------------------------------- +CREATE TABLE EmailMessage ( + EmailMessageId int(10) NOT NULL auto_increment, + Template longtext, + MessageType enum('html','text') NOT NULL default 'text', + LanguageId int(11) NOT NULL default '0', + EventId int(11) NOT NULL default '0', + PRIMARY KEY (EmailMessageId) +) +# -------------------------------------------------------- +CREATE TABLE EmailQueue ( + Subject text NOT NULL, + toaddr text NOT NULL, + fromaddr text NOT NULL, + message blob, + headers blob, + queued timestamp NOT NULL +) +# -------------------------------------------------------- +CREATE TABLE EmailSubscribers ( + EmailMessageId int(11) NOT NULL default '0', + PortalUserId int(11) NOT NULL default '0' +) +# -------------------------------------------------------- +CREATE TABLE Events ( + EventId int(11) NOT NULL auto_increment, + Event varchar(40) NOT NULL default '', + Enabled int(11) NOT NULL default '1', + FromUserId int(11) NOT NULL default '0', + Module varchar(40) NOT NULL default '', + Description varchar(255) NOT NULL default '', + Type int(11) NOT NULL default '0', + PRIMARY KEY (EventId) +) +# -------------------------------------------------------- +CREATE TABLE Favorites ( + FavoriteId int(11) NOT NULL auto_increment, + PortalUserId int(11) NOT NULL default '0', + ResourceId int(11) NOT NULL default '0', + ItemTypeId int(11) NOT NULL default '0', + Modified int(11) NOT NULL default '0', + PRIMARY KEY (FavoriteId), + UNIQUE KEY main (PortalUserId,ResourceId) +) +# -------------------------------------------------------- +CREATE TABLE IdGenerator ( + lastid int(11) default NULL +) +# -------------------------------------------------------- +CREATE TABLE Images ( + ImageId int(11) NOT NULL auto_increment, + ResourceId int(11) NOT NULL default '0', + Url varchar(255) NOT NULL default '', + Name varchar(255) NOT NULL default '', + AltName varchar(255) default NULL, + ImageIndex int(11) NOT NULL default '0', + LocalImage tinyint(4) NOT NULL default '1', + LocalPath varchar(240) NOT NULL default '', + Enabled int(11) NOT NULL default '1', + DefaultImg int(11) NOT NULL default '0', + ThumbUrl varchar(255) default NULL, + Priority int(11) NOT NULL default '0', + ThumbPath varchar(255) default NULL, + LocalThumb tinyint(4) NOT NULL default '0', + SameImages tinyint(4) NOT NULL default '0', + PRIMARY KEY (ImageId), + KEY ResourceId (ResourceId) +) +# -------------------------------------------------------- +CREATE TABLE ItemRating ( + RatingId int(11) NOT NULL auto_increment, + IPAddress varchar(255) NOT NULL default '', + CreatedOn double NOT NULL default '0', + RatingValue int(11) NOT NULL default '0', + ItemId int(11) NOT NULL default '0', + PRIMARY KEY (RatingId) +) +# -------------------------------------------------------- +CREATE TABLE ItemReview ( + ReviewId int(11) NOT NULL auto_increment, + CreatedOn double NOT NULL default '0', + ReviewText longtext NOT NULL, + IPAddress varchar(255) NOT NULL default '', + ItemId int(11) NOT NULL default '0', + CreatedById int(11) NOT NULL default '0', + ItemType tinyint(4) NOT NULL default '0', + Priority int(11) NOT NULL default '0', + Status tinyint(4) NOT NULL default '0', + TextFormat int(11) NOT NULL default '0', + Module varchar(255) NOT NULL default '', + PRIMARY KEY (ReviewId) +) +# -------------------------------------------------------- +CREATE TABLE ItemTypes ( + ItemType int(11) NOT NULL default '0', + Module varchar(50) NOT NULL default '', + SourceTable varchar(100) NOT NULL default '', + TitleField varchar(50) default NULL, + CreatorField varchar(255) NOT NULL default '', + PopField varchar(255) default NULL, + RateField varchar(255) default NULL, + LangVar varchar(255) NOT NULL default '', + PrimaryItem int(11) NOT NULL default '0', + EditUrl varchar(255) NOT NULL default '', + ClassName varchar(40) NOT NULL default '', + ItemName varchar(50) NOT NULL default '', + PRIMARY KEY (ItemType), + KEY Module (Module) +) +# -------------------------------------------------------- +CREATE TABLE Language ( + LanguageId int(11) NOT NULL auto_increment, + PackName varchar(40) NOT NULL default '', + LocalName varchar(40) NOT NULL default '', + Enabled int(11) NOT NULL default '0', + PrimaryLang int(11) NOT NULL default '0', + IconURL varchar(255) default NULL, + DateFormat varchar(50) NOT NULL default '', + TimeFormat varchar(50) NOT NULL default '', + DecimalPoint char(2) NOT NULL default '.', + ThousandSep char(1) NOT NULL default ',', + PRIMARY KEY (LanguageId) +) +# -------------------------------------------------------- +CREATE TABLE Modules ( + Name varchar(255) NOT NULL default '', + Path varchar(255) NOT NULL default '', + Var varchar(10) NOT NULL default '', + Version varchar(10) NOT NULL default '', + Loaded tinyint(4) NOT NULL default '1', + LoadOrder tinyint(4) NOT NULL default '0', + TemplatePath varchar(255) NOT NULL default '', + RootCat int(11) NOT NULL default '0', + BuildDate double NOT NULL default '0', + PRIMARY KEY (Name) +) +# -------------------------------------------------------- +CREATE TABLE PermCache ( + PermCacheId int(11) NOT NULL auto_increment, + CategoryId int(11) NOT NULL default '0', + PermId int(11) NOT NULL default '0', + ACL varchar(255) NOT NULL default '', + DACL varchar(255) NOT NULL default '', + PRIMARY KEY (PermCacheId), + KEY CategoryId (CategoryId), + KEY PermId (PermId) +) +# -------------------------------------------------------- +CREATE TABLE PermissionConfig ( + PermissionConfigId int(11) NOT NULL auto_increment, + PermissionName varchar(30) NOT NULL default '', + Description varchar(255) NOT NULL default '', + ErrorMessage varchar(255) NOT NULL default '', + ModuleId varchar(20) NOT NULL default '0', + PRIMARY KEY (PermissionConfigId), + KEY PermissionName (PermissionName) +) +# -------------------------------------------------------- +CREATE TABLE Permissions ( + PermissionId int(11) NOT NULL auto_increment, + Permission varchar(30) NOT NULL default '', + GroupId int(11) default '0', + PermissionValue int(11) NOT NULL default '0', + Type tinyint(4) NOT NULL default '0', + CatId int(11) NOT NULL default '0', + PRIMARY KEY (PermissionId) +) +# -------------------------------------------------------- +CREATE TABLE PersistantSessionData ( + PortalUserId int(11) NOT NULL default '0', + VariableName varchar(255) NOT NULL default '', + VariableValue text NOT NULL, + KEY UserId (PortalUserId), + KEY VariableName (VariableName) +) +# -------------------------------------------------------- +CREATE TABLE Phrase ( + Phrase varchar(255) NOT NULL default '', + Translation varchar(255) NOT NULL default '', + PhraseType int(11) NOT NULL default '0', + PhraseId int(11) NOT NULL auto_increment, + LanguageId int(11) NOT NULL default '0', + PRIMARY KEY (PhraseId), + INDEX Phrase_Index (Phrase) +) +# -------------------------------------------------------- +CREATE TABLE PhraseCache ( + Template varchar(40) NOT NULL default '', + PhraseList text NOT NULL, + CacheDate int(11) NOT NULL default '0', + ThemeId int(11) NOT NULL default '0', + PRIMARY KEY (Template) +) +# -------------------------------------------------------- +CREATE TABLE PortalGroup ( + GroupId int(11) NOT NULL auto_increment, + Name varchar(255) NOT NULL default '', + Description varchar(255) default NULL, + CreatedOn double NOT NULL default '0', + System tinyint(4) NOT NULL default '0', + Personal tinyint(4) NOT NULL default '0', + Enabled tinyint(4) NOT NULL default '1', + ResourceId int(11) NOT NULL default '0', + PRIMARY KEY (GroupId), + UNIQUE KEY Name (Name), + KEY ResourceId (ResourceId), + KEY Personal (Personal), + KEY Enabled (Enabled) +) +# -------------------------------------------------------- +CREATE TABLE PortalUser ( + PortalUserId int(11) NOT NULL auto_increment, + Login varchar(255) default NULL, + Password varchar(255) default NULL, + FirstName varchar(255) default NULL, + LastName varchar(255) default NULL, + Email varchar(255) NOT NULL default '', + CreatedOn double NOT NULL default '0', + Phone varchar(20) default NULL, + Street varchar(255) default NULL, + City varchar(20) default NULL, + State varchar(20) default NULL, + Zip varchar(20) default NULL, + Country varchar(20) NOT NULL default '', + ResourceId int(11) NOT NULL default '0', + Status tinyint(4) NOT NULL default '2', + Modified int(11) NOT NULL default '0', + dob double NOT NULL default '0', + tz int(11) default NULL, + ip varchar(20) default NULL, + IsBanned tinyint(1) NOT NULL default '0', + PRIMARY KEY (PortalUserId), + UNIQUE KEY Login (Login), + KEY ResourceId (ResourceId), + KEY CreatedOn (CreatedOn) +) +# -------------------------------------------------------- +CREATE TABLE Relationship ( + RelationshipId int(11) NOT NULL auto_increment, + SourceId int(11) default NULL, + TargetId int(11) default NULL, + SourceType tinyint(4) NOT NULL default '0', + TargetType tinyint(4) NOT NULL default '0', + Type int(11) NOT NULL default '0', + Enabled int(11) NOT NULL default '1', + Priority int(11) NOT NULL default '0', + PRIMARY KEY (RelationshipId), + KEY RelSource (SourceId), + KEY RelTarget (TargetId) +) +# -------------------------------------------------------- +CREATE TABLE SearchConfig ( + TableName varchar(40) NOT NULL default '', + FieldName varchar(40) NOT NULL default '', + SimpleSearch tinyint(4) NOT NULL default '0', + AdvancedSearch tinyint(4) NOT NULL default '0', + Description varchar(255) default NULL, + DisplayName varchar(80) default NULL, + ModuleName varchar(20) default NULL, + ConfigHeader varchar(255) default NULL, + DisplayOrder int(11) NOT NULL default '0', + SearchConfigId int(11) NOT NULL auto_increment, + Priority int(11) NOT NULL default '0', + FieldType varchar(20) NOT NULL default 'text', + ForeignField varchar(255) default NULL, + JoinClause varchar(255) default NULL, + IsWhere text, + IsNotWhere text, + ContainsWhere text, + NotContainsWhere text, + CustomFieldId int(11) NOT NULL default '0', + PRIMARY KEY (SearchConfigId) +) +# -------------------------------------------------------- +CREATE TABLE SearchLog ( + SearchLogId int(11) NOT NULL auto_increment, + Keyword varchar(255) NOT NULL default '', + Indices bigint(20) NOT NULL default '0', + SearchType int(11) NOT NULL default '0', + PRIMARY KEY (SearchLogId) +) +# -------------------------------------------------------- +CREATE TABLE SessionData ( + SessionKey varchar(50) NOT NULL default '', + VariableName varchar(255) NOT NULL default '', + VariableValue text NOT NULL, + KEY SessionKey (SessionKey), + KEY VariableName (VariableName) +) +# -------------------------------------------------------- +CREATE TABLE SpamControl ( + ItemResourceId int(11) NOT NULL default '0', + IPaddress varchar(20) NOT NULL default '', + Expire double NOT NULL default '0', + PortalUserId int(11) NOT NULL default '0', + DataType varchar(20) default NULL +) +# -------------------------------------------------------- +CREATE TABLE StatItem ( + StatItemId int(11) NOT NULL auto_increment, + Module varchar(20) NOT NULL default '', + ValueSQL varchar(255) default NULL, + ResetSQL varchar(255) default NULL, + ListLabel varchar(255) NOT NULL default '', + Priority int(11) NOT NULL default '0', + AdminSummary int(11) NOT NULL default '0', + PRIMARY KEY (StatItemId) +) +# -------------------------------------------------------- +CREATE TABLE Theme ( + ThemeId int(11) NOT NULL auto_increment, + Name varchar(40) NOT NULL default '', + Enabled int(11) NOT NULL default '1', + Description varchar(255) default NULL, + PrimaryTheme int(11) NOT NULL default '0', + CacheTimeout int(11) NOT NULL default '0', + PRIMARY KEY (ThemeId) +) +# -------------------------------------------------------- +CREATE TABLE ThemeFiles ( + FileId int(11) NOT NULL auto_increment, + ThemeId int(11) NOT NULL default '0', + FileName varchar(255) NOT NULL default '', + FilePath varchar(255) NOT NULL default '', + Description varchar(255) default NULL, + FileType int(11) NOT NULL default '0', + PRIMARY KEY (FileId) +) +# -------------------------------------------------------- +CREATE TABLE UserGroup ( + PortalUserId int(11) NOT NULL default '0', + GroupId int(11) NOT NULL default '0', + PrimaryGroup tinyint(4) NOT NULL default '1', + PRIMARY KEY (PortalUserId,GroupId), + KEY GroupId (GroupId), + KEY PrimaryGroup (PrimaryGroup) +) +# -------------------------------------------------------- + +CREATE TABLE UserSession ( + SessionKey varchar(50) NOT NULL default '', + CurrentTempKey varchar(50) default NULL, + PrevTempKey varchar(50) default NULL, + LastAccessed double NOT NULL default '0', + PortalUserId varchar(255) NOT NULL default '', + Language varchar(255) NOT NULL default '', + Theme varchar(255) NOT NULL default '', + GroupId int(11) NOT NULL default '0', + IpAddress varchar(20) NOT NULL default '0.0.0.0', + Status int(11) NOT NULL default '1', + GroupList varchar(255) default NULL, + tz int(11) default NULL, + PRIMARY KEY (SessionKey), + KEY UserId (PortalUserId), + KEY LastAccessed (LastAccessed) +) +# -------------------------------------------------------- +CREATE TABLE SuggestMail ( + email varchar(255) NOT NULL default '', + sent double, + PRIMARY KEY (email) +) +# -------------------------------------------------------- +CREATE TABLE SysCache ( + SysCacheId int(11) NOT NULL auto_increment, + Name varchar(255) NOT NULL default '', + Value mediumtext, + Expire double NOT NULL default '0', + Module varchar(20) default NULL, + Context varchar(255) default NULL, + GroupList varchar(255) NOT NULL default '', + PRIMARY KEY (SysCacheId), + KEY Name (Name) +) +# -------------------------------------------------------- +CREATE TABLE TagLibrary ( + TagId int(11) NOT NULL auto_increment, + name varchar(255) NOT NULL default '', + description text, + example text, + scope varchar(20) NOT NULL default 'global', + PRIMARY KEY (TagId) +) +# -------------------------------------------------------- +CREATE TABLE TagAttributes ( + AttrId int(11) NOT NULL auto_increment, + TagId int(11) NOT NULL default '0', + Name varchar(255) NOT NULL default '', + AttrType varchar(20) default NULL, + DefValue varchar(255) default NULL, + Description TEXT, + Required int(11) NOT NULL default '0', + PRIMARY KEY (AttrId) +) Index: trunk/admin/images/toolbar/tool_e-mail.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_primary_group.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_template.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/browse/sample_html/images/techpcb.jpg =================================================================== diff -u Binary files differ Index: trunk/themes/default/register/register_pending.tpl =================================================================== diff -u --- trunk/themes/default/register/register_pending.tpl (revision 0) +++ trunk/themes/default/register/register_pending.tpl (revision 13) @@ -0,0 +1,110 @@ + + + +
    + + + + + + + + + + +
    + Backup Directory: + +


    +
    + + + + + +
    +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + +
    + + + + + +

    +
    + + "> + + + + + + + + + + + + + + + + + + + + + +



     
    +

    +

    +



    +
    + " class="button"> +
    +
    +

    +
    + + + Index: trunk/kernel/admin/include/toolbar/browse.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/browse.php (revision 0) +++ trunk/kernel/admin/include/toolbar/browse.php (revision 13) @@ -0,0 +1,782 @@ +Get("CatTab_Hide"); + +$CategoryView = $objConfig->Get("Category_View"); +if(!is_numeric($CategoryView)) +{ + $CategoryView = 127; +} + +$Category_Sortfield = $objConfig->Get("Category_Sortfield"); +if(!strlen($Category_Sortfield)) + $Category_Sortfield = "Name"; + +$Category_Sortorder = $objConfig->Get("Category_Sortorder"); +if(!strlen($Category_Sortorder)) + $Category_Sortorder = "desc"; + +$Perpage_Category = (int)$objConfig->Get("Perpage_Category"); +if(!$Perpage_Category) + $Perpage_Category="'all'"; + + +if($CategoryView == 127) +{ + $Category_ShowAll = 1; +} +else +{ + $Category_ShowAll=0; + $Status = array(); + $Mod = array(); + if($CategoryView & $Bit_Pending) + $Status[] = STATUS_PENDING; + + if($CategoryView & $Bit_Active) + $Status[] = STATUS_ACTIVE; + + + if($CategoryView & $Bit_Disabled) + $Status[] = STATUS_DISABLED; + + if(count($Status)) + { + $CategoryFilter .= " AND (Status IN (".implode(",",$Status).") "; + } + else + $CategoryFilter .= " AND ((Status=-1) "; + + if($CategoryView & $Bit_Ed) + { + $CategoryFilter .= " OR (EditorsPick=1) "; + } + + if($CategoryView & $Bit_New) + { + $cutoff = adodb_date("U") - ($objConfig->Get("Category_DaysNew") * 86400); + $CategoryFilter .= " OR (CreatedOn > ".$cutoff.") "; + } + $CategoryFilter .= ")"; +} + +$list = $objSession->GetVariable("SearchWord"); +if(strlen($list)) +{ + $CatScope = $objSession->GetVariable("SearchScope"); + switch($CatScope) + { + case 0 : + $CatScopeClause = ""; + break; + case 1: + $cat = $objCatList->CurrentCategoryID(); + if($cat>0) + { + $allcats = $objCatList->AllSubCats($cat); + if(count($allcats)>0) + { + $catlist = implode(",",$allcats); + $CatScopeClause = " CategoryId IN ($catlist) "; + } + } + break; + case 2: + $CatScopeClause = "CategoryId=".$objCatList->CurrentCategoryID(); + break; + } +} +else + $CatScopeClause=""; + +$Cat_Paste = "false"; +if($objCatList->ItemsOnClipboard()>0) + $Cat_Paste = "true"; + +$CurrentCat = $objCatList->CurrentCategoryID(); +if($CurrentCat>0) +{ + $c = $objCatList->GetItem($CurrentCat); + $CurrentRes = (int)$c->Get("ResourceId"); +} +else + $CurrentRes =0; +$mnuClearSearch = language("la_SearchMenu_Clear"); +$mnuNewSearch = language("la_SearchMenu_New"); +$mnuSearchCategory = language("la_SearchMenu_Categories"); + +$lang_New = language("la_Text_New"); +$lang_Hot = language("la_Text_Hot"); +$lang_EdPick = language("la_prompt_EditorsPick"); +$lang_Pop = language("la_Text_Pop"); + +$lang_Rating = language("la_prompt_Rating"); +$lang_Hits = language("la_prompt_Hits"); +$lang_Votes = language("la_prompt_Votes"); +$lang_Name = language("la_prompt_Name"); + +$lang_Categories = language("la_ItemTab_Categories"); +$lang_Description = language("la_prompt_Description"); +$lang_MetaKeywords = language("la_prompt_MetaKeywords"); +$lang_SubSearch = language("la_prompt_SubSearch"); +$lang_Within = language("la_Text_Within"); +$lang_Current = language("la_Text_Current"); +$lang_Active = language("la_Text_Active"); +$lang_SubCats = language("la_Text_SubCats"); +$lang_SubItems = language("la_Text_Subitems"); + +print << +var Category_Sortfield = '$Category_Sortfield'; +var Category_Sortorder = '$Category_Sortorder'; +var Category_Perpage = $Perpage_Category; +var Category_ShowAll = $Category_ShowAll; +var CategoryView = $CategoryView; +var default_tab = "$DefaultTab"; +var Categories_Paste = $Cat_Paste; +var CurrentCat = $CurrentCat; +var CurrentRes = $CurrentRes; + +PasteButton = PasteButton || Categories_Paste; + +//JS Language variables +var lang_New = "$lang_New"; +var lang_Hot = "$lang_Hot"; +var lang_EdPick = "$lang_EdPick"; + +var lang_Pop = "$lang_Pop"; +var lang_Rating = "$lang_Rating"; +var lang_Hits = "$lang_Hits"; +var lang_Votes = "$lang_Votes"; +var lang_Name = "$lang_Name"; +var lang_Categories = "$lang_Categories"; +var lang_Description = "$lang_Description"; +var lang_MetaKeywords = "$lang_MetaKeywords"; +var lang_SubSearch = "$lang_SubSearch"; +var lang_Within="$lang_Within"; +var lang_Current = "$lang_Current"; +var lang_Active = "$lang_Active"; +var lang_SubCats = "$lang_SubCats"; +var lang_SubItems = "$lang_SubItems"; + + +var m_tab_CatTab_hide = $m_tab_CatTab_Hide; +var hostname = '$rootURL'; +var env = '$envar'; +var actionlist = new Array(); +var homeURL = "$homeURL"; +var upURL = "$upURL"; + + + function InitPage() + { + addCommonActions(); + initToolbar('mainToolBar', actionHandler); + initCheckBoxes(); + toggleMenu(); + } + + function AddButtonAction(actionname,actionval) + { + var item = new Array(actionname,actionval); + actionlist[actionlist.length] = item; + } + + function actionHandler(button) + { + //alert('a button has been pressed!'); + for(i=0; i0) + path = path + '?'+attr; + + window.location.href=path; + return true; + } + + function check_submit(page,actionValue) + { + + if (actionValue.match(/delete$/)) { + if (!theMainScript.Confirm(lang_DeleteConfirm)) return; + } + + var formname = ''; + var action_prefix =''; + + if ((activeTab) && (!isAnyChecked('categories'))) + { + form_name = activeTab.id; + action_prefix = activeTab.getAttribute("ActionPrefix"); + if(page.length==0) + page = activeTab.getAttribute("EditURL"); + } + else + { + form_name = 'categories'; + action_prefix = 'm_cat_'; + if(page.length==0) + page="$admin" + '/category/addcategory'; + } + var f = document.getElementsByName(form_name+'_form')[0]; + + if(f) + { + f.Action.value = action_prefix + actionValue; + f.action = '$rootURL' + page + '.php?'+ env; + //alert(f.name+ ' is submitting to '+ f.action + ' action=' + f.Action.value); + f.submit(); + } + } // check submit + + function edit_current() + { + if(CurrentCat==0) + { + get_to_server('$adminURL/category/addcategory_permissions.php',env+'&item=0'); + } + else + get_to_server('$adminURL/category/addcategory.php',env+'&item=$CurrentRes'); + } + + function flip_current(field_suffix) + { + if(activeTab) + { + field = activeTab.getAttribute("tabTitle")+field_suffix; + return flip(eval(field)); + } + } + + function config_current(field_suffix,value) + { + if(activeTab) + { + field = activeTab.getAttribute("tabTitle")+field_suffix; + config_val(field,value); + } + } + + function getSType(type,value) + { + f = document.getElementById("admin_search"); + if(f) + { + if (f.SearchType.value == type) return 2; else return 0; + } else return 0; + + } + + function getSScope(scope) + { + f = document.getElementById("admin_search"); + if(f) + { + if (f.SearchScope.value == scope) return 2; else return 0; + } else return 0; + + } + + function setSearchMenu() + { + + window.SearchMenu = new Menu("search"); + SearchMenu.addMenuItem(lang_All,"SetSearchType('all');",getSType('all')); + SearchMenu.addMenuSeparator() + + SearchMenu.addMenuItem(lang_Categories, "SetSearchType('categories');",getSType('categories')); + param = ""; + + for (var i = 0; i < tabIDs.length; i++) + { + d = document.getElementById(tabIDs[i]); + if(d) + { + tabname = d.getAttribute("tabTitle"); + param = "SetSearchType('"+tabname+"');"; + + SearchMenu.addMenuItem(tabname,param,getSType(tabname)); + } + } + + SearchMenu.addMenuSeparator(); + SearchMenu.addMenuItem(lang_All+' '+lang_Categories,"SetSearchScope('0');",getSScope(0)); + SearchMenu.addMenuItem(lang_SubSearch,"ToggleNewSearch();",isNewSearch()); + SearchMenu.addMenuItem(lang_Current+' '+lang_Categories,"SetSearchScope('2');",getSScope(2)); + SearchMenu.addMenuItem(lang_Within+' '+lang_Categories,"SetSearchScope('1');",getSScope(1)); + + SearchMenu.addMenuSeparator(); + + window.SearchMenu.addMenuItem('$mnuClearSearch',"ClearSearch();",""); + window.triedToWriteMenus = false; + window.SearchMenu.writeMenus(); + } + + function Category_SortMenu(caption) + { + menu_sorting = new Menu(caption); + + menu_sorting.addMenuItem(lang_Asc,"config_val('Category_Sortorder','asc');",RadioIsSelected(Category_Sortorder,'asc')); + menu_sorting.addMenuItem(lang_Desc,"config_val('Category_Sortorder','desc');",RadioIsSelected(Category_Sortorder,'desc')); + menu_sorting.addMenuSeparator(); + + menu_sorting.addMenuItem(lang_Default,"config_val('Category_Sortfield','Name');",""); + menu_sorting.addMenuItem(lang_Name,"config_val('Category_Sortfield','Name');",RadioIsSelected(Category_Sortfield,'Name')); + menu_sorting.addMenuItem(lang_Description,"config_val('Category_Sortfield','Description');",RadioIsSelected(Category_Sortfield,'Description')); + + menu_sorting.addMenuItem(lang_CreatedOn,"config_val('Category_Sortfield','CreatedOn');",RadioIsSelected(Category_Sortfield,'CreatedOn')); + menu_sorting.addMenuItem(lang_SubCats,"config_val('Category_Sortfield','CachedDescendantCatsQty');",RadioIsSelected(Category_Sortfield,'CachedDescendantCatsQty')); + menu_sorting.addMenuItem(lang_SubItems,"config_val('Category_Sortfield','SubItems');",RadioIsSelected(Category_Sortfield,'SubItems')); + + return menu_sorting; + + } + + + function Category_FilterMenu(caption) + { + menu_filter = new Menu(caption); + menu_filter.addMenuItem(lang_All,"config_val('Category_View', 127);",CategoryView==127); + menu_filter.addMenuSeparator(); + menu_filter.addMenuItem(lang_Active,"FlipBit('Category_View',CategoryView,6);",BitStatus(CategoryView,6)); + menu_filter.addMenuItem(lang_Pending,"FlipBit('Category_View',CategoryView,5);", BitStatus(CategoryView,5)); + menu_filter.addMenuItem(lang_Disabled,"FlipBit('Category_View',CategoryView,4);",BitStatus(CategoryView,4)); + + menu_filter.addMenuSeparator(); + menu_filter.addMenuItem(lang_New,"FlipBit('Category_View',CategoryView,3);",BitStatus(CategoryView,3)); + menu_filter.addMenuItem(lang_EdPick,"FlipBit('Category_View',CategoryView,0);",BitStatus(CategoryView,0)); + + return menu_filter; + } + + function toggleMenu() + { + //var tab_title = GetTabTitle(activeTab.id); + //alert(tab_title); + if ((document.getElementById('categories').active) && (activeTab)) + { + filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu();'; + + window.cat_menu_filter_sub = Category_FilterMenu(lang_Categories); + window.sub_menu_filter_sub = eval(filterfunc); + + window.cat_menu_filter = new Menu(lang_View); + cat_menu_filter.addMenuItem(cat_menu_filter_sub); + cat_menu_filter.addMenuItem(sub_menu_filter_sub); + } + else + { + if (document.getElementById('categories').active) + { + window.cat_menu_filter = Category_FilterMenu(lang_View); + } + if (activeTab) + { + filterfunc = activeTab.getAttribute("tabTitle")+'_FilterMenu();'; + window.cat_menu_filter = eval(filterfunc); + } + } // Filter + + //Sorting + if ((document.getElementById('categories').active) && (activeTab)) + { + //Sort->Categories + sortfunc = activeTab.getAttribute("tabTitle")+'_SortMenu();'; + + window.cat_menu_sorting_sub = Category_SortMenu(lang_Categories); + window.sub_menu_sorting_sub = eval(sortfunc); + + window.cat_menu_sorting = new Menu(lang_Sort); + cat_menu_sorting.addMenuItem(cat_menu_sorting_sub); + cat_menu_sorting.addMenuItem(sub_menu_sorting_sub); + } + else + { + if (document.getElementById('categories').active) + { + window.cat_menu_sorting = Category_SortMenu(lang_Sort); + + } // categories + if (activeTab) + { + window.cat_menu_sorting = Category_SortMenu(lang_Sort); + } + + } // && Sorting + if ((document.getElementById('categories').active) && (activeTab)) + { + window.cat_menu_select_sub = new Menu(lang_Categories); + cat_menu_select_sub.addMenuItem(lang_All,"javascript:selectAllC('categories');",""); + cat_menu_select_sub.addMenuItem(lang_Unselect,"javascript:unselectAll('categories');",""); + cat_menu_select_sub.addMenuItem(lang_Invert,"javascript:invert('categories');",""); + + selectfunc = activeTab.getAttribute("tabTitle")+"_SelectMenu();"; + + window.sub_menu_select_sub = eval(selectfunc); +// sub_menu_select_sub.addMenuItem(lang_All,"javascript:selectAllC('"+activeTab.id+"');",""); +// sub_menu_select_sub.addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');",""); +// sub_menu_select_sub.addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');",""); + +END; +if (!$hideSelectAll) { +echo " + window.cat_menu_select = new Menu(lang_Select); + cat_menu_select.addMenuItem(cat_menu_select_sub); + cat_menu_select.addMenuItem(sub_menu_select_sub);"; +} +print << + +END; +?> Index: trunk/admin/config/missing_label_search.php =================================================================== diff -u --- trunk/admin/config/missing_label_search.php (revision 0) +++ trunk/admin/config/missing_label_search.php (revision 13) @@ -0,0 +1,270 @@ +clsTemplateList($TemplateRoot); + } + + function ParseTag($raw) + { + $res = ""; + //echo "Tag:".htmlentities($raw).":
    \n"; + if(strlen(trim($raw))>0) + { + $tag = new clsHtmlTag($raw); + + switch($tag->name) + { + case "include": + case "perm_include": + $res = ""; + break; + case "mod_include": + $res = ""; + break; + default: + + //if($tag->name=="m_language") + $res = $tag->Execute(); + break; + } + unset($tag); + } + return $res; + } + +} +//admin only util +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$pathtolocal = $pathtoroot."in-news/"; +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"); + +$section = "in-portal:missing_label_search"; + +$FilesPerLoad = 20; +$ado = GetADODBConnection(); + +if($_GET["LangId"]) +{ + $LangId = $_GET["LangId"]; + $ThemeId = $_GET["theme"]; + $table = $objSession->GetSessionTable("_".$ThemeId."_labels"); + @$ado->Execute("DROP TABLE $table "); + $Phrases = new clsPhraseList(); + $query = "SELECT * FROM ".$Phrases->SourceTable." WHERE PhraseId = -1"; + $insert = "CREATE TABLE ".$table." ".$query; + $ado->Execute($insert); + $FileIndex = 0; + $objThemeFiles = new clsThemeFileList($ThemeId); + $NumFiles = TableCount($objThemeFiles->SourceTable,"ThemeId=$ThemeId",0); + $objSession->SetVariable("Missing_ThemeId",$ThemeId); + $objSession->SetVariable("Missing_LangId",$LangId); +} +else +{ + $ThemeId = $objSession->GetVariable("Missing_ThemeId"); + $table = $objSession->GetSessionKey()."_".$ThemeId."_labels"; + $objThemeFiles = new clsThemeFileList($ThemeId); + $LangId = $objSession->GetVariable("Missing_LangId"); + $FileIndex = $_GET["File"]; + $NumFiles = $_GET["NumFiles"]; +} + +$l = $objLanguages->GetItem($LangId); +$name = $l->Get("PackName"); + +$objThemeList = new clsThemeList(); +$Theme = $objThemeList->GetItem($ThemeId); +$theme_name = $Theme->Get("Name"); + +$sql = "SELECT * FROM $table"; +$rs = $ado->Execute($sql); +$found = array(); +while($rs && !$rs->EOF) +{ + $p = $rs->fields["Phrase"]; + if(!in_array($p,$found)) + $found[] = $p; + $rs->MoveNext(); +} + + +$subtitle = prompt_language("la_prompt_Theme").": ".$theme_name; +$title = prompt_language("la_Text_Scanning")." ".prompt_language("la_Text_Templates"); + +int_header(NULL,NULL,$title); +?> + + +"; + echo ""; + } + else if ($percent < 60) + { + echo ""; + } + else if ($percent == 100) + { + echo ""; + } + else + { + echo ""; + } + + $sql = "SELECT * FROM ".$objThemeFiles->SourceTable." WHERE ThemeId=$ThemeId LIMIT $FileIndex,$FilesPerLoad"; + $TemplateRoot = $Theme->ThemeDirectory()."/"; + $objTemplate = new clsLangParser($TemplateRoot); + $objTemplate->SkipIncludes=1; + //$ForceLanguage = $LangId; + $LogPhraseLookups = TRUE; + $rs = $ado->Execute($sql); + while($rs && !$rs->EOF) + { + $path = ""; + $p = $rs->fields["FilePath"]; + if(strlen(trim($p))) + $path .= $p."/"; + $path .= $rs->fields["FileName"]; + $path = substr($path,0,-4); + //echo "Parsing $path
    \n"; + $html = $objTemplate->ParseTemplate($path); + //echo htmlentities($html)."
    \n"; + $rs->MoveNext(); + } + if(is_array($MissingList)) + { + for($x=0;$x\n"; + $ado->Execute($sql); + } + } + } + if($FileIndex >=$NumFiles) + { + $target = $adminURL."/config/missing_label_edit.php?env=".BuildEnv()."&lpn=1"; + } + else + { + $next = $FileIndex+$FilesPerLoad; + $target = $_SERVER["PHP_SELF"]."?env=".BuildEnv()."&File=".$next."&NumFiles=$NumFiles"; + } +?> +
    $percent"; + echo "%
    "; + $row2 = 100-$percent; + echo " $percent"; + echo "%
    $percent%
    $percent%"; + $row2 = 100-$percent; + echo "
    + +"; + print " location.href='$target';"; + print " "; + //print "$target"; +?> Index: trunk/kernel/include/error.php =================================================================== diff -u --- trunk/kernel/include/error.php (revision 0) +++ trunk/kernel/include/error.php (revision 13) @@ -0,0 +1,204 @@ +SetMessage($message); + $this->SetField($field); + } + + function GetMessage() + { + return $this->m_Message; + } + + function SetMessage($value) + { + $this->m_Message = $value; + } + + function GetField() + { + return $this->m_Field; + } + + function SetField($value) + { + $this->m_Field = $value; + } + +} + +class clsErrorManager +{ + + var $m_errorsMap = array(); + var $m_Errors; + var $m_Language; + var $m_CurrentError; + var $m_UserErrors = array(); + + function clsErrorManager() + { + $this->SetLanguage("english"); + } + + function NumErrors() + { + return count($this->m_Errors); + } + + function GetErrors() + { + return $this->m_Errors; + } + + function Get($property) + { + return $this->config[$property]; + } + + function Set($property, $value) + { + $varname = "m_".$property; + $this->$varname = $value; + } + + + function ClearErrors() + { + unset($this->m_Errors); + $this->m_CurrentError = 0; + $this->m_UserErrors = array(); + } + + function SetLanguage($lang) + { + $this->m_Language=$lang; + } + + function AddAdminUserError($errorLang) + { + $this->m_UserErrors[] = $errorLang; + } + + function GetAdminUserErrors() + { + return $this->m_UserErrors; + } + + function AddError($errorPhrase, $errorField=NULL,$arg1 = NULL,$arg2 = NULL,$arg3 = NULL,$arg4 = NULL,$fatal=FALSE) + { + global $g_DebugMode, $objLanguageCache, $g_ErrorLog; + + + $errorText = ""; + + //$arg3::$arg4\t$errorPhrase\t$arg1 #arg2 + $errorText = "%s::%s\t%s\t%s %s\n"; + $errorMessage = sprintf($errorText,$arg3,$arg4,$errorPhrase,$arg1,$arg2); + + $error = new clsError($errorMessage, $errorField); + $this->m_Errors[] = $error; + if($g_DebugMode) + echo ("Error code: $errorMessage, Field: $errorField"); + if(strlen($g_ErrorLog)) + { + if(is_writable($g_ErrorLog)) + { + $fp = fopen($g_ErrorLog,"a"); + if($fp) + { + $datestamp = date("Y-m-d H:i:s"); + fputs($fp,$datestamp."\t",$errorMessage." ".$errorField); + fclose($fp); + } + } + } + } + + function GetNextErrorText() + { + if($this->NumErrors()>$this->m_CurrentError) + { + return $this->m_Errors[$this->m_CurrentError++]->GetMessage(); + } + else + { + return ""; + } + } + + function GetNextError() + { + if($this->NumErrors()>$this->m_CurrentError) + { + return $this->m_Errors[$this->m_CurrentError++]; + } + else + return FALSE; + } + + + function HandleErrors($postBackUrl) + { + + $this->Set("Current_Error",0); + $Global_Error = ""; + $e=$this->GetNextError(); + while($e) + { + if($e->GetField() != "") + { + + $message = urlencode($e->GetMessage()); + if(strstr($postBackUrl,"?") == NULL) + $postBackUrl = $postBackUrl."?".$e->GetField()."_Error=".$e->GetMessage(); + else + $postBackUrl = $postBackUrl."&".$e->GetField()."_Error=".$e->GetMessage(); + } + else + { + $Global_Error = $e->GetMessage(); + } + } + + if(isset($Global_Error) && $Global_Error != "") + { + if(strstr($postBackUrl,"?") == NULL) + $postBackUrl .= "?Global_Error=$message"; + else + $postBackUrl .= "&Global_Error=$message"; + } + + $compleateUrl = GetCompleteUrl($postBackUrl); + + echo(''); + + // header ("Location: $compleateUrl"); /* Redirect browser + // to PHP web site */ + exit; /* Make sure that code below does + not get executed when we redirect. */ + $e=$this->GetNextError(); + } +} + + +function Permission_Error($message) +{ + global $PermissionError; + + $PermissionError = $message; + /* here we can do some logging or other cool stuff */ +} + + +?> Index: trunk/kernel/include/custommetadata.php =================================================================== diff -u --- trunk/kernel/include/custommetadata.php (revision 0) +++ trunk/kernel/include/custommetadata.php (revision 13) @@ -0,0 +1,260 @@ +clsItem(); + $this->tablename=GetTablePrefix()."CustomMetaData"; + $this->type=12; + $this->BasePermission=""; + $this->id_field = "CustomDataId"; + $this->NoResourceId=1; //set this to avoid using a resource ID + + if(isset($CustomDataId)) + $this->LoadFromDatabase($CustomDataId); + } + + function Validate() + { + global $Errors; + + $dataValid = true; + if(!strlen($this->Get("ResourceId"))) + { + $Errors->AddError("error.fieldIsRequired",'ResourceId',"","",get_class($this),"Validate"); + $dataValid = false; + } + return $dataValid; + } + + function SetFieldName($name) + { + $this->FieldName = $name; + } + + function GetFieldName() + { + return $this->FieldName; + } + + function Save() + { + if(is_numeric($this->Get("CustomDataId"))) + { + $this->Update(); + } + else + $this->Create(); + } + + /* + function LoadFromDatabase($Id) + { + global $objSession, $Errors; + + if(!isset($Id)) + { + $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase"); + return false; + } + $sql = sprintf("SELECT * FROM ".$this->SourceTable." WHERE CustomDataId = '%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; + } + */ +} /*clsCustomMetaData*/ + +class clsCustomDataList extends clsItemCollection +{ + + function clsCustomDataList($table="") + { + $this->clsItemCollection(); + $this->classname = "clsCustomMetaData"; + if(!strlen($table)) + $table = GetTablePrefix()."CustomMetaData"; + $this->SourceTable = $table; + } + + function LoadResource($ResourceId) + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE ResourceId=".$ResourceId; + $this->Query_Item($sql); + return $this->Items; + } + + function DeleteResource($ResourceId) + { + $sql = "DELETE FROM ".$this->SourceTable." WHERE ResourceID=".$ResourceId; + $this->adodbConnection->Execute($ResourceId); + } + + function &SetFieldValue($FieldId,$ResourceId,$Value) + { + $d =& $this->GetDataItem($FieldId); + if(is_object($d)) + { + $d->Set("Value",$Value); + if(!strlen($Value)) + { + for($x=0;$xItems);$x++) + { + if($this->Items[$x]->Get("CustomFieldId")==$FieldId && + $this->Items[$x]->Get("ResourceId")==$ResourceId) + { + $this->Items[$x]->Set("CustomFieldId",0); + break; + } + } + $d->Delete(); + } + } + else + { + if(strlen($Value)>0) + { + $d = new clsCustomMetaData(); + $d->Set("CustomFieldId",$FieldId); + $d->Set("ResourceId",$ResourceId); + $d->Set("Value",$Value); + array_push($this->Items,$d); + } + } + return $d; + } + + function &GetDataItem($id) + { + $found = false; + for($i=0;$i<$this->NumItems();$i++) + { + $d =& $this->GetItemRefByIndex($i); + if($d->Get("CustomFieldId")==$id) + { + $found=TRUE; + break; + } + } + return ($found) ? $d : false; + } + + function SaveData() + { + foreach($this->Items as $f) + { + $FieldId = $f->Get("CustomFieldId"); + $value = $f->Get("Value"); + $ResId = $f->Get("ResourceId"); + $DataId = $f->Get("CustomDataId"); + if(is_numeric($DataId)) + { + $sql = "UPDATE ".$this->SourceTable." SET Value='".$value."' WHERE CustomFieldId='$FieldId' AND ResourceId='$ResId'"; + $this->adodbConnection->Execute($sql); + } + else + { + if($FieldId>0) + { + $sql = "INSERT INTO ".$this->SourceTable." (ResourceId,CustomFieldId,Value) VALUES ('".$ResId."','$FieldId','$value')"; + $this->adodbConnection->Execute($sql); + } + } + } + + $rs = $this->adodbConnection->Execute("SELECT * FROM ".$this->SourceTable." WHERE CustomDataId=0 "); + while($rs && !$rs->EOF) + { + $m = $this->adodbConnection->Execute("SELECT MIN(CustomDataId) as MinValue FROM ".$this->SourceTable); + $NewId = $m->fields["MinValue"]-1; + + $sql = "UPDATE ".$this->SourceTable." SET CustomDataId=$NewId WHERE ResourceId=".$rs->fields["ResourceId"]." AND "; + $sql .= "CustomFieldId=".$rs->fields["CustomFieldId"]; + $this->adodbConnection->Execute($sql); + $rs->MoveNext(); + } + } + + function CopyToEditTable($idfield, $idlist) + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + @$this->adodbConnection->Execute("DROP TABLE $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((int)$GLOBALS["debuglevel"]) + echo $insert; + $this->adodbConnection->Execute($insert); + $this->SourceTable = $edit_table; + $this->SaveData(); + + } + + function CopyFromEditTable($ResourceId) + { + global $objSession; + + $edit_table = $objSession->GetEditTable($this->SourceTable); + $idlist = array(); + + //$this->adodbConnection->Execute($sql); + + $sql = "SELECT * FROM $edit_table"; + $this->Clear(); + $rs = $this->adodbConnection->Execute($sql); + while($rs && !$rs->EOF) + { + $data = $rs->fields; + + $c = $this->AddItemFromArray($data); + if(strlen($data["Value"])>0) + { + $c->Dirty(); + if($data["CustomDataId"]>0) + { + + $c->Update(); + } + else + { + $c->UnsetIdField(); + $c->Create(); + } + $idlist[] = $c->Get("CustomDataId"); + } + else + { + $sql = "DELETE FROM ".$this->SourceTable." WHERE ResourceId=".$data["ResourceId"]." AND CustomFieldId=".$data["CustomFieldId"]; + //echo $sql."
    \n"; + $this->adodbConnection->Execute($sql); + } + $rs->MoveNext(); + } + @$this->adodbConnection->Execute("DROP TABLE $edit_table"); + } + +} /* clsCustomDataList */ +?> Index: trunk/themes/default/img/bgr_links.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/worship.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_ban_user_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/modules/mod_status.php =================================================================== diff -u --- trunk/admin/modules/mod_status.php (revision 0) +++ trunk/admin/modules/mod_status.php (revision 13) @@ -0,0 +1,205 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL=$rootURL.$admin; +$imagesURL = $adminURL."/images"; + +//admin only util +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"); + +$pathtolocal = $pathtoroot; + +//Set Section +$section = 'in-portal:mod_status'; + +//Set Environment Variable +$envar = "env=" . BuildEnv(); + +//Display header + +$objListToolBar = new clsToolBar(); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass","ModChecks"); +$objListToolBar->Set("CheckForm","modlistform"); +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add( "mod_enable", + "la_ToolTip_Enable", + "#", + "if (ModChecks.itemChecked()) swap('mod_enable','toolbar/tool_approve_f2.gif');", + "if (ModChecks.itemChecked()) swap('mod_enable', 'toolbar/tool_approve.gif');", + "if (ModChecks.itemChecked()) ModChecks.check_submit('mod_status', 'm_mod_enable');", + "tool_approve.gif"); +$listImages[] = "ModChecks.addImage('mod_enable','$imagesURL/toolbar/tool_approve.gif','$imagesURL/toolbar/tool_approve_f3.gif',1); "; + +$objListToolBar->Add( "mod_disable", + "la_ToolTip_Disable", + "#", + "if (ModChecks.itemChecked()) swap('mod_disable','toolbar/tool_decline_f2.gif');", + "if (ModChecks.itemChecked()) swap('mod_disable', 'toolbar/tool_decline.gif');", + "if (ModChecks.itemChecked()) ModChecks.check_submit('mod_status', 'm_mod_disable');", + "tool_decline.gif"); +$listImages[] = "ModChecks.addImage('mod_disable','$imagesURL/toolbar/tool_decline.gif','$imagesURL/toolbar/tool_decline_f3.gif',1); "; + + +$objListToolBar->AddToInitScript($listImages); + +$order = $objConfig->Get("Module_SortOrder"); + +$orderBy = trim($objConfig->Get("Module_SortField")." ".$order); +if(strlen($orderBy)) +{ + $orderBy = " ORDER BY LoadOrder,".$orderBy; +} +else + $orderBy = " ORDER BY LoadOrder"; + +$where = ''; +$sql = "SELECT m.Name as Name,m.Version as Version, "; +$sql .="ELT(m.Loaded+1,'".admin_language("la_Text_Disabled")."','".admin_language("la_Text_Enabled")."') as Status "; +$sql .="FROM ".GetTablePrefix()."Modules as m ".$where." ".$orderBy; + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; + + +$objModules->Clear(); +$objModules->Query_Item($sql); + +$itemcount = TableCount(GetTablePrefix()."Modules", $where,0); + + +$title = admin_language("la_Text_Modules")." (".$itemcount.")"; + +$objListView = new clsListView($objListToolBar,$objModules); +$objListView->IdField = "Name"; +$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl"; + +$objListView->ColumnHeaders->Add("Name", admin_language("la_prompt_Name"),1,0,$order,"width=\"50%\"","Module_SortField","Module_SortOrder","Name"); +$objListView->ColumnHeaders->Add("Status",admin_language("la_prompt_Status"),1,0,$order,"width=\"50%\"","Module_SortField","Module_SortOrder","Status"); +$objListView->ColumnHeaders->Add("Version",admin_language("la_Text_Version"),1,0,$order,"width=\"50%\"","Module_SortField","Module_SortOrder","Version"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get("Module_SortField"),$order); + +$objListView->PrintToolBar = FALSE; +$objListView->SearchBar = FALSE; +$objListView->SearchAction=""; +$objListView->CurrentPageVar = "Page_Modules"; +$objListView->PerPageVar = "Perpage_Modules"; +$objListView->CheckboxName = "itemlist[]"; +$objListView->TotalItemCount = $itemcount; + +int_header($objListToolBar,NULL,$title); +?> +
    +PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */ + $objListView->SliceItems(); + print $objListView->PrintList(); +?> + +
    + +
    + + + + +
    + + + + + Index: trunk/admin/icons/icon24_tool_restore.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/cool.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_template_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/lv/js/js_lang.php =================================================================== diff -u --- trunk/admin/lv/js/js_lang.php (revision 0) +++ trunk/admin/lv/js/js_lang.php (revision 13) @@ -0,0 +1,14 @@ + + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/alien2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/icon16_search_reset.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/adodb-errorpear.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/adodb-errorpear.inc.php (revision 0) +++ trunk/kernel/include/adodb/adodb-errorpear.inc.php (revision 13) @@ -0,0 +1,88 @@ +!$s

    "; +} + +/** +* Returns last PEAR_Error object. This error might be for an error that +* occured several sql statements ago. +*/ +function &ADODB_PEAR_Error() +{ +global $ADODB_Last_PEAR_Error; + + return $ADODB_Last_PEAR_Error; +} + +?> \ No newline at end of file Index: trunk/admin/category/addpermission.php =================================================================== diff -u --- trunk/admin/category/addpermission.php (revision 0) +++ trunk/admin/category/addpermission.php (revision 13) @@ -0,0 +1,405 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; + +$imagesURL = $adminURL."/images"; +$cssURL = $adminURL."/include"; + +$browseURL = $adminURL."/browse"; + +//$pathtolocal = $pathtoroot."in-news/"; +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."/browse/toolbar.php"); +require_once($pathtoroot.$admin."/listview/listview.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + +unset($objEditItems); + +$objEditItems = new clsCatList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Category"); + +//Multiedit init +$en = (int)$_GET["en"]; +$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); +$itemcount=$objEditItems->NumItems(); + +$c = $objEditItems->GetItemByIndex($en); + +if(!is_object($c)) +{ + $c = new clsCategory(); + $c->Set("CategoryId",0); +} +if($itemcount>1) +{ + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; +} +$action = "m_edit_permissions"; + +$envar = "env=" . BuildEnv() . "&en=$en"; + +$section = 'in-portal:catperm_setperm'; +$Module = $_GET["module"]; +$GroupId = $_GET["GroupId"]; + +$g = $objGroups->GetItem($GroupId); + +$objPermList = new clsPermList($c->Get("CategoryId"),$GroupId); +$objPermList->LoadPermTree($c); + +$objParentPerms = new clsPermList($c->Get("ParentId"),$GroupId); +$p = $objCatList->GetCategory($c->Get("ParentId")); +$objParentPerms->LoadPermTree($p); + +$ado = GetADODBConnection(); + +/* page header */ +print << + + In-portal + + + + + + + + + + + +END; + +//int_SectionHeader(); +//$back_url = $rootURL."admin/category/addpermission_modules.php?env=".BuildEnv()."&GroupId=$GroupId"; +$back_url = "javascript:do_edit_save('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);"; + +if($c->Get("CategoryId")>0) +{ + $title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Category")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Permissions"); + $title .= " ".prompt_language("la_text_for")." '".$g->parsetag("group_name")."'"; +} +else +{ + $title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Root")." ".prompt_language("la_Text_Category")." - "."' - ".prompt_language("la_tab_Permissions"); + $title .= " ".prompt_language("la_text_for")." '".$g->parsetag("group_name")."'"; +} + +$objListToolBar = new clsToolBar(); + +$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);",$imagesURL."/toolbar/tool_select.gif"); +//$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('category','admin/category/addpermission_modules.php',-1);", $imagesURL."/toolbar/tool_cancel.gif"); +$objListToolBar->Add("img_cancel", "la_Cancel",$back_url,"swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","", $imagesURL."/toolbar/tool_cancel.gif"); +$sec =& $objSections->GetSection($section); + +if($c->Get("CategoryId")==0) +{ + $sec->Set("left",NULL); + $sec->Set("right",NULL); + +} +int_header($objListToolBar,NULL,$title); +if ($objSession->GetVariable("HasChanges") == 1) { +?> + + + + +
    + +
    + + + + + + + +
    + + + + + + ".prompt_language("la_prompt_Description").""; + if($c->Get("CategoryId")!=0) + { + echo ""; + } + echo "\n"; + if($c->Get("CategoryId")!=0) + { + echo ""; + } + ?> + +Get("CategoryId")>0) + { + $ParentCatList = "0".$c->Get("ParentPath"); + } + else + $ParentCatList = "0".$c->GetParentField("ParentPath","",""); + $ParentCats = explode("|",$ParentCatList); + $ParentCats = array_reverse($ParentCats); + + $sql = "SELECT * FROM ".GetTablePrefix()."PermissionConfig WHERE ModuleId='$Module'"; + $rs = $ado->Execute($sql); + while($rs && !$rs->EOF) + { + $perm = $rs->fields; + $Permission = $perm["PermissionName"]; + $Desc = $perm["Description"]; + echo "\n"; + echo ""; + $p = $objPermList->GetPermByName($Permission); + $checked = ""; + $MatchCatPath = ""; + if(is_object($p)) + { + //echo $p->Get("Permission")." Found
    \n"; + if($p->Inherited) + { + $checked = " CHECKED"; + $MatchCatPath = ""; + if($c->Get("CategoryId")>0) + { + $MatchedCat = $objPermList->GetDefinedCategory($Permission,$GroupId); + } + else + $MatchedCat = $objParentPerms->GetDefinedCategory($Permission,$GroupId); + + if(is_numeric($MatchedCat)) + { + if($MatchedCat!=0) + { + $mcat = $objCatList->GetCategory($MatchedCat); + $MatchCatPath = language($objConfig->Get("Root_Name")).">".$mcat->Get("CachedNavbar"); + } + else + $MatchCatPath = language($objConfig->Get("Root_Name")); + } + else + $MatchCatPath = ""; + } + } + else + $checked = " CHECKED"; + if($c->Get("CategoryId")!=0) + { + echo " \n"; + } + else + { + if(is_object($p)) + $p->Inherited = FALSE; + } + $checked = ""; + $imgsrc="red"; + if(is_object($p)) + { + if($p->Get("PermissionValue")) + { + $checked = " CHECKED"; + $imgsrc = "green"; + $current = "true"; + } + else + { + $imgsrc = "red"; + $current = "false"; + } + $disabled = ""; + if($p->Inherited) + { + if($c->Get("CategoryId")!=0) + { + $InheritValue = $current; + $UnInheritValue = "false"; + $disabled = "DISABLED=\"true\""; + } + else + { + $disabled = ""; + $UnInheritValue = "false"; + $InheritValue="false"; + + } + } + else + { + $disabled = ""; + if($p->Get("PermissionValue")) + { + $InheritValue = "false"; //need to look this up! + } + else + $InheritValue = "false"; + $UnInheritValue = $current; + } + + } + else + { + if($c->Get("CategoryId")!=0) + { + $disabled = "DISABLED=\"true\""; + $InheritValue = "false"; + $UnInheritValue = "false"; + $Matched = FALSE; + $MatchCatPath = ""; + $MatchedCat = $objPermList->GetDefinedCategory($Permission,$GroupId); + if(is_numeric($MatchedCat)) + { + if($MatchedCat>0) + { + $mcat = $objCatList->GetCategory($MatchedCat); + $MatchCatPath =language($objConfig->Get("Root_Name")).">".$mcat->Get("CachedNavbar"); + } + else + $MatchCatPath = language($objConfig->Get("Root_Name")); + } + else + $MatchCatPath = ""; + } + else + { + $disabled = ""; + $UnInheritValue = "false"; + $InheritValue="false"; + } + } + echo " \n"; + if($c->Get("CategoryId")!=0) + echo ""; + echo "\n"; + $rs->MoveNext(); + } +?> + + + + "> + + + +
    ".prompt_language("la_ColHeader_PermInherited")."".prompt_language("la_ColHeader_PermAccess")."".prompt_language("la_ColHeader_InheritFrom")."
    ".prompt_language("$Desc")." [$Permission]"; + + echo " "; + echo " $MatchCatPath
    + +
    + + + + +
    + + Index: trunk/kernel/include/searchitems.php =================================================================== diff -u --- trunk/kernel/include/searchitems.php (revision 0) +++ trunk/kernel/include/searchitems.php (revision 13) @@ -0,0 +1,651 @@ + : is required + - : cannot exist in the searched field + "word word" : contents between the quotes are treated as a single entity + +/-"word word" is supported + ignore words are not case sensitive +*/ +class clsSearchLog extends clsItemDB +{ + function clsSearchLog($id=NULL) + { + $this->clsItemDB(); + $this->tablename = GetTablePrefix()."SearchLog"; + $this->id_field = "SearchLogId"; + $this->NoResourceId = 1; + if($id) + $this->LoadFromDatabase($id); + } + + 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; + } +} + +class clsSearchLogList extends clsItemCollection +{ + var $Page; + var $PerPageVar; + + function clsSearchLogList() + { + $this->clsItemCollection(); + $this->SourceTable = GetTablePrefix()."SearchLog"; + $this->classname = "clsSearchLog"; + $this->Page=1; + $this->PerPageVar = "Perpage_SearchLog"; + $this->AdminSearchFields = array("Keyword"); + } + + function UpdateKeyword($keyword,$SearchType) + { + $sql = "UPDATE ".$this->SourceTable." SET Indices = Indices+1 WHERE Keyword='$keyword' AND SearchType=$SearchType"; + //echo $sql."
    \n"; + $this->adodbConnection->Execute($sql); + if($this->adodbConnection->Affected_Rows()==0) + { + //echo "Creating Keyword record..
    \n"; + $k = new clsSearchLog(); + $k->Set("Keyword",$keyword); + $k->Set("Indices",1); + $k->Set("SearchType",$SearchType); + $k->Create(); + } + } + + function AddKeywords($Keywords) + { + if(is_array($Keywords)) + { + for($i=0;$iUpdateKeyword($Keywords[$i]); + } + } + else + $this->UpdateKeyword($Keywords); + } +} + +class clsSearchResults extends clsItemCollection +{ + var $ResultTable; + var $FieldList; + var $FieldWeight; + var $WhereClauses; + var $SourceTable; + var $Relationships; + var $Ignored_Words; + var $CatClause; + var $Keywords; + var $Phrase = ""; + var $SearchType; + var $RequiredRelevance; + var $PctRelevance; + var $PctPop; + var $PctRating; + + function clsSearchResults($SearchSource,$DataClass) + { + global $objConfig; + + $this->clsItemCollection(); + $this->SourceTable = $SearchSource; + $this->SetResultTable($SearchSource,$DataClass); + $this->FieldList = array(); + $this->Relationships = array(); + $this->Ignored_Words = array(); + $this->WhereClauses = array(); + $this->FieldWeight = array(); + $this->Keywords = GetKeywords(""); + $this->SearchType = 0; //simple + $this->RequiredRelevance=0; + $this->PctRelevance = $objConfig->Get("SearchRel_DefaultKeyword")/100; + $this->PctPop = $objConfig->Get("SearchRel_DefaultPop")/100; + $this->PctRating = $objConfig->Get("SearchRel_DefaultRating")/100; + } + + function SetResultTable($SearchSource,$DataClass) + { + global $objSession; + + $this->ResultTable = $objSession->GetSearchTable(); + $this->classname= $DataClass; + } + + function LoadSearchResults($Start=0,$PerPage=NULL) + { + if($PerPage) + { + $limit = "LIMIT $Start,$PerPage"; + } + $sql = "SELECT * FROM ".$this->ResultTable." ".$limit; + $this->Clear(); + $rs = $this->adodbConnection->Execute($sql); + return $this->Query_Item($sql); + } + + function SetCategoryClause($whereclause) + { + $this->CatClause=$whereclause; + } + + function AddRelationship($JoinTable,$JoinExpression=NULL) + { + + $this->Relationships[$JoinTable]=$JoinExpression; + } + + function SetKeywords($keywords) + { + $this->Phrase=$keywords; + $this->keywords = GetKeywords($keywords); + } + + function AddSimpleCustomFields() + { + $sql = "SELECT * FROM ".GetTablePrefix()."SearchConfig WHERE TableName='".$this->SourceTable."' AND SimpleSearch=1 AND CustomFieldId>0"; + //echo $sql; + foreach($this->Relationships as $Table=>$clause) + { + if(strlen($Table)>0 && $Table != "Category") + $sql .= " OR TableName='".$Table."'"; + } + $ctable = GetTablePrefix()."CustomMetaData"; + $rs = $this->adodbConnection->Execute($sql); + $CustomJoined = FALSE; + while($rs && !$rs->EOF) + { + $x = $rs->fields["CustomFieldId"]; + $t = $ctable." as c".$x; + $join = "(c$x.ResourceId=".GetTablePrefix().$this->SourceTable.".ResourceId AND c$x.CustomFieldId=".$rs->fields["CustomFieldId"].")"; + $this->AddRelationship($t,$join); + $f = "c".$x.".Value "; + $this->FieldList[] = $f; + $this->FieldWeight[$f] = $rs->fields["Priority"]; + $rs->MoveNext(); + } + } + + function AddSimpleFields() + { + $sql = "SELECT * FROM ".GetTablePrefix()."SearchConfig WHERE TableName='".$this->SourceTable."' AND SimpleSearch=1 AND CustomFieldId=0"; + //echo $sql; + foreach($this->Relationships as $Table=>$clause) + { + if(strlen($Table)>0 && $Table != "Category") + $sql .= " OR TableName='".$Table."'"; + } + $rs = $this->adodbConnection->Execute($sql); + + while($rs && !$rs->EOF) + { + $f = GetTablePrefix().$rs->fields["TableName"].".".$rs->fields["FieldName"]; + $this->FieldList[] = $f; + $this->FieldWeight[$f] = $rs->fields["Priority"]; + $rs->MoveNext(); + } + $this->AddSimpleCustomFields(); + } + + function AddSearchWhereClause($FieldName) + { + $req_where = ""; + /* build required keywords string */ + + if(count($this->keywords["required"])>0) + { + $required = $this->keywords["required"]; + for($i=0;$i0) + { + if($i>0) + { + $or =" AND "; + } + else + $or = ""; + $w .= $or." ".$FieldName." LIKE '%".$required[$i]."%'"; + } + } + if(strlen($w)>0) + { + $req_where = "(". $w.")"; + } + else + $req_where = ""; + } + $w = ""; + $not_where=""; + if(count($this->keywords["notallowed"])>0) + { + $words = $this->keywords["notallowed"]; + for($i=0;$i0) + { + if($i>0) + { + $or =" AND "; + } + else + $or = ""; + $w .= $or." ".$FieldName." NOT LIKE '%".$words[$i]."%'"; + } + } + if(strlen($w)>0) + { + $not_where = "(".$w.")"; + } + else + $not_where = ""; + } + + $w=""; + $normal = $this->keywords["normal"]; + if(count($normal)>0) + { + for($i=0;$i0) + { + if($i>0) + { + $or =" OR "; + } + else + $or = ""; + $w .= "$or $FieldName LIKE '%".$normal[$i]."%'"; + } + } + if(count($required)>0) + $w .= " OR "; + for($i=0;$i0) + { + if($i>0) + { + $or = " OR "; + } + else + $or=""; + $w .= "$or $FieldName LIKE '%".$required[$i]."%')"; + } + } + if(strlen($w)>0) + { + $where = "(".$w.")"; + } + else + $where = ""; + } + + $complete= BuildWhereClause($where,$req_where,$not_where); + $this->WhereClauses[$FieldName]="(".$complete.")"; + $this->Ignored_Words=$this->keywords["ignored"]; + } + + function PerformSearch($ItemType,$OrderBy=NULL,$InitTable=FALSE, $idlist=NULL) + { + static $SelectSQL, $OldItemType; + global $objSession, $objItemTypes; + + //echo "Old Item Type: $OldItemType New: $ItemType
    \n"; + if($ItemType != $OldItemType) + $SelectSQL = ""; + $OldItemType = $ItemType; + + $ctype = $objItemTypes->GetItem($ItemType); + $idField = $ctype->Get("SourceTable")."Id"; + $this->SourceTable = GetTablePrefix().$ctype->Get("SourceTable"); + $result=0; + $PopField = $ctype->Get("PopField"); + $RateField = $ctype->Get("RateField"); + if(!strlen($SelectSQL)) + { + $typestr = str_pad($ItemType,2,"0",STR_PAD_LEFT); + $SelectSQL = "SELECT "; + $ifs = array(); + $weightsum = 0; + foreach($this->FieldWeight as $w) + $weightsum += $w; + $wordcount = count($this->keywords["normal"])+count($this->keywords["required"]); + $single = ($wordcount == 1); + foreach($this->FieldList as $f) + { + $weight = (int)$this->FieldWeight[$f]; + $s = array(); + + if(!$single) + { + $full = trim(implode(" ",$this->keywords["normal"])); + $s[] = " (IF ($f LIKE '%$full%', ".$weightsum.", 0))"; + } + foreach($this->keywords["normal"] as $k) + { + if($k != $full || $single) + { + $temp = " (IF ($f LIKE '%$k%', ".$weight.", 0))"; + $s[] = $temp; + } + } + + foreach($this->keywords["required"] as $k) + { + if($this->RequiredRelevance>0) + $weight = $this->FieldWeight[$f] + ($this->FieldWeight[$f]*($this->RequiredRelevance/100)); + + if($k != $full || $single) + { + $s[] = " (IF ($f LIKE '%$k%', ".$weight.", 0))"; + } + } + //echo "
    ";print_r($s); echo "
    "; + $txt = implode("+",$s); + //echo $txt."
    \n"; + $ifs[] = $txt; + unset($s); + } +// echo "
    ";print_r($ifs); echo "
    "; + + /* add relevance formula for weighting hits & popularity */ + + if($weightsum==0) + $weightsum=1; + + if(strlen($PopField)>0 && $this->PctPop>0) + { + $popcalc = " + ((($PopField + 1) / (max($PopField)+1)*".$this->PctPop."))"; + } + else + $popcalc = ""; + + if(strlen($RateField)>0 && $this->PctRating>0) + { + $ratecalc = " + ((($RateField + 1) / (max($RateField)+1)*".$this->PctRating."))"; + } + else + $ratecalc = ""; + + if($this->PctRelevance>0) + { + $relcalc = "(((".implode("+",$ifs).")/$weightsum)*".$this->PctRelevance.")"; + } + else + $relcalc = "0"; + + $SelectSQL .= $relcalc.$popcalc.$ratecalc." as Relevance, "; + + $SelectSQL .= $this->SourceTable.".".$idField." as ItemId, ".$this->SourceTable.".ResourceId as ResourceId, CONCAT($typestr) as ItemType, EditorsPick as EdPick FROM ".$this->SourceTable." "; + + foreach($this->Relationships as $JoinTable=>$OnClause) + { + $SelectSQL .= "LEFT JOIN $JoinTable ON $OnClause "; + } + $first=1; + $where=0; + + foreach($this->FieldList as $field) + { + if(strpos($field,"as")>0) + { + $fparts = explode("as",$field,2); + $f = $fparts[1]; + $this->AddSearchWhereClause($field); + } + else { + $this->AddSearchWhereClause($field); + } + } + + $SelectSQL .= " WHERE "; + $SelectSQL .= implode(" or ",$this->WhereClauses); + + if(is_array($idlist)) + { + $SelectSQL .= " AND (ResourceId IN (".implode(",",$idlist)."))"; + } + } + $SelectSQL .= "GROUP BY $idField "; + //echo $SelectSQL."

    \n"; + if($InitTable) + { + $this->adodbConnection->Execute("DROP TABLE ".$this->ResultTable); + //$indexSQL = "(INDEX(Relevance), INDEX(ItemId), INDEX(ItemType), INDEX sorting (EdPick,Relevance)) "; + $full_sql = "CREATE TABLE ".$this->ResultTable." ".$indexSQL.$SelectSQL; +// echo $full_sql."
    \n"; + $this->adodbConnection->Execute($full_sql); + //echo $this->adodbConnection->ErrorMsg()."
    \n"; + $objSession->SetVariable("Search_Keywords",$this->Phrase); + } + else + { + $full_sql = "INSERT INTO ".$this->ResultTable." (Relevance,ItemId,ResourceId,ItemType,EdPick) ".$SelectSQL; +// echo "[".$full_sql."]
    \n"; + $this->adodbConnection->Execute($full_sql); + //echo $this->adodbConnection->ErrorMsg()."
    \n"; + } + } + + function BuildIndexes() + { + $sql = "ALTER TABLE ".$this->ResultTable." ADD INDEX (Relevance), "; + $sql .="ADD INDEX (ItemId), "; + $sql .="ADD INDEX (ItemType), "; + $sql .=" ADD INDEX sorting (EdPick,Relevance)"; + //echo $sql; + $this->adodbConnection->Execute($sql); + } + + function Result_IdList() + { + /* returns an array contain a resource ID list */ + $sql = "SELECT DISTINCT(ResourceId) FROM ".$this->ResultTable; + $rs = $this->adodbConnection->Execute($sql); + $result = array(); + while($rs && !$rs->EOF) + { + $result[] = $rs->fields["ResourceId"]; + $rs->MoveNext(); + } + return $result; + } +} + +function count_words($string) +{ + // below line added to make contiguous spaces count as one space + if(strlen($string)) + { + $string = eregi_replace(" +", " ", $string); + return substr_count($string," ")+1; + } + else + return 0; +} + +function GetKeywords($phrase) +{ + global $KeywordIgnore; + + if(count($KeywordIgnore)==0) + GetIgnoreList(); + $keywords["normal"]= array(); + $keywords["required"]= array(); + $keywords["notallowed"] = array(); + $keywords["ignored"] = array(); + if(!strlen($phrase)) + return $keywords; + $w_array = array(); + $phrase=trim($phrase); + //if(count_words($phrase)>1) + // $keywords["normal"][] = $phrase; + $t_len = strlen($phrase); + $ce=0; + for ($i=0; $i<$t_len; $i++) + { #search for next special tag + switch ($phrase[$i]) + { + case "\"": + $exact_match_close = strpos($phrase,"\"", $i+1); + if(!$exact_match_close) + break; + $exact_word=substr($phrase, $i+1, ($exact_match_close-$i)-1); + $i=$exact_match_close; + if($exact_word) + { + if(strlen($token)==0) + $token="|"; + $w_array[$ce]=$token.addslashes($exact_word); + $token=""; + $ce++; + $exact_word=""; + } + break; + + case "+": + if(strlen($exact_word)==0) + { + $token = "+"; + } + else + $exact_word .= "+"; + break; + case "-": + if(strlen($exact_word)==0) + { + $token = "-"; + } + else + $exact_word .="-"; + break; + case " ": + case ",": + if($exact_word) + { + if(strlen($token)==0) + $token="|"; + if($token=="|") + { + if($KeywordIgnore[strtolower($exact_word)]==1) + { + $w_array[$ce]= "=".addslashes($exact_word); + $ce++; + } + else + { + $w_array[$ce]=$token.addslashes($exact_word); + $ce++; + } + } + else + { + $w_array[$ce]=$token.addslashes($exact_word); + $ce++; + } + $token=""; + $exact_word=""; + } + break; + + default: + $exact_word.=$phrase[$i]; + } + } + if($exact_word) + { + if(strlen($token)==0) + $token="|"; + if($KeywordIgnore[strtolower($exact_word)]==1 && ($token =="|" || $token=="=")) + { + $w_array[$ce]= "=".addslashes($exact_word); + $ce++; + } + else + { + $w_array[$ce]=$token.addslashes($exact_word); + $ce++; + } + } + for ($i=0;$i0 && strlen($notallowed)>0) + { + $return .= " AND "; + } + $return .= $notallowed; + if(strlen($return)>0 && strlen($normal)>0) + { + $return .= " AND "; + } + $return .= $normal; + return $return; +} + +function GetIgnoreList() +{ + global $KeywordIgnore; + + $adodbConnection = GetADODBConnection(); + + $rs = $adodbConnection->Execute("SELECT * FROM IgnoreKeywords"); + while($rs && !$rs->EOF) + { + $KeywordIgnore[strtolower($rs->fields["keyword"])]=1; + $rs->MoveNext(); + } +// foreach($KeywordIgnore as $word=>$dummy) +// echo $word.","; +// echo "
    \n"; +} + +?> Index: trunk/admin/icons/icon46_logs_reports.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/modselect.php =================================================================== diff -u --- trunk/admin/install/modselect.php (revision 0) +++ trunk/admin/install/modselect.php (revision 13) @@ -0,0 +1,45 @@ + +  Select Modules to Install

    + + + + + + + +
     Step - Select Modules
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/toolbar/button.image.gif =================================================================== diff -u Binary files differ Index: trunk/robots_list.txt =================================================================== diff -u --- trunk/robots_list.txt (revision 0) +++ trunk/robots_list.txt (revision 13) @@ -0,0 +1,293 @@ +ADSAComponent ADSAComponent (postmaster@cnds.ucd.ie) +AOL-IWENG 3.0 Mozilla/2.0 (Compatible; AOL-IWENG 3.0; Win16) +ASPseek 1.2.10 ASPseek/1.2.10 +Almaden c01 http://www.almaden.ibm.com/cs/crawler [c01] +Almaden wf55 http://www.almaden.ibm.com/cs/crawler [wf55] +Amsterdam 2002 Mozilla/4.0 (Search Engine Marketing Tactics Amsterdam 2002 Information Spider) +Antibot 1.1.11 antibot-V1.1.11/i586-linux-2.2 +AnyBrowser Search Engine AnyBrowser.com Search Engine +Appie 1.1 appie 1.1 (www.walhello.com) +Ask Jeeves Mozilla/2.0 (compatible; Ask Jeeves) +Ask Jeeves Teoma Mozilla/2.0 (compatible; Ask Jeeves/Teoma) +AvantGo 3.2 Mozilla/3.0 (compatible; AvantGo 3.2) +BaiDuSpider BaiDuSpider +BaiDuSpider Baiduspider+(+http://www.baidu.com/search/spider.htm) +Big Brother Big Brother (http://pauillac.inria.fr/~fpottier/) +BlogBot 1.2 BlogBot/1.2 +Boitho-robot 1.0 boitho.com-robot/1.0 +BorderManager 3.0 Mozilla/4.0 (compatible; BorderManager 3.0) +BrailleBot 1.0 BrailleBot 1.0 +Bumblebee 1.0 bumblebee/1.0 (bumblebee@relevare.com; http://www.relevare.com/) +Cd34 0.1 cd34/0.1 +ComMOOnity LambdaMOO 1.8.1 ComMOOnity LambdaMOO/1.8.1 +Cosmos 0.9 cosmos/0.9_(robot@xyleme.com) +Crawl_Application Crawl_Application +CrocCrawler 3.3 CrocCrawler v3.3 [en] (http://www.croccrawler.com) (X11; I; Linux 2.0.44 i686) +CrocCrawler 4.3 CrocCrawler v4.3 [en] (http://www.croccrawler.com) (X11; I; Linux 2.0.44 i686) +Custo 2.0 Custo 2.0 (www.netwu.com) +DeMozulator 1.0 DeMozulator 1.0 (MacOS, dMoz URL Check Agent, trebor@animeigo.com) +DeepIndex DeepIndex (http://www.deepindex.com) +DoCoMo 1.0 DoCoMo/1.0/N504i/c10/TB +DoCoMo 1.0 DoCoMo/1.0/P504iS/c10/TB +Dual Proxy Dual Proxy +FAST-WebCrawler 3.2 FAST-WebCrawler/3.2 test +FAST-WebCrawler 3.6 FAST-WebCrawler/3.6 (atw-crawler at fast dot no; http://fast.no/support/crawler.asp) +FAST-WebCrawler 3.6 FAST-WebCrawler/3.6/FirstPage (atw-crawler at fast dot no;http://fast.no/support/crawler.asp) +FAST-WebCrawler 3.6 FAST-WebCrawler/3.6/FirstPage (crawler@fast.no; http://fast.no/support.php?c=faqs/crawler) +FAST-WebCrawler 3.7 FAST-WebCrawler/3.7 (atw-crawler at fast dot no; http://fast.no/support/crawler.asp) +FAST-WebCrawler 3.7 FAST-WebCrawler/3.7/FirstPage (atw-crawler at fast dot no;http://fast.no/support/crawler.asp) +FAST-WebCrawler 3.8 FAST-WebCrawler/3.8 (atw-crawler at fast dot no; http://fast.no/support/crawler.asp) +FAST-WebCrawler 3.x FAST-WebCrawler/3.x Multimedia +FAST-WebCrawler 3.x FAST-WebCrawler/3.x Multimedia (mm dash crawler at fast dot no) +FDSE robot Mozilla/4.0 (compatible: FDSE robot) +Firefly 1.0 Firefly/1.0 (compatible; Mozilla 4.0; MSIE 5.5) +FlickBot 1.1 Flickbot 1.1 RPT-HTTPClient/0.3-3 +FlickBot 2.0 FlickBot 2.0 RPT-HTTPClient/0.3-3 +Fluffy the spider Mozilla/3.0 (compatible; Fluffy the spider; http://www.searchhippo.com/; info@searchhippo.com) +FusionBot Mozilla/4.0 (compatible; MSIE 5.0; www.galaxy.com; http://www.pgts.com.au/; +http://www.galaxy.com/info/crawler.html) +GAIS Robot 1.1A2 GAIS Robot/1.1A2 +Gatherer 0.9 gatherer/0.9 +Generic Generic +GetRight 4.5 GetRight/4.5e +Gigabot 1.0 Gigabot/1.0 +Girafabot Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; Girafabot; girafabot at girafa dot com; http://www.girafa.com) +Googlebot 2.1 Googlebot/2.1 (+http://www.googlebot.com/bot.html) +Googlebot-Image 1.0 Googlebot-Image/1.0 (+http://www.googlebot.com/bot.html) +Grub-client grub-client +Grub-client 0.3.0 Mozilla/4.0 (compatible; grub-client-0.3.0; Crawl your own stuff with http://grub.org) +Grub-client 1.0.3 Mozilla/4.0 (compatible; grub-client-1.0.3; Crawl your own stuff with http://grub.org) +Grub-client 1.0.4 Mozilla/4.0 (compatible; grub-client-1.0.4; Crawl your own stuff with http://grub.org) +Grub-client 1.0.5 Mozilla/4.0 (compatible; grub-client-1.0.5; Crawl your own stuff with http://grub.org) +Grub-client 1.0.6 Mozilla/4.0 (compatible; grub-client-1.0.6; Crawl your own stuff with http://grub.org) +Grub-client 1.0.7 Mozilla/4.0 (compatible; grub-client-1.0.7; Crawl your own stuff with http://grub.org) +Grub-client 1.07 Mozilla/4.0 (compatible; grub-client-1.07; Crawl your own stuff with http://grub.org) +Grub-client 1.1.1 Mozilla/4.0 (compatible; grub-client-1.1.1; Crawl your own stuff with http://grub.org) +Grub-client 1.2.1 Mozilla/4.0 (compatible; grub-client-1.2.1; Crawl your own stuff with http://grub.org) +Grub-client 1.3.1 Mozilla/4.0 (compatible; grub-client-1.3.1; Crawl your own stuff with http://grub.org) +Grub-client 1.3.7 Mozilla/4.0 (compatible; grub-client-1.3.7; Crawl your own stuff with http://grub.org) +GulperBot 0.2.4 Crawler [en] (compatible; Crawler Gulper Web Bot 0.2.4 www.ecsl.cs.sunysb.edu/~maxim/cgi-bin/Link/GulperBot) +GulperBot 0.2.4 Mozilla/5.0 [en] (compatible; Gulper Web Bot 0.2.4 www.ecsl.cs.sunysb.edu/~maxim/cgi-bin/Link/GulperBot) +HTTrack 3.0x Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) +Harvest-NG 1.0.2 Harvest-NG/1.0.2 +Hget 0.3 hget/0.3 +Hitwise Spider 1.0 Hitwise Spider v1.0 http://www.hitwise.com +Htdig htdig +Htdig 3.1.5 htdig/3.1.5 (admin@ipc-opc.lan) +Htdig 3.1.5 htdig/3.1.5 (unconfigured@htdig.searchengine.maintainer) +Htdig 3.1.6 htdig/3.1.6 (http://computerorgs.com) +Httpcheck 1.0 Httpcheck/1.0 (Perl 5.006001) +ICS 1.2.105 Mozilla/4.0 (compatible; ICS 1.2.105) +IPiumBot IPiumBot laurion(dot)com +Ia_archiver ia_archiver +IcabotAccept lcabotAccept: */* +IlTrovatore-Setaccio IlTrovatore-Setaccio (+http://www.iltrovatore.it) +Imagefetch 0.1 imagefetch/0.1 libwww-perl/5.66 +Indy Library Mozilla/3.0 (compatible; Indy Library) +InfoSeek Sidewinder 1.0A InfoSeek Sidewinder/1.0A +Ingrid 3.0 Mozilla/3.0 (INGRID/3.0 MT; webcrawler@NOSPAMexperimental.net; http://aanmelden.ilse.nl/?aanmeld_mode=webhints) +Inktomi slurp Mozilla/3.0 (Slurp/si; slurp@inktomi.com; http://www.inktomi.com/slurp.html) +Inktomi slurp Mozilla/5.0 (Slurp/cat; slurp@inktomi.com; http://www.inktomi.com/slurp.html) +Inktomi slurp Mozilla/5.0 (Slurp/si; slurp@inktomi.com; http://www.inktomi.com/slurp.html) +Inktomi slurp Slurp/si-emb (slurp@inktomi.com; http://www.inktomi.com/slurp.html) +InternetLinkAgent 3.1 InternetLinkAgent/3.1 +Java 1.4.0 Java1.4.0 +JoBo 1.3 JoBo/1.3 (http://www.matuschek.net/jobo.html) +KMcrawler KMcrawler +Knowledge Engine Knowledge Engine +LNSpiderguy LNSpiderguy +Larbin LARBIN-EXPERIMENTAL (efp@gmx.net) +Larbin LARBIN-EXPERIMENTAL efp@gmx.net +Larbin MSIE-5.13 (larbin@unspecified.mail) +Larbin MSIE-5.13 larbin@unspecified.mail +Larbin Mozilla (la2@unspecified.mail) +Larbin Mozilla la2@unspecified.mail +Larbin Mozilla/4.0 (efp@gmx.net) +Larbin Mozilla/4.0 efp@gmx.net +Larbin WinampMPEG/2.00 (larbin@unspecified.mail) +Larbin WinampMPEG/2.00 larbin@unspecified.mail +Larbin larbin (samualt9@bigfoot.com) +Larbin larbin samualt9@bigfoot.com +Larbin 2.6.2 larbin_2.6.2 (kalou@kalou.net) +Larbin 2.6.2 larbin_2.6.2 (larbin2.6.2@unspecified.mail) +Larbin 2.6.2 larbin_2.6.2 (larbin@correa.org) +Larbin 2.6.2 larbin_2.6.2 (pimenas@systems.tuc.gr) +Larbin 2.6.2 larbin_2.6.2 (sumeet_sobti@yahoo.com) +Larbin 2.6.2 larbin_2.6.2 (vitalbox1@hotmail.com) +Larbin 2.6.2 larbin_2.6.2 (vshelk@yahoo.com) +Larbin 2.6.2 larbin_2.6.2 larbin2.6.2@unspecified.mail +Larbin 2.6.2 larbin_2.6.2 larbin@correa.org +Larbin 2.6.2 larbin_2.6.2 pimenas@systems.tuc.gr +Larbin 2.6.2 larbin_2.6.2 sumeet_sobti@yahoo.com +Larbin 2.6.2 larbin_2.6.2 vitalbox1@hotmail.com +Libwww-perl Perl-Win32::Internet/0.082 +Libwww-perl 5.3.2 / libwww/5.3.2 +Libwww-perl 5.50 libwww-perl/5.50 +Libwww-perl 5.51 libwww-perl/5.51 +Libwww-perl 5.52 libwww-perl/5.52 FP/4.0 +Libwww-perl 5.53 libwww-perl/5.53 +Libwww-perl 5.63 libwww-perl/5.63 +Libwww-perl 5.64 libwww-perl/5.64 +Libwww-perl 5.65 libwww-perl/5.65 +Libwww-perl 5.66 rawiswar/0.1 libwww-perl/5.66 +Linkbot 3.0 Linkbot 3.0 +Lite Bot 0616B Lite Bot 0616B +Lwp-request 2.01 lwp-request/2.01 +Lycos_Spider Lycos_Spider_(modspider) +MS Data Access Microsoft Data Access Internet Publishing Provider Cache Manager +MS Data Access Microsoft Data Access Internet Publishing Provider DAV +MS Data Access Microsoft Data Access Internet Publishing Provider DAV 1.1 +MS Data Access Microsoft Data Access Internet Publishing Provider Protocol Discovery +MS FrontPage 4.0 MSFrontPage/4.0 +MS FrontPage 4.0 Mozilla/2.0 (compatible; MS FrontPage 4.0) +MS FrontPage 5.0 MSFrontPage/5.0 +MS FrontPage 5.0 Mozilla/2.0 (compatible; MS FrontPage 5.0) +MSIECrawler Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; MSIECrawler) +MSIECrawler Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; Q312461; BTopenworld; MSIECrawler) +MSIECrawler Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; MSIECrawler) +MSIECrawler Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; MSIECrawler) +MSIECrawler Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; MSIECrawler) +MSIECrawler Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; matlas-2.0.2501; MSIECrawler) +MSIECrawler Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MSIECrawler) +MSProxy 2.0 MSProxy/2.0 +Mercator 2.0 Mercator-2.0 +MetaGer-LinkChecker MetaGer-LinkChecker +Metacarta metacarta (crawler@metacarta.com) +Metacarta metacarta crawler@metacarta.com +Microsoft URL Control Microsoft URL Control - 5.00.3609 +Microsoft URL Control Microsoft URL Control - 5.01.4319 +Microsoft URL Control Microsoft URL Control - 6.00.8169 +Microsoft URL Control Microsoft URL Control - 6.00.8862 +Microsoft-ATL-Native 7.00 Microsoft-ATL-Native/7.00 +MicrosoftPrototypeCrawler MicrosoftPrototypeCrawler (How's my crawling? mailto:newbiecrawler@hotmail.com) +Moget 1.0 moget/1.0 (moget@goo.ne.jp) +Moget 2.1 moget/2.1 (moget@goo.ne.jp) +MysteryBot Mozilla/3.01 (compatible;) +NG 1.0 NG/1.0 +NPBot NPBot +NPBot NPBot-1/2.0 +NPBot NPBot-1/2.0 (http://www.nameprotect.com/botinfo.html) +NationalDirectory-WebSpider 1.3 NationalDirectory-WebSpider/1.3 +NaverRobot 1.0 dloader(NaverRobot)/1.0 +NetAnts 1.25 NetAnts/1.25 +NetNose-Crawler 2.0 Mozilla/4.0 (compatible; MSIE 5.0; NetNose-Crawler 2.0; A New Search Experience: http://www.netnose.com) +NetNoseCrawler v1.0 NetNoseCrawler/v1.0 +NetResearchServer NetResearchServer(http://www.look.com) +NetResearchServer 2.4 NetResearchServer/2.4(loopimprovements.com/robot.html) +NetResearchServer 2.5 NetResearchServer/2.5(loopimprovements.com/robot.html) +NetResearchServer 2.7 NetResearchServer/2.7(loopimprovements.com/robot.html) +Netcraft Web Server Survey Mozilla/4.0 (compatible; Netcraft Web Server Survey) +None none +NutchCrawler Robot: NutchCrawler, Owner: wdavies@acm.org +NutchOrg 0.03 NutchOrg/0.03-dev (Nutch; http://www.nutch.org/docs/bot.html; nutch-agent@lists.sourceforge.net) +OWR_Crawler 0.1 OWR_Crawler 0.1 +Obot Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; obot) +Obot oBot +Openbot 3.0 Openfind data gatherer, Openbot/3.0+(robot-response@openfind.com.tw;+http://www.openfind.com.tw/robot.html) +OrangeBot OrangeBot +Organica 2.24 Mozilla/4.0 (compatible; Advanced Email Extractor v2.24) +PWS.Kiosk PWS.Kiosk - Content Filtering +Parabot parabot (paracite@ecs.soton.ac.uk) +Pavuk 0.9 pavuk/0.9pl28 i586-pc-cygwin +Pavuk 0.9 pavuk/0.9pl29b i686-pc-linux-gnu +Polybot 1.0 polybot 1.0 (http://cis.poly.edu/polybot/) +Pompos 1.1 Pompos/1.1 http://pompos.iliad.fr +Pompos 1.2 Pompos/1.2 http://pompos.iliad.fr +Portal Manager 0.7 Portal Manager 0.7 +Potbot 1.0 potbot 1.0 +ProWebGuide Link Checker ProWebGuide Link Checker (http://www.prowebguide.com) +Psbot 0.1 psbot/0.1 (+http://www.picsearch.com/bot.html) +Pverify 1.2 pverify/1.2 +QuepasaCreep v0.9.13 QuepasaCreep v0.9.13 +RPT-HTTPClient 0.3 RPT-HTTPClient/0.3-3 +Reifier reifier.org (admin@reifier.org) +Reifier reifier.org admin@reifier.org +Rico 0.1 rico/0.1 +RobotMidareru 0.7 RobotMidareru/0.7libwww-perl/5.65 +Robots.txt Validator Search Engine World Robots.txt Validator at http://www.searchengineworld.com/cgi-bin/robotcheck.cgi +Robozilla 1.0 Robozilla/1.0 +SYCLIKControl LinkChecker Mozilla/5.0 (compatible; SYCLIKControl/LinkChecker;) +Scooter 1.0 Scooter/1.0 +Scooter 1.1 Scooter-ARS-1.1 +Scooter 3.2 Scooter-3.2 +Scooter 3.2 Scooter-3.2.BT +Scooter 3.2 Scooter-3.2.EX +Scooter 3.2 Scooter-3.2.FNR +Scooter 3.2 Scooter-3.2.PDF +Scooter 3.2 Scooter-3.2.SF0 +Scooter 3.2 Scooter-3.2.TX.FNR +Scooter 3.2 Scooter-3.2.XX0 +Scooter 3.2 Scooter/3.2 +Scooter 3.2 Scooter/3.2.SF0 +Scooter 3.2 Scooter_x0-3.2.EX +Scooter 3.3 Scooter/3.3 +Scooter 3.3 Scooter/3.3.QA +Scooter 3.3 Scooter/3.3.QA.pczukor +Scooter 3.3 Scooter/3.3.vscooter +Scooter 3.3 Scooter/3.3_SF +Scrubby 2.2 Scrubby/2.2 (http://www.scrubtheweb.com/) +Search Agent 1.0 Search Agent 1.0 +Semanticdiscovery 0.1 semanticdiscovery/0.1 +Sherlock 1.3 sherlock/1.3 httpget/1.3 +Sitecheck InternetSeer.com +Sitecheck sitecheck.internetseer.com (For more info see: http://sitecheck.internetseer.com) +Sitescooper 3.1.2 sitescooper/3.1.2 (http://sitescooper.org) libwww-perl/5.51 +SlySearch 1.3 SlySearch/1.3 (http://www.slysearch.com) +SlySearch 1.3 SlySearch/1.3 http://www.slysearch.com +Speedy_Spider Speedy_Spider_(http://www.entireweb.com) +Sqworm 2.9.85 Sqworm/2.9.85-BETA (beta_release; 20011115-775; i686-pc-linux-gnu) +Star Downloader Star Downloader +Steeler 1.3 Steeler/1.3 (http://www.tkl.iis.u-tokyo.ac.jp/~crawler/) +SuperCleaner 2.56 Mozilla/4.0 (compatible; SuperCleaner 2.56; Windows NT 5.1) +Szukacz 1.5 Szukacz/1.5 +Szukacz 1.5 Szukacz/1.5 (robot; www.szukacz.pl/jakdzialarobot.html; info@szukacz.pl) +TclSOAP 1.0 Tcl http client package 1.0 +TclSOAP 2.3 Tcl http client package 2.3 +Teradex Mapper (Teradex Mapper; mapper@teradex.com; http://www.teradex.com) +TulipChain 5.7 TulipChain/5.7 (http://ostermiller.org/tulipchain/) Java/1.4.0_02 (http://java.sun.com/) Windows_Me/4.90 +TurnitinBot 1.4 TurnitinBot/1.4 (http://www.turnitin.com/robot/crawlerinfo.html) +TurnitinBot 1.4 TurnitinBot/1.4 http://www.turnitin.com/robot/crawlerinfo.html +TurnitinBot 1.5 TurnitinBot/1.5 (http://www.turnitin.com/robot/crawlerinfo.html) +TurnitinBot 1.5 TurnitinBot/1.5 http://www.turnitin.com/robot/crawlerinfo.html +UIowaCrawler 2.0 UIowaCrawler/2.0 +UdmSearch 3.1.20 UdmSearch/3.1.20 +Vagabondo 2.0 Vagabondo/2.0 MT (webagent at wise-guys dot nl) +Vagabondo 2.0 Vagabondo/2.0 MT (webagent@NOSPAMwise-guys.nl) +Vagabondo 2.1 Mozilla/5.0 (compatible; Vagabondo/2.1; webcrawler at wise-guys dot nl; http://webagent.wise-guys.nl/) +VoilaBot 1.6 Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) VoilaBot; 1.6 +VoilaBot 1.6 Mozilla/4.0_(compatible;_MSIE_5.0;_Windows_95)_VoilaBot/1.6 libwww/5.3.2 +Vspider vspider +W3C-checklink 2.90 W3C-checklink/2.90 libwww-perl/5.64 +W3C-checklink 3.6.2.3 W3C-checklink/3.6.2.3 libwww-perl/5.64 +W3C_Validator 1.183 W3C_Validator/1.183 libwww-perl/5.64 +W3C_Validator 1.305.2.12 W3C_Validator/1.305.2.12 libwww-perl/5.64 +WebFilter Robot 1.0 WebFilter Robot 1.0 +WebSearch http://www.WebSearch.com.au/ (larbin2.6.2@unspecified.mail) +WebSearch http://www.WebSearch.com.au/ - Australian Search Engine/3.1.3 (sites@websearch.com.au) +WebSearch http://www.WebSearch.com.au/ - Australian Search Engine/3.1.6 (sites@websearch.com.au) +WebSearch http://www.WebSearch.com.au/ larbin2.6.2@unspecified.mail +WebSearch http://www.websearch.com.au (larbin2.6.2@unspecified.mail) +WebSearch http://www.websearch.com.au larbin2.6.2@unspecified.mail +WebSearch www.WebSearch.com.au (search@websearch.com.au) +WebSearch www.WebSearch.com.au search@websearch.com.au +WebSearch 2.0.1 WebSearch/2.0.1 (Dez@Blanchfield.COM.AU, http://www.WebSearch.com.au/) +WebcraftBoot Thu Mar 27 18:20:34 CET 2003WebcraftBoot +WebcraftBoot 1.4.1 Fri Nov 15 04:51:18 EST 2002WebcraftBoot Java/1.4.1_01 +WebcraftBoot 1.4.2 Sun Apr 20 22:00:01 EDT 2003WebcraftBoot Java/1.4.2-beta +WebcraftBoot 1.4.2 Tue Apr 15 22:00:03 EDT 2003WebcraftBoot Java/1.4.2-beta +Webinator-indexer 2.56 Mozilla/3.0 (compatible; Webinator-indexer.cyberalert.com/2.56) +Webwombat www.webwombat.com.au +Wget 1.5.2 Wget/1.5.2 +Wget 1.7 Wget/1.7 +Wget 1.8 Wget/1.8 +Wget 1.8.1 Wget/1.8.1 +Wget 1.8.2 Wget/1.8.2 +Willow 2.1 Willow Internet Crawler by Twotrees V2.1 +Xenu Link Sleuth 1.1a Xenu's Link Sleuth 1.1a +Xenu Link Sleuth 1.2b Xenu Link Sleuth 1.2b +Xenu Link Sleuth 1.2d Xenu Link Sleuth 1.2d +Zao 0.1 Zao/0.1 (http://www.kototoi.org/zao/) +Zeus 57657 Zeus 57657 Webster Pro V2.9 Win32 +ZyBorg 1.0 Mozilla/4.0 compatible ZyBorg/1.0 (ZyBorg@WISEnutbot.com; http://www.WISEnutbot.com) +ZyBorg 1.0 Mozilla/4.0 compatible ZyBorg/1.0 (wn.zyborg@looksmart.net; http://www.WISEnutbot.com) +unknown Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) Fetch API Request +unknown Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+.NET+CLR+1.1.4322) Index: trunk/admin/editor/FCKeditor/license.txt =================================================================== diff -u --- trunk/admin/editor/FCKeditor/license.txt (revision 0) +++ trunk/admin/editor/FCKeditor/license.txt (revision 13) @@ -0,0 +1,458 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS Index: trunk/themes/default/register.tpl =================================================================== diff -u --- trunk/themes/default/register.tpl (revision 0) +++ trunk/themes/default/register.tpl (revision 13) @@ -0,0 +1,112 @@ + + + +
    + + +\n"; + } +?> + + + + + +
    "; + echo ""; + echo $m; + echo "


    +
    + + + + + + + +
    +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + +

    + + + + + + +
       + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +
    + + +
    + + + + +

    + + + +
    + + + + + +

    + +
    + + + + +
    + + + + + +

    +

    + + + + + + + +

    + +


    +
    + + +

    +
    + + + + Index: trunk/admin/backup/backup3.php =================================================================== diff -u --- trunk/admin/backup/backup3.php (revision 0) +++ trunk/admin/backup/backup3.php (revision 13) @@ -0,0 +1,123 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$adminURL = $rootURL.$admin; + +$localURL=$rootURL."kernel/"; +$imagesURL = $rootURL."admin/images"; +//admin only util +$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"); + + +$filename= $objSession->GetVariable("backup_filename"); +$filepath=$objSession->GetVariable("Backup_Path"); +$filename= $filepath."/".$filename; + + +$error = $objSession->GetVariable("backup_error"); +$success=0; +$success=$objSession->GetVariable("backup_success"); + +$objSession->SetVariable("backup_start",0); +$objSession->SetVariable("backup_tnumber",0); + +$section = "in-portal:backup"; +//Set Environment Variable +$envar = "env=" . BuildEnv(); +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); + + $var="?env=".BuildEnv(); + $link=$rootURL."admin/backup/backup1.php".$var; + + $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif"); + $MouseOver=""; + $MouseOut=""; + $onClick=""; + $link="#"; + $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),"#","","","","tool_next_f3.gif"); + + $title = admin_language("la_performing_backup")." - ".admin_language("la_Step")." 3"; + + int_header($objCatToolBar,NULL,$title); + +?> + +"> + + + > + + + +
    +
    +
    +
    + Index: trunk/admin/editor/FCKeditor/dialog/fck_about/logo_fredck.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_users.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-ibase.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-ibase.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-ibase.inc.php (revision 13) @@ -0,0 +1,665 @@ + + changed transaction handling and added experimental blob stuff + + Docs to interbase at the website + http://www.synectics.co.za/php3/tutorial/IB_PHP3_API.html + + To use gen_id(), see + http://www.volny.cz/iprenosil/interbase/ip_ib_code.htm#_code_creategen + + $rs = $conn->Execute('select gen_id(adodb,1) from rdb$database'); + $id = $rs->fields[0]; + $conn->Execute("insert into table (id, col1,...) values ($id, $val1,...)"); +*/ + + +class ADODB_ibase extends ADOConnection { + var $databaseType = "ibase"; + var $dataProvider = "ibase"; + var $replaceQuote = "''"; // string to use to replace quotes + var $ibase_timefmt = '%Y-%m-%d'; + var $fmtDate = "'Y-m-d'"; + var $fmtTimeStamp = "'Y-m-d, H:i:s'"; + var $concat_operator='||'; + var $_transactionID; + var $metaTablesSQL = "select rdb\$relation_name from rdb\$relations where rdb\$relation_name not like 'RDB\$%'"; + var $metaColumnsSQL = "select a.rdb\$field_name,b.rdb\$field_type,b.rdb\$field_length from rdb\$relation_fields a join rdb\$fields b on a.rdb\$field_source=b.rdb\$field_name where rdb\$relation_name ='%s'"; + var $ibasetrans = IBASE_DEFAULT; + var $hasGenID = true; + var $_bindInputArray = true; + var $buffers = 0; + var $dialect = 1; + var $sysDate = "cast('TODAY' as date)"; + var $sysTimeStamp = "cast('NOW' as timestamp)"; + var $ansiOuter = true; + var $hasAffectedRows = false; + var $poorAffectedRows = true; + var $blobEncodeType = 'C'; + + function ADODB_ibase() + { + } + + function MetaPrimaryKeys($table,$owner_notused=false,$internalKey=false) + { + if ($internalKey) return array('RDB$DB_KEY'); + + $table = strtoupper($table); + + $sql = 'SELECT S.RDB$FIELD_NAME AFIELDNAME + FROM RDB$INDICES I JOIN RDB$INDEX_SEGMENTS S ON I.RDB$INDEX_NAME=S.RDB$INDEX_NAME + WHERE I.RDB$RELATION_NAME=\''.$table.'\' and I.RDB$INDEX_NAME like \'RDB$PRIMARY%\' + ORDER BY I.RDB$INDEX_NAME,S.RDB$FIELD_POSITION'; + + $a = $this->GetCol($sql,false,true); + if ($a && sizeof($a)>0) return $a; + return false; + } + + function ServerInfo() + { + $arr['dialect'] = $this->dialect; + switch($arr['dialect']) { + case '': + case '1': $s = 'Interbase 5.5 or earlier'; break; + case '2': $s = 'Interbase 5.6'; break; + default: + case '3': $s = 'Interbase 6.0'; break; + } + $arr['version'] = ADOConnection::_findvers($s); + $arr['description'] = $s; + return $arr; + } + + function BeginTrans() + { + if ($this->transOff) return true; + $this->transCnt += 1; + $this->autoCommit = false; + $this->_transactionID = $this->_connectionID;//ibase_trans($this->ibasetrans, $this->_connectionID); + return $this->_transactionID; + } + + function CommitTrans($ok=true) + { + if (!$ok) return $this->RollbackTrans(); + if ($this->transOff) return true; + if ($this->transCnt) $this->transCnt -= 1; + $ret = false; + $this->autoCommit = true; + if ($this->_transactionID) { + //print ' commit '; + $ret = ibase_commit($this->_transactionID); + } + $this->_transactionID = false; + return $ret; + } + + function RollbackTrans() + { + if ($this->transOff) return true; + if ($this->transCnt) $this->transCnt -= 1; + $ret = false; + $this->autoCommit = true; + if ($this->_transactionID) + $ret = ibase_rollback($this->_transactionID); + $this->_transactionID = false; + + return $ret; + } + + // See http://community.borland.com/article/0,1410,25844,00.html + function RowLock($tables,$where,$col) + { + if ($this->autoCommit) $this->BeginTrans(); + $this->Execute("UPDATE $table SET $col=$col WHERE $where "); // is this correct - jlim? + return 1; + } + + /*// use delete and insert instead + function Replace($table, $fieldArray, $keyCol,$autoQuote=false) + { + if (count($fieldArray) == 0) return 0; + + if (!is_array($keyCol)) { + $keyCol = array($keyCol); + } + + if ($autoQuote) + foreach($fieldArray as $k => $v) { + if (!is_numeric($v) and $v[0] != "'" and strcasecmp($v,'null')!=0) { + $v = $this->qstr($v); + $fieldArray[$k] = $v; + } + } + + $first = true; + foreach ($keyCol as $v) { + if ($first) { + $first = false; + $where = "$v=$fieldArray[$v]"; + } else { + $where .= " and $v=$fieldArray[$v]"; + } + } + + $first = true; + foreach($fieldArray as $k => $v) { + if ($first) { + $first = false; + $iCols = "$k"; + $iVals = "$v"; + } else { + $iCols .= ",$k"; + $iVals .= ",$v"; + } + } + $this->BeginTrans(); + $this->Execute("DELETE FROM $table WHERE $where"); + $ok = $this->Execute("INSERT INTO $table ($iCols) VALUES ($iVals)"); + $this->CommitTrans(); + + return ($ok) ? 2 : 0; + } + */ + function CreateSequence($seqname,$startID=1) + { + $ok = $this->Execute(("INSERT INTO RDB\$GENERATORS (RDB\$GENERATOR_NAME) VALUES (UPPER('$seqname'))" )); + if (!$ok) return false; + return $this->Execute("SET GENERATOR $seqname TO ".($startID-1).';'); + } + + function DropSequence($seqname) + { + $seqname = strtoupper($seqname); + $this->Execute("delete from RDB\$GENERATORS where RDB\$GENERATOR_NAME='$seqname'"); + } + + function GenID($seqname='adodbseq',$startID=1) + { + $getnext = ("SELECT Gen_ID($seqname,1) FROM RDB\$DATABASE"); + $rs = @$this->Execute($getnext); + if (!$rs) { + $this->Execute(("INSERT INTO RDB\$GENERATORS (RDB\$GENERATOR_NAME) VALUES (UPPER('$seqname'))" )); + $this->Execute("SET GENERATOR $seqname TO ".($startID-1).';'); + $rs = $this->Execute($getnext); + } + if ($rs && !$rs->EOF) $this->genID = (integer) reset($rs->fields); + else $this->genID = 0; // false + + if ($rs) $rs->Close(); + + return $this->genID; + } + + function SelectDB($dbName) + { + return false; + } + + function _handleerror() + { + $this->_errorMsg = ibase_errmsg(); + } + + function ErrorNo() + { + if (preg_match('/error code = ([\-0-9]*)/i', $this->_errorMsg,$arr)) return (integer) $arr[1]; + else return 0; + } + + function ErrorMsg() + { + return $this->_errorMsg; + } + + // returns true or false + function _connect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + if ($argDatabasename) $argHostname .= ':'.$argDatabasename; + $this->_connectionID = ibase_connect($argHostname,$argUsername,$argPassword,$this->charSet,$this->buffers,$this->dialect); + if ($this->dialect != 1) { // http://www.ibphoenix.com/ibp_60_del_id_ds.html + $this->replaceQuote = "''"; + } + if ($this->_connectionID === false) { + $this->_handleerror(); + return false; + } + + ibase_timefmt($this->ibase_timefmt); + return true; + } + // returns true or false + function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) + { + if ($argDatabasename) $argHostname .= ':'.$argDatabasename; + $this->_connectionID = ibase_pconnect($argHostname,$argUsername,$argPassword,$this->charSet,$this->buffers,$this->dialect); + if ($this->dialect != 1) { // http://www.ibphoenix.com/ibp_60_del_id_ds.html + $this->replaceQuote = "''"; + } + if ($this->_connectionID === false) { + $this->_handleerror(); + return false; + } + + ibase_timefmt($this->ibase_timefmt); + return true; + } + + function Prepare($sql) + { + // return $sql; + $stmt = ibase_prepare($sql); + if (!$stmt) return false; + return array($sql,$stmt); + } + + // returns query ID if successful, otherwise false + // there have been reports of problems with nested queries - the code is probably not re-entrant? + function _query($sql,$iarr=false) + { + + if (!$this->autoCommit && $this->_transactionID) { + $conn = $this->_transactionID; + $docommit = false; + } else { + $conn = $this->_connectionID; + $docommit = true; + } + if (is_array($sql)) { + $fn = 'ibase_execute'; + $sql = $sql[1]; + + if (is_array($iarr)) { + if (ADODB_PHPVER >= 0x4050) { // actually 4.0.4 + $fnarr = array_merge( array($sql) , $iarr); + $ret = call_user_func_array($fn,$fnarr); + } else { + switch(sizeof($iarr)) { + case 1: $ret = $fn($sql,$iarr[0]); break; + case 2: $ret = $fn($sql,$iarr[0],$iarr[1]); break; + case 3: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2]); break; + case 4: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3]); break; + case 5: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4]); break; + case 6: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5]); break; + case 7: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6]); break; + default: ADOConnection::outp( "Too many parameters to ibase query $sql"); + case 8: $ret = $fn($sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6],$iarr[7]); break; + } + } + } else $ret = $fn($sql); + } else { + $fn = 'ibase_query'; + + if (is_array($iarr)) { + if (ADODB_PHPVER >= 0x4050) { // actually 4.0.4 + $fnarr = array_merge( array($conn,$sql) , $iarr); + $ret = call_user_func_array($fn,$fnarr); + } else { + switch(sizeof($iarr)) { + case 1: $ret = $fn($conn,$sql,$iarr[0]); break; + case 2: $ret = $fn($conn,$sql,$iarr[0],$iarr[1]); break; + case 3: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2]); break; + case 4: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3]); break; + case 5: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4]); break; + case 6: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5]); break; + case 7: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6]); break; + default: ADOConnection::outp( "Too many parameters to ibase query $sql"); + case 8: $ret = $fn($conn,$sql,$iarr[0],$iarr[1],$iarr[2],$iarr[3],$iarr[4],$iarr[5],$iarr[6],$iarr[7]); break; + } + } + } else $ret = $fn($conn,$sql); + } + if ($docommit && $ret === true) ibase_commit($this->_connectionID); + + $this->_handleerror(); + return $ret; + } + + // returns true or false + function _close() + { + if (!$this->autoCommit) @ibase_rollback($this->_connectionID); + return @ibase_close($this->_connectionID); + } + + // returns array of ADOFieldObjects for current table + function &MetaColumns($table) + { + global $ADODB_FETCH_MODE; + + if ($this->metaColumnsSQL) { + + $save = $ADODB_FETCH_MODE; + $ADODB_FETCH_MODE = ADODB_FETCH_NUM; + + $rs = $this->Execute(sprintf($this->metaColumnsSQL,strtoupper($table))); + + $ADODB_FETCH_MODE = $save; + if ($rs === false) return false; + + $retarr = array(); + while (!$rs->EOF) { //print_r($rs->fields); + $fld = new ADOFieldObject(); + $fld->name = trim($rs->fields[0]); + $tt = $rs->fields[1]; + switch($tt) + { + case 7: + case 8: + case 9:$tt = 'INTEGER'; break; + case 10: + case 27: + case 11:$tt = 'FLOAT'; break; + default: + case 40: + case 14:$tt = 'CHAR'; break; + case 35:$tt = 'DATE'; break; + case 37:$tt = 'VARCHAR'; break; + case 261:$tt = 'BLOB'; break; + case 14: $tt = 'TEXT'; break; + case 13: + case 35:$tt = 'TIMESTAMP'; break; + } + $fld->type = $tt; + $fld->max_length = $rs->fields[2]; + $retarr[strtoupper($fld->name)] = $fld; + + $rs->MoveNext(); + } + $rs->Close(); + return $retarr; + } + return false; + } + + function BlobEncode( $blob ) + { + $blobid = ibase_blob_create( $this->_connectionID); + ibase_blob_add( $blobid, $blob ); + return ibase_blob_close( $blobid ); + } + + // since we auto-decode all blob's since 2.42, + // BlobDecode should not do any transforms + function BlobDecode($blob) + { + return $blob; + } + + // old blobdecode function + // still used to auto-decode all blob's + function _BlobDecode( $blob ) + { + $blobid = ibase_blob_open( $blob ); + $realblob = ibase_blob_get( $blobid,$this->maxblobsize); // 2nd param is max size of blob -- Kevin Boillet + while($string = ibase_blob_get($blobid, 8192)){ + $realblob .= $string; + } + ibase_blob_close( $blobid ); + + return( $realblob ); + } + + function UpdateBlobFile($table,$column,$path,$where,$blobtype='BLOB') + { + $fd = fopen($path,'rb'); + if ($fd === false) return false; + $blob_id = ibase_blob_create($this->_connectionID); + + /* fill with data */ + + while ($val = fread($fd,32768)){ + ibase_blob_add($blob_id, $val); + } + + /* close and get $blob_id_str for inserting into table */ + $blob_id_str = ibase_blob_close($blob_id); + + fclose($fd); + return $this->Execute("UPDATE $table SET $column=(?) WHERE $where",array($blob_id_str)) != false; + } + + /* + Insert a null into the blob field of the table first. + Then use UpdateBlob to store the blob. + + Usage: + + $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); + $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1'); + */ + function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') + { + $blob_id = ibase_blob_create($this->_connectionID); + + // ibase_blob_add($blob_id, $val); + + // replacement that solves the problem by which only the first modulus 64K / + // of $val are stored at the blob field //////////////////////////////////// + // Thx Abel Berenstein aberenstein#afip.gov.ar + $len = strlen($val); + $chunk_size = 32768; + $tail_size = $len % $chunk_size; + $n_chunks = ($len - $tail_size) / $chunk_size; + + for ($n = 0; $n < $n_chunks; $n++) { + $start = $n * $chunk_size; + $data = substr($val, $start, $chunk_size); + ibase_blob_add($blob_id, $data); + } + + if ($tail_size) { + $start = $n_chunks * $chunk_size; + $data = substr($val, $start, $tail_size); + ibase_blob_add($blob_id, $data); + } + // end replacement ///////////////////////////////////////////////////////// + + $blob_id_str = ibase_blob_close($blob_id); + + return $this->Execute("UPDATE $table SET $column=(?) WHERE $where",array($blob_id_str)) != false; + + } + + + function OldUpdateBlob($table,$column,$val,$where,$blobtype='BLOB') + { + $blob_id = ibase_blob_create($this->_connectionID); + ibase_blob_add($blob_id, $val); + $blob_id_str = ibase_blob_close($blob_id); + return $this->Execute("UPDATE $table SET $column=(?) WHERE $where",array($blob_id_str)) != false; + } + + // Format date column in sql string given an input format that understands Y M D + // Only since Interbase 6.0 - uses EXTRACT + // problem - does not zero-fill the day and month yet + function SQLDate($fmt, $col=false) + { + if (!$col) $col = $this->sysDate; + $s = ''; + + $len = strlen($fmt); + for ($i=0; $i < $len; $i++) { + if ($s) $s .= '||'; + $ch = $fmt[$i]; + switch($ch) { + case 'Y': + case 'y': + $s .= "extract(year from $col)"; + break; + case 'M': + case 'm': + $s .= "extract(month from $col)"; + break; + case 'Q': + case 'q': + $s .= "cast(((extract(month from $col)+2) / 3) as integer)"; + break; + case 'D': + case 'd': + $s .= "(extract(day from $col))"; + break; + default: + if ($ch == '\\') { + $i++; + $ch = substr($fmt,$i,1); + } + $s .= $this->qstr($ch); + break; + } + } + return $s; + } +} + +/*-------------------------------------------------------------------------------------- + Class Name: Recordset +--------------------------------------------------------------------------------------*/ + +class ADORecordset_ibase extends ADORecordSet +{ + + var $databaseType = "ibase"; + var $bind=false; + var $_cacheType; + + function ADORecordset_ibase($id,$mode=false) + { + global $ADODB_FETCH_MODE; + + $this->fetchMode = ($mode === false) ? $ADODB_FETCH_MODE : $mode; + return $this->ADORecordSet($id); + } + + /* Returns: an object containing field information. + Get column information in the Recordset object. fetchField() can be used in order to obtain information about + fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by + fetchField() is retrieved. */ + + function &FetchField($fieldOffset = -1) + { + $fld = new ADOFieldObject; + $ibf = ibase_field_info($this->_queryID,$fieldOffset); + $fld->name = strtolower($ibf['alias']); + if (empty($fld->name)) $fld->name = strtolower($ibf['name']); + $fld->type = $ibf['type']; + $fld->max_length = $ibf['length']; + return $fld; + } + + function _initrs() + { + $this->_numOfRows = -1; + $this->_numOfFields = @ibase_num_fields($this->_queryID); + + // cache types for blob decode check + for ($i=0, $max = $this->_numOfFields; $i < $max; $i++) { + $f1 = $this->FetchField($i); + $this->_cacheType[] = $f1->type; + } + } + + function _seek($row) + { + return false; + } + + function _fetch() + { + $f = @ibase_fetch_row($this->_queryID); + if ($f === false) { + $this->fields = false; + return false; + } + // OPN stuff start - optimized + // fix missing nulls and decode blobs automatically + for ($i=0, $max = $this->_numOfFields; $i < $max; $i++) { + if ($this->_cacheType[$i]=="BLOB") { + if (isset($f[$i])) { + $f[$i] = ADODB_ibase::_BlobDecode($f[$i]); + } else { + $f[$i] = null; + } + } else { + if (!isset($f[$i])) { + $f[$i] = null; + } + } + } + // OPN stuff end + + $this->fields = $f; + if ($this->fetchMode & ADODB_FETCH_ASSOC) { + $this->fields = $this->GetRowAssoc(ADODB_ASSOC_CASE); + } + return true; + } + + /* Use associative array to get fields array */ + function Fields($colname) + { + if ($this->fetchMode & ADODB_FETCH_ASSOC) return $this->fields[$colname]; + if (!$this->bind) { + $this->bind = array(); + for ($i=0; $i < $this->_numOfFields; $i++) { + $o = $this->FetchField($i); + $this->bind[strtoupper($o->name)] = $i; + } + } + + return $this->fields[$this->bind[strtoupper($colname)]]; + + } + + + function _close() + { + return @ibase_free_result($this->_queryID); + } + + function MetaType($t,$len=-1,$fieldobj=false) + { + if (is_object($t)) { + $fieldobj = $t; + $t = $fieldobj->type; + $len = $fieldobj->max_length; + } + switch (strtoupper($t)) { + case 'CHAR': + return 'C'; + + case 'TEXT': + case 'VARCHAR': + case 'VARYING': + if ($len <= $this->blobSize) return 'C'; + return 'X'; + case 'BLOB': + return 'B'; + + case 'TIMESTAMP': + case 'DATE': return 'D'; + + //case 'T': return 'T'; + + //case 'L': return 'L'; + case 'INT': + case 'SHORT': + case 'INTEGER': return 'I'; + default: return 'N'; + } + } + +} +?> \ No newline at end of file Index: trunk/admin/images/toolbar/tool_approve_f3.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/categories/no_categories.tpl =================================================================== diff -u --- trunk/themes/default/categories/no_categories.tpl (revision 0) +++ trunk/themes/default/categories/no_categories.tpl (revision 13) @@ -0,0 +1,21 @@ + + + +
    + + + + +

    + + + + + + + + +


    + + + Index: trunk/kernel/admin/include/toolbar/groupselect.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/groupselect.php (revision 0) +++ trunk/kernel/admin/include/toolbar/groupselect.php (revision 13) @@ -0,0 +1,187 @@ +Get("Perpage_Grouplist"); +if(!$User_Page) + $User_Page = 10; + +/* Set the sort values */ +$SortField = trim($objConfig->Get("GroupSelect_SortField")); +$SortOrder = trim($objConfig->Get("GroupSelect_SortOrder")); +if(!strlen($SortOrder)) + $SortOrder = "asc"; + + +$browseURL = $adminURL."/browse"; + +$lang_users = language("la_Text_Users"); +$lang_Username = language("la_prompt_Username"); +$lang_LastName = language("la_prompt_LastName"); +$lang_FirstName = language("la_prompt_FirstName"); +$lang_Email = language("la_prompt_Email"); +$lang_PrimaryGroup = language("la_prompt_PrimaryGroup"); +$lang_Valid = language("la_Text_Valid"); +$lang_GroupName = language("la_Text_Group_Name"); +$lang_Group = language("la_Text_Group"); +$lang_UserCount = language("la_Text_User_Count"); +$lang_Groups = language("la_Text_Groups"); +$lang_Default = language("la_Text_Default"); + +print << + + + + + + + + + +END; +?> \ No newline at end of file Index: trunk/admin/images/itemicons/icon16_image_disabled.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/register/right.tpl =================================================================== diff -u --- trunk/themes/default/register/right.tpl (revision 0) +++ trunk/themes/default/register/right.tpl (revision 13) @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file Index: trunk/themes/default/my_preferences/pref_menubar_element1.tpl =================================================================== diff -u --- trunk/themes/default/my_preferences/pref_menubar_element1.tpl (revision 0) +++ trunk/themes/default/my_preferences/pref_menubar_element1.tpl (revision 13) @@ -0,0 +1,10 @@ + + + + + + +
    ">
    ">
    + + + Index: trunk/admin/editor/FCKeditor/js/fck_lang.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/js/fck_lang.js (revision 0) +++ trunk/admin/editor/FCKeditor/js/fck_lang.js (revision 13) @@ -0,0 +1,92 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fck_lang.js: Handles multi language functionality. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +var lang = new Object() ; + +var AvailableLangs = new Object() ; + +AvailableLangs["bs"] = true ; +AvailableLangs["cs"] = true ; +AvailableLangs["da"] = true ; +AvailableLangs["de"] = true ; +AvailableLangs["en"] = true ; +AvailableLangs["es"] = true ; +AvailableLangs["fi"] = true ; +AvailableLangs["fr"] = true ; +AvailableLangs["gr"] = true ; +AvailableLangs["hu"] = true ; +AvailableLangs["is"] = true ; +AvailableLangs["it"] = true ; +AvailableLangs["jp"] = true ; +AvailableLangs["ko"] = true ; +AvailableLangs["nl"] = true ; +AvailableLangs["no"] = true ; +AvailableLangs["pl"] = true ; +AvailableLangs["pt-br"] = true ; +AvailableLangs["ro"] = true ; +AvailableLangs["ru"] = true ; +AvailableLangs["sk"] = true ; +AvailableLangs["sv"] = true ; +AvailableLangs["tr"] = true ; +AvailableLangs["zh-cn"] = true ; + +AvailableLangs.GetActiveLanguage = function() +{ + if ( config.AutoDetectLanguage ) + { + var sUserLang = navigator.userLanguage.toLowerCase() ; + + if ( this[sUserLang] ) + return sUserLang ; + else if ( sUserLang.length > 2 ) + { + sUserLang = sUserLang.substr(0,2) ; + if ( this[sUserLang] ) + return sUserLang ; + } + } + + return config.DefaultLanguage ; +} + +document.write(' + + Index: trunk/themes/default/suggest_cat.tpl =================================================================== diff -u --- trunk/themes/default/suggest_cat.tpl (revision 0) +++ trunk/themes/default/suggest_cat.tpl (revision 13) @@ -0,0 +1,108 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + +

    + + + +
    + + + + + +

    + +
    + + + + +
    + + + + + +

    +
    + + + + + +


    +

    +
    + + + + Index: trunk/themes/default/advsearch/adv_searchtype_options.tpl =================================================================== diff -u --- trunk/themes/default/advsearch/adv_searchtype_options.tpl (revision 0) +++ trunk/themes/default/advsearch/adv_searchtype_options.tpl (revision 13) @@ -0,0 +1 @@ + \ No newline at end of file Index: trunk/themes/default/img/close_win.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/install_lib.php =================================================================== diff -u --- trunk/admin/install/install_lib.php (revision 0) +++ trunk/admin/install/install_lib.php (revision 13) @@ -0,0 +1,491 @@ +MetaTables(); + for($x=0;$x $section) + { + fwrite($fp,"[".$secname."]\n"); + foreach($section as $key => $value) fwrite($fp,"$key = \"$value\"\n"); + fwrite($fp,"\n"); + } + fclose($fp); + //} +} + +function RunSchemaFile($ado,$filename) +{ + if(file_exists($filename)) + { + $fp = fopen($filename, "r");//open file + $sql = fread($fp, filesize($filename)); + fclose($fp); + if(strlen($sql)) + RunSchemaText($ado,$sql); + } +} + +function RunSchemaText($ado,$sql) +{ + global $g_TablePrefix; + + if(strlen($g_TablePrefix)) + { + $what = "CREATE TABLE "; + $replace = "CREATE TABLE ".$g_TablePrefix; + $sql = ereg_replace($what, $replace, $sql); + + $what = "DROP TABLE "; + $replace = "DROP TABLE ".$g_TablePrefix; + $sql = ereg_replace($what, $replace, $sql); + + $what = "INSERT INTO "; + $replace = "INSERT INTO ".$g_TablePrefix; + $sql = ereg_replace($what, $replace, $sql); + + $what = "UPDATE "; + $replace = "UPDATE ".$g_TablePrefix; + $sql = ereg_replace($what, $replace, $sql); + + $what = "ALTER TABLE "; + $replace = "ALTER TABLE ".$g_TablePrefix; + $sql = ereg_replace($what, $replace, $sql); + } + $commands = explode("# --------------------------------------------------------",$sql); + if(count($commands)>0) + { + for($i=0;$i0) + { + $ado->Execute($cmd); + if($ado->ErrorNo()!=0) + { + $db_error = $ado->ErrorMsg()." COMMAND:
    $cmd
    "; + //echo "

    $db_error

    "; + //break; + } + } + } + } +} + +function RunSQLText($ado,$allsql) +{ + global $g_TablePrefix; + + $line = 0; + while($line0 && substr($sql,0,1)!="#") + { + if(strlen($g_TablePrefix)) + { + $what = "CREATE TABLE "; + $replace = "CREATE TABLE ".$g_TablePrefix; + $sql = ereg_replace($what, $replace, $sql); + + $what = "DROP TABLE "; + $replace = "DROP TABLE ".$g_TablePrefix; + $sql = ereg_replace($what, $replace, $sql); + + $what = "INSERT INTO "; + $replace = "INSERT INTO ".$g_TablePrefix; + $sql = ereg_replace($what, $replace, $sql); + + $what = "UPDATE "; + $replace = "UPDATE ".$g_TablePrefix; + $sql = ereg_replace($what, $replace, $sql); + + $what = "ALTER TABLE "; + $replace = "ALTER TABLE ".$g_TablePrefix; + $sql = ereg_replace($what, $replace, $sql); + } + $sql = trim($sql); + if(strlen($sql)>0) + { + $ado->Execute($sql); + if($ado->ErrorNo()!=0) + { + $db_error = $ado->ErrorMsg()." COMMAND:
    $sql
    "; + //echo "

    $db_error

    "; + $error = TRUE; + } + } + } + $line++; + } +} + +function RunSQLFile($ado,$filename) +{ + if(file_exists($filename)) + { + $allsql = file($filename); + RunSQLText($ado,$allsql); + } +} + +function RunRestoreFile($ado,$filename,$FileOffset,$MaxLines) +{ + $size = filesize($filename); + + if($FileOffset > $size) + return -2; + + $fp = fopen($filename,"r"); + if(!$fp) + return -1; + + if($FileOffset>0) + { + fseek($fp,$FileOffset); + } + else + { + $EndOfSQL = FALSE; + $sql = ""; + while(!feof($fp) && !$EndOfSQL) + { + $l = fgets($fp,16384); + if(substr($l,0,11)=="INSERT INTO") + { + $EndOfSQL = TRUE; + } + else + { + $sql .= $l; + $FileOffset = ftell($fp) - strlen($l); + } + } + if(strlen($sql)) + { + RunSchemaText($ado,$sql); + } + fseek($fp,$FileOffset); + } + $LinesRead = 0; + $sql = ""; + $AllSql = array(); + while($LinesRead < $MaxLines && !feof($fp)) + { + $sql = fgets($fp, 16384); + if(strlen($sql)) + { + $AllSql[] = $sql; + $LinesRead++; + } + } + if(!feof($fp)) + { + $FileOffset = ftell($fp); + } + else + { + $FileOffset = $TotalSize; + } + fclose($fp); + if(count($AllSql)>0) + RunSQLText($ado,$AllSql); + return (int)$FileOffset; +} + +function inst_keyED($txt,$encrypt_key) +{ + $encrypt_key = md5($encrypt_key); + $ctr=0; + $tmp = ""; + for ($i=0;$i15 && $p[1]<32) + $localb=TRUE; + } + $localname = (strpos($domain,".")==0); + if($domain=="localhost" || $domain=="127.0.0.1" || substr($domain,0,7)=="192.168" || + substr($domain,0,3)=="10." || $localb || $localname) + { + return TRUE; + } + return FALSE; +} + + +function inst_ModuleLicensed($name) +{ + global $i_Keys, $objConfig, $g_License, $g_Domain; + + //$lic = LoadLicense(); + $lic = base64_decode($g_License); + inst_ParseLicense($lic); +// echo "Checking $g_Domain..
    \n"; +// echo "
    ";print_r($i_Keys); echo "

    "; + $modules = array(); + if(!inst_IsLocalSite($g_Domain)) + { + for($x=0;$x\n"; + return TRUE; + } + else + { + // echo "Module $name is not licensed
    \n"; + return FALSE; + } + } + else + return TRUE; + + return FALSE; +} + +function inst_GetModuleList() +{ + global $rootpath,$pathchar,$admin, $pathtoroot; + + $path = $pathtoroot; + + $new = array(); + if ($dir = @opendir($path)) + { + while (($file = readdir($dir)) !== false) + { + if($file !="." && $file !=".." && substr($file,0,1)!="_") + { + if(is_dir($path."/".$file)) + { + $inst_file = $path.$file."/admin/install.php"; + if(file_exists($inst_file)) + { +// if(inst_ModuleLicensed($file)) +// { + $new[$file] = $inst_file; +// } + } + } + } + } + closedir($dir); + } + return array_keys($new); +} + +function GetDirList ($dirName) +{ + + $filedates = array(); + $d = dir($dirName); + + while($entry = $d->read()) + { + if ($entry != "." && $entry != "..") + { + if (!is_dir($dirName."/".$entry)) + { + $filedate[]=$entry; + } + } + } + $d->close(); + return $filedate; +} + +function GetLanguageList() +{ + global $pathtoroot, $admin; + + $packs = array(); + $dir = $pathtoroot.$admin."/install/langpacks"; + $files = GetDirList($dir); + + if(is_array($files)) + { + foreach($files as $f) + { + $p = pathinfo($f); + if($p["extension"]=="lang") + { + $packs[] = $f; + } + } + } + return $packs; +} + +?> Index: trunk/admin/images/tab_back.jpg =================================================================== diff -u Binary files differ Index: trunk/admin/images/divider_dn.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/vanadium.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/lang/thai.gif =================================================================== diff -u Binary files differ Index: trunk/admin/config/addtheme.php =================================================================== diff -u --- trunk/admin/config/addtheme.php (revision 0) +++ trunk/admin/config/addtheme.php (revision 13) @@ -0,0 +1,244 @@ +Get("Site_Path"); + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +$browseURL = $adminURL."/browse"; + +$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."/browse/toolbar.php"); +require_once($pathtoroot.$admin."/listview/listview.php"); + +$m = GetModuleArray(); +foreach($m as $key=>$value) +{ + $path = $pathtoroot. $value."admin/include/parser.php"; + if(file_exists($path)) + { + include_once($path); + } +} + + +unset($objEditItems); + +$objEditItems = new clsThemeList(); +$objEditItems->SourceTable = $objSession->GetEditTable("Theme"); +$objEditItems->EnablePaging = FALSE; + +if ($_GET["new"] == 1) +{ + $c = new clsTheme(NULL); + $en = 0; + $action = "m_theme_add"; + $name = prompt_language("la_Text_NewTheme"); + $objThemes->CreateEmptyEditTable("ThemeId"); +} +else +{ + $en = (int)$_GET["en"]; + if (isset($_POST["itemlist"])) + { + $objThemes->CopyToEditTable("ThemeId",$_POST["itemlist"]); + } + $objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); + $itemcount=$objEditItems->NumItems(); + + $c = $objEditItems->GetItemByIndex($en); + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_theme_edit"; + $name = $c->Get("Name"); +} + +$section = "in-portal:theme_general"; + +$envar = "env=".BuildEnv(); + +$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Theme")." -'".$name."'"; + +//Display header +$sec = $objSections->GetSection($section); +$objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('theme','ThemeEditStatus','".$admin."/config/config_theme.php',1);","/toolbar/tool_select.gif"); +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('theme','ThemeEditStatus','".$admin."/config/config_theme.php',2);",$imagesURL."/toolbar/tool_cancel.gif"); + +if ( isset($en_prev) || isset($en_next) ) +{ + $url = $RootUrl.$admin."/config/addtheme.php"; + $StatusField = "ThemeEditStatus"; + $form = "theme"; + MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick")); + $objCatToolBar->Add("divider"); +} + + int_header($objCatToolBar,NULL,$title); +?> +
    + + + + > + + + + + + > + + + + + + > + + + + + +> + + + + + + > + + + + + + +> + + + + + "> + + + + + + > + + + +
    Get("ThemeId"); ?>
    ">
    ">
    + Get("Enabled") == 1) echo "checked"; ?>> +  
    + "> +  
    + Get("PrimaryTheme") == 1) echo "checked"; ?>> +  
    + +
    + + +
    + + + + +
    + + + Index: trunk/admin/editor/FCKeditor/lang/is.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/is.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/is.js (revision 13) @@ -0,0 +1,198 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * is.js: Iceland support by Andri �skarsson + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Klippa" ; +lang["Copy"] = "Afrita" ; +lang["Paste"] = "L�ma" ; +lang["PasteText"] = "L�ma sem texta" ; +lang["PasteWord"] = "L�ma �r Word" ; +lang["Find"] = "Finna" ; +lang["SelectAll"] = "Velja allt" ; +lang["RemoveFormat"] = "Fjarl�gja sni�" ; +lang["InsertLink"] = "B�ta vi�/Breyta link" ; +lang["RemoveLink"] = "Ey�a link" ; +lang["InsertImage"] = "B�ta vi�/Breyta mynd" ; +lang["InsertTable"] = "B�ta vi�/Breyta t�flu" ; +lang["InsertLine"] = "B�ta vi� l��r�ttri l�nu" ; +lang["InsertSpecialChar"] = "B�ta vi� t�kni" ; +lang["InsertSmiley"] = "B�ta vi� broskalli" ; +lang["About"] = "Um FCKeditor" ; + +lang["Bold"] = "Feitletra�" ; +lang["Italic"] = "Sk�letra�" ; +lang["Underline"] = "Undirstrika�" ; +lang["StrikeThrough"] = "Yfirstrika�" ; +lang["Subscript"] = "Subscript" ; +lang["Superscript"] = "Superscript" ; +lang["LeftJustify"] = "Left Justify" ; +lang["CenterJustify"] = "Center Justify" ; +lang["RightJustify"] = "Right Justify" ; +lang["BlockJustify"] = "Block Justify" ; +lang["DecreaseIndent"] = "Minnka bil" ; +lang["IncreaseIndent"] = "Auka bil" ; +lang["Undo"] = "�gera" ; +lang["Redo"] = "Endurgera" ; +lang["NumberedList"] = "N�mera�ur listi" ; +lang["BulettedList"] = "Punkta�ur listi" ; + +lang["ShowTableBorders"] = "S�na ramma t�flu" ; +lang["ShowDetails"] = "S�na sm�atri�i" ; + +lang["FontStyle"] = "St�ll" ; +lang["FontFormat"] = "Sni�" ; +lang["Font"] = "Leturger�" ; +lang["FontSize"] = "St�r�" ; +lang["TextColor"] = "Litur texta" ; +lang["BGColor"] = "Litur bakgrunns" ; +lang["Source"] = "Grunnk��i" ; + +// Context Menu + +lang["EditLink"] = "Breyta link" ; +lang["InsertRow"] = "B�ta vi� r��" ; +lang["DeleteRows"] = "Ey�a r��" ; +lang["InsertColumn"] = "B�ta vi� d�lki" ; +lang["DeleteColumns"] = "Ey�a d�lki" ; +lang["InsertCell"] = "B�ta vi� sellu" ; +lang["DeleteCells"] = "Ey�a sellu" ; +lang["MergeCells"] = "Blanda sellu" ; +lang["SplitCell"] = "Skipta sellu" ; +lang["CellProperties"] = "Stillingar sellu" ; +lang["TableProperties"] = "Stillingar t�flu" ; +lang["ImageProperties"] = "Stillingar myndar" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Er a� vinna XHTML. Vinsamlegast b��i�..." ; +lang["Done"] = "Afgreitt" ; +lang["PasteWordConfirm"] = "Textinn sem �� l�mdir vir�ist koma �r Word. Viltu hreinsa hann ��ur?" ; +lang["NotCompatiblePaste"] = "�essi skipun virkar a�eins me� Internet Explorer 5.5 e�a n�rra. Viltu l�ma �n �ess a� hreinsa?" ; + +// Dialogs +lang["DlgBtnOK"] = "�fram" ; +lang["DlgBtnCancel"] = "H�tta vi�" ; +lang["DlgBtnClose"] = "Loka" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "B�ta vi� mynd" ; +lang["DlgImgTitleEdit"] = "Breyta mynd" ; +lang["DlgImgBtnUpload"] = "Senda � �j�n" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Uploada" ; +lang["DlgImgBtnBrowse"] = "Browsa �j�n" ; +lang["DlgImgAlt"] = "Texti me� mynd" ; +lang["DlgImgWidth"] = "breidd" ; +lang["DlgImgHeight"] = "h��" ; +lang["DlgImgLockRatio"] = "L�sa vi�mi�um" ; +lang["DlgBtnResetSize"] = "Endursetja st�r�" ; +lang["DlgImgBorder"] = "Rammi" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Align" ; +lang["DlgImgAlignLeft"] = "Vinstri" ; +lang["DlgImgAlignAbsBottom"] = "Abs Botn" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Mi�ja" ; +lang["DlgImgAlignBaseline"] = "Baseline" ; +lang["DlgImgAlignBottom"] = "Botn" ; +lang["DlgImgAlignMiddle"] = "Mi�ja" ; +lang["DlgImgAlignRight"] = "H�gri" ; +lang["DlgImgAlignTextTop"] = "Toppur texta" ; +lang["DlgImgAlignTop"] = "Toppur" ; +lang["DlgImgPreview"] = "Sj� ��ur" ; +lang["DlgImgMsgWrongExt"] = "Sorry, only the following file types uploads are allowed:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgImgAlertSelect"] = "Please select an image to upload." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Link" ; // NEW +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Upload" ; +lang["DlgLnkTarget"] = "Target" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "New Window (_blank)" ; +lang["DlgLnkTargetParent"] = "Parent Window (_parent)" ; +lang["DlgLnkTargetSelf"] = "Same Window (_self)" ; +lang["DlgLnkTargetTop"] = "Topmost Window (_top)" ; +lang["DlgLnkTitle"] = "Title" ; +lang["DlgLnkBtnUpload"] = "Send it to the Server" ; +lang["DlgLnkBtnBrowse"] = "Browse Server" ; +lang["DlgLnkMsgWrongExtA"] = "�v� mi�ur eru a�eins eftirfarandi skr�r leyf�ar:\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperation canceled." ; +lang["DlgLnkMsgWrongExtD"] = "�v� mi�ur eru eftirfarandi skr�r ekki leyf�ar:\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperation canceled." ; + +// Color Dialog +lang["DlgColorTitle"] = "Velji� lit" ; +lang["DlgColorBtnClear"] = "Hreinsa" ; +lang["DlgColorHighlight"] = "Merkja" ; +lang["DlgColorSelected"] = "Velja" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Setja inn broskall" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Setja inn t�kn" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "B�ta vi� t�flu" ; +lang["DlgTableTitleEdit"] = "Breyta t�flu" ; +lang["DlgTableRows"] = "Ra�ir" ; +lang["DlgTableColumns"] = "D�lkar" ; +lang["DlgTableBorder"] = "St�r� bor�a" ; +lang["DlgTableAlign"] = "Alingment" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Vinstri" ; +lang["DlgTableAlignCenter"] = "Mi�ja" ; +lang["DlgTableAlignRight"] = "H�gri" ; +lang["DlgTableWidth"] = "Breidd" ; +lang["DlgTableWidthPx"] = "pixelar" ; +lang["DlgTableWidthPc"] = "pr�senta" ; +lang["DlgTableHeight"] = "H��" ; +lang["DlgTableCellSpace"] = "Bil sellu" ; +lang["DlgTableCellPad"] = "Sp�ss�a sellu" ; +lang["DlgTableCaption"] = "Hli�artexti" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Stillingar sellu" ; +lang["DlgCellWidth"] = "Breidd" ; +lang["DlgCellWidthPx"] = "pixelar" ; +lang["DlgCellWidthPc"] = "pr�sentur" ; +lang["DlgCellHeight"] = "H��" ; +lang["DlgCellWordWrap"] = "Or�ap�kkun" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "J�" ; +lang["DlgCellWordWrapNo"] = "Nei" ; +lang["DlgCellHorAlign"] = "L��r�tt Alignment" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Vinstri" ; +lang["DlgCellHorAlignCenter"] = "Mi�ja" ; +lang["DlgCellHorAlignRight"] = "H�gri" ; +lang["DlgCellVerAlign"] = "L�r�tt Alignment" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Toppur" ; +lang["DlgCellVerAlignMiddle"] = "Mi�ja" ; +lang["DlgCellVerAlignBottom"] = "Botn" ; +lang["DlgCellVerAlignBaseline"] = "Stofnl�na" ; +lang["DlgCellRowSpan"] = "Span ra�a" ; +lang["DlgCellCollSpan"] = "Span d�lka" ; +lang["DlgCellBackColor"] = "Litur backgrunns" ; +lang["DlgCellBorderColor"] = "Litur bor�a" ; +lang["DlgCellBtnSelect"] = "Velji�..." ; + +// About Dialog +lang["DlgAboutVersion"] = "�tg�fa" ; +lang["DlgAboutLicense"] = "Gefi� �t undir skilm�lum GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "Fyrir frekari uppl�singar fari� �" ; \ No newline at end of file Index: trunk/themes/default/img/ic_top.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_pick.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/msn/whatchutalkingabout_smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/msn/shades_smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_cat_new.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/sovxx.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/toolbar.php =================================================================== diff -u --- trunk/admin/install/toolbar.php (revision 0) +++ trunk/admin/install/toolbar.php (revision 13) @@ -0,0 +1,12 @@ + + + Save + Cancel + + + + Cancel + + +   + \ No newline at end of file Index: trunk/themes/default/img/ic_lock.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/group_mail.php =================================================================== diff -u --- trunk/admin/users/group_mail.php (revision 0) +++ trunk/admin/users/group_mail.php (revision 13) @@ -0,0 +1,183 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +$pathtolocal = $pathtoroot."in-news/"; +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"); + +unset($objEditItems); + +$objEditItems = new clsGroupList(); +$objEditItems->SourceTable = $objSession->GetEditTable("PortalGroup"); +$objEditItems->EnablePaging = FALSE; +$GroupCount = 0; + + if (isset($_POST["itemlist"])) + { + if(is_array($_POST["itemlist"])) + { + $GroupList = implode(",",$_POST["itemlist"]); + $GroupCount = count($_POST["itemlist"]); + } + else + { + $a = explode($_POST["itemlist"]); + $GroupCount = count($a); + unset($a); + $GroupList = $_POST["itemlist"]; + } + + if($itemcount>1) + { + if ($en+1 == $itemcount) + $en_next = -1; + else + $en_next = $en+1; + + if ($en == 0) + $en_prev = -1; + else + $en_prev = $en-1; + } + $action = "m_sendmail"; +} + +$envar = "env=" . BuildEnv(); + +$section = 'in-portal:editgroup_sendmail'; + +$title = prompt_language("la_Text_Send")." ".prompt_language("la_Text_Email")." ".prompt_language("la_Text_To")." $GroupCount ".prompt_language("la_Text_Groups"); +echo $envar."
    \n"; + +//Display header + $sec = $objSections->GetSection($section); + $objCatToolBar = new clsToolBar(); +$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('editgroup','".$admin."/users/user_groups.php',1);",$imagesURL."/toolbar/tool_select.gif"); + +$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('editgroup','".$admin."/users/user_groups.php',2);",$imagesURL."/toolbar/tool_cancel.gif"); + + int_header($objCatToolBar,NULL,$title); +?> + + + > + + + + + > + + + + + > + + + + + + > + + + +
    + +
    + +
    + +
    + +
    + + + + " class="button" onclick="edit_submit('editgroup','".$admin."/users/user_groups.php',1);"> + " class="button" onclick="edit_submit('editgroup','".$admin."/users/user_groups.php',2);"> +
    + + + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_decline_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_prev_f2.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_quest_big.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/blocks.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_logs_reports.gif =================================================================== diff -u Binary files differ Index: trunk/compat/file_put_contents.php =================================================================== diff -u --- trunk/compat/file_put_contents.php (revision 0) +++ trunk/compat/file_put_contents.php (revision 13) @@ -0,0 +1,105 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: file_put_contents.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +if (!defined('FILE_USE_INCLUDE_PATH')) { + define('FILE_USE_INCLUDE_PATH', 1); +} + +if (!defined('FILE_APPEND')) { + define('FILE_APPEND', 8); +} + + +/** + * Replace file_put_contents() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.file_put_contents + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @internal $resource_context is not supported + * @since PHP 5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('file_put_contents')) +{ + function file_put_contents ($filename, $content, $flags = null, $resource_context = null) + { + // If $content is an array, convert it to a string + if (is_array($content)) { + $content = implode('', $content); + } + + // If we don't have a string, throw an error + if (!is_string($content)) { + trigger_error('file_put_contents() The 2nd parameter should be either a string or an array', E_USER_WARNING); + return false; + } + + // Get the length of date to write + $length = strlen($content); + + // Check what mode we are using + $mode = ($flags & FILE_APPEND) ? + $mode = 'a' : + $mode = 'w'; + + // Check if we're using the include path + $use_inc_path = ($flags & FILE_USE_INCLUDE_PATH) ? + true : + false; + + // Open the file for writing + if (($fh = @fopen($filename, $mode, $use_inc_path)) === false) { + trigger_error('file_put_contents() failed to open stream: Permission denied', E_USER_WARNING); + return false; + } + + // Write to the file + $bytes = 0; + if (($bytes = @fwrite($fh, $content)) === false) { + $errormsg = sprintf('file_put_contents() Failed to write %d bytes to %s', + $length, + $filename); + trigger_error($errormsg, E_USER_WARNING); + return false; + } + + // Close the handle + @fclose($fh); + + // Check all the data was written + if ($bytes != $length) { + $errormsg = sprintf('file_put_contents() Only %d of %d bytes written, possibly out of free disk space.', + $bytes, + $length); + trigger_error($errormsg, E_USER_WARNING); + return false; + } + + // Return length + return $bytes; + } +} + +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/angry.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/sk.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/sk.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/sk.js (revision 13) @@ -0,0 +1,197 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * sk.js: Slovak support. + * + * Authors: + * Juraj Chlebec (havran@mailbox.sk) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Vystrihnúť" ; +lang["Copy"] = "Kopírovať" ; +lang["Paste"] = "Prilepiť" ; +lang["PasteText"] = "Prilepiť bez formátovania" ; +lang["PasteWord"] = "Prilepiť z Wordu" ; +lang["Find"] = "Vyhladať" ; +lang["SelectAll"] = "Vybrať všetko" ; +lang["RemoveFormat"] = "Odstrániť formátovanie" ; +lang["InsertLink"] = "Vložiť/zmeniť hypertextový odkaz" ; +lang["RemoveLink"] = "Odstrániť hypertextový odkaz" ; +lang["InsertImage"] = "Vložiť/zmeniť obrázok" ; +lang["InsertTable"] = "Vložiť/zmeniť tabuľku" ; +lang["InsertLine"] = "Vložiť horizontálnu čiaru" ; +lang["InsertSpecialChar"] = "Vložiť speciálny znak" ; +lang["InsertSmiley"] = "Vložiť smajlík" ; +lang["About"] = "O aplikácii FCKeditor" ; + +lang["Bold"] = "Tučné" ; +lang["Italic"] = "Kurzíva" ; +lang["Underline"] = "Podčiarknuté" ; +lang["StrikeThrough"] = "Prečiarknuté" ; +lang["Subscript"] = "Dolný index" ; +lang["Superscript"] = "Horný index" ; +lang["LeftJustify"] = "Zarovnať doľava" ; +lang["CenterJustify"] = "Centrovať" ; +lang["RightJustify"] = "Zarovnať doprava" ; +lang["BlockJustify"] = "Zarovnať podľa okraja" ; +lang["DecreaseIndent"] = "Zmenšiť zarážku" ; +lang["IncreaseIndent"] = "Zväčšiť zarážku" ; +lang["Undo"] = "Späť" ; +lang["Redo"] = "Znova" ; +lang["NumberedList"] = "Číslovanie" ; +lang["BulettedList"] = "Odrážky" ; + +lang["ShowTableBorders"] = "Zobraziť ohraničenie tabuliek" ; +lang["ShowDetails"] = "Zobraziť podrobnosti" ; + +lang["FontStyle"] = "Štýl" ; +lang["FontFormat"] = "Formát" ; +lang["Font"] = "Písmo" ; +lang["FontSize"] = "Veľkosť písma" ; +lang["TextColor"] = "Farba písma" ; +lang["BGColor"] = "Zvýrazniť" ; +lang["Source"] = "Zdroj" ; + +// Context Menu + +lang["EditLink"] = "Vlastnosti hypertextového odkazu" ; +lang["InsertRow"] = "Vložiť riadok" ; +lang["DeleteRows"] = "Zmazať riadok" ; +lang["InsertColumn"] = "Vložiť stĺpec" ; +lang["DeleteColumns"] = "Zmazať stĺpec" ; +lang["InsertCell"] = "Vložiť bunku" ; +lang["DeleteCells"] = "Zmazať bunky" ; +lang["MergeCells"] = "Zlúčiť bunky" ; +lang["SplitCell"] = "Rozdeliť bunku" ; +lang["CellProperties"] = "Vlastnosti bunky" ; +lang["TableProperties"] = "Vlastnosti tabuľky" ; +lang["ImageProperties"] = "Vlastnosti obrázku" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Spracovávam XHTML. Moment prosím..." ; +lang["Done"] = "Hotovo" ; +lang["PasteWordConfirm"] = "Text, který práve vkladáte do dokumentu, pochádza pravdepodobne z Wordu.\nChcete vykonať vyčistenie zdojového kódu?" ; +lang["NotCompatiblePaste"] = "Tento príkaz je funkčný iba v IE verzie 5.5 a vyššej. Chcete vložiť text bez vyčistenia?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Zrušit" ; +lang["DlgBtnClose"] = "Zavrieť" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Vložiť obrázok" ; +lang["DlgImgTitleEdit"] = "Zmeniť obrázok" ; +lang["DlgImgBtnUpload"] = "Poslať na server" ; +lang["DlgImgURL"] = "URL" ; +lang["DlgImgUpload"] = "Upload" ; +lang["DlgImgBtnBrowse"] = "Prechádzať server" ; +lang["DlgImgAlt"] = "Alternatívny text" ; +lang["DlgImgWidth"] = "Šírka" ; +lang["DlgImgHeight"] = "Výška" ; +lang["DlgImgLockRatio"] = "Zachovať pomer strán" ; +lang["DlgBtnResetSize"] = "Pôvodná veľkosť" ; +lang["DlgImgBorder"] = "Okraj" ; +lang["DlgImgHSpace"] = "HSpace" ; +lang["DlgImgVSpace"] = "VSpace" ; +lang["DlgImgAlign"] = "Zarovnanie" ; +lang["DlgImgAlignLeft"] = "Left" ; +lang["DlgImgAlignAbsBottom"] = "Abs Bottom" ; +lang["DlgImgAlignAbsMiddle"] = "Abs Middle" ; +lang["DlgImgAlignBaseline"] = "Baseline" ; +lang["DlgImgAlignBottom"] = "Bottom" ; +lang["DlgImgAlignMiddle"] = "Middle" ; +lang["DlgImgAlignRight"] = "Right" ; +lang["DlgImgAlignTextTop"] = "Text Top" ; +lang["DlgImgAlignTop"] = "Top" ; +lang["DlgImgPreview"] = "Náhľad" ; +lang["DlgImgMsgWrongExt"] = "Pre upload sú povolené iba nasledujúce dátové typy:\n\n" + config.ImageUploadAllowedExtensions + "\n\nOperácia zrušená." ; +lang["DlgImgAlertSelect"] = "Prosím vyberte si obrázok pre upload." ; // TODO + +// Link Dialog +lang["DlgLnkWindowTitle"] = "Hypertextový odkaz" ; // TODO +lang["DlgLnkURL"] = "URL" ; +lang["DlgLnkUpload"] = "Upload" ; +lang["DlgLnkTarget"] = "Cieľ" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Nové okno (_blank)" ; +lang["DlgLnkTargetParent"] = "Rodičovské okno (_parent)" ; +lang["DlgLnkTargetSelf"] = "To isté okno (_self)" ; +lang["DlgLnkTargetTop"] = "Hlavné okno (_top)" ; +lang["DlgLnkTitle"] = "Nadpis" ; +lang["DlgLnkBtnUpload"] = "Poslať na server" ; +lang["DlgLnkBtnBrowse"] = "Prechádzať server" ; +lang["DlgLnkMsgWrongExtA"] = "Pre upload sú povolené iba nasledujúce dátové typy:\n\n" + config.LinkUploadAllowedExtensions + "\n\nOperácia zrušená." ; +lang["DlgLnkMsgWrongExtD"] = "Tieto dátové typy nie sú povolené pre upload:\n\n" + config.LinkUploadDeniedExtensions + "\n\nOperácia zrušená." ; + +// Color Dialog +lang["DlgColorTitle"] = "Vyberte farbu" ; +lang["DlgColorBtnClear"] = "Zmazať" ; +lang["DlgColorHighlight"] = "Zvýrazniť" ; +lang["DlgColorSelected"] = "Vybraná" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Vloženie smajlíku" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Vloženie špeciálneho znaku" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Vloženie tabuľky" ; +lang["DlgTableTitleEdit"] = "Editácia tabuľky" ; +lang["DlgTableRows"] = "Riadky" ; +lang["DlgTableColumns"] = "Stĺpce" ; +lang["DlgTableBorder"] = "Hrúbka okraja" ; +lang["DlgTableAlign"] = "Zarovnanie" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "Doľava" ; +lang["DlgTableAlignCenter"] = "Vycentrovať" ; +lang["DlgTableAlignRight"] = "Doprava" ; +lang["DlgTableWidth"] = "Šírka" ; +lang["DlgTableWidthPx"] = "pixelov" ; +lang["DlgTableWidthPc"] = "percent" ; +lang["DlgTableHeight"] = "Výška" ; +lang["DlgTableCellSpace"] = "Medzera medzi bunkami" ; +lang["DlgTableCellPad"] = "Odsadenie v bunke" ; +lang["DlgTableCaption"] = "Titulok" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Vlastnosti bunky" ; +lang["DlgCellWidth"] = "Šírka" ; +lang["DlgCellWidthPx"] = "pixelov" ; +lang["DlgCellWidthPc"] = "percent" ; +lang["DlgCellHeight"] = "Výška" ; +lang["DlgCellWordWrap"] = "Zalomenie textu" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Áno" ; +lang["DlgCellWordWrapNo"] = "Nie" ; +lang["DlgCellHorAlign"] = "Horizontálne zar." ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "Doľava" ; +lang["DlgCellHorAlignCenter"] = "Vycentrovať" ; +lang["DlgCellHorAlignRight"] = "Doprava" ; +lang["DlgCellVerAlign"] = "Vertikálne zar." ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "Top" ; +lang["DlgCellVerAlignMiddle"] = "Middle" ; +lang["DlgCellVerAlignBottom"] = "Bottom" ; +lang["DlgCellVerAlignBaseline"] = "Baseline" ; +lang["DlgCellRowSpan"] = "Presah riadkov" ; +lang["DlgCellCollSpan"] = "Presah stĺpcov" ; +lang["DlgCellBackColor"] = "Farba pozadia" ; +lang["DlgCellBorderColor"] = "Farba okraja" ; +lang["DlgCellBtnSelect"] = "Vybrať..." ; + +// About Dialog +lang["DlgAboutVersion"] = "verzia" ; +lang["DlgAboutLicense"] = "Licensed under the terms of the GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "For further information go to" ; \ No newline at end of file Index: trunk/admin/images/toolbar/tool_new_template.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/icon_question.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_select.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/editor.php =================================================================== diff -u --- trunk/admin/editor/editor.php (revision 0) +++ trunk/admin/editor/editor.php (revision 13) @@ -0,0 +1,175 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; +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."/editor/FCKeditor/fckeditor.php"); + +$style_sheet_global = $adminURL."/include/style.css"; +?> + + + Online Editor + \n"; ?> + + + +
    +Set("section",$section); + $objListToolBar->Set("load_menu_func",""); + $objListToolBar->Set("CheckClass",""); + + $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');", + "document.frm.submit();","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"); + + $title = "Online HTML Editor"; + + $objSections->SetCurrentSection($section); + print $objSections->section_header($envar,NULL,$title); + $TargetForm = $_GET["TargetForm"]; + $TargetField = $_GET["TargetField"]; + echo $objListToolBar->Build(); +?> +
    +Value = '' ; + $oFCKeditor->CreateFCKeditor( 'Content', '100%','80%' ) ; +?> +
    +
    + + + + + + Index: trunk/kernel/admin/include/toolbar/root.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/root.php (revision 0) +++ trunk/kernel/admin/include/toolbar/root.php (revision 13) @@ -0,0 +1,34 @@ + + + + +END; + +?> Index: trunk/admin/icons/icon46_users.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/fckeditor.php =================================================================== diff -u --- trunk/admin/editor/FCKeditor/fckeditor.php (revision 0) +++ trunk/admin/editor/FCKeditor/fckeditor.php (revision 13) @@ -0,0 +1,156 @@ +ToolbarSet = '' ; + $this->Value = '' ; + $this->CanUpload = 'none' ; + $this->CanBrowse = 'none' ; + } + + function CreateFCKeditor($instanceName, $width, $height) + { + echo $this->ReturnFCKeditor($instanceName, $width, $height) ; + } + + function ReturnFCKeditor($instanceName, $width, $height) + { + +// $grstr = htmlentities( $this->Value ) ; + $grstr = htmlspecialchars( $this->Value ) ; + + $strEditor = "" ; + + if ( $this->IsCompatible() ) + { + global $FCKeditorBasePath ; + $sLink = $FCKeditorBasePath . "fckeditor.html?FieldName=$instanceName" ; + + if ( $this->ToolbarSet != '' ) + $sLink = $sLink . "&Toolbar=$this->ToolbarSet" ; + + if ( $this->CanUpload != 'none' ) + { + if ($this->CanUpload == true) + $sLink = $sLink . "&Upload=true" ; + else + $sLink = $sLink . "&Upload=false" ; + } + + if ( $this->CanBrowse != 'none' ) + { + if ($this->CanBrowse == true) + $sLink = $sLink . "&Browse=true" ; + else + $sLink = $sLink . "&Browse=false" ; + } + + $strEditor .= "" ; + $strEditor .= "" ; + } + else + { + $strEditor .= "" ; + } + + return $strEditor; + } + + function IsCompatible() + { + $sAgent = $_SERVER['HTTP_USER_AGENT'] ; + + if ( is_integer( strpos($sAgent, 'MSIE') ) && is_integer( strpos($sAgent, 'Windows') ) && !is_integer( strpos($sAgent, 'Opera') ) ) + { + $iVersion = (int)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 1) ; + return ($iVersion >= 5) ; + } else { + return FALSE ; + } + } +} +?> Index: trunk/themes/default/img/ic_myfriends_big.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/recommend.gif =================================================================== diff -u Binary files differ Index: trunk/admin/include/checkarray.js =================================================================== diff -u --- trunk/admin/include/checkarray.js (revision 0) +++ trunk/admin/include/checkarray.js (revision 13) @@ -0,0 +1,185 @@ +/* CheckArray - used to enable or disable toolbar images if items are checked or unchecked*/ +function CheckArray() +{ /* class properties */ +//alert('test'); + this.paste_ = false; + this.ImageList = new Array(); // 2D array to hold image information + //[x][0] = image ID + //[x][1] = 'on' URL + //[x][2] = 'off' URL + //[x][3] = min. # of items required for 'on' state + this.CheckList = new Array(); // 1D array that contains document IDs for checkboxes + this.CheckValues = new Array();//1D array that contains values for each checkbox + this.itemschecked=0; // number of checked items + this.formname = null; // name of form containing checkboxes + this.envar = null; // envar of the document (from the query_string) + this.uncheckClassName = new Array(); //class to set element class to when unchecking item + /* class methods */ + this.addImage = addImage; //adds an image to the image array + this.selectAll = selectAll; //set all check boxes to a value (true/false) + this.invertItems = invertItems; //invert all checkboxes + this.addCheck = addCheck; //called when an item is checked + this.removeCheck = removeCheck; //called when an item is unchecked + this.setImages = setImages; //used to set images to their on or off state + this.check_submit = check_submit; //called to submit the form + this.itemChecked=itemChecked; //returns true if at least 1 item is checked + this.countChecks=countChecks; //returns the # of checked items + this.getItemList=getItemList; //returns an array of the IDs currently checked +} + +function addImage(Id,onURL,offURL,count) +{ + img = new Array(Id,onURL,offURL,count); + this.ImageList[this.ImageList.length] = img; +} + +function itemChecked() +{ + if(this.itemschecked>0) + { + return true; + } + else + { + return false; + } +} + +function selectAll(value) +{ + checkcount = this.CheckList.length; + for(var i=0; i0) + { + res[res.length] = this.CheckList[i]; + } + } + return res; +} + +function check_submit(location, ActionValue, EnvVar) +{ + if( ActionValue.match(/_del/) || ActionValue.match(/del_/) ) + if (!theMainScript.Confirm(lang_DeleteConfirm)) return; + + f = document.getElementById(this.formname); + if(f) + { + f.Action.value = ActionValue; + f.action = location + '.php?' + this.envar; + if(EnvVar != null) f.action += EnvVar; + //alert(f.name+ ' is submitting to '+ f.action + ' action=' + f.Action.value); + f.submit(); + } + else + alert('Form ' + this.formname + ' was not found.'); +} Index: trunk/kernel/admin/include/toolbar/edituser_permission.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/edituser_permission.php (revision 0) +++ trunk/kernel/admin/include/toolbar/edituser_permission.php (revision 13) @@ -0,0 +1,62 @@ + + + + +END; +?> Index: trunk/tools/explang.php =================================================================== diff -u --- trunk/tools/explang.php (revision 0) +++ trunk/tools/explang.php (revision 13) @@ -0,0 +1,26 @@ +Query_Item("SELECT * FROM ".$objLanguages->SourceTable); +foreach($objLanguages->Items as $l) +{ + fputs($fp,"[".$l->Get("PackName")."|".$l->Get("LocalName")."]\n"); + $sql = "SELECT * FROM ".GetTablePrefix()."Phrase WHERE LanguageId=".$l->Get("LanguageId"); + $rs=$ado->Execute($sql); + while($rs && ! $rs->EOF) + { + $s = " ".$rs->fields["Phrase"]."=".$rs->fields["PhraseType"].",".$rs->fields["Translation"]."\n"; + fputs($fp,$s); + $rs->MoveNext(); + } +} + +fclose($fp); +?> + Index: trunk/admin/images/toolbar/tool_apply_rules_f2.gif =================================================================== diff -u Binary files differ Index: trunk/compat/strripos.php =================================================================== diff -u --- trunk/compat/strripos.php (revision 0) +++ trunk/compat/strripos.php (revision 13) @@ -0,0 +1,83 @@ + | +// | Stephan Schmidt | +// +----------------------------------------------------------------------+ +// +// $Id: strripos.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace strripos() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.strripos + * @author Aidan Lister + * @author Stephan Schmidt + * @version $Revision: 1.1 $ + * @since PHP 5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('strripos')) +{ + function strripos ($haystack, $needle, $offset = null) + { + if (!is_scalar($haystack)) { + trigger_error('strripos() expects parameter 1 to be scalar, ' . gettype($haystack) . ' given', E_USER_WARNING); + return false; + } + + if (!is_scalar($needle)) { + trigger_error('strripos() expects parameter 2 to be scalar, ' . gettype($needle) . ' given', E_USER_WARNING); + return false; + } + + if (!is_null($offset) && !is_numeric($offset)) { + trigger_error('strripos() expects parameter 3 to be long, ' . gettype($offset) . ' given', E_USER_WARNING); + return false; + } + + // Manipulate the string if there is an offset + $fix = 0; + if (!is_null($offset)) + { + // If the offset is larger than the haystack, return + if (abs($offset) >= strlen($haystack)) { + return false; + } + + // Check whether offset is negative or positive + if ($offset > 0) { + $haystack = substr($haystack, $offset, strlen($haystack) - $offset); + // We need to add this to the position of the needle + $fix = $offset; + } + else { + $haystack = substr($haystack, 0, strlen($haystack) + $offset); + } + } + + $segments = explode(strtolower($needle), strtolower($haystack)); + + $last_seg = count($segments) - 1; + $position = strlen($haystack) + $fix - strlen($segments[$last_seg]) - strlen($needle); + + return $position; + } +} +?> \ No newline at end of file Index: trunk/admin/editor/FCKeditor/images/smiley/fun/rastapop.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/ic_category_big.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.print.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/adodb/drivers/adodb-oci805.inc.php =================================================================== diff -u --- trunk/kernel/include/adodb/drivers/adodb-oci805.inc.php (revision 0) +++ trunk/kernel/include/adodb/drivers/adodb-oci805.inc.php (revision 13) @@ -0,0 +1,56 @@ +ADODB_oci8(); + } + + function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$arg3=false,$secs2cache=0) + { + // seems that oracle only supports 1 hint comment in 8i + if (strpos($sql,'/*+') !== false) + $sql = str_replace('/*+ ','/*+FIRST_ROWS ',$sql); + else + $sql = preg_replace('/^[ \t\n]*select/i','SELECT /*+FIRST_ROWS*/',$sql); + + /* + The following is only available from 8.1.5 because order by in inline views not + available before then... + http://www.jlcomp.demon.co.uk/faq/top_sql.html + if ($nrows > 0) { + if ($offset > 0) $nrows += $offset; + $sql = "select * from ($sql) where rownum <= $nrows"; + $nrows = -1; + } + */ + + return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$arg3,$secs2cache); + } +} + +class ADORecordset_oci805 extends ADORecordset_oci8 { + var $databaseType = "oci805"; + function ADORecordset_oci805($id,$mode=false) + { + $this->ADORecordset_oci8($id,$mode); + } +} +?> \ No newline at end of file Index: trunk/admin/icons/icon46_list_validate.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/lang/spanish.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/lang/sv.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/lang/sv.js (revision 0) +++ trunk/admin/editor/FCKeditor/lang/sv.js (revision 13) @@ -0,0 +1,198 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * en.js: English support. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +// Toolbar Items and Context Menu + +lang["Cut"] = "Klipp ut" ; +lang["Copy"] = "Kopiera" ; +lang["Paste"] = "Klistra in" ; +lang["PasteText"] = "Klistra in utan formatering" ; +lang["PasteWord"] = "Klistra in fr�n Word" ; +lang["Find"] = "S�k" ; +lang["SelectAll"] = "Markera allt" ; +lang["RemoveFormat"] = "Ta bort formatering" ; +lang["InsertLink"] = "Infoga/redigera l�nk" ; +lang["RemoveLink"] = "Ta bort l�nk" ; +lang["InsertImage"] = "Infoga/redigera bild" ; +lang["InsertTable"] = "Infoga/redigera tabell" ; +lang["InsertLine"] = "Infoga v�gr�t linje" ; +lang["InsertSpecialChar"] = "Infoga special tecken" ; +lang["InsertSmiley"] = "Infoga smiley" ; +lang["About"] = "Om FCKeditor" ; + +lang["Bold"] = "Fet" ; +lang["Italic"] = "Kursiv" ; +lang["Underline"] = "Understruken" ; +lang["StrikeThrough"] = "Genomstruken" ; +lang["Subscript"] = "Upph�jd" ; +lang["Superscript"] = "Neds�nkt" ; +lang["LeftJustify"] = "V�nsterjustera" ; +lang["CenterJustify"] = "Centrera" ; +lang["RightJustify"] = "H�gerjustera" ; +lang["BlockJustify"] = "Marginaljustera" ; +lang["DecreaseIndent"] = "Minska indrag" ; +lang["IncreaseIndent"] = "�ka indrag" ; +lang["Undo"] = "�ngra" ; +lang["Redo"] = "G�r om" ; +lang["NumberedList"] = "Numrerad lista" ; +lang["BulettedList"] = "Punktlista" ; + +lang["ShowTableBorders"] = "Visa tabell kantlinjer" ; +lang["ShowDetails"] = "Visa formatering" ; + +lang["FontStyle"] = "Stil" ; +lang["FontFormat"] = "Formatmall" ; +lang["Font"] = "Teckensnitt" ; +lang["FontSize"] = "Teckenstorlek" ; +lang["TextColor"] = "Teckenf�rg" ; +lang["BGColor"] = "F�rg�verstrykning" ; +lang["Source"] = "Visa k�lla" ; + +// Context Menu + +lang["EditLink"] = "Redigera l�nk" ; +lang["InsertRow"] = "Infoga rad" ; +lang["DeleteRows"] = "Ta bort rad" ; +lang["InsertColumn"] = "Infoga kolumn" ; +lang["DeleteColumns"] = "Ta bort kolumn" ; +lang["InsertCell"] = "Infoga cell" ; +lang["DeleteCells"] = "Ta bort celler" ; +lang["MergeCells"] = "Sammanfoga celler" ; +lang["SplitCell"] = "Dela cell" ; +lang["CellProperties"] = "Cell egenskaper" ; +lang["TableProperties"] = "Tabell egenskaper" ; +lang["ImageProperties"] = "Bild egenskaper" ; + +// Alerts and Messages + +lang["ProcessingXHTML"] = "Bearbetar XHTML. Var god v�nta..." ; +lang["Done"] = "Klart" ; +lang["PasteWordConfirm"] = "Texten du vill klistra in verkar vara kopierad fr�n Word. Vill du rensa innan du klistar in?" ; +lang["NotCompatiblePaste"] = "Denna �tg�rd �r inte tillg�ngligt f�r Internet Explorer version 5.5 eller h�gre. Vill du klistra in utan att rensa?" ; + +// Dialogs +lang["DlgBtnOK"] = "OK" ; +lang["DlgBtnCancel"] = "Avbryt" ; +lang["DlgBtnClose"] = "St�ng" ; + +// Image Dialog +lang["DlgImgTitleInsert"] = "Infoga bild" ; +lang["DlgImgTitleEdit"] = "Redigera bild" ; +lang["DlgImgBtnUpload"] = "Skicka till server" ; +lang["DlgImgURL"] = "S�kv�g" ; +lang["DlgImgUpload"] = "Ladda upp" ; +lang["DlgImgBtnBrowse"] = "Bl�ddra server" ; +lang["DlgImgAlt"] = "Alternativ text" ; +lang["DlgImgWidth"] = "Bredd" ; +lang["DlgImgHeight"] = "H�jd" ; +lang["DlgImgLockRatio"] = "L�s h�jd/bredd f�rh�llanden" ; +lang["DlgBtnResetSize"] = "�terst�ll storlek" ; +lang["DlgImgBorder"] = "Kantlinje" ; +lang["DlgImgHSpace"] = "Horisontell marginal" ; +lang["DlgImgVSpace"] = "Vertikal marginal" ; +lang["DlgImgAlign"] = "Justering" ; +lang["DlgImgAlignLeft"] = "V�nsterkant" ; +lang["DlgImgAlignAbsBottom"] = "Absolut nederkant" ; +lang["DlgImgAlignAbsMiddle"] = "Absolut mitten" ; +lang["DlgImgAlignBaseline"] = "Baslinje" ; +lang["DlgImgAlignBottom"] = "Nederkant" ; +lang["DlgImgAlignMiddle"] = "Mitten" ; +lang["DlgImgAlignRight"] = "H�gerkant" ; +lang["DlgImgAlignTextTop"] = "Text �verkant" ; +lang["DlgImgAlignTop"] = "�verkant" ; +lang["DlgImgPreview"] = "F�rhandsgranska" ; +lang["DlgImgMsgWrongExt"] = "Tyv�rr, endast dessa filtyper kan laddas upp:\n\n" + config.ImageUploadAllowedExtensions + "\n\nProcessen avbruten." ; +lang["DlgImgAlertSelect"] = "Var god v�lj en bild att lada upp." ; // NEW + + +// Link Dialog +lang["DlgLnkWindowTitle"] = "L�nk" ; // NEW +lang["DlgLnkURL"] = "S�kv�g" ; +lang["DlgLnkUpload"] = "Ladda upp" ; +lang["DlgLnkTarget"] = "M�l" ; +lang["DlgLnkTargetNotSet"] = "" ; +lang["DlgLnkTargetBlank"] = "Nytt f�nster (_blank)" ; +lang["DlgLnkTargetParent"] = "�gar f�nster (_parent)" ; +lang["DlgLnkTargetSelf"] = "Samma f�nster (_self)" ; +lang["DlgLnkTargetTop"] = "�versta f�nstret (_top)" ; +lang["DlgLnkTitle"] = "Rubrik" ; +lang["DlgLnkBtnUpload"] = "Skicka till server" ; +lang["DlgLnkBtnBrowse"] = "Bl�ddra server" ; +lang["DlgLnkMsgWrongExtA"] = "Tyv�rr, endast dessa filtyper kan laddas upp:\n\n" + config.LinkUploadAllowedExtensions + "\n\nProcessen avbruten." ; +lang["DlgLnkMsgWrongExtD"] = "Tyv�rr, endast dessa filtyper kan laddas upp:\n\n" + config.LinkUploadDeniedExtensions + "\n\nProcessen avbruten." ; + +// Color Dialog +lang["DlgColorTitle"] = "V�lj f�rg" ; +lang["DlgColorBtnClear"] = "Ta bort" ; +lang["DlgColorHighlight"] = "Markera" ; +lang["DlgColorSelected"] = "Markerad" ; + +// Smiley Dialog +lang["DlgSmileyTitle"] = "Infoga en smiley" ; + +// Special Character Dialog +lang["DlgSpecialCharTitle"] = "Infoga specialtecken" ; + +// Table Dialog +lang["DlgTableTitleInsert"] = "Infoga tabell" ; +lang["DlgTableTitleEdit"] = "Redigera tabell" ; +lang["DlgTableRows"] = "Rader" ; +lang["DlgTableColumns"] = "Kolumner" ; +lang["DlgTableBorder"] = "Kantstorlek" ; +lang["DlgTableAlign"] = "Justering" ; +lang["DlgTableAlignNotSet"] = "" ; +lang["DlgTableAlignLeft"] = "V�nster" ; +lang["DlgTableAlignCenter"] = "Centrerad" ; +lang["DlgTableAlignRight"] = "H�ger" ; +lang["DlgTableWidth"] = "Bredd" ; +lang["DlgTableWidthPx"] = "pixlar" ; +lang["DlgTableWidthPc"] = "procent" ; +lang["DlgTableHeight"] = "H�jd" ; +lang["DlgTableCellSpace"] = "Cell mellanrum" ; +lang["DlgTableCellPad"] = "Cellmarginal" ; +lang["DlgTableCaption"] = "�verskrift" ; + +// Table Cell Dialog +lang["DlgCellTitle"] = "Cell egenskaper" ; +lang["DlgCellWidth"] = "Bredd" ; +lang["DlgCellWidthPx"] = "pixlar" ; +lang["DlgCellWidthPc"] = "procent" ; +lang["DlgCellHeight"] = "H�jd" ; +lang["DlgCellWordWrap"] = "Radbrytning" ; +lang["DlgCellWordWrapNotSet"] = "" ; +lang["DlgCellWordWrapYes"] = "Ja" ; +lang["DlgCellWordWrapNo"] = "Nej" ; +lang["DlgCellHorAlign"] = "Horisontell justering" ; +lang["DlgCellHorAlignNotSet"] = "" ; +lang["DlgCellHorAlignLeft"] = "V�nster" ; +lang["DlgCellHorAlignCenter"] = "Centrerad" ; +lang["DlgCellHorAlignRight"] = "H�ger" ; +lang["DlgCellVerAlign"] = "Vertikal justering" ; +lang["DlgCellVerAlignNotSet"] = "" ; +lang["DlgCellVerAlignTop"] = "�verkant" ; +lang["DlgCellVerAlignMiddle"] = "Mitten" ; +lang["DlgCellVerAlignBottom"] = "Nederkant" ; +lang["DlgCellVerAlignBaseline"] = "Baslinje" ; +lang["DlgCellRowSpan"] = "Radomf�ng" ; +lang["DlgCellCollSpan"] = "Kolumnomf�ng" ; +lang["DlgCellBackColor"] = "Bakgrundsf�rg" ; +lang["DlgCellBorderColor"] = "Kantf�rg" ; +lang["DlgCellBtnSelect"] = "V�lj.." ; + +// About Dialog +lang["DlgAboutVersion"] = "version" ; +lang["DlgAboutLicense"] = "Licensierad under villkoren av GNU Lesser General Public License" ; +lang["DlgAboutInfo"] = "F�r mer information g� till" ; \ No newline at end of file Index: trunk/themes/default/img/ic_remove.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.insertorderedlist.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/filemanager/browse/sample_php/browse.php =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/browse/sample_php/browse.php (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/browse/sample_php/browse.php (revision 13) @@ -0,0 +1,134 @@ +$file
    \n"; +} + +?> + + + + + Image Browser + + + + + + + + + + + +
    + + + + + + +
    + + + + + + + +
    File :
    +
    +
    +
        + + + + + + + +
    Preview :
    +
    +
    +
    +
    +      +
    +
    + + Index: trunk/admin/editor/FCKeditor/images/smiley/msn/cry_smile.gif =================================================================== diff -u Binary files differ Index: trunk/admin/browse/fw_menu.js =================================================================== diff -u --- trunk/admin/browse/fw_menu.js (revision 0) +++ trunk/admin/browse/fw_menu.js (revision 13) @@ -0,0 +1,716 @@ +/** + * fw_menu 24OCT2000 Version 4.0 + * John Ahlquist, October 2000 + * Copyright (c) 2000 Macromedia, Inc. + * + * based on menu.js + * by gary smith, July 1997 + * Copyright (c) 1997-1999 Netscape Communications Corp. + * + * Netscape grants you a royalty free license to use or modify this + * software provided that this copyright notice appears on all copies. + * This software is provided "AS IS," without a warranty of any kind. + * + * Modified By Intechnic Corporation for use in In-Portal + * 6/28/02 + * + */ +function Menu(label) { + this.version = "990702 [Menu; menu.js]"; + this.type = "Menu"; + this.menuWidth = 0; + this.menuItemHeight = 0; + this.fontSize = 11; + this.fontWeight = "normal"; + this.fontFamily = "helvetica, arial, verdana, helvetica"; + this.fontColor = "#000000"; + this.fontColorHilite = "#000000"; + this.bgColor = "#555555"; + this.menuBorder = 1; + this.menuItemBorder = 0; + this.menuItemBgColor = "#f0f1eb"; + this.menuLiteBgColor = "#ffffff"; + this.menuBorderBgColor = "#777777"; + this.menuHiliteBgColor = "#e0e0da"; + this.menuContainerBgColor = "#cccccc"; + this.imagePath ="images/"; + this.childMenuIcon = "menu_arrow.gif"; + this.items = new Array(); + this.actions = new Array(); + this.types = new Array(); //for check/radio type to show pics + this.childMenus = new Array(); + + this.hideOnMouseOut = true; + + this.addMenuItem = addMenuItem; + this.addMenuSeparator = addMenuSeparator; + this.writeMenus = writeMenus; + this.FW_showMenu = FW_showMenu; + this.onMenuItemOver = onMenuItemOver; + this.onMenuItemAction = onMenuItemAction; + this.hideMenu = hideMenu; + this.hideChildMenu = hideChildMenu; + + if (!window.menus) window.menus = new Array(); + this.label = label || "menuLabel" + window.menus.length; + window.menus[this.label] = this; + window.menus[window.menus.length] = this; + if (!window.activeMenus) window.activeMenus = new Array(); +} + +function addMenuItem(label, action, type) { + this.items[this.items.length] = label; + this.actions[this.actions.length] = action; + if (type == 1) this.types[this.types.length] = this.imagePath+"check_on.gif"; + if (type == 2) this.types[this.types.length] = this.imagePath+"menu_dot.gif"; + if ((type!=1) && (type !=2)) this.types[this.types.length] = ""; +} + +function addMenuSeparator() { + this.items[this.items.length] = "separator"; + this.actions[this.actions.length] = ""; + this.types[this.types.length] = ""; + this.menuItemBorder = 0; +} + +// For NS6. +function FIND(item) { + if (document.all) return(document.all[item]); + if (document.getElementById) return(document.getElementById(item)); + return(false); +} + +function writeMenus(container) { + + if (window.triedToWriteMenus) return; + + if (!container && document.layers) { + window.delayWriteMenus = this.writeMenus; + var timer = setTimeout('delayWriteMenus()', 100); + container = new Layer(100); + clearTimeout(timer); + } else if (document.all || document.hasChildNodes) { + container = FIND("menuContainer"); + if (!container) + { + document.writeln(''); + container = FIND("menuContainer"); + } + else container.innerHTML = ""; + } + + window.fwHideMenuTimer = null; + if (!container) return; window.triedToWriteMenus = true; + container.isContainer = true; + container.menus = new Array(); + for (var i=0; i
  • \n'; + } + i=x; + } + if (document.layers) { + container.clip.width = window.innerWidth; + container.clip.height = window.innerHeight; + container.onmouseout = mouseoutMenu; + container.menuContainerBgColor = this.menuContainerBgColor; + for (var i=0; i0) l.top = body.document.layers[n-1].top + body.document.layers[n-1].clip.height + proto.menuItemBorder; + l.hilite = l.document.layers[1]; + if (proto.bgImageUp) l.background.src = proto.bgImageUp; + l.document.layers[1].isHilite = true; + if (l.document.layers[0].id.indexOf("menuSeparator") != -1) { + l.hilite = null; + l.clip.height -= l.clip.height / 2; + l.document.layers[0].document.bgColor = proto.bgColor; + l.document.layers[0].clip.width = l.clip.width -2; + l.document.layers[0].clip.height = 1; + l.document.layers[1].document.bgColor = proto.menuLiteBgColor; + l.document.layers[1].clip.width = l.clip.width -2; + l.document.layers[1].clip.height = 1; + l.document.layers[1].top = l.document.layers[0].top + 1; + } else if (l.document.layers.length > 2) { + l.childMenu = container.menus[i].items[n].menuLayer; + l.document.layers[2].left = l.clip.width -13; + l.document.layers[2].top = (l.clip.height / 2) -4; + l.document.layers[2].clip.left += 3; + l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu; + } + } + body.document.bgColor = proto.bgColor; + body.clip.width = l.clip.width +proto.menuBorder; + body.clip.height = l.top + l.clip.height +proto.menuBorder; + var focusItem = body.document.layers[n]; + focusItem.clip.width = body.clip.width; + focusItem.Menu = l.Menu; + focusItem.top = -30; + focusItem.captureEvents(Event.MOUSEDOWN); + focusItem.onmousedown = onMenuItemDown; + menu.document.bgColor = proto.menuBorderBgColor; + var lite = menu.document.layers[0]; + lite.document.bgColor = proto.menuLiteBgColor; + lite.clip.width = body.clip.width +1; + lite.clip.height = body.clip.height +1; + menu.clip.width = body.clip.width + (proto.menuBorder * 3) ; + menu.clip.height = body.clip.height + (proto.menuBorder * 3); + } + } else { + if ((document.all) || (container.hasChildNodes)) { + container.innerHTML=content; + } else { + container.document.open("text/html"); + container.document.writeln(content); + container.document.close(); + } + if (!FIND("menuLayer0")) return; + var menuCount = 0; + for (var x=0; x window.innerWidth || + NS4sIH > window.innerHeight || + NS4sIH < window.innerHeight ) + { + window.location.reload(); + } +} + +function onMenuItemOver(e, l) { + FW_clearTimeout(); + l = l || this; + a = window.ActiveMenuItem; + if (document.layers) { + if (a) { + a.document.bgColor = a.saveColor; + if (a.hilite) a.hilite.visibility = "hidden"; + if (a.Menu.bgImageOver) { + a.background.src = a.Menu.bgImageUp; + } + a.focusItem.top = -100; + a.clicked = false; + } + if (l.hilite) { + l.document.bgColor = l.menuHiliteBgColor; + l.zIndex = 100; + l.hilite.visibility = "inherit"; + l.hilite.zIndex = 101; + l.document.layers[1].zIndex = 100; + l.focusItem.zIndex = this.zIndex +2; + } + if (l.Menu.bgImageOver) { + l.background.src = l.Menu.bgImageOver; + } + l.focusItem.top = this.top; + l.Menu.hideChildMenu(l); + } else if (l.style && l.Menu) { + if (a) { + a.style.backgroundColor = a.saveColor; + if (a.hilite) a.hilite.style.visibility = "hidden"; + if (a.Menu.bgImageUp) { + a.style.background = "url(" + a.Menu.bgImageUp +")";; + } + } + if (l.isSeparator) return; + l.style.backgroundColor = l.menuHiliteBgColor; + l.zIndex = 100; // magic IE 4.5 mac happy doohicky. jba + if (l.Menu.bgImageOver) { + l.style.background = "url(" + l.Menu.bgImageOver +")"; + } + if (l.hilite) { + l.style.backgroundColor = l.menuHiliteBgColor; + l.hilite.style.visibility = "inherit"; + } + l.focusItem.style.top = l.focusItem.style.pixelTop = l.style.pixelTop; + l.focusItem.style.zIndex = l.zIndex +1; + l.Menu.hideChildMenu(l); + } else { + return; // not a menu - magic IE 4.5 mac happy doohicky. jba + } + window.ActiveMenuItem = l; +} + +function onMenuItemAction(e, l) { + l = window.ActiveMenuItem; + if (!l) return; + hideActiveMenus(); + //alert(l.action); + if (l.action) { + eval("" + l.action); + } + window.ActiveMenuItem = 0; +} + +function FW_clearTimeout() +{ + if (fwHideMenuTimer) clearTimeout(fwHideMenuTimer); + fwHideMenuTimer = null; + fwDHFlag = false; +} +function FW_startTimeout() +{ + fwStart = new Date(); + fwDHFlag = true; + fwHideMenuTimer = setTimeout("fwDoHide()", 1000); +} + +function fwDoHide() +{ + if (!fwDHFlag) return; + var elapsed = new Date() - fwStart; + if (elapsed < 1000) { + fwHideMenuTimer = setTimeout("fwDoHide()", 1100-elapsed); + return; + } + fwDHFlag = false; + hideActiveMenus(); + window.ActiveMenuItem = 0; +} + +function FW_showMenu(menu, x, y, child) { + if (!window.fwWroteMenu) + { + alert('No Menu Written'); + return; + } + FW_clearTimeout(); + if (document.layers) { + if (menu) { + var l = menu.menuLayer || menu; + l.left = 1; + l.top = 1; + hideActiveMenus(); + if (this.visibility) l = this; + window.ActiveMenu = l; + } else { + var l = child; + } + if (!l) return; + for (var i=0; i 0) + FW_showMenu(null, "relative", "relative", l.layers[i]); + } + if (l.parentLayer) { + if (x != "relative") + l.parentLayer.left = x || window.pageX || 0; + if (l.parentLayer.left + l.clip.width > window.innerWidth) + l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth); + if (y != "relative") + l.parentLayer.top = y || window.pageY || 0; + if (l.parentLayer.isContainer) { + l.Menu.xOffset = window.pageXOffset; + l.Menu.yOffset = window.pageYOffset; + l.parentLayer.clip.width = window.ActiveMenu.clip.width +2; + l.parentLayer.clip.height = window.ActiveMenu.clip.height +2; + if (l.parentLayer.menuContainerBgColor) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor; + } + } + l.visibility = "inherit"; + if (l.Menu) l.Menu.container.visibility = "inherit"; + } else if (FIND("menuItem0")) { + var l = menu.menuLayer || menu; + hideActiveMenus(); + if (typeof(l) == "string") { + l = FIND(l); + } + window.ActiveMenu = l; + var s = l.style; + s.visibility = "inherit"; + if (x != "relative") + s.left = s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0; + if (y != "relative") + s.top = s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0; + l.Menu.xOffset = document.body.scrollLeft; + l.Menu.yOffset = document.body.scrollTop; + } + if (menu) { + window.activeMenus[window.activeMenus.length] = l; + } +} + +function onMenuItemDown(e, l) { + var a = window.ActiveMenuItem; + if (document.layers) { + if (a) { + a.eX = e.pageX; + a.eY = e.pageY; + a.clicked = true; + } + } +} + +function mouseupMenu(e) +{ + hideMenu(true, e); + hideActiveMenus(); + return true; +} + +function mouseoutMenu() +{ + hideMenu(false, false); + return true; +} + + +function hideMenu(mouseup, e) { + var a = window.ActiveMenuItem; + if (a && document.layers) { + a.document.bgColor = a.saveColor; + a.focusItem.top = -30; + if (a.hilite) a.hilite.visibility = "hidden"; + if (mouseup && a.action && a.clicked && window.ActiveMenu) { + if (a.eX <= e.pageX+15 && a.eX >= e.pageX-15 && a.eY <= e.pageY+10 && a.eY >= e.pageY-10) { + setTimeout('window.ActiveMenu.Menu.onMenuItemAction();', 2); + } + } + a.clicked = false; + if (a.Menu.bgImageOver) { + a.background.src = a.Menu.bgImageUp; + } + } else if (window.ActiveMenu && FIND("menuItem0")) { + if (a) { + a.style.backgroundColor = a.saveColor; + if (a.hilite) a.hilite.style.visibility = "hidden"; + if (a.Menu.bgImageUp) { + a.style.background = "url(" + a.Menu.bgImageUp +")";; + } + } + } + if (!mouseup && window.ActiveMenu) { + if (window.ActiveMenu.Menu) { + if (window.ActiveMenu.Menu.hideOnMouseOut) { + FW_startTimeout(); + } + return(true); + } + } + return(true); +} + +function PxToNum(pxStr) +{ // pxStr == 27px, we want 27. + if (pxStr.length > 2) { + n = Number(pxStr.substr(0, pxStr.length-2)); + return(n); + } + return(0); +} + +function hideChildMenu(hcmLayer) { + FW_clearTimeout(); + var l = hcmLayer; + for (var i=0; i < l.Menu.childMenus.length; i++) { + var theLayer = l.Menu.childMenus[i]; + if (document.layers) { + theLayer.visibility = "hidden"; + } else { + theLayer = FIND(theLayer); + theLayer.style.visibility = "hidden"; + } + theLayer.Menu.hideChildMenu(theLayer); + } + + if (l.childMenu) { + var childMenu = l.childMenu; + if (document.layers) { + l.Menu.FW_showMenu(null,null,null,childMenu.layers[0]); + childMenu.zIndex = l.parentLayer.zIndex +1; + childMenu.top = l.top + l.parentLayer.top + l.Menu.menuLayer.top + l.Menu.menuItemHeight/3; + if (childMenu.left + childMenu.clip.width > window.innerWidth) { + childMenu.left = l.parentLayer.left - childMenu.clip.width + l.Menu.menuLayer.left + 15; + l.Menu.container.clip.left -= childMenu.clip.width; + } else { + childMenu.left = l.parentLayer.left + l.parentLayer.clip.width + l.Menu.menuLayer.left -5; + } + var w = childMenu.clip.width+childMenu.left-l.Menu.container.clip.left; + if (w > l.Menu.container.clip.width) + l.Menu.container.clip.width = w; + var h = childMenu.clip.height+childMenu.top-l.Menu.container.clip.top; + if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h; + l.document.layers[1].zIndex = 0; + childMenu.visibility = "inherit"; + } else if (FIND("menuItem0")) { + childMenu = FIND(l.childMenu); + var menuLayer = FIND(l.Menu.menuLayer); + var s = childMenu.style; + s.zIndex = menuLayer.style.zIndex+1; + if (document.all) { // ie case. + s.pixelTop = l.style.pixelTop + menuLayer.style.pixelTop + l.Menu.menuItemHeight/3; + left = s.pixelLeft = (menuLayer.style.pixelWidth) + menuLayer.style.pixelLeft -5; +// alert(left + parseInt(s.width) - document.body.scrollLeft) + if (left + parseInt(s.width) > document.body.scrollLeft + document.body.offsetWidth) + left -= parseInt(s.width) + l.offsetWidth - 5; + s.left = left; + + + } else { // zilla case + var top = PxToNum(l.style.top) + PxToNum(menuLayer.style.top) + l.Menu.menuItemHeight/3; + var left = (PxToNum(menuLayer.style.width)) + PxToNum(menuLayer.style.left) -5; + s.top = top; +// alert() + if (left + parseInt(s.width) > document.body.offsetWidth) + left -= parseInt(s.width) + l.offsetWidth - 5; + s.left = left; + } + childMenu.style.visibility = "inherit"; + } else { + return; + } + window.activeMenus[window.activeMenus.length] = childMenu; + } +} + +function hideActiveMenus() { + if (!window.activeMenus) return; + for (var i=0; i < window.activeMenus.length; i++) { + if (!activeMenus[i]) continue; + if (activeMenus[i].visibility && activeMenus[i].Menu) { + activeMenus[i].visibility = "hidden"; + activeMenus[i].Menu.container.visibility = "hidden"; + activeMenus[i].Menu.container.clip.left = 0; + } else if (activeMenus[i].style) { + var s = activeMenus[i].style; + s.visibility = "hidden"; + s.left = -200; + s.top = -200; + } + } + if (window.ActiveMenuItem) { + hideMenu(false, false); + } + window.activeMenus.length = 0; +} + + Index: trunk/kernel/admin/include/summary/site.php =================================================================== diff -u --- trunk/kernel/admin/include/summary/site.php (revision 0) +++ trunk/kernel/admin/include/summary/site.php (revision 13) @@ -0,0 +1,114 @@ +SourceTable; +$Total = TableCount($table,"",0); +$Active = TableCount($table,"Status=1",0); +$Pending = TableCount($table,"Status=2",0); +$Disabled = TableCount($table,"Status=0",0); +$Pick = TableCount($table,"EditorsPick=1",0); + +$NewVal = adodb_date("U") - ($objConfig->Get("Category_NewDays") * 86400); +$where = "(CreatedOn > ".$NewVal." AND NewItem=".AUTO.") OR NewItem=".ALWAYS; +$New = TableCount($table,$where ,0); + +$ConfigVar = "Category_View"; +$CurrentVal = $objConfig->Get($ConfigVar); +$TabName = "categories"; + +$date_str = adodb_date("F j, Y"); + + +print << +
    +
    + $lang_Search $lang_Catalog +
    +
    +
    + +
    + +
    +
    +
    + + + + + +
    $lang_Categories ($Total)
    +
    + +
    +END; +?> Index: trunk/kernel/include/init.php =================================================================== diff -u --- trunk/kernel/include/init.php (revision 0) +++ trunk/kernel/include/init.php (revision 13) @@ -0,0 +1 @@ +$lid=0; Index: trunk/admin/editor/FCKeditor/dialog/fck_tablecell.html =================================================================== diff -u --- trunk/admin/editor/FCKeditor/dialog/fck_tablecell.html (revision 0) +++ trunk/admin/editor/FCKeditor/dialog/fck_tablecell.html (revision 13) @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Width:  
    Height:  pixels
      
    Word Wrap: 
      
    Horizontal Alignment: 
    Vertival Alignement: 
    +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Rows Span: 
    Columns Span: 
       
    Background Color:  
    Border Color:  
       
    Class Name: +  
    +
    +

    +   +
    + + Index: trunk/admin/images/about.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/ini.php =================================================================== diff -u --- trunk/admin/editor/ini.php (revision 0) +++ trunk/admin/editor/ini.php (revision 13) @@ -0,0 +1,4 @@ + \ No newline at end of file Index: trunk/admin/images/toolbar/tool_preview_theme_f3.gif =================================================================== diff -u Binary files differ Index: trunk/compat/vprintf.php =================================================================== diff -u --- trunk/compat/vprintf.php (revision 0) +++ trunk/compat/vprintf.php (revision 13) @@ -0,0 +1,47 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: vprintf.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace vprintf() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.vprintf + * @author Aidan Lister + * @version $Revision: 1.1 $ + * @since PHP 4.1.0 + * @require PHP 4.0.4 (call_user_func_array) + */ +if (!function_exists('vprintf')) +{ + function vprintf ($format, $args) + { + if (count($args) < 2) { + trigger_error('vprintf() Too few arguments', E_USER_WARNING); + return null; + } + + array_unshift($args, $format); + return call_user_func_array('printf', $args); + } +} +?> \ No newline at end of file Index: trunk/themes/default/my_friends.tpl =================================================================== diff -u --- trunk/themes/default/my_friends.tpl (revision 0) +++ trunk/themes/default/my_friends.tpl (revision 13) @@ -0,0 +1,135 @@ + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + "> > + "> > + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + +

    +
    + + + + + + +
    + + + + + +

    +

    + () +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + +

    ()


    ()



    + + + + +
    + +

    + + + +
    + +


    +
    +

    +
    + + + Index: trunk/themes/default/my_preferences/pref_menubar_element.tpl =================================================================== diff -u --- trunk/themes/default/my_preferences/pref_menubar_element.tpl (revision 0) +++ trunk/themes/default/my_preferences/pref_menubar_element.tpl (revision 13) @@ -0,0 +1,10 @@ + + + + + + +
    ">
    ">
    + + + Index: trunk/themes/default/error_session.tpl =================================================================== diff -u --- trunk/themes/default/error_session.tpl (revision 0) +++ trunk/themes/default/error_session.tpl (revision 13) @@ -0,0 +1,110 @@ + + + + + + + + + + + + +
    + + + + + + + + + + + + + + +
    + +
    + + + + + + + + + +


    + + + + + +

     
    +
     
    + +
    + + + + + + + + +

    +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +



      +
    +

    +
    +




      +
    " /> + " class="button"> +
    +
    + +
    +

    +

    + +
    +
    + + + Index: trunk/admin/editor/FCKeditor/images/toolbar/button.rule.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_search_b_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/halm.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/search_results/search_count.tpl =================================================================== diff -u --- trunk/themes/default/search_results/search_count.tpl (revision 0) +++ trunk/themes/default/search_results/search_count.tpl (revision 13) @@ -0,0 +1,2 @@ +
    + - "> Index: trunk/compat/array_search.php =================================================================== diff -u --- trunk/compat/array_search.php (revision 0) +++ trunk/compat/array_search.php (revision 13) @@ -0,0 +1,54 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: array_search.php,v 1.1 2004-10-26 18:22:16 kostja Exp $ +// + + +/** + * Replace array_search() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/array_search + * @author Aidan Lister + * @author Thiemo M�ttig (http://maettig.com/) + * @version $Revision: 1.1 $ + * @since PHP 4.0.5 + * @require PHP 4.0.1 (trigger_error) + */ +if (!function_exists('array_search')) +{ + function array_search ($needle, $haystack, $strict = false) + { + if (!is_array($haystack)) { + trigger_error("array_search() Wrong datatype for second argument", E_USER_WARNING); + return false; + } + + foreach ($haystack as $key => $value) { + if ($strict ? $value === $needle : $value == $needle) { + return $key; + } + } + + return false; + } +} + +?> \ No newline at end of file Index: trunk/admin/install/general_error.php =================================================================== diff -u --- trunk/admin/install/general_error.php (revision 0) +++ trunk/admin/install/general_error.php (revision 13) @@ -0,0 +1,33 @@ + +  Installation Error

    + + + + + + + +
     Installation Error
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/icons/icon46_list_settings_search.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemicons/icon16_relation_one-way_disabled.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_preview_theme.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_new_template_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_list_users_settings.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/smiley/fun/yopyopyop.gif =================================================================== diff -u Binary files differ Index: trunk/admin/include/toolbar.js =================================================================== diff -u --- trunk/admin/include/toolbar.js (revision 0) +++ trunk/admin/include/toolbar.js (revision 13) @@ -0,0 +1,806 @@ + + + + + + + + + + + + + + + + +END; + +} + +?> \ No newline at end of file Index: trunk/themes/default/recommend/error.tpl =================================================================== diff -u --- trunk/themes/default/recommend/error.tpl (revision 0) +++ trunk/themes/default/recommend/error.tpl (revision 13) @@ -0,0 +1,113 @@ + + + +
    + + + + + + +


    +
    + + + + +
    +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + + +

    +
    + + " /> + + + + + + + + + + + + + + + + + + + + + +



      +
    +


    + +




    +
    + " class="button"> +
    +
    + + +

    +
    + + + Index: trunk/admin/editor/FCKeditor/images/toolbar/button.outdent.gif =================================================================== diff -u Binary files differ Index: trunk/admin/editor/FCKeditor/images/toolbar/button.textcolor.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon46_search_log.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/images/3493_1.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_search_reset.gif =================================================================== diff -u Binary files differ Index: trunk/admin/users/user_list.php =================================================================== diff -u --- trunk/admin/users/user_list.php (revision 0) +++ trunk/admin/users/user_list.php (revision 13) @@ -0,0 +1,363 @@ +Logout(); + header("Location: ".$adminURL."/login.php"); + die(); + //require_once($pathtoroot."admin/login.php"); +} + +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); + +$localURL=$rootURL."kernel/"; +$adminURL = $rootURL.$admin; +$imagesURL = $adminURL."/images"; + +$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; + +/* -------------------------------------- Section configuration ------------------------------------------- */ +$section = 'in-portal:user_list'; +$envar = "env=" . BuildEnv(); + +$SortFieldVar = "User_SortField"; +$SortOrderVar = "User_SortOrder"; +$DefaultSortField = "Login"; +$PerPageVar = "Perpage_User"; +$CurrentPageVar = "Page_UserList"; +$CurrentFilterVar = "User_View"; + +$ListForm = "userlistform"; +$CheckClass = "UserChecks"; + +/* ------------------------------------- Configure the toolbar ------------------------------------------- */ +$objListToolBar = new clsToolBar(); + +$objListToolBar->Set("section",$section); +$objListToolBar->Set("load_menu_func",""); +$objListToolBar->Set("CheckClass",$CheckClass); +$objListToolBar->Set("CheckForm",$ListForm); + +$listImages = array(); + //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick + +$objListToolBar->Add("new_user", "la_ToolTip_New_User",$adminURL."/users/adduser.php?$envar&new=1","swap('new_user','toolbar/tool_new_user_f2.gif');", + "swap('new_user', 'toolbar/tool_new_user.gif');",""); + +$objListToolBar->Add("user_edit","la_ToolTip_Edit","#", "if (UserChecks.itemChecked()) swap('user_edit','toolbar/tool_edit_f2.gif');", + "if (UserChecks.itemChecked()) swap('user_edit', 'toolbar/tool_edit.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('adduser', '');", + "tool_edit.gif",TRUE,TRUE); +$listImages[] = "UserChecks.addImage('user_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; + +$objListToolBar->Add("user_del","la_ToolTip_Delete","#", "if (UserChecks.itemChecked()) swap('user_del','toolbar/tool_delete_f2.gif');", + "if (UserChecks.itemChecked()) swap('user_del', 'toolbar/tool_delete.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('user_list', 'm_delete_user');", + "tool_delete.gif",FALSE,TRUE); +$listImages[] = "UserChecks.addImage('user_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; + +$objListToolBar->Add("user_primary","la_ToolTip_PrimaryGroup","#", "if (UserChecks.itemChecked()) swap('user_primary','toolbar/tool_primary_user_group_f2.gif');", + "if (UserChecks.itemChecked()) swap('user_primary', 'toolbar/tool_primary_user_group.gif');","if (UserChecks.itemChecked()) SelectPrimaryGroup();", + "tool_primary_user_group.gif",FALSE,TRUE); +$listImages[] = "UserChecks.addImage('user_primary','$imagesURL/toolbar/tool_primary_user_group.gif','$imagesURL/toolbar/tool_primary_user_group_f3.gif',1); "; + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("user_app","la_ToolTip_Approve","#","if (UserChecks.itemChecked()) swap('user_app','toolbar/tool_approve_f2.gif');", + "if (UserChecks.itemChecked()) swap('user_app', 'toolbar/tool_approve.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('user_list', 'm_approve_user');", + "tool_approve.gif",FALSE,TRUE); +$listImages[] = "UserChecks.addImage('user_app','$imagesURL/toolbar/tool_approve.gif','$imagesURL/toolbar/tool_approve_f3.gif',1); "; + +$objListToolBar->Add("user_deny","la_ToolTip_Deny","#","if (UserChecks.itemChecked()) swap('user_deny','toolbar/tool_decline_f2.gif');", + "if (UserChecks.itemChecked()) swap('user_deny', 'toolbar/tool_decline.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('user_list', 'm_deny_user');", + "tool_deny.gif",FALSE,TRUE); +$listImages[] = "UserChecks.addImage('user_deny','$imagesURL/toolbar/tool_decline.gif','$imagesURL/toolbar/tool_decline_f3.gif',1); "; + +$objListToolBar->Add("user_ban","la_ToolTip_Ban","#","if (UserChecks.itemChecked()) swap('user_ban','toolbar/tool_ban_user_f2.gif');", + "if (UserChecks.itemChecked()) swap('user_ban', 'toolbar/tool_ban_user.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('banuser', '');", + "tool_deny.gif",FALSE,TRUE); +$listImages[] = "UserChecks.addImage('user_ban','$imagesURL/toolbar/tool_ban_user.gif','$imagesURL/toolbar/tool_ban_user_f3.gif',1); "; + +$objListToolBar->Add("divider"); + +$objListToolBar->Add("user_mail","la_ToolTip_SendMail","#", "if (UserChecks.itemChecked()) swap('user_mail','toolbar/tool_e-mail_f2.gif');", + "if (UserChecks.itemChecked()) swap('user_mail', 'toolbar/tool_e-mail.gif');","if (UserChecks.itemChecked()) openEmailPopup('','sendmail',$CheckClass);", + "tool_e-mail.gif",FALSE,TRUE); + +$listImages[] = "UserChecks.addImage('user_mail','$imagesURL/toolbar/tool_e-mail.gif','$imagesURL/toolbar/tool_e-mail_f3.gif',1); "; + +$objListToolBar->Add("user_print", "la_ToolTip_Print","#","swap('user_print','toolbar/tool_print_f2.gif');", + "swap('user_print', 'toolbar/tool_print.gif');","window.print();","tool_print.gif"); + +$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); + +/* ----------------------------------------- Set the View Filter ---------------------------------------- */ + +/* bit place holders for category view menu */ +$Bit_Pending=4; +$Bit_Disabled=2; +$Bit_Valid=1; +$Bit_All = 7; + +$FilterLabels = array(); + +$FilterLabels[0] = admin_language("la_Text_Enabled"); +$FilterLabels[1] = admin_language("la_Text_Disabled"); +$FilterLabels[2] = admin_language("la_Text_Pending"); + +/* determine current view menu settings */ +$UserView = $objConfig->Get("User_View"); + +if(!is_numeric($UserView)) +{ + $UserView = $Bit_All; //Set all bits ON + $UserFilter = ""; +} + if($UserView & $Bit_Valid) + $Status[] = 1; + + if($UserView & $Bit_Disabled) + $Status[] = 0; + + if($UserView & $Bit_Pending) + $Status[] = 2; + + if(count($Status)>0) + { + $UserFilter = "Status IN (".implode(",",$Status).")"; + } + else + $UserFilter = "Status = -1"; + +$order = $objConfig->Get($SortOrderVar); +$SearchWords = $objSession->GetVariable("UserSearchWord"); + +$where = "(ug.PrimaryGroup!=0 OR ug.PrimaryGroup IS NULL)"; +if(strlen($SearchWords)) +{ + $SearchWhere = $objUsers->AdminSearchWhereClause($SearchWords); +} + +if(strlen($SearchWhere)) +{ + $where .= " AND (".$SearchWhere.")"; +} + +if(strlen($UserFilter)) + $where .= " AND (".$UserFilter.")"; + + +/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/ + +$sql = "SELECT u.*,g.Name as GroupName,ELT(u.status+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ','".admin_language("la_Text_Pending")."') as UserStatus, "; +$sql .="FROM_UNIXTIME(u.CreatedOn,'%m-%d-%Y') as DateCreated FROM ".GetTablePrefix()."PortalUser as u "; +$sql .="LEFT JOIN ".GetTablePrefix()."UserGroup as ug ON (u.PortalUserId=ug.PortalUserId) "; +$sql .="LEFT JOIN ".GetTablePrefix()."PortalGroup as g ON (ug.GroupId=g.GroupId) WHERE $where"; + +if(!strlen($objConfig->Get($SortFieldVar))) + $objConfig->Set($SortFieldVar,$DefaultSortField); + +$orderBy = trim($objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar)); +if(strlen($orderBy)) + $sql .=" ORDER BY ".$orderBy; + +if((int)$_GET["resetpage"]) +{ + $page = 1; + $objSession->SetVariable($CurrentPageVar,1); +} +else +{ + if((int)$_GET["lpn"]) + { + $objSession->SetVariable($CurrentPageVar,(int)$_GET["lpn"]); + $page = (int)$_GET["lpn"]; + } + else + { + $page = $objSession->GetVariable($CurrentPageVar); + } +} +$sql .=" ".GetLimitSQL($page,(int)$objConfig->Get($PerPageVar)); + +if($objSession->HasSystemPermission("DEBUG.LIST")) + echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; +//echo "SQL: $sql
    "; +$objUsers->Query_Item($sql); + +$itemcount = QueryCount($sql); +//$title = prompt_language("la_Text_ShowingUsers")." (".$objUsers->NumItems().")"; +//removed by PSK 2004-10-21 +if(strlen($SearchWords)) +{ + $title = prompt_language("la_Text_Search_Results")." (".$itemcount.")"; + } +else + $title = prompt_language("la_Text_ShowingUsers")." (".$itemcount.")"; + + +/* ---------------------------------------- Configure the list view ---------------------------------------- */ +$objListView = new clsListView($objListToolBar,$objUsers); +$objListView->IdField = "ResourceId"; +$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl"; + +$objListView->ColumnHeaders->Add("Login",admin_language("la_prompt_Username"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"Login"); +$objListView->ColumnHeaders->Add("LastName",admin_language("la_prompt_Last_Name"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"LastName"); +$objListView->ColumnHeaders->Add("FirstName",admin_language("la_prompt_First_Name"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"FirstName"); +$objListView->ColumnHeaders->Add("Email",admin_language("la_prompt_Email"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"Email"); +$objListView->ColumnHeaders->Add("GroupName",admin_language("la_prompt_PrimaryGroup"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"GroupName"); +$objListView->ColumnHeaders->Add("DateCreated",admin_language("la_prompt_CreatedOn"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"u.CreatedOn"); + +$objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar)); + +$objListView->PrintToolBar = FALSE; +$objListView->SearchBar = TRUE; +$objListView->SearchKeywords = $SearchWords; +$objListView->SearchAction="m_user_search"; +$objListView->CurrentPageVar = $CurrentPageVar; +$objListView->PerPageVar = $PerPageVar; +$objListView->CheckboxName = "itemlist[]"; +$objListView->TotalItemCount = $itemcount; + + $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, + $CurrentFilterVar,$UserView,$Bit_All); + + foreach($FilterLabels as $Bit=>$Label) + { + $objListView->AddViewMenuFilter($Label,$Bit); + } + +for($i=0;$iItems);$i++) +{ + $u =& $objUsers->GetItemRefByIndex($i); + $objListView->RowIcons[] = $u->StatusIcon(); +} +$objListToolBar->AddToInitScript("fwLoadMenus();"); + +$h = "\n\n\n"; +int_header($objListToolBar,NULL, $title,NULL,$h); +?> +
    +PrintList(); +?> + +
    +
    + + +
    + +
    + + + + +
    + + +
    + + +
    + + + + + + Index: trunk/admin/backup/backup2.php =================================================================== diff -u --- trunk/admin/backup/backup2.php (revision 0) +++ trunk/admin/backup/backup2.php (revision 13) @@ -0,0 +1,328 @@ +Get("Site_Path"); +$admin = $objConfig->Get("AdminDirectory"); +if(!strlen($admin)) + $admin = "admin"; +$adminURL = $rootURL.$admin; + +$localURL=$rootURL."kernel/"; +$imagesURL = $rootURL."admin/images"; + +//admin only util +$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"); + + +global $tables; +unset($tables); + +//$m = GetModuleArray(); +//foreach($m as $key => $value) +//{ +// $mod = $pathtoroot . $value . "admin/include/backup.php"; +// require_once($mod); +//} + +$section = "in-portal:backup_toolbar"; +$envar = "env=" . BuildEnv(); +$sec = $objSections->GetSection($section); + +$title = admin_language("la_performing_backup")." - ".admin_language("la_Step")." 2"; + +int_header(NULL,NULL,$title); + +/*******************************BEGINNING*********************************/ + +$conn = GetAdodbConnection(); + + +$tables = $conn->MetaTables(); // array_keys($tables); +//echo "
    "; print_r($tables); echo "
    "; +$prefix = GetTablePrefix(); +//if(strlen($prefix)) +//{ + for($x=0;$xGetVariable("backup_filename"); +$filepath=$objConfig->Get("Backup_Path"); + +$filename = $filepath."/".$filename; +$PageTitle = admin_language("la_text_Backup_in_progress"); +$CancelURL = $rootURL ."admin/backup/backup1.php?".$envar ; + +if ($success==1) +{ + finish(); +} + + +$CurrentTable = $TableNames[$TableIndex]; +$NumItems = TableCount($CurrentTable,"",0); + +$caption = admin_language("la_Text_backing_up")." ".$CurrentTable." (".$NumItems." ".admin_language("la_Text_Rows").") "; +stats($caption,$SqlStart,$NumItems); +$out = array(); + +$caption = admin_language("la_Text_Table")." ".$TableIndex." ".admin_language("lu_of")." ".$num_tables." "; +stats($caption,$TableIndex,$num_tables); + +if($SqlStart==0 && $TableIndex==0) +{ + for($x=0;$xExecute($sql); + while ($r && !$r->EOF) { + $version = $r->fields['Version']; + fwrite($fp, "# ".$r->fields['Name']." Version: $version;\n"); + $r->MoveNext(); + } + fwrite($fp, "#------------------------------------------\n\n"); +} + +if($fp) +{ + fwrite($fp,implode("\n",$out)); + fwrite($fp,"\n"); + fclose($fp); +} +else +{ + echo "Error opening $filename
    \n"; + exit(); +} + +$SqlStart += $RowCount; +if($SqlStart>=$NumItems) +{ + $SqlStart = 0; + $TableIndex++; +} + +if($TableIndex < $num_tables) +{ + $url = $adminURL."/backup/backup2.php?".$envar."&TableIndex=$TableIndex&Start=$SqlStart"; +} +else +{ + $url = $adminURL."/backup/backup3.php?".$envar; +} + +reload($url); + +echo "\n"; + +//extracts the rows of data from tables using limits +function insert_data($table, $start, $limit, $mywhere) +{ + global $out; + + $conn = GetAdodbConnection(); + + if ($mywhere !="") + { + $whereclause= " WHERE ".$mywhere." "; + } + else + { + $whereclause = ""; + } + + $rs = $conn->Execute("SELECT * from $table $whereclause LIMIT $start, $limit"); + $prefix = GetTablePrefix(); + $rowcount = 0; + while($rs && !$rs->EOF) + { + $temp=$conn->GetInsertSQL($rs,$rs->fields); + $temp=ereg_replace("\n","\\n", $temp); + $temp=ereg_replace("\r","\\r", $temp); + if(strlen($prefix)) + { + $temp = str_replace("INSERT INTO $prefix","INSERT INTO ",$temp); + } + $out[] = $temp; + $rs->MoveNext(); + $rowcount++; + } + + return $rowcount; +} + +function GetTableCreate($conn, $table, $crlf="\n") +{ + $schema_create = 'DROP TABLE ' . $table . ';' . $crlf; + $schema_create .="# --------------------------------------------------------".$crlf; + $conn->Execute("SET SQL_QUOTE_SHOW_CREATE = 0"); + $result = $conn->Execute("SHOW CREATE TABLE $table"); + if($result && !$result->EOF) + { + $tmpres = $result->fields; // mysql_fetch_array($result); + $pos = strpos($tmpres["Create Table"], ' ('); + $pos2 = strpos($tmpres["Create Table"], '('); + if ($pos2 != $pos + 1) + { + $pos = $pos2; + $tmpres["Create Table"] = str_replace(",", ",\n ", $tmpres["Create Table"]); + } + + $tmpres["Create Table"] = substr($tmpres["Create Table"], 0, 13) + . (($use_backquotes) ? $tmpres["Table"] : $tmpres["Table"]) + . substr($tmpres["Create Table"], $pos); + $tmpres["Create Table"] = str_replace("\n", $crlf, $tmpres["Create Table"]); + if (preg_match_all('((,\r?\n[\s]*(CONSTRAINT|FOREIGN[\s]*KEY)[^\r\n,]+)+)', $tmpres["Create Table"], $regs)) { + if (!isset($sql_constraints)) { + if (isset($GLOBALS['no_constraints_comments'])) { + $sql_constraints = ''; + } else { + $sql_constraints = $crlf . '#' . $crlf + . '# ' . $GLOBALS['strConstraintsForDumped'] . $crlf + . '#' . $crlf; + } + } + if (!isset($GLOBALS['no_constraints_comments'])) { + $sql_constraints .= $crlf .'#' . $crlf .'# ' . $GLOBALS['strConstraintsForTable'] . ' ' . $table . $crlf . '#' . $crlf; + } + $sql_constraints .= 'ALTER TABLE $table $crlf ' + . preg_replace('/(,\r?\n|^)([\s]*)(CONSTRAINT|FOREIGN[\s]*KEY)/', '\1\2ADD \3', substr($regs[0][0], 2)) + . ";\n"; + $tmpres["Create Table"] = preg_replace('((,\r?\n[\s]*(CONSTRAINT|FOREIGN[\s]*KEY)[^\r\n,]+)+)', '', $tmpres["Create Table"]); + } + $schema_create .= $tmpres["Create Table"]; + } + unset($rs); + if(strlen($schema_create)) + { + $schema_create = str_replace("DROP TABLE ".GetTablePrefix(),"DROP TABLE ",$schema_create); + $schema_create = str_replace("CREATE TABLE ".GetTablePrefix(),"CREATE TABLE ",$schema_create); + while(strlen($schema_create && substr($schema_create,-1)!=")")) + { + $schema_create = substr($schema_create,0,-1); + } + } + $schema_create .= "\n# --------------------------------------------------------\n"; + return $schema_create; +} + +function stats($caption,$myprogress,$totalnum) +{ + global $rootURL, $CancelURL,$PageTitle; + + if($totalnum>0) + { + $pct=round(($myprogress/ $totalnum)*100); + } + else + $pct = 100; + $o .=""; + + echo "\n"; + $o .= int_subsection_title_ret($caption."-".$pct."%"); + $o .= "

    "; + $o .= " "; + $o .=" "; + $comp_pct = 100-$pct; + $o .= " "; + $o .= "
     
    "; + $o .= "
    "; + echo $o."\n"; + echo "
    "; + +} +function reload($url) +{ + print ""; + //echo "Next "; +} + +?> \ No newline at end of file Index: trunk/kernel/admin/include/toolbar/addpermission.php =================================================================== diff -u --- trunk/kernel/admin/include/toolbar/addpermission.php (revision 0) +++ trunk/kernel/admin/include/toolbar/addpermission.php (revision 13) @@ -0,0 +1,45 @@ + + + + + +END; +?> Index: trunk/admin/images/toolbar/tool_approve_f2.gif =================================================================== diff -u Binary files differ Index: trunk/admin/install/reinstall.php =================================================================== diff -u --- trunk/admin/install/reinstall.php (revision 0) +++ trunk/admin/install/reinstall.php (revision 13) @@ -0,0 +1,75 @@ + +  Licence Verification

    + + + + + + + +
     Step 1 - Licence Verification
    + + +
    + + + + + \ No newline at end of file Index: trunk/admin/include/style.css =================================================================== diff -u --- trunk/admin/include/style.css (revision 0) +++ trunk/admin/include/style.css (revision 13) @@ -0,0 +1,425 @@ +.CURRENT_PAGE {font-size:12px; background-color: #C4C4C4; font-family: verdana; font-weight:bold; padding-left:1px; padding-right:1px} +.NAV_URL {font-size:12px; color: #1F569A; font-family: verdana; font-weight:bold; } +.NAV_ARROW {font-size:12px; color: #1F569A; font-family: verdana; font-weight:normal; padding-left:3px; padding-right:3px} +.NAV_CURRENT_ITEM {font-size:12px; color:#666666; font-family: verdana; font-weight:normal; font-weight:bold; } +.priority {color: #ff0000; padding-left:1px; padding-right:1px; font-size:11px; } + +.validation_error { + FONT-WEIGHT: bold; + FONT-SIZE: 12px; + FONT-FAMILY: verdana, arial; + TEXT-DECORATION: none; + color: red; +} + +.checksection { + BORDER-RIGHT: 1px; BORDER-TOP: 1px; LEFT: 0px; VISIBILITY: hidden; BORDER-LEFT: 1px; BORDER-BOTTOM: 1px; POSITION: absolute; TOP: 0px; BACKGROUND-COLOR: #acacac +} +.text { + FONT-WEIGHT: normal; FONT-SIZE: 12px; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.small { + FONT-SIZE: 9px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif +} +.tab { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: verdana, arial, helvetica; TEXT-DECORATION: none +} +.tab2 { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #ffffff; FONT-FAMILY: verdana, arial, helvetica; TEXT-DECORATION: none +} +.tab2:hover { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: verdana, arial, helvetica; TEXT-DECORATION: none +} +.tab:hover { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: verdana, arial, helvetica; TEXT-DECORATION: none +} +.tab_border { + BORDER-RIGHT: #000000 0px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 0px solid; BORDER-BOTTOM: #000000 0px solid +} +.table_tab { + FONT-WEIGHT: bold; FONT-SIZE: 20px; COLOR: #ffffff; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #666666; TEXT-DECORATION: none +} +.button { + FONT-WEIGHT: normal; FONT-SIZE: 12px; BACKGROUND: url(../images/button_back.gif) #f9eeae repeat-x; COLOR: black; FONT-FAMILY: arial, verdana; TEXT-DECORATION: none +} +.button1 { + FONT-SIZE: 9px; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #a3d799 +} +.button2 { + FONT-SIZE: 9px; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #fe8b7e +} +.button3 { + FONT-SIZE: 9px; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #999999 +} +.buttonsmall { + FONT-SIZE: 9px; CURSOR: hand; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #f9eeae +} +.toolbar { + BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 0px solid; FONT-SIZE: 10pt; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #f0f1eb +} +.actionborder_full { + BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid; FONT-SIZE: 10pt; BORDER-LEFT: #999999 1px solid; BORDER-BOTTOM: #999999 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serif +} +.actiontitle { + FONT-SIZE: 8pt; COLOR: #ffffff; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #999999 +} +.action_link { + FONT-SIZE: 10px; COLOR: black; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif +} +.action_link:hover { + FONT-SIZE: 10px; COLOR: #009ff0; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif +} +.pagenav { + BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 0px solid; FONT-SIZE: 10pt; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #e0e0da +} +.navbar { + FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #006699; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none +} +.navbar:hover { + FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #009ff0; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none +} +.navbar_selected { + FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #ffffff; FONT-FAMILY: verdana, arial, sans-serif; BACKGROUND-COLOR: #006699; TEXT-DECORATION: none +} +.tablenav { + FONT-WEIGHT: bold; + FONT-SIZE: 14px; + COLOR: white; + FONT-FAMILY: verdana, arial; + BACKGROUND-COLOR: #73c4f5; + TEXT-DECORATION: none; +} +.tablenav_link { + FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: white; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.tablenav_link:hover { + FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #ffcc00; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.selection { + BACKGROUND-COLOR: #c6d6ef +} +.error { + FONT-WEIGHT: bold; FONT-SIZE: 9pt; COLOR: #ff0000; FONT-FAMILY: Arial, Helvetica, sans-serif +} +.error2 { + FONT-WEIGHT: bold; FONT-SIZE: 7pt; COLOR: #ff0000; FONT-FAMILY: Arial, Helvetica, sans-serif +} +.disabled_text { + FONT-WEIGHT: bold; FONT-SIZE: 9pt; COLOR: #CCCCCC; FONT-FAMILY: Arial, Helvetica, sans-serif +} + +.marg { + MARGIN: 5px +} +.table_header_text { + MARGIN-BOTTOM: 2px; MARGIN-LEFT: 5px +} +.table_text { + PADDING-RIGHT: 8px; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; PADDING-TOP: 8px +} +.divider { + BACKGROUND-COLOR: #999999 +} +.divider_tab { + BACKGROUND-COLOR: #999999 +} +.admintitle, .admintitle-white { + FONT-WEIGHT: bold; FONT-SIZE: 20px; COLOR: #009ff0; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.admintitle-white { + color: #fff +} +.tabletitle { + FONT-WEIGHT: bold; FONT-SIZE: 17px; COLOR: white; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #73c4f5; TEXT-DECORATION: none +} +.subsectiontitle { + FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: white; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #999999; TEXT-DECORATION: none; height: 24px +} +.subsectiontitle:hover { + FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #ffcc00; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #999999; TEXT-DECORATION: none +} +.columntitle { + FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: white; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #999999; TEXT-DECORATION: none +} +.columntitle:hover { + FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #ffcc00; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #999999; TEXT-DECORATION: none +} +.columntitle_small { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: white; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #999999; TEXT-DECORATION: none +} +.columntitle_small:hover { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #ffcc00; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #999999; TEXT-DECORATION: none +} +.permissions1 { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #bb0000; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions1:hover { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #bb0000; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions2 { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #c8601a; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions2:hover { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #c8601a; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions3 { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #ea8c00; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions3:hover { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #ea8c00; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions4 { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #e6b800; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions4:hover { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #e6b800; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions5 { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #92bc2e; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions5:hover { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #92bc2e; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions6 { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #339900; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions6:hover { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #339900; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.permissions1_cell { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #bb0000; TEXT-DECORATION: none +} +.permissions2_cell { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #c8601a; TEXT-DECORATION: none +} +.permissions3_cell { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #ea8c00; TEXT-DECORATION: none +} +.permissions4_cell { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #e6b800; TEXT-DECORATION: none +} +.permissions5_cell { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #92bc2e; TEXT-DECORATION: none +} +.permissions6_cell { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: black; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #339900; TEXT-DECORATION: none +} +.table_color1 { + FONT-WEIGHT: normal; FONT-SIZE: 14px; COLOR: black; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #f6f6f6; TEXT-DECORATION: none +} +.table_color2 { + FONT-WEIGHT: normal; FONT-SIZE: 14px; COLOR: black; FONT-FAMILY: verdana, arial; BACKGROUND-COLOR: #ebebeb; TEXT-DECORATION: none +} +.head_version { + PADDING-RIGHT: 5px; FONT-WEIGHT: normal; FONT-SIZE: 10px; COLOR: white; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.form_note { + FONT-WEIGHT: normal; FONT-SIZE: 10px; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.tree_head { + FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: white; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.tree_head_credits { + FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: white; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +.tree_head_credits:hover { + FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: white; FONT-FAMILY: verdana, arial; TEXT-DECORATION: none +} +H1.selector { + FONT-WEIGHT: bold; FONT-SIZE: 18pt; FONT-FAMILY: Arial +} +BODY { + SCROLLBAR-FACE-COLOR: #009ffd; FONT-SIZE: 12px; SCROLLBAR-HIGHLIGHT-COLOR: #009ffd; SCROLLBAR-SHADOW-COLOR: #009ffd; COLOR: #000000; SCROLLBAR-3DLIGHT-COLOR: #333333; SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-TRACK-COLOR: #88d2f8; FONT-FAMILY: Verdana, Arial, Helvetica, Sans-serif; SCROLLBAR-DARKSHADOW-COLOR: #333333; + OVERFLOW-X: auto; OVERFLOW-Y: auto; +} +TD { + FONT-SIZE: 10pt; FONT-FAMILY: verdana,helvetica; TEXT-DECORATION: none +} +.tableborder { + BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 0px solid; FONT-SIZE: 10pt; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serif +} +.tableborder_full { + BORDER-RIGHT: #000000 1px solid; + BORDER-TOP: #000000 1px solid; + FONT-SIZE: 10pt; + BORDER-LEFT: #000000 1px solid; + BORDER-BOTTOM: #000000 1px solid; + FONT-FAMILY: Arial, Helvetica, sans-serif; + background-image: url(../images/tab_middle.gif); + background-repeat: repeat-x; +} + +.header_left_bg { + background-image: url(../images/tabnav_left.jpg); + background-repeat: no-repeat; +} + +.tableborder_full_a { + BORDER-RIGHT: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serif +} + + +A { + COLOR: #006699; TEXT-DECORATION: none +} +A:hover { + COLOR: #009ff0; TEXT-DECORATION: none +} +.control_link {font-size:12px; color: #1F569A; font-family: verdana; font-weight:bold; } + +.control_link:hover { + FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #009ff0; FONT-FAMILY: verdana, arial +} +.header_link { + FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #003399; FONT-FAMILY: verdana, arial +} +.header_link:hover { + FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #009ff0; FONT-FAMILY: verdana, arial +} +.tree { + FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: helvetica, arial, verdana, helvetica; TEXT-DECORATION: none +} +.cat { + FONT-WEIGHT: bold; FONT-SIZE: 9pt; COLOR: #003399; FONT-FAMILY: arial, helvetica, sans-serif +} +.cat:hover { + FONT-WEIGHT: bold; FONT-SIZE: 9pt; COLOR: #009ff0; FONT-FAMILY: arial, helvetica, sans-serif +} +.catsub { + FONT-SIZE: 8pt; COLOR: #000090; FONT-FAMILY: arial, helvetica, sans-serif +} +.catsub:hover { + FONT-SIZE: 8pt; COLOR: #9d9ddc; FONT-FAMILY: arial, helvetica, sans-serif +} +.cat_no { + FONT-SIZE: 10px; COLOR: #707070; FONT-FAMILY: arial, verdana, sans-serif +} +.cat_desc { + FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: arial,verdana,sans-serif +} +.cat_new { + FONT-SIZE: 12px; VERTICAL-ALIGN: super; COLOR: blue; FONT-FAMILY: arial, verdana, sans-serif +} +.cat_pick { + FONT-SIZE: 12px; VERTICAL-ALIGN: super; COLOR: #009900; FONT-FAMILY: arial, helvetica, sans-serif +} +.cats_stats { + FONT-SIZE: 11px; COLOR: #707070; FONT-FAMILY: arial,verdana,sans-serif; +} + +.cat_detail { + FONT-SIZE: 8pt; COLOR: #707070; FONT-FAMILY: arial,verdana,sans-serif +} +.cat_fullpath { + FONT-SIZE: 8pt; COLOR: #707070; FONT-FAMILY: arial,verdana,sans-serif +} + +.action1 { + FONT-SIZE: 12px; COLOR: #006600; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action1:link { + FONT-SIZE: 12px; COLOR: #006600; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action1:unknown { + FONT-SIZE: 12px; COLOR: #006600; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action1:unknown { + FONT-SIZE: 12px; COLOR: #006600; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action1:hover { + FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action2 { + FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #990000; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action2:link { + FONT-SIZE: 12px; COLOR: #990000; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action2:unknown { + FONT-SIZE: 12px; COLOR: #990000; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action2:unknown { + FONT-SIZE: 12px; COLOR: #990000; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action2:hover { + FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action3 { + FONT-SIZE: 12px; COLOR: #a27900; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action3:link { + FONT-SIZE: 12px; COLOR: #a27900; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action3:unknown { + FONT-SIZE: 12px; COLOR: #a27900; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action3:unknown { + FONT-SIZE: 12px; COLOR: #a27900; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action3:hover { + FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action4 { + FONT-SIZE: 12px; COLOR: #800080; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action4:link { + FONT-SIZE: 12px; COLOR: #800080; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action4:unknown { + FONT-SIZE: 12px; COLOR: #800080; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action4:unknown { + FONT-SIZE: 12px; COLOR: #800080; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action4:hover { + FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action5 { + FONT-SIZE: 12px; COLOR: #0079a2; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action5:link { + FONT-SIZE: 12px; COLOR: #0079a2; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action5:unknown { + FONT-SIZE: 12px; COLOR: #0079a2; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action5:unknown { + FONT-SIZE: 12px; COLOR: #0079a2; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.action5:hover { + FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none +} +.hint { + FONT-SIZE: 12px; COLOR: #666666; FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif +} + +.hint_red { + FONT-SIZE: 10px; COLOR: #FF0000; FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif +} + +.tabTable { + background-color: #d7d7d7; + border-width: 1px; + border-style: solid; + border-color: black; +} +.navbar_link { + FONT-WEIGHT: bold; FONT-SIZE: 9pt; COLOR: #006699; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: underline; +} +form{ + display : inline; +} + +.admintitle-white { + color: #fff +} + +.tableborder { + BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 0px solid; FONT-SIZE: 10pt; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serif +} +.tableborder_full { + BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 10pt; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serif +} +.tableborder_full_a { + BORDER-RIGHT: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serif +} Index: trunk/admin/install/blocks-vert.png =================================================================== diff -u Binary files differ Index: trunk/admin/images/toolbar/tool_apply_rules.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/img/bgr_top.jpg =================================================================== diff -u Binary files differ Index: trunk/kernel/include/systemconfiguration.php =================================================================== diff -u --- trunk/kernel/include/systemconfiguration.php (revision 0) +++ trunk/kernel/include/systemconfiguration.php (revision 13) @@ -0,0 +1,210 @@ +Execute($sql); + if ($result === false) + { + AddError(DB_ERROR,$adodbConnection->ErrorMsg(),'',"","SystemConfiguration","SystemConfiguration"); + return false; + } + + $this->m_DefaultLanguage = $result->fields[0]; + $this->m_DefaultTheme = $result->fields[1]; + $this->m_DBSchemaVersion = $result->fields[2]; + $this->m_SystemSecurityContextId = $result->fields[3]; + + //get module list + $m_ModuleList=array(); + $i=0; + $sql = sprintf("SELECT Name,Path,Version,Loaded FROM Modules"); + $result = $adodbConnection->Execute($sql); + if ($result === false) + { + AddError(DB_ERROR,$adodbConnection->ErrorMsg(),'',"","SystemConfiguration","SystemConfiguration"); + return false; + } + else + while($result) + { if($result->fileds[0] != "In-portal") + { $this->m_ModuleList[$i]['Name']=$result->fileds[0]; + $this->m_ModuleList[$i]['Path']=$result->fileds[1]; + $this->m_ModuleList[$i]['Version']=$result->fileds[2]; + $this->m_ModuleList[$i]['Loaded']=$result->fileds[3]; + $i++; + } + $result->MoveNext(); + } + + } + + //Required attributes accessors YOU MUST USE THIS FUNCTIONS + //TO READ AND WRITE ATTRIBUTES VALUES + + function GetDefaultLanguage() + { + return $this->m_DefaultLanguage; + } + + function SetDefaultLanguage($value) + { + $this->m_DefaultLanguage = $value; + $this->m_dirtyFieldsMap['DefaultLanguage'] = $value; + } + + function GetDefaultTheme() + { + return $this->m_DefaultTheme; + } + + function SetDefaultTheme($value) + { + $this->m_DefaultTheme = $value; + $this->m_dirtyFieldsMap['DefaultTheme'] = $value; + } + + function GetDBSchemaVersion() + { + return $this->m_DBSchemaVersion; + } + + function SetDBSchemaVersion($value) + { + $this->m_DBSchemaVersion = $value; + $this->m_dirtyFieldsMap['DBSchemaVersion'] = $value; + } + + function GetSystemSecurityContext() + { + return $this->m_SystemSecurityContextId; + } + + function SetSystemSecurityContext($value) + { + $this->m_SystemSecurityContextId = $value; + $this->m_dirtyFieldsMap['SystemSecurityContextId'] = $value; + } + + function Update($adodbConnection) + { + if(count($this->m_dirtyFieldsMap) == 0) + return true; + + $adodbConnection = GetADODBConnection(); + + $sql = 'UPDATE SystemConfiguration SET '; + $first = 1; + foreach ($this->m_dirtyFieldsMap as $key => $value) + { + if($first) + { + $sql = sprintf("%s %s=%s",$sql,$key,$adodbConnection->qstr($value)); + $first = 0; + } + else + { + $sql = sprintf("%s, %s=%s",$sql,$key,$adodbConnection->qstr($value)); + } + } + + if ($adodbConnection->Execute($sql) === false) + { + AddError(DB_ERROR,$adodbConnection->ErrorMsg(),'',"","SystemConfiguration","Update"); + return false; + } + return true; + } + + + function GetValue($variableName) + { + $adodbConnection = GetADODBConnection(); // create a connection + + $sql = sprintf("SELECT VariableValue FROM ConfigurationValues WHERE VariableName = '%s'",$variableName); + $result = $adodbConnection->Execute($sql); + if ($result === false) + { + AddError(DB_ERROR,$adodbConnection->ErrorMsg(),'',"","SystemConfiguration","GetValue"); + return false; + } + + return $result->fields[0]; + } + + function SetValue($variableName, $variableValue) + { + $adodbConnection = GetADODBConnection(); // create a connection + if($variableValue == NULL) //Remove field + { + $sql = sprintf("DELETE FROM ConfigurationValues WHERE VariableName = '%s'",$variableName); + $adodbConnection->Execute($sql); + return true; + } + + //Befoe insert may be field already exists - try to update it + $sql = sprintf("SELECT * FROM ConfigurationValues WHERE VariableName = '%s'",$variableName); + $result = $adodbConnection->Execute($sql); + if ($result === false) + { + AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"","SystemConfiguration","SetValue"); + return false; + } + + if(!$result->EOF) //Field alredy exists - just update it;s value + { + $sql = sprintf("UPDATE ConfigurationValues SET VariableValue = '$variableValue' WHERE VariableName = '%s'",$variableName); + $adodbConnection->Execute($sql); + if ($result === false) + { + AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"","SystemConfiguration","SetValue"); + return false; + } + + return true; + } + + //Does not exists - insert + if($result->EOF) //Field alredy exists - just update it;s value + { + $sql = sprintf("INSERT INTO ConfigurationValues (VariableName,VariableValue) VALUES('%s','%s')", $variableName,$variableValue); + $adodbConnection->Execute($sql); + if ($result === false) + { + AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"","SystemConfiguration","SetValue"); + return false; + } + + return true; + } + } + + function GetModuleList() + { return $this->m_ModuleList; + } + + //Common DB operation class variables + var $m_dirtyFieldsMap = array(); + + + //Required attributes + var $m_DefaultLanguage; + var $m_DefaultTheme; + var $m_DBSchemaVersion; + var $m_SystemSecurityContextId; + var $m_ModuleList; +} +?> Index: trunk/admin/images/icon16_search_reset.gif =================================================================== diff -u Binary files differ Index: trunk/admin/category/images/ddarrow_active.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/review_access_denied.tpl =================================================================== diff -u --- trunk/themes/default/review_access_denied.tpl (revision 0) +++ trunk/themes/default/review_access_denied.tpl (revision 13) @@ -0,0 +1,56 @@ + + + +"> +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    In-Portal is already installed at this location.

    In order to use the installation tool, please provide your Intechnic account information:
    Username:
    Password:


    Upgrade In-Portal
    + Clean out the In-Portal database and reinstall
    +
    + Clean out the In-Portal database and reinstall from backup +
    Install to a new database
    Update License Information
    Change Database Configuration


    +
    + + + + + +
    +
    + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    *
     
    *
     
      + ">
    +
    + " class="button"> +
     


    +
    +

    + +


    ">
    +
    + + + Index: trunk/admin/images/blue_bar_logout.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/customfield.php =================================================================== diff -u --- trunk/kernel/include/customfield.php (revision 0) +++ trunk/kernel/include/customfield.php (revision 13) @@ -0,0 +1,262 @@ +clsItem(); + $this->tablename=GetTablePrefix()."CustomField"; + $this->type=10; + $this->BasePermission=""; + $this->id_field = "CustomFieldId"; + $this->NoResourceId=1; //set this to avoid using a resource ID + $this->debuglevel=0; + if($CustomFieldId>-1) + $this->LoadFromDatabase($CustomFieldId); + } + + + function GetAdminUI() + { + $a = new clsConfigAdminItem(); + $a->name = "_".strtolower($this->Get("FieldName")); + $a->heading = $this->Get("Heading"); + $a->prompt = $this->Get("Prompt"); + $a->ElementType = $this->Get("ElementType"); + $a->ValidationRules=""; + $a->default_value = ""; + $a->ValueList=$this->Get("ValueList"); + if(!strlen($a->ElementType)) + $a->ElementType="text"; + if(!strlen($a->prompt)) + $a->prompt = "lu_fieldcustom__".strtolower($this->Get("FieldName")); + return $a; + } + + function parsetag($tag) + { + if(is_object($tag)) + { + $tagname = $tag->name; + } + else + $tagname = $tag; + switch($tagname) + { + case "fieldlabel": + return $this->Get("FieldLabel"); + break; + + case "fieldname": + return $this->Get("FieldName"); + break; + + case "customfieldid": + return $this->Get("CustomFieldId"); + + default: + return "Undefined:$tagname"; + break; + } + } + + } + +class clsCustomFieldList extends clsItemCollection +{ + var $Type; + + function clsCustomFieldList($type=-1,$table="CustomField") + { + $this->clsItemCollection(); + $this->Type=$type; + $this->classname = "clsCustomField"; + if($table=="CustomField") + $table = GetTablePrefix().$table; + $this->SourceTable = $table; + if($this->Type>0) + $this->LoadFields(); + } + + function LoadFields() + { + $this->Clear(); + $sql = "SELECT * FROM ".$this->SourceTable." WHERE Type=".$this->Type; + if((int)$GLOBALS["debuglevel"]) + echo $sql."
    \n"; + $rs = $this->adodbConnection->Execute($sql); + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $this->AddItemFromArray($data); + $rs->MoveNext(); + } + } + + function LoadFieldsAndValues($ResourceId) + { + $this->Clear(); + $table = $this->SourceTable; + $DataTable = GetTablePrefix()."CustomMetaData"; + $sql = "SELECT $table.*,$DataTable.Value as Value, $DataTable.CustomDataId as CustomDataId FROM ".$table." LEFT JOIN $DataTable ON "; + $sql .= "(".$table.".CustomFieldId=$DataTable.CustomFieldId AND $DataTable.ResourceId=$ResourceId) WHERE Type=".$this->Type; + if((int)$_GLOBALS["debuglevel"]) + echo $sql."
    \n"; + $rs = $this->adodbConnection->Execute($sql); + while($rs && !$rs->EOF) + { + $data = $rs->fields; + $this->AddItemFromArray($data); + $rs->MoveNext(); + } + } + + function GetFieldUIList($GeneralTab=FALSE) + { + $ret = new clsConfigAdmin(); + + if($this->NumItems()>0) + { + foreach($this->Items as $field) + { + if($GeneralTab==TRUE && $field->Get("OnGeneralTab")==1 || !$GeneralTab) + { + $ui = $field->GetAdminUI(); + array_push($ret->Items,$ui); + } + } + } + return $ret; + } + + function GetFieldNames() + { + $res = array(); + foreach($this->Items as $f) + $res[] = $f->Get("FieldName"); + return $res; + } + + function SaveFields() + { + foreach($this->Items as $i) + { + if($i->Get("CustomFieldId")) + { + $i->Update(); + } + else + $i->Create(); + } + + } + + function Query_CustomField($where=NULL,$orderby=NULL,$limit=NULL) + { + $this->Clear(); + $sql = "SELECT * FROM ".$this->SourceTable; + if(isset($where)) + $sql = sprintf('%s WHERE %s',$sql,$where); + if(isset($orderby) && strlen(trim($orderby))>0) + $sql = sprintf('%s ORDER BY %s',$sql,$orderby); + if(isset($limit) && strlen(trim($limit))) + $sql .= " ".$limit; + // $sql."
    "; + $this->Query_Item($sql); + return $this->Items; + } + + function AddField($Type,$FieldName,$FieldLabel,$ShowGeneral=0,$Heading="", $Prompt="", + $ElementType="",$ValueList="") + { + global $objItemTypes,$objSearchConfig,$objLanguages; + + //if(!is_numeric($Type)) + // { + $f = new clsCustomField(); + $f->tablename = $this->SourceTable; + $f->Set(array("Type","FieldName","FieldLabel","OnGeneralTab","Heading","Prompt", + "ElementType","ValueList"), + array($Type,$FieldName,$FieldLabel,$ShowGeneral,$Heading,$Prompt, + $ElementType,$ValueList)); + $f->Create(); + $Item = $objItemTypes->GetItem($Type); + if(is_object($Item)) + { + //$Table = $Item->Get("SourceTable"); + $Table = GetTablePrefix()."CustomField"; + $Header = "la_text_".strtolower($Item->Get("ItemName")); + $Module = $Item->Get("Module"); + $Desc = $FieldLabel; + + if(!is_object($objSearchConfig)) + { + $objSearchConfig = new clsSearchConfigList(); + } + $NextOrder = $objSearchConfig->GetNextDisplayOrder($Module); + $desc = "lu_fieldcustom__".strtolower($FieldName); + if(!strlen($FieldLabel)) + { + $FieldLabel = $FieldName; + } + + $l = $objLanguages->GetPrimary(); + $phrases = new clsPhraseList(); + $phrases->AddPhrase($desc,$l,$FieldLabel,2); + + $dtable = GetTablePrefix()."CustomMetaData"; + $Join = "($dtable.ResourceId={Table}.ResourceId)"; + $objSearchConfig->AddSearchField($Table,$FieldName,$Module,0,0,$FieldLabel,$desc,$Header,$NextOrder,0,"text",$Join,$f->Get("CustomFieldId")); + } + return $f; + //} + //else + // return FALSE; + } + + function EditField($FieldId,$Type,$FieldName,$FieldLabel,$ShowGeneral=0,$Heading="", $Prompt="", + $ElementType="",$ValueList="") + { + $f = $this->GetItem($FieldId); + $f->Set(array("Type","FieldName","FieldLabel","OnGeneralTab","Heading","Prompt", + "ElementType","ValueList"), + array($Type,$FieldName,$FieldLabel,$ShowGeneral,$Heading,$Prompt, + $ElementType,$ValueList)); + $f->Update(); + return $f; + } + + function DeleteField($FieldId) + { + global $objItemTypes, $objSearchConfig; + //echo "
    "; print_r($objSearchConfig); echo "
    "; + $f = $this->GetItem($FieldId); + $Type = $f->Get("Type"); + $Item = $objItemTypes->GetItem($Type); + $Module = $Item->Get("Module"); + if(is_object($Item)) + { + //$table = $Item->Get("TableName"); + $table = GetTablePrefix()."CustomField"; + if(!is_object($objSearchConfig)) + { + $objSearchConfig = new clsSearchConfigList($Module); + } + + if (is_object($objSearchConfig)) { + $s = $objSearchConfig->GetItemByName($table,$f->Get("FieldName")); + //echo "$table ".$f->Get("FieldName")."
    "; print_r($s); echo "
    "; + if(is_object($s)) + { + $s->Delete(); + } + } + } + $f->Delete(); + } + +}/*clsCustomFieldList*/ + + +?> Index: trunk/kernel/include/config.php =================================================================== diff -u --- trunk/kernel/include/config.php (revision 0) +++ trunk/kernel/include/config.php (revision 13) @@ -0,0 +1,514 @@ +m_IsDirty=false; + $this->adodbConnection = GetADODBConnection(); + $this->config = array(); + $this->m_IsDefault = array(); + $this->VarType = array(); + } + + function SetDebugLevel($value) + { + } + + + function Load() + { + if(is_object($this->adodbConnection)) + { + LogEntry("Config Load Start\n"); + $sql = "select VariableName, VariableValue from ".GetTablePrefix()."ConfigurationValues"; + $rs = $this->adodbConnection->Execute($sql); + unset($this->config); + #this->config=array(); + $count=0; + while($rs && !$rs->EOF) + { + $this->config[$rs->fields["VariableName"]] = $rs->fields["VariableValue"]; + $this->m_VarType[$rs->fields["VariableName"]] = 0; + // $this->Set($rs->fields["VariableName"],$rs->fields["VariableValue"],0); + if( defined('ADODB_EXTENSION') && constant('ADODB_EXTENSION') > 0 ) + { + adodb_movenext($rs); + } + else + $rs->MoveNext(); + $count++; + } + LogEntry("Config Load End - $count Variables\n"); + } + unset($this->m_DirtyFields); + $this->m_IsDirty=false; + } + + function Get($property) + { + return isset($this->config[$property]) ? $this->config[$property] : ''; + } + + function Set($property, $value,$type=0,$force=FALSE) + { + if(is_array($this->config) && strlen($property)>0) + { + if(array_key_exists($property,$this->config)) + { + $current = $this->config[$property]; + $changed = ($current != $value); + } + else + $changed = true; + } + else + $changed = false; + $this->config[$property]=$value; + $this->m_IsDirty = ($this->m_IsDirty or $changed or $force); + if($changed || $force) + { + $this->m_DirtyFields[$property] = $value; + } + $this->m_VarType[$property] = $type; + } + + function Save() + { + if($this->m_IsDirty==TRUE) + { + foreach($this->m_DirtyFields as $field=>$value) + { + if($this->m_VarType[$field]==0) + { + $sql = sprintf("UPDATE ".GetTablePrefix()."ConfigurationValues SET VariableValue=%s WHERE VariableName=%s", $this->adodbConnection->qstr($value), $this->adodbConnection->qstr($field)); + // echo $sql."
    \n"; + + $rs = $this->adodbConnection->execute($sql); + } + } + } + $this->m_IsDirty=FALSE; + unset($this->m_DirtyFields); + } + + function TimeFormat() + { + if($this->Get("ampm_time")=="1") + { + $format = "g:i:s A"; + } + else + $format = "H:i:s"; + return $format; + } + + /* vartype should be either 1 or 2, 1 = perstant data, 2 = session data */ + function GetDirtySessionValues($VarType) + { + $result = array(); + + if(is_array($this->m_DirtyFields)) + { + foreach($this->m_DirtyFields as $property=>$values) + { + if($this->m_VarType[$property]==$VarType) + $result[$property] = $values; + } + } + return $result; + } + + function GetSessionValues($VarType) + { + $result = array(); + foreach($this->config as $property=>$values) + { + if(strlen($values[$VarType])>0) + { + $result[$property] = $values[$VarType]; + } + } + return $result; + } +}/* clsConfig */ + +/* +To create the configuration forms in the admin section, populate the table ConfigurationAdmin and +ConfigurationValues. + + The tables are fairly straight-forward. The fields of concern in the ConfigurationValues table is +ModuleOwner and Section. ModuleOwner should either be the module name or In-Portal for kernel related stuff. +(Items which should appear under 'System Configuration'). + + The Section field determines the NavMenu section the value is associated with. For example, +in-portal:configure_general refers to items listed under System Configuration->General. + + In the ConfigurationAdmin table, ensure the VariableName field is the same as the one in ConfigurationValues +(this is the field that creates the natural join.) The prompt field is the text displayed to the left of the form element +in the table. This should contain LANGUAGE ELEMENT IDENTIFIERS that are plugged into the Language function. + + The element_type field describes the type of form element is associated with this item. Possible values are: + - text : textbox + - checkbox : a simple checkbox + - select : creates a dropdown box. In this case, the ValueList field should be populated with a comma-separated list + in name=value,name=value format (each element is translated to: + + + To add dynamic data to this list, enclose an SQL statement with tags for example: + SELECT FieldLabel as OptionName, FieldName as OptionValue FROM CustomField WHERE .CustomFieldType=3> + + note the specific field labels OptionName and OptionValue. They are required by the parser. + use the tag to insert the system's table prefix into the sql statement as appropriate + +*/ +class clsConfigAdminItem +{ + var $name; + var $heading; + var $prompt; + var $ElementType; + var $ValueList; /* comma-separated list in name=value pair format*/ + var $ValidationRules; + var $default_value; + var $adodbConnection; + var $NextItem=NULL; + var $Section; + + function clsConfigAdminItem($config_name=NULL) + { + $this->adodbConnection = GetADODBConnection(); + if($config_name) + $this->LoadSetting($config_name); + } + + function LoadSetting($config_name) + { + $sql = "SELECT * FROM ".GetTablePrefix()."ConfigurationAdmin INNER JOIN ".GetTablePrefix()."ConfigurationValues Using(VariableName) WHERE ".GetTablePrefix()."ConfigurationAdmin.VariableName='".$config_name."'"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $this->name = $rs->fields["VariableName"]; + $this->heading = $rs->fields["heading"]; + $this->prompt = $rs->fields["prompt"]; + $this->ElementType = $rs->fields["element_type"]; + $this->ValidationRules=$rs->fields["validation"]; + $this->default_value = $rs->fields["VariableValue"]; + $this->ValueList=$rs->fields["ValueList"]; + $this->Section = $rs->fields["Section"]; + } + } + + function explode_sql($sql) + { + $s = ""; + + $rs = $this->adodbConnection->Execute($sql); + + while ($rs && !$rs->EOF) + { + if(strlen(trim($rs->fields["OptionName"]))>0 && strlen(trim($rs->fields["OptionValue"]))>0) + { + if(strlen($s)) + $s .= ","; + $s .= $rs->fields["OptionName"]."="."+".$rs->fields["OptionValue"]; + $rs->MoveNext(); + } + } + return $s; + } + + function replace_sql($string) + { + $string = str_replace("",GetTablePrefix(),$string); + + $start = strpos($string,""); + + while($start) + { + $end = strpos($string,""); + if(!$end) + { + $end = strlen($string); + } + $len = $end - $start; + $sql = substr($string,$start+5,$len-5); + + $sql_val = $this->explode_sql($sql); + $s = substr($string,0,$start) . $sql_val . substr($string,$end+5); + + $string = $s; + $start = strpos($string,""); + } + return $string; + } + + function ItemFormElement() + { + global $objConfig; + static $TabIndex; + + if (empty($TabIndex)) + $TabIndex = 1; + + $o = ""; + if($objConfig->Get($this->name)!="") + $this->default_value = stripslashes($objConfig->Get($this->name)); + + switch($this->ElementType) + { + case "text": + $o .= "name."\" "; + $o .= "VALUE=\"".$this->default_value."\">"; + break; + case "checkbox": + $o .= "name."\" tabindex=\"".($TabIndex++)."\""; + if($this->default_value) + { + $o .= " CHECKED>"; + } + else + $o .= ">"; + + break; + case "password": + + /* To exclude config form from populating with Root (md5) password */ + if ($this->Section == "in-portal:configure_users") + $this->default_value = ""; + + $o .= "name."\" "; + $o .= "VALUE=\"".$this->default_value."\">"; + break; + case "textarea": + $o .= ""; + break; + case "label": + if($this->default_value) + { + $o .= $this->default_value; + } + break; + case "radio": + $radioname = $this->name; + + $ValList = $this->replace_sql($this->ValueList); + + $TabIndex++; + $localTabIndex = $TabIndex; + $TabIndex++; + + $val = explode(",",$ValList); + for($i=0;$i<=count($val);$i++) + { + if(strlen($val[$i])) + { + $parts = explode("=",$val[$i]); + $s = $parts[1]; + if(strlen($s)==0) + $s=""; + + $o .= "name."\" VALUE=\"".$parts[0]."\""; + if($this->default_value==$parts[0]) + { + $o .= " CHECKED>"; + } + else + $o .= ">"; + if(substr($s,0,1)=="+") + { + $o .= $s; + } + else + $o .= prompt_language($s); + } + } + + break; + case "select": + $o .= ""; + } + return $o; + } + + function GetPrompt() + { + $ret = prompt_language($this->prompt); + return $ret; + } +} + +class clsConfigAdmin +{ + var $module; + var $section; + var $Items; + + function clsConfigAdmin($module="",$section="",$Inst=FALSE) + { + $this->module = $module; + $this->section = $section; + $this->Items= array(); + if(strlen($module) && strlen($section)) + $this->LoadItems(TRUE,$Inst); + } + + function Clear() + { + unset($this->Items); + $this->Items = array(); + } + + function NumItems() + { + if(is_array($this->Items)) + { + return count($this->Items); + } + else + return 0; + } + + function LoadItems($CheckNextItems=TRUE, $inst=FALSE) + { + $this->Clear(); + if(!$inst) + { + $sql = "SELECT * FROM ".GetTablePrefix()."ConfigurationAdmin INNER JOIN ".GetTablePrefix()."ConfigurationValues Using(VariableName) + WHERE ModuleOwner='".$this->module."' AND Section='".$this->section."' ORDER BY DisplayOrder ASC"; + } + else + { + + $sql = "SELECT * FROM ".GetTablePrefix()."ConfigurationAdmin INNER JOIN ".GetTablePrefix()."ConfigurationValues Using(VariableName) + WHERE ModuleOwner='".$this->module."' AND Section='".$this->section."' AND Install=1 ORDER BY DisplayOrder ASC"; + } + if((int)$_GLOBALS["debuglevel"]) + echo $sql."
    \n"; + $adodbConnection = GetADODBConnection(); + $rs = $adodbConnection->Execute($sql); + while($rs && !$rs->EOF) + { + $data = $rs->fields; + if(is_object($i) && $CheckNextItems) + { + $last = $i->prompt; + unset($i); + } + $i = new clsConfigAdminItem(NULL); + $i->name = $data["VariableName"]; + $i->default_value = $data["VariableValue"]; + $i->heading = $data["heading"]; + $i->prompt = $data["prompt"]; + $i->ElementType = $data["element_type"]; + $i->ValueList = $data["ValueList"]; + $i->ValidationRules = $data["validaton"]; + $i->Section = $data["Section"]; + + if(strlen($last)>0) + { + if($i->prompt==$last) + { + $this->Items[count($this->Items)-1]->NextItem=$i; + } + else + { + $i->NextItem=NULL; + array_push($this->Items,$i); + } + } + else + { + $i->NextItem=NULL; + array_push($this->Items,$i); + } + //unset($i); + $rs->MoveNext(); + } + } + + function SaveItems($POSTVARS, $force=FALSE) + { + global $objConfig; + + foreach($this->Items as $i) + { + if($i->ElementType != "label") + { + if($i->ElementType != "checkbox") + { + $objConfig->Set($i->name,$POSTVARS[$i->name]); + } + else + { + if($POSTVARS[$i->name]=="on") + { + $value=1; + } + else + $value = (int)$POSTVARS[$i->name]; + $objConfig->Set($i->name,$value,0,$force); + } + } + } + $objConfig->Save(); + } + + function GetHeadingList() + { + $res = array(); + foreach($this->Items as $i) + { + $res[$i->heading]=1; + } + reset($res); + return array_keys($res); + } + + function GetHeadingItems($heading) + { + $res = array(); + foreach($this->Items as $i) + { + if($i->heading==$heading) + array_push($res,$i); + } + return $res; + } +} + + +?> Index: trunk/admin/images/toolbar/tool_new_group_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/images/itemtabs/divider_up.gif =================================================================== diff -u Binary files differ Index: trunk/themes/default/register/register_confirm.tpl =================================================================== diff -u --- trunk/themes/default/register/register_confirm.tpl (revision 0) +++ trunk/themes/default/register/register_confirm.tpl (revision 13) @@ -0,0 +1,126 @@ + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +



    + + + + + + + + + + + +

    + + + + + + +

    + + + + + + + +
    " width="18" height="12" alt="" />
       
    +
    + +

    + + + + + + + +

    + + +
    + + + + + +

    + +
    + + + + + + + + + + + + + + + + +
    + + + + + +

    +
    + + + + + + + + +



    +


    +
    +

    + +
    + +
    +

    +
    + + + Index: trunk/admin/browse/toolbar.php =================================================================== diff -u --- trunk/admin/browse/toolbar.php (revision 0) +++ trunk/admin/browse/toolbar.php (revision 13) @@ -0,0 +1,252 @@ +img=="divider") + { + $o .= "\n"; + } + else + { + $o .= "link."\" onMouseOut=\"".$this->onMouseOut."\""; + $o .= " onMouseOver=\"".$this->onMouseOver."\" onClick=\"".$this->onClick."\">\n"; + $o .= "img."\" alt=\"".language($this->alt)."\" src=\"".$this->filename."\" width=\"32\" height=\"32\" border=\"0\">"; + $o .= "\n"; + } + return $o; + } +} + +class clsToolBar +{ + var $Items; + var $m_section; + var $m_load_menu_func; + var $m_CheckClass; + var $InitScript; + + function clsToolBar() + { + $this->Items = array(); + $this->InitScript = array(); + } + + function Get($name) + { + $var = "m_" . $name; + return $this->$var; + } + + function Set($name, $value) + { + if (is_array($name)) + { + for ($i=0; $i$var = $value[$i]; + $this->m_dirtyFieldsMap[$name[$i]] = $value[$i]; + echo "$var = ".$value[$i]."
    \n"; + } + } + else + { + $var = "m_" . $name; + $this->$var = $value; + $this->m_dirtyFieldsMap[$name] = $value; + } + } + + function Add($img,$alt="",$link="",$MouseOver="",$MouseOut="",$onClick="", $filename="") + { + global $imagesURL; + + $t = new clsToolBarItem(); + $t->img = $img; + $t->alt = $alt; + $t->link = $link; + $t->onMouseOver = $MouseOver; + $t->onMouseOut = $MouseOut; + $t->onClick = $onClick; + if(strlen($filename)==0) + { + $t->filename = $imagesURL."/toolbar/tool_".$img.".gif"; + } + else + { + if(substr($filename,0,4)=="http") + { + $t->filename = $filename; + } + else + { + if(substr($filename,0,1)!="/") + $filename = "/".$filename; + if(substr($filename,0,9)!="/toolbar/") + $filename = "/toolbar".$filename; + $t->filename = $imagesURL.$filename; + } + } + array_push($this->Items,$t); + return $t; + } + + function AddToInitScript($s) + { + if(is_array($s)) + { + for($i=0;$iInitScript,$s[$i]); + } + else + array_push($this->InitScript,$s); + } + + function GetInitScript() + { + $s=""; + if(count($this->InitScript)>0) + $s = implode("\n",$this->InitScript); + return ""; + } + + function Build() + { + global $imagesURL; + + $o = ""; + $o .= "\n"; + foreach($this->Items as $t) + { + $o .= ""; + } + $o .= "
    |".$t->GetItem()."
    "; + return $o; + } + + function onLoadString() + { + return ""; + } +} + +class clsItemTabs +{ + var $Tabs; + var $ItemCount; + + function clsItemTabs() + { + $this->Tabs = array(); + $this->ItemCount = array(); + } + + function SetItemCount($divname,$Value) + { + $this->ItemCount[$divname] = $Value; + } + + function GetItemCount($divname) + { + return (int)$this->ItemCount[$divname]; + } + + function AddTab($Caption,$divname,$ItemCount,$selected,$numfunc="") + { + $t["caption"]=$Caption; + $t["divname"]=$divname; + $this->SetItemCount($divname,$ItemCount); + $t["selected"]=$selected; + $t["numfunc"]=$numfunc; + $this->Tabs[] = $t; + } + + function TabItem($i) + { + global $imagesURL; + + $t = $this->Tabs[$i]; + $div = $t["divname"]; + $o = "\n + + + + +
      "; + $o .= " "; + $o .= $t["caption"]." "; + + $func = $t["numfunc"]; + if( is_numeric($func) ) + $total = $func; + else + if( function_exists($func) ) $total = $func(); + + $count = $this->GetItemCount($div); + + $o .= '('.( ($total != $count) ? $count.' / '.$total : $count ).')'; + + $o .= '  + +
    '."\n"; + + return $o; + } + + function tabRow() + { + global $imagesURL; + + $o = "\n"; + $o .= "\n"; + for($i=0;$iTabs);$i++) + { + $o .= $this->TabItem($i); + } + $o .= "\n"; + $o .= "
     
    \n"; + //$o .= "
    \n"; + //$o .= "\n"; + //$o .= "\n"; + //$o .= "
    \n"; + //$o .= "
    Index: trunk/admin/images/toolbar/tool_primary_image_f3.gif =================================================================== diff -u Binary files differ Index: trunk/admin/icons/icon24_settings_output.gif =================================================================== diff -u Binary files differ Index: trunk/kernel/include/cachecount.php =================================================================== diff -u --- trunk/kernel/include/cachecount.php (revision 0) +++ trunk/kernel/include/cachecount.php (revision 13) @@ -0,0 +1,268 @@ +clsItemDB(); + $this->tablename = GetTablePrefix()."CountCache"; + $this->id_field = "CountCacheId"; + $this->NoResourceId=1; + if($id) + $this->LoadFromDatabase($id); + } + + 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; + } + +} + +class clsCacheCountList extends clsItemCollection +{ + var $CategoryId=0; + var $Loaded = FALSE; + + function clsCacheCountList($CatId=NULL) + { + $this->clsItemCollection(); + $this->SourceTable = GetTablePrefix()."CountCache"; + $this->classname = "clsCacheCount"; + if($CatId) + $this->CategoryId = $CatId; + } + + function LoadCategoryValues() + { + if($this->Loaded==FALSE) + { + $sql = "SELECT * FROM ".$this->SourceTable. " WHERE CategoryId=".(int)$this->CategoryId; + $this->Query_Item($sql); + $this->Loaded = TRUE; + } + } + + function GetItemByField($Field,$Value,$LoadFromDB=TRUE) + { + $found=FALSE; + if(is_array($this->Items)) + { + foreach($this->Items as $i) + { + if($i->Get($Field)==$Value && $i->Get("CategoryId")==$this->CategoryId) + { + $found = TRUE; + break; + } + } + } + if(!$found && $LoadFromDB==TRUE) + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE $Field = '$Value' AND CategoryId=".(int)$this->CategoryId; + $res = $this->adodbConnection->Execute($sql); + if($res && !$res->EOF) + { + $i = $this->AddItemFromArray($res->fields); + } + else + $i = FALSE; + } + return $i; + } + + function GetCountObject($ListType,$ItemType,$ExtraId,$TodayOnly) + { + $found=FALSE; + + if(is_array($this->Items)) + { + foreach($this->Items as $i) + { + if($i->Get("ItemType")==$ItemType && $i->Get("ListType")==$ListType && + ($i->Get("ExtraId")==$ExtraId) && $i->Get("TodayOnly")==$TodayOnly) + { + $found = TRUE; + break; + } + } + } + if(!$found) + { + $sql = "SELECT * FROM ".$this->SourceTable." WHERE ItemType=$ItemType AND ListType=$ListType AND ExtraId='$ExtraId' AND TodayOnly=$TodayOnly"; + $res = $this->adodbConnection->Execute($sql); + if($res && !$res->EOF) + { + $i = $this->AddItemFromArray($res->fields); + $found = TRUE; + } + else + $i = FALSE; + } + if(!$found) + $i = FALSE; + return $i; + } + + + function GetValue($ListType,$ItemType,$ExtraId,$TodayOnly,$Timeout) + { + $val = ""; + if(strlen($ExtraId)) + { + $i = $this->GetCountObject($ListType,$ItemType,$ExtraId,$TodayOnly); + if(is_object($i)) + { + $d = $i->Get("LastUpdate"); + $el = date("U") - $d; + if($el > $Timeout) + { + $val = ""; + } + else + { + if($i->Get("CountCacheId")>0) + { + $val = $i->Get("Value"); + } + } + } + unset($i); + } + else + { + $sql = "SELECT Value,LastUpdate FROM ".$this->SourceTable." WHERE ListType=$ListType AND ItemType=$ItemType AND TodayOnly=$TodayOnly"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + $d = $rs->fields["LastUpdate"]; + $el = $date("U") - $d; + if($el < $Timeout) + { + $val = (int)$rs->fields["Value"]; + } + else + { + $val = ""; + $rs = FALSE; + } + } + } + return $val; + } + + function SetValue($ListType,$ItemType,$ExtraId,$Today,$Value) + { + $c = $this->GetCountObject($ListType,$ItemType,$ExtraId,$Today); + if(is_object($c)) + { + $c->Set("Value",$Value); + $c->Set("LastUpdate",Date("U")); + $c->Update(); + } + else + { + $c = new $this->classname; + $c->Set("ListType",$ListType); + $c->Set("ItemType",$ItemType); + $c->Set("ExtraId",$ExtraId); + $c->Set("Value",$Value); + $c->Set("TodayOnly",$Today); + $c->Set("LastUpdate",Date("U")); + $c->Create(); + } + } + + function DeleteValue($ListType,$ItemType,$ExtraId,$Today) + { + $c = $this->GetCountObject($ListType,$ItemType,$ExtraId,$Today); + if(is_object($c)) + { + $c->Delete(); + } + } + + function IncrementParentValues($ValueName,$CatList,$IncVal=1) + { + $sql = "UPDATE ".$this->SourceTable." SET Value=Value+$IncVal WHERE CategoryId IN ($CatList) AND ItemType='$ValueName'"; + //echo $sql."
    \n"; + $this->adodbConnection->Execute($sql); + } + + function DecrementParentValues($ValueName,$CatList,$DecVal=1) + { + $sql = "UPDATE ".$this->SourceTable." SET Value=Value-$DecVal WHERE CategoryId IN ($CatList)"; + //echo $sql."
    \n"; + $this->adodbConnection->Execute($sql); + } + + function GetCatListTotal($ValueName,$CatList) + { + global $objItemTypes; + + if(is_array($CatList)) + $CatList = implode(",",$CatList); + + if($ValueName>0) + { + $sql = "SELECT SUM(Value) as total FROM ".$this->SourceTable." WHERE CategoryId IN (".$CatList.") AND ItemType='".$ValueName."'"; + } + else + { + foreach($objItemTypes->Items as $i) + { + $AutoTypes[] = $i->Get("ItemType"); + } + $types = implode(",",$AutoTypes); + $sql = "SELECT SUM(Value) as total FROM ".$this->SourceTable." WHERE CategoryId IN (".$CatList.") AND ItemType IN ($types)"; + } + //echo $sql; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + return (int)$rs->fields["total"]; + } + else + return 0; + } + + function GetCategoryCount($CategoryId) + { + $sql = "SELECT SUM(Value) as total FROM ".$this->SourceTable." WHERE CategoryId=".$CategoryId; + //echo $sql."
    \n"; + $rs = $this->adodbConnection->Execute($sql); + if($rs && !$rs->EOF) + { + return $rs->fields["total"]; + } + else + return 0; + } + + function RefreshCategoryCount($CategoryId,$ItemType) + { + global $objCatList, $objItemTypes; + } + +} +?> Index: trunk/admin/editor/FCKeditor/filemanager/upload/asp/upload.cnt =================================================================== diff -u --- trunk/admin/editor/FCKeditor/filemanager/upload/asp/upload.cnt (revision 0) +++ trunk/admin/editor/FCKeditor/filemanager/upload/asp/upload.cnt (revision 13) @@ -0,0 +1 @@ +0 \ No newline at end of file Index: trunk/admin/editor/FCKeditor/fckeditor.js =================================================================== diff -u --- trunk/admin/editor/FCKeditor/fckeditor.js (revision 0) +++ trunk/admin/editor/FCKeditor/fckeditor.js (revision 13) @@ -0,0 +1,76 @@ +/* + * FCKeditor - The text editor for internet + * Copyright (C) 2003 Frederico Caldeira Knabben + * + * Licensed under the terms of the GNU Lesser General Public License + * (http://www.opensource.org/licenses/lgpl-license.php) + * + * For further information go to http://www.fredck.com/FCKeditor/ + * or contact fckeditor@fredck.com. + * + * fckeditor.js: Inserts a FCKeditor instance in a HTML page. + * + * Authors: + * Frederico Caldeira Knabben (fckeditor@fredck.com) + */ + +var FCKeditorBasePath = '/FCKeditor/' ; + +var isOpera = (navigator.userAgent.indexOf("Opera") > 0) ; + +// Check if the browser is compatible with the Editor: +// - Internet Explorer 5 or above +var isCompatible = (!isOpera && navigator.appName == 'Microsoft Internet Explorer') ; +if (isCompatible) +{ + var browserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ; + isCompatible = (browserVersion >= 5) ; +} + +// FCKeditor class +function FCKeditor(instanceName, width, height, toolbarSet, value) +{ + this.InstanceName = instanceName ; + this.Width = width || '100%' ; + this.Height = height || '200' ; + this.ToolbarSet = toolbarSet ; + this.Value = value || '' ; + + this.Config = new Object() ; + this.CanUpload = null ; // true / false + this.CanBrowse = null ; // true / false +} + +FCKeditor.prototype.Create = function() +{ + if (isCompatible) + { + var sLink = FCKeditorBasePath + 'fckeditor.html?FieldName=' + this.InstanceName ; + if (this.ToolbarSet) sLink += '&Toolbar=' + this.ToolbarSet ; + if (this.CanUpload != null) sLink += '&Upload=' + (this.CanUpload ? "true" : "false") ; + if (this.CanBrowse != null) sLink += '&Browse=' + (this.CanBrowse ? "true" : "false") ; + + for ( o in this.Config ) + sLink += '&' + o + '=' + this.Config[o] ; + + document.write('') ; + document.write('') ; + } + else + { + var sWidth = this.Width.toString().indexOf('%') > 0 ? this.Width : this.Width + 'px' ; + var sHeight = this.Height.toString().indexOf('%') > 0 ? this.Height : this.Height + 'px' ; + document.write('