Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1069499
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jul 20, 1:18 AM
Size
104 KB
Mime Type
text/x-diff
Expires
Tue, Jul 22, 1:18 AM (13 h, 4 m)
Engine
blob
Format
Raw Data
Handle
692405
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/RC/core/kernel/session/session.php
===================================================================
--- branches/RC/core/kernel/session/session.php (revision 11427)
+++ branches/RC/core/kernel/session/session.php (revision 11428)
@@ -1,1098 +1,1105 @@
<?php
/*
The session works the following way:
1. When a visitor loads a page from the site the script checks if cookies_on varibale has been passed to it as a cookie.
2. If it has been passed, the script tries to get Session ID (SID) from the request:
3. Depending on session mode the script is getting SID differently.
The following modes are available:
smAUTO - Automatic mode: if cookies are on at the client side, the script relays only on cookies and
ignore all other methods of passing SID.
If cookies are off at the client side, the script relays on SID passed through query string
and referal passed by the client. THIS METHOD IS NOT 100% SECURE, as long as attacker may
get SID and substitude referal to gain access to user' session. One of the faults of this method
is that the session is only created when the visitor clicks the first link on the site, so
there is NO session at the first load of the page. (Actually there is a session, but it gets lost
after the first click because we do not use SID in query string while we are not sure if we need it)
smCOOKIES_ONLY - Cookies only: in this mode the script relays solely on cookies passed from the browser
and ignores all other methods. In this mode there is no way to use sessions for clients
without cookies support or cookies support disabled. The cookies are stored with the
full domain name and path to base-directory of script installation.
smGET_ONLY - GET only: the script will not set any cookies and will use only SID passed in
query string using GET, it will also check referal. The script will set SID at the
first load of the page
smCOOKIES_AND_GET - Combined mode: the script will use both cookies and GET right from the start. If client has
cookies enabled, the script will check SID stored in cookie and passed in query string, and will
use this SID only if both cookie and query string matches. However if cookies are disabled on the
client side, the script will work the same way as in GET_ONLY mode.
4. After the script has the SID it tries to load it from the Storage (default is database)
5. If such SID is found in the database, the script checks its expiration time. If session is not expired, it updates
its expiration, and resend the cookie (if applicable to session mode)
6. Then the script loads all the data (session variables) pertaining to the SID.
Usage:
$session = new Session(smAUTO); //smAUTO is default, you could just leave the brackets empty, or provide another mode
$session->SetCookieDomain('my.domain.com');
$session->SetCookiePath('/myscript');
$session->SetCookieName('my_sid_cookie');
$session->SetGETName('sid');
$session->InitSession();
...
//link output:
echo "<a href='index.php?'". ( $session->NeedQueryString() ? 'sid='.$session->SID : '' ) .">My Link</a>";
*/
//Implements session storage in the database
class SessionStorage extends kDBBase {
var $Expiration;
var $SessionTimeout=0;
var $DirectVars = Array();
var $ChangedDirectVars = Array();
var $PersistentVars = Array ();
var $OriginalData=Array();
var $TimestampField;
var $SessionDataTable;
var $DataValueField;
var $DataVarField;
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->setTableName('sessions');
$this->setIDField('sid');
$this->TimestampField = 'expire';
$this->SessionDataTable = 'SessionData';
$this->DataValueField = 'value';
$this->DataVarField = 'var';
}
function setSessionTimeout($new_timeout)
{
$this->SessionTimeout = $new_timeout;
}
function StoreSession(&$session, $additional_fields = Array())
{
if (defined('IS_INSTALL') && IS_INSTALL && !$this->Application->TableFound($this->TableName)) {
return false;
}
$fields_hash = Array (
$this->IDField => $session->SID,
$this->TimestampField => $session->Expiration
);
$this->Conn->doInsert($fields_hash, $this->TableName);
foreach ($additional_fields as $field_name => $field_value) {
$this->SetField($session, $field_name, $field_value);
}
}
function DeleteSession(&$session)
{
$query = ' DELETE FROM '.$this->TableName.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->Conn->Query($query);
$query = ' DELETE FROM '.$this->SessionDataTable.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->Conn->Query($query);
$this->OriginalData = Array();
}
function UpdateSession(&$session, $timeout=0)
{
$this->SetField($session, $this->TimestampField, $session->Expiration);
$query = ' UPDATE '.$this->TableName.' SET '.$this->TimestampField.' = '.$session->Expiration.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->Conn->Query($query);
}
function LocateSession($sid)
{
$query = ' SELECT * FROM '.$this->TableName.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($sid);
$result = $this->Conn->GetRow($query);
if($result===false) return false;
$this->DirectVars = $result;
$this->Expiration = $result[$this->TimestampField];
return true;
}
function GetExpiration()
{
return $this->Expiration;
}
function LoadData(&$session)
{
$query = 'SELECT '.$this->DataValueField.','.$this->DataVarField.' FROM '.$this->SessionDataTable.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID);
$this->OriginalData = $this->Conn->GetCol($query, $this->DataVarField);
return $this->OriginalData;
}
/**
* Enter description here...
*
* @param Session $session
* @param string $var_name
* @param mixed $default
*/
function GetField(&$session, $var_name, $default = false)
{
return isset($this->DirectVars[$var_name]) ? $this->DirectVars[$var_name] : $default;
//return $this->Conn->GetOne('SELECT '.$var_name.' FROM '.$this->TableName.' WHERE `'.$this->IDField.'` = '.$this->Conn->qstr($session->GetID()) );
}
function SetField(&$session, $var_name, $value)
{
$value_changed = !isset($this->DirectVars[$var_name]) || ($this->DirectVars[$var_name] != $value);
if ($value_changed) {
$this->DirectVars[$var_name] = $value;
$this->ChangedDirectVars[] = $var_name;
$this->ChangedDirectVars = array_unique($this->ChangedDirectVars);
}
//return $this->Conn->Query('UPDATE '.$this->TableName.' SET '.$var_name.' = '.$this->Conn->qstr($value).' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->GetID()) );
}
function SaveData(&$session)
{
if(!$session->SID) return false; // can't save without sid
$ses_data = $session->Data->GetParams();
$replace = '';
foreach ($ses_data as $key => $value)
{
if ( isset($this->OriginalData[$key]) && $this->OriginalData[$key] == $value)
{
continue; //skip unchanged session data
}
else
{
$replace .= sprintf("(%s, %s, %s),",
$this->Conn->qstr($session->SID),
$this->Conn->qstr($key),
$this->Conn->qstr($value));
}
}
$replace = rtrim($replace, ',');
if ($replace != '') {
$query = ' REPLACE INTO '.$this->SessionDataTable. ' ('.$this->IDField.', '.$this->DataVarField.', '.$this->DataValueField.') VALUES '.$replace;
$this->Conn->Query($query);
}
if ($this->ChangedDirectVars) {
$changes = array();
foreach ($this->ChangedDirectVars as $var) {
$changes[] = $var.' = '.$this->Conn->qstr($this->DirectVars[$var]);
}
$query = 'UPDATE '.$this->TableName.' SET '.implode(',', $changes).' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->GetID());
$this->Conn->Query($query);
}
}
function RemoveFromData(&$session, $var)
{
$query = 'DELETE FROM '.$this->SessionDataTable.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID).
' AND '.$this->DataVarField.' = '.$this->Conn->qstr($var);
$this->Conn->Query($query);
unset($this->OriginalData[$var]);
}
function GetFromData(&$session, $var)
{
return getArrayValue($this->OriginalData, $var);
}
function GetExpiredSIDs()
{
$query = ' SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE '.$this->TimestampField.' > '.adodb_mktime();
return $this->Conn->GetCol($query);
}
function DeleteExpired()
{
$expired_sids = $this->GetExpiredSIDs();
if ($expired_sids) {
$sessionlog_table = $this->Application->getUnitOption('session-log', 'TableName');
$session_log_sql =
' UPDATE '.$sessionlog_table.'
SET Status = 2, SessionEnd =
( SELECT '.$this->TimestampField.' - '.$this->SessionTimeout.'
FROM '.$this->TableName.'
WHERE '.$this->IDField.' = '.$sessionlog_table.'.SessionId
)
WHERE Status = 0 AND SessionId IN ('.join(',', $expired_sids).')';
if ($sessionlog_table) {
$this->Conn->Query($session_log_sql);
}
$where_clause = ' WHERE '.$this->IDField.' IN ("'.implode('","',$expired_sids).'")';
$sql = 'DELETE FROM '.$this->SessionDataTable.$where_clause;
$this->Conn->Query($sql);
$sql = 'DELETE FROM '.$this->TableName.$where_clause;
$this->Conn->Query($sql);
// delete debugger ouputs left of expired sessions
foreach ($expired_sids as $expired_sid) {
$debug_file = (defined('WRITEABLE') ? WRITEABLE : FULL_PATH.'/kernel').'/cache/debug_@'.$expired_sid.'@.txt';
if (file_exists($debug_file)) {
@unlink($debug_file);
}
}
}
return $expired_sids;
}
function LoadPersistentVars(&$session)
{
$user_id = $session->RecallVar('user_id');
if ($user_id != -2) {
// root & normal users
$sql = 'SELECT VariableValue, VariableName
FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE PortalUserId = '.$user_id;
$this->PersistentVars = $this->Conn->GetCol($sql, 'VariableName');
}
else {
$this->PersistentVars = Array ();
}
}
/**
* Stores variable to persistent session
*
* @param Session $session
* @param string $var_name
* @param mixed $var_value
*/
function StorePersistentVar(&$session, $var_name, $var_value)
{
$user_id = $session->RecallVar('user_id');
if ($user_id == -2 || $user_id === false) {
// -2 (when not logged in), false (when after u:OnLogout event)
$session->StoreVar($var_name, $var_value);
return ;
}
$this->PersistentVars[$var_name] = $var_value;
$key_clause = 'PortalUserId = '.$user_id.' AND VariableName = '.$this->Conn->qstr($var_name);
$sql = 'SELECT VariableName
FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE '.$key_clause;
$record_found = $this->Conn->GetOne($sql);
$fields_hash = Array (
'PortalUserId' => $user_id,
'VariableName' => $var_name,
'VariableValue' => $var_value,
);
if ($record_found) {
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'PersistantSessionData', $key_clause);
}
else {
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PersistantSessionData');
}
}
/**
* Gets persistent variable
*
* @param Session $session
* @param string $var_name
* @param mixed $default
* @return mixed
*/
function RecallPersistentVar(&$session, $var_name, $default = false)
{
if ($session->RecallVar('user_id') == -2) {
if ($default == '_USE_DEFAULT_USER_DATA_') {
$default = null;
}
return $session->RecallVar($var_name, $default);
}
if (array_key_exists($var_name, $this->PersistentVars)) {
return $this->PersistentVars[$var_name];
}
elseif ($default == '_USE_DEFAULT_USER_DATA_') {
$default_user_id = $this->Application->ConfigValue('DefaultSettingsUserId');
if (!$default_user_id) {
$default_user_id = -1;
}
$sql = 'SELECT VariableValue, VariableName
FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE VariableName = '.$this->Conn->qstr($var_name).' AND PortalUserId = '.$default_user_id;
$value = $this->Conn->GetOne($sql);
$this->PersistentVars[$var_name] = $value;
if ($value !== false) {
$this->StorePersistentVar($session, $var_name, $value); //storing it, so next time we don't load default user setting
}
return $value;
}
else {
return $default;
}
}
function RemovePersistentVar(&$session, $var_name)
{
unset($this->PersistentVars[$var_name]);
$user_id = $session->RecallVar('user_id');
if ($user_id != -2) {
$sql = 'DELETE FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE PortalUserId = '.$user_id.' AND VariableName = '.$this->Conn->qstr($var_name);
$this->Conn->Query($sql);
}
}
}
define('smAUTO', 1);
define('smCOOKIES_ONLY', 2);
define('smGET_ONLY', 3);
define('smCOOKIES_AND_GET', 4);
class Session extends kBase {
var $Checkers;
var $Mode;
var $OriginalMode = null;
var $GETName = 'sid';
var $CookiesEnabled = true;
var $CookieName = 'sid';
var $CookieDomain;
var $CookiePath;
var $CookieSecure = 0;
var $SessionTimeout = 3600;
var $Expiration;
var $SID;
+ var $CachedSID;
+
var $SessionSet = false;
/**
* Enter description here...
*
* @var SessionStorage
*/
var $Storage;
var $CachedNeedQueryString = null;
/**
* Session Data array
*
* @var Params
*/
var $Data;
/**
* Names of optional session keys (which does not need to be always stored
*
* @var array
*/
var $OptionalData = array();
function Session($mode=smAUTO)
{
parent::kBase();
$this->SetMode($mode);
}
function SetMode($mode)
{
$this->Mode = $mode;
$this->CachedNeedQueryString = null;
$this->CachedSID = null;
}
function SetCookiePath($path)
{
$this->CookiePath = str_replace(' ', '%20', $path);
}
/**
* Setting cookie domain. Set false for local domains, because they don't contain dots in their names.
*
* @param string $domain
*/
function SetCookieDomain($domain)
{
$this->CookieDomain = substr_count($domain, '.') ? '.'.ltrim($domain, '.') : false;
}
function SetGETName($get_name)
{
$this->GETName = $get_name;
}
function SetCookieName($cookie_name)
{
$this->CookieName = $cookie_name;
}
function InitStorage($special)
{
$this->Storage =& $this->Application->recallObject('SessionStorage.'.$special);
$this->Storage->setSessionTimeout($this->SessionTimeout);
}
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->CheckIfCookiesAreOn();
if ($this->CookiesEnabled) $_COOKIE['cookies_on'] = 1;
$this->Checkers = Array();
$this->InitStorage($special);
$this->Data = new Params();
$tmp_sid = $this->GetPassedSIDValue();
$check = $this->Check();
if ($check) {
$this->SID = $this->GetPassedSIDValue();
$this->Refresh();
$this->LoadData();
}
else {
$this->SetSession();
}
if (!is_null($this->OriginalMode)) $this->SetMode($this->OriginalMode);
}
function ValidateExpired() {
if( !(defined('IS_INSTALL') && IS_INSTALL) )
{
$expired_sids = $this->DeleteExpired();
if ( ( $expired_sids && in_array($this->CachedSID,$expired_sids) ) || ( $this->CachedSID && !$this->SessionSet ) ) {
$this->RemoveSessionCookie();
// true was here to force new session creation, but I used RemoveCookie a line above, to avoid redirect loop with expired sid not being removed
// setSession with true was used before, to set NEW session cookie
$this->SetSession();
$this->Application->HandleEvent($event, 'u:OnSessionExpire');
return ;
}
}
}
function IsHTTPSRedirect()
{
$http_referer = getArrayValue($_SERVER, 'HTTP_REFERER');
return (
( PROTOCOL == 'https://' && preg_match('#http:\/\/#', $http_referer) )
||
( PROTOCOL == 'http://' && preg_match('#https:\/\/#', $http_referer) )
);
}
function CheckReferer($for_cookies=0)
{
if (!$for_cookies) {
if ( !$this->Application->ConfigValue('SessionReferrerCheck') || $_SERVER['REQUEST_METHOD'] != 'POST') {
return true;
}
}
$path = preg_replace('/admin[\/]{0,1}$/', '', $this->CookiePath); // removing /admin for compatability with in-portal (in-link/admin/add_link.php)
$reg = '#^'.preg_quote(PROTOCOL.ltrim($this->CookieDomain, '.').$path).'#';
return preg_match($reg, getArrayValue($_SERVER, 'HTTP_REFERER') ) || (defined('IS_POPUP') && IS_POPUP);
}
/*function CheckDuplicateCookies()
{
if (isset($_SERVER['HTTP_COOKIE'])) {
$cookie_str = $_SERVER['HTTP_COOKIE'];
$cookies = explode('; ', $cookie_str);
$all_cookies = array();
foreach ($cookies as $cookie) {
list($name, $value) = explode('=', $cookie);
if (isset($all_cookies[$name])) {
//double cookie name!!!
$this->RemoveCookie($name);
}
else $all_cookies[$name] = $value;
}
}
}
function RemoveCookie($name)
{
$path = $_SERVER['PHP_SELF'];
$path_parts = explode('/', $path);
$cur_path = '';
setcookie($name, false, null, $cur_path);
foreach ($path_parts as $part) {
$cur_path .= $part;
setcookie($name, false, null, $cur_path);
$cur_path .= '/';
setcookie($name, false, null, $cur_path);
}
}*/
function CheckIfCookiesAreOn()
{
// $this->CheckDuplicateCookies();
if ($this->Mode == smGET_ONLY)
{
//we don't need to bother checking if we would not use it
$this->CookiesEnabled = false;
return;
}
$http_query =& $this->Application->recallObject('HTTPQuery');
$cookies_on = isset($http_query->Cookie['cookies_on']); // not good here
$get_sid = getArrayValue($http_query->Get, $this->GETName);
if ($this->IsHTTPSRedirect() && $get_sid) { //Redirect from http to https on different domain
$this->OriginalMode = $this->Mode;
$this->SetMode(smGET_ONLY);
}
if (!$cookies_on || $this->IsHTTPSRedirect()) {
//If referer is our server, but we don't have our cookies_on, it's definetly off
$is_install = defined('IS_INSTALL') && IS_INSTALL;
if (!$is_install && $this->CheckReferer(1) && !$this->Application->GetVar('admin') && !$this->IsHTTPSRedirect()) {
$this->CookiesEnabled = false;
}
else {
//Otherwise we still suppose cookies are on, because may be it's the first time user visits the site
//So we send cookies on to get it next time (when referal will tell us if they are realy off
$this->SetCookie('cookies_on', 1, adodb_mktime() + 31104000); //one year should be enough
}
}
else
$this->CookiesEnabled = true;
return $this->CookiesEnabled;
}
/**
* Sets cookie for current site using path and domain
*
* @param string $name
* @param mixed $value
* @param int $expires
*/
function SetCookie($name, $value, $expires = null)
{
setcookie($name, $value, $expires, $this->CookiePath, $this->CookieDomain, $this->CookieSecure);
}
function Check()
{
// we should check referer if cookies are disabled, and in combined mode
// auto mode would detect cookies, get only mode would turn it off - so we would get here
// and we don't care about referal in cookies only mode
if ( $this->Mode != smCOOKIES_ONLY && (!$this->CookiesEnabled || $this->Mode == smCOOKIES_AND_GET) ) {
if (!$this->CheckReferer())
return false;
}
$sid = $this->GetPassedSIDValue();
if (empty($sid)) return false;
//try to load session by sid, if everything is fine
$result = $this->LoadSession($sid);
$this->SessionSet = $result;
return $result;
}
function LoadSession($sid)
{
if( $this->Storage->LocateSession($sid) ) {
//if we have session with such SID - get its expiration
$this->Expiration = $this->Storage->GetExpiration();
//If session has expired
if ($this->Expiration < adodb_mktime()) {
$this->Destroy();
- return false;
+
+ // when Destory methods calls SetSession inside and new session get created
+ return $this->SessionSet;
}
//Otherwise it's ok
return true;
}
else //fake or deleted due to expiration SID
return false;
}
function GetPassedSIDValue($use_cache = 1)
{
if (!empty($this->CachedSID) && $use_cache) return $this->CachedSID;
$http_query =& $this->Application->recallObject('HTTPQuery');
$get_sid = getArrayValue($http_query->Get, $this->GETName);
if ($this->Application->GetVar('admin') == 1 && $get_sid) {
$sid = $get_sid;
}
else {
switch ($this->Mode) {
case smAUTO:
//Cookies has the priority - we ignore everything else
$sid = $this->CookiesEnabled ? $this->GetSessionCookie() : $get_sid;
break;
case smCOOKIES_ONLY:
$sid = $this->GetSessionCookie();
break;
case smGET_ONLY:
$sid = $get_sid;
break;
case smCOOKIES_AND_GET:
$cookie_sid = $this->GetSessionCookie();
//both sids should match if cookies are enabled
if (!$this->CookiesEnabled || ($cookie_sid == $get_sid))
{
$sid = $get_sid; //we use get here just in case cookies are disabled
}
else
{
$sid = '';
}
break;
}
}
$this->CachedSID = $sid;
return $this->CachedSID;
}
/**
* Returns session id
*
* @return int
* @access public
*/
function GetID()
{
return $this->SID;
}
/**
* Generates new session id
*
* @return int
* @access private
*/
function GenerateSID()
{
list($usec, $sec) = explode(" ",microtime());
$sid_part_1 = substr($usec, 4, 4);
$sid_part_2 = mt_rand(1,9);
$sid_part_3 = substr($sec, 6, 4);
$digit_one = substr($sid_part_1, 0, 1);
if ($digit_one == 0) {
$digit_one = mt_rand(1,9);
$sid_part_1 = ereg_replace("^0","",$sid_part_1);
$sid_part_1=$digit_one.$sid_part_1;
}
$this->setSID($sid_part_1.$sid_part_2.$sid_part_3);
return $this->SID;
}
/**
* Set's new session id
*
* @param int $new_sid
* @access private
*/
function setSID($new_sid)
{
- $this->SID=$new_sid;
+ $this->SID = $this->CachedSID = $new_sid;
$this->Application->SetVar($this->GETName,$new_sid);
}
function NeedSession()
{
$data = $this->Data->GetParams();
$data_keys = array_keys($data);
$optional_keys = array_unique($this->OptionalData);
$real_keys = array_diff($data_keys, $optional_keys);
return $real_keys ? true : false;
}
function SetSession($force = false)
{
if ($this->SessionSet && !$force) return true;
if (!$force && !($this->Application->IsAdmin() || $this->Application->GetVar('admin')) && !$this->NeedSession()) {
$this->GenerateSID();
return false;
}
if (!$this->SID || $force) $this->GenerateSID();
$this->Expiration = adodb_mktime() + $this->SessionTimeout;
switch ($this->Mode) {
case smAUTO:
if ($this->CookiesEnabled) {
$this->SetSessionCookie();
}
break;
case smGET_ONLY:
break;
case smCOOKIES_ONLY:
case smCOOKIES_AND_GET:
$this->SetSessionCookie();
break;
}
$this->Storage->StoreSession($this);
if ($this->Application->IsAdmin() || $this->Special == 'admin') {
$this->StoreVar('admin', 1);
}
$this->SessionSet = true; // should be called before SaveData, because SaveData will try to SetSession again
if ($this->Special != '') {
// front-session called from admin or otherwise, then save it's data
$this->SaveData();
}
$this->Application->resetCounters('UserSession');
return true;
}
/**
* Returns SID from cookie.
*
* Use 2 cookies to have 2 expiration:
* - 1. for normal expiration when browser is not closed (30 minutes by default), configurable
* - 2. for advanced expiration when browser is closed
*
* @return int
*/
function GetSessionCookie()
{
$keep_session_on_browser_close = $this->Application->ConfigValue('KeepSessionOnBrowserClose');
if (isset($this->Application->HttpQuery->Cookie[$this->CookieName]) &&
( $keep_session_on_browser_close ||
(
!$keep_session_on_browser_close &&
isset($this->Application->HttpQuery->Cookie[$this->CookieName.'_live'])
&&
$this->Application->HttpQuery->Cookie[$this->CookieName] == $this->Application->HttpQuery->Cookie[$this->CookieName.'_live']
)
)
) {
return $this->Application->HttpQuery->Cookie[$this->CookieName];
}
return false;
}
/**
* Updates SID in cookie with new value
*
*/
function SetSessionCookie()
{
$this->SetCookie($this->CookieName, $this->SID, $this->Expiration);
$this->SetCookie($this->CookieName.'_live', $this->SID);
$_COOKIE[$this->CookieName] = $this->SID; // for compatibility with in-portal
}
function RemoveSessionCookie()
{
$this->SetCookie($this->CookieName, '');
$this->SetCookie($this->CookieName.'_live', '');
$_COOKIE[$this->CookieName] = null; // for compatibility with in-portal
}
/**
* Refreshes session expiration time
*
* @access private
*/
function Refresh()
{
if ($this->Application->GetVar('skip_session_refresh')) {
return ;
}
if ($this->CookiesEnabled) {
// we need to refresh the cookie
$this->SetSessionCookie();
}
$this->Storage->UpdateSession($this);
}
function Destroy()
{
$this->Storage->DeleteSession($this);
$this->Data = new Params();
- $this->SID = '';
+ $this->SID = $this->CachedSID = '';
+ $this->SessionSet = false;
+
if ($this->CookiesEnabled) $this->SetSessionCookie(); //will remove the cookie due to value (sid) is empty
+
$this->SetSession(true); //will create a new session, true to force
}
function NeedQueryString($use_cache = 1)
{
if ($this->CachedNeedQueryString != null && $use_cache) return $this->CachedNeedQueryString;
$result = false;
switch ($this->Mode)
{
case smAUTO:
if (!$this->CookiesEnabled) $result = true;
break;
/*case smCOOKIES_ONLY:
break;*/
case smGET_ONLY:
case smCOOKIES_AND_GET:
$result = true;
break;
}
$this->CachedNeedQueryString = $result;
return $result;
}
function LoadData()
{
$this->Data->AddParams($this->Storage->LoadData($this));
}
function PrintSession($comment='')
{
if($this->Application->isDebugMode() && constOn('DBG_SHOW_SESSIONDATA')) {
// dump session data
$this->Application->Debugger->appendHTML('SessionStorage ('.$comment.'):');
$session_data = $this->Data->GetParams();
ksort($session_data);
foreach ($session_data as $session_key => $session_value) {
if (IsSerialized($session_value)) {
$session_data[$session_key] = unserialize($session_value);
}
}
$this->Application->Debugger->dumpVars($session_data);
}
if ($this->Application->isDebugMode() && constOn('DBG_SHOW_PERSISTENTDATA')) {
// dump persistent session data
if ($this->Storage->PersistentVars) {
$this->Application->Debugger->appendHTML('Persistant Session:');
$session_data = $this->Storage->PersistentVars;
ksort($session_data);
foreach ($session_data as $session_key => $session_value) {
if (IsSerialized($session_value)) {
$session_data[$session_key] = unserialize($session_value);
}
}
$this->Application->Debugger->dumpVars($session_data);
}
}
}
function SaveData()
{
if (!$this->SetSession()) { // call it here - it may be not set before, because there was no need; if there is a need, it will be set here
return;
}
if (!$this->Application->GetVar('skip_last_template') && $this->Application->GetVar('ajax') != 'yes') {
$this->SaveLastTemplate( $this->Application->GetVar('t') );
}
$this->PrintSession('after save');
$this->Storage->SaveData($this);
}
function SaveLastTemplate($t)
{
// save last_template
$wid = $this->Application->GetVar('m_wid');
$last_env = $this->getLastTemplateENV($t, Array('m_opener' => 'u'));
$last_template = basename($_SERVER['PHP_SELF']).'|'.mb_substr($last_env, mb_strlen(ENV_VAR_NAME) + 1);
$this->StoreVar(rtrim('last_template_'.$wid, '_'), $last_template);
// prepare last_template for opener stack, module & session could be added later
$last_env = $this->getLastTemplateENV($t, null, false);
$last_template = basename($_SERVER['PHP_SELF']).'|'.mb_substr($last_env, mb_strlen(ENV_VAR_NAME) + 1);
// save last_template in persistant session
if (!$wid) {
if ($this->Application->IsAdmin()) {
// only for main window, not popups, not login template, not temp mode (used in adm:MainFrameLink tag)
$temp_mode = false;
$passed = explode(',', $this->Application->GetVar('passed'));
foreach ($passed as $passed_prefix) {
if ($this->Application->GetVar($passed_prefix.'_mode')) {
$temp_mode = true;
break;
}
}
if (!$temp_mode) {
if (isset($this->Application->HttpQuery->Get['section'])) {
// check directly in GET, bacause LinkVar (session -> request) used on these vars
$last_template .= '§ion='.$this->Application->GetVar('section').'&module='.$this->Application->GetVar('module');
}
$this->StorePersistentVar('last_template_popup', $last_template);
}
}
elseif ($this->Application->GetVar('admin') == 1) {
$admin_session =& $this->Application->recallObject('Session.admin');
/* @var $admin_ses Session */
$admin_session->StorePersistentVar('last_template_popup', '../'.$last_template);
}
}
// save other last... variables for mistical purposes (customizations may be)
$this->StoreVar('last_url', $_SERVER['REQUEST_URI']); // needed by ord:StoreContinueShoppingLink
$this->StoreVar('last_env', mb_substr($last_env, mb_strlen(ENV_VAR_NAME)+1));
// save last template here, becase section & module could be added before
$this->StoreVar(rtrim('last_template_popup_'.$wid, '_'), $last_template);
}
function getLastTemplateENV($t, $params = null, $encode = true)
{
if (!isset($params)) {
$params = Array ();
}
$params['__URLENCODE__'] = 1; // uses "&" instead of "&" for url part concatenation + replaces "\" to "%5C" (works in HTML)
$params = array_merge($this->Application->getPassThroughVariables($params), $params);
$ret = $this->Application->BuildEnv($t, $params, 'all');
if (!$encode) {
// cancels 2nd part of replacements, that URLENCODE does
$ret = str_replace('%5C', '\\', $ret);
}
return $ret;
}
function StoreVar($name, $value, $optional = false)
{
$this->Data->Set($name, $value);
if ($optional) {
$this->OptionalData[] = $name;
}
}
function StorePersistentVar($name, $value)
{
$this->Storage->StorePersistentVar($this, $name, $value);
}
function LoadPersistentVars()
{
$this->Storage->LoadPersistentVars($this);
}
function StoreVarDefault($name, $value, $optional=false)
{
$tmp = $this->RecallVar($name);
if($tmp === false || $tmp == '')
{
$this->StoreVar($name, $value, $optional);
}
}
function RecallVar($name, $default = false)
{
$ret = $this->Data->Get($name);
return ($ret === false) ? $default : $ret;
}
function RecallPersistentVar($name, $default = false)
{
return $this->Storage->RecallPersistentVar($this, $name, $default);
}
function RemoveVar($name)
{
$this->Storage->RemoveFromData($this, $name);
$this->Data->Remove($name);
}
function RemovePersistentVar($name)
{
return $this->Storage->RemovePersistentVar($this, $name);
}
/**
* Ignores session varible value set before
*
* @param string $name
*/
function RestoreVar($name)
{
return $this->StoreVar($name, $this->Storage->GetFromData($this, $name));
}
function GetField($var_name, $default = false)
{
return $this->Storage->GetField($this, $var_name, $default);
}
function SetField($var_name, $value)
{
$this->Storage->SetField($this, $var_name, $value);
}
/**
* Deletes expired sessions
*
* @return Array expired sids if any
* @access private
*/
function DeleteExpired()
{
return $this->Storage->DeleteExpired();
}
/**
* Allows to check if user in this session is logged in or not
*
* @return bool
*/
function LoggedIn()
{
$user_id = $this->RecallVar('user_id');
$ret = $user_id > 0;
if (($this->RecallVar('admin') == 1 || defined('ADMIN')) && ($user_id == -1)) {
$ret = true;
}
return $ret;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/kernel/session/session.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.59.2.20
\ No newline at end of property
+1.59.2.21
\ No newline at end of property
Index: branches/RC/core/units/general/helpers/template_helper.php
===================================================================
--- branches/RC/core/units/general/helpers/template_helper.php (revision 11427)
+++ branches/RC/core/units/general/helpers/template_helper.php (revision 11428)
@@ -1,273 +1,275 @@
<?php
class TemplateHelper extends kHelper {
/**
* parser element location information
*
* @var Array
*/
var $_blockLocation = Array ();
/**
* Block name, that will be used
*
* @var string
*/
var $_blockName = '';
/**
* Function name, that represents compiled block
*
* @var sting
*/
var $_functionName = '';
/**
* Errors found during template parsing
*
* @var Array
*/
var $_parseErrors = Array ();
function TemplateHelper()
{
parent::kHelper();
// 1. get block information
$block_info = $this->Application->GetVar('block');
list ($this->_blockName, $this->_functionName) = explode(':', $block_info);
$this->_parseTemplate();
if (array_key_exists($this->_functionName, $this->Application->Parser->ElementLocations)) {
$this->_blockLocation = $this->Application->Parser->ElementLocations[$this->_functionName];
}
}
/**
* Render source template to get parse errors OR it's element locations
*
*/
function _parseTemplate($append = '')
{
// 1. set internal error handler to catch all parsing errors
$error_handlers = $this->Application->errorHandlers;
$this->Application->errorHandlers = Array (
Array (&$this, '_saveError'),
);
// 2. parse template
$this->Application->InitParser(); // we have no parser when saving block content
$this->Application->Parser->Run($this->Application->GetVar('source') . $append);
// 3. restore original error handler
$this->Application->errorHandlers = $error_handlers;
if ($this->_parseErrors) {
if ($this->_isMainTemplate()) {
// 3.1. delete temporary file, that was parsed
$filename = $this->_getTemplateFile(false, $append . '.tpl');
if (!unlink($filename)) {
$error_file = $this->_getTemplateFile(true, $append . '.tpl');
$this->Application->SetVar('Failed to delete temporary template "<strong>' . $error_file . '</strong>"');
return false;
}
}
else {
// 3.2. restore backup
if (!rename($this->_getTemplateFile(false, '.tpl.bak'), $this->_getTemplateFile(false))) {
$error_file = $this->_getTemplateFile(true);
$this->Application->SetVar('Failed to restore template "<strong>' . $error_file . '</strong>" from backup.');
return false;
}
}
return false;
}
return true;
}
/**
* Returns information about parser element locations in template
*
* @param Array $params
* @return mixed
*/
function blockInfo($info_type)
{
switch ($info_type) {
case 'block_name':
return $this->_blockName;
break;
case 'function_name':
return $this->_functionName;
break;
case 'start_pos':
case 'end_pos':
case 'template':
if (!array_key_exists($info_type, $this->_blockLocation)) {
// invalid block name
return 'invalid block name';
}
return $this->_blockLocation[$info_type];
break;
case 'template_file':
return $this->_getTemplateFile(true);
break;
case 'content':
$function_body = $this->Application->GetVar('function_body');
if ($function_body !== false) {
// error happened -> use unsaved template content
return unhtmlentities( $function_body );
}
$template_body = file_get_contents( $this->_getTemplateFile() );
$length = $this->_blockLocation['end_pos'] - $this->_blockLocation['start_pos'];
return substr($template_body, $this->_blockLocation['start_pos'], $length);
break;
}
return 'undefined';
}
/**
* Main template being edited (parse copy, instead of original)
*
* @return bool
*/
function _isMainTemplate()
{
return $this->_blockLocation['template'] == $this->Application->GetVar('source');
}
/**
* Returns filename, that contains template, where block is located
*
* @return string
*/
function _getTemplateFile($relative = false, $extension = '.tpl')
{
$filename = $this->Application->TemplatesCache->GetRealFilename( $this->_blockLocation['template'] ) . $extension;
if ($relative) {
$filename = preg_replace('/^' . preg_quote(FULL_PATH, '/') . '/', '', $filename, 1);
}
return $filename;
}
/**
* Saves new version of block to template, where it's located
*
* @param kEvent $event
*/
function saveBlock(&$event)
{
$main_template = $this->_isMainTemplate();
$filename = $this->_getTemplateFile(false);
// 1. get new template content
$new_template_body = $this->_getNewTemplateContent($filename, $lines_before);
if (is_bool($new_template_body) && ($new_template_body === true)) {
// when nothing changed -> stop processing
echo '0';
return true;
}
// 2. backup original template
if (!$main_template && !copy($filename, $filename . '.bak')) {
// backup failed
$error_file = $this->_getTemplateFile(true, '.tpl.bak');
$this->Application->SetVar('error_msg', 'Failed to create backup template "<strong>' . $error_file . '</strong>" backup.');
return false;
}
// 3. save changed template
$save_filename = $this->_getTemplateFile(false, $main_template ? '.tmp.tpl' : '.tpl');
$fp = fopen($save_filename, 'w');
if (!$fp) {
// backup template create failed OR existing template save
$error_file = $this->_getTemplateFile(true, $main_template ? '.tmp.tpl' : '.tpl');
$this->Application->SetVar('error_msg', 'Failed to save template "<strong>' . $error_file . '</strong>" changes.');
return false;
}
fwrite($fp, $new_template_body);
fclose($fp);
// 3. parse template to check for errors
$this->_parseTemplate($main_template ? '.tmp' : '');
if ($this->_parseErrors) {
$error_msg = Array ();
foreach ($this->_parseErrors as $error_data) {
if (preg_match('/line ([\d]+)/', $error_data['msg'], $regs)) {
// another line number inside message -> patch it
$error_data['msg'] = str_replace('line ' . $regs[1], 'line ' . ($regs[1] - $lines_before), $error_data['msg']);
}
$error_msg[] = $error_data['msg'] . ' at line ' . ($error_data['line'] - $lines_before);
}
$this->Application->SetVar('error_msg', 'Template syntax errors:<br/>' . implode('<br/>', $error_msg));
return false;
}
if ($main_template) {
// 4.1. replace original file with temporary
if (!rename($this->_getTemplateFile(false, '.tmp.tpl'), $filename)) {
// failed to save new content to original template
$error_file = $this->_getTemplateFile(true);
$this->Application->SetVar('error_msg', 'Failed to save template "<strong>' . $error_file . '</strong>".');
return false;
}
}
else {
// 4.2. delete backup
unlink( $this->_getTemplateFile(false, '.tpl.bak') );
}
+ define('DBG_SKIP_REPORTING', 1);
+ $this->Application->Redirect($this->Application->GetVar('source'));
echo 1; // were changes
return true;
}
/**
* Returns new template content of "true", when nothing is changed
*
* @param string $filename
* @param int $lines_before
* @return mixed
*/
function _getNewTemplateContent($filename, &$lines_before)
{
$new_content = unhtmlentities( $this->Application->GetVar('function_body') );
$template_body = file_get_contents($filename);
$lines_before = substr_count(substr($template_body, 0, $this->_blockLocation['start_pos']), "\n");
$new_template_body = substr($template_body, 0, $this->_blockLocation['start_pos']) .
$new_content .
substr($template_body, $this->_blockLocation['end_pos']);
return crc32($template_body) == crc32($new_template_body) ? true : $new_template_body;
}
function _saveError($errno, $errstr, $errfile, $errline, $errcontext)
{
if (defined('E_STRICT') && ($errno == E_STRICT)) {
// always ignore strict errors here (specially when not in debug mode)
return true;
}
$this->_parseErrors[] = Array ('msg' => $errstr, 'file' => $errfile, 'line' => $errline);
return true;
}
}
\ No newline at end of file
Property changes on: branches/RC/core/units/general/helpers/template_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.1
\ No newline at end of property
+1.1.2.2
\ No newline at end of property
Index: branches/RC/core/units/general/inp_ses_storage.php
===================================================================
--- branches/RC/core/units/general/inp_ses_storage.php (revision 11427)
+++ branches/RC/core/units/general/inp_ses_storage.php (revision 11428)
@@ -1,134 +1,135 @@
<?php
class InpSession extends Session
{
function Init($prefix,$special)
{
$this->SessionTimeout = $this->Application->ConfigValue('SessionTimeout');
$path = (BASE_PATH == '') ? '/' : BASE_PATH;
// if ( $this->Application->IsAdmin() ) $path = rtrim($path, '/').'/admin';
$this->SetCookiePath($path);
$cookie_name = $this->Application->ConfigValue('SessionCookieName');
if (!$cookie_name) $cookie_name = 'sid';
if (($this->Application->IsAdmin() && $special !== 'front') || $special == 'admin' ) { // || $this->Application->GetVar('admin') == 1
$cookie_name = 'adm_'.$cookie_name;
}
$this->SetCookieName($cookie_name);
$this->SetCookieDomain(SERVER_NAME);
if( $this->Application->IsAdmin()) { // && $this->Application->GetVar('admin') != 1
$mode = smAUTO;
}
elseif (constOn('IS_INSTALL')) {
$mode = smCOOKIES_ONLY;
}
else {
$ses_mode = $this->Application->ConfigValue('CookieSessions');
if ($ses_mode == 2) $mode = smAUTO;
if ($ses_mode == 1) $mode = smCOOKIES_ONLY;
if ($ses_mode == 0) $mode = smGET_ONLY;
}
$this->SetMode($mode);
parent::Init($prefix,$special);
if( !$this->Application->IsAdmin() && $this->GetField('PortalUserId') <= 0 )
{
$group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup');
$this->SetField('GroupId', $this->Application->ConfigValue('User_GuestGroup'));
$this->SetField('GroupList', $group_list);
}
}
function Destroy()
{
$this->Storage->DeleteSession($this);
$this->Storage->DeleteEditTables();
$this->Data = new Params();
- $this->SID = '';
+ $this->SID = $this->CachedSID = '';
if ($this->CookiesEnabled) $this->SetSessionCookie(); //will remove the cookie due to value (sid) is empty
+
$this->SetSession(); //will create a new session
}
}
class InpSessionStorage extends SessionStorage {
function Init($prefix,$special)
{
parent::Init($prefix,$special);
$this->setTableName(TABLE_PREFIX.'UserSession');
$this->SessionDataTable = TABLE_PREFIX.'SessionData';
$this->setIDField('SessionKey');
$this->TimestampField = 'LastAccessed';
$this->DataValueField = 'VariableValue';
$this->DataVarField = 'VariableName';
}
function LocateSession($sid)
{
$res = parent::LocateSession($sid);
if ($res) {
$this->Expiration += $this->SessionTimeout;
}
return $res;
}
function UpdateSession(&$session)
{
$time = adodb_mktime();
// Update LastAccessed only if it's newer than 1/10 of session timeout - perfomance optimization to eliminate needless updates on every click
// if ($time - $this->DirectVars['LastAccessed'] > $this->SessionTimeout/10) {
$this->SetField($session, $this->TimestampField, $time + $this->SessionTimeout);
// }
}
function StoreSession(&$session, $additional_fields = Array())
{
$fields_hash = Array( 'PortalUserId' => $this->Application->IsAdmin() ? 0 : -2, // Guest
'Language' => $this->Application->GetDefaultLanguageId(),
'Theme' => $this->Application->GetDefaultThemeId(),
'IpAddress' => $_SERVER['REMOTE_ADDR'],
'GroupId' => $this->Application->ConfigValue('User_GuestGroup'),
'GroupList' => $this->Application->ConfigValue('User_GuestGroup'),
'CurrentTempKey'=> $session->SID,
);
parent::StoreSession($session, $fields_hash);
}
function GetExpiredSIDs()
{
$query = ' SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE '.$this->TimestampField.' < '.(adodb_mktime());
$ret = $this->Conn->GetCol($query);
if($ret) {
$this->DeleteEditTables();
}
return $ret;
}
function DeleteEditTables()
{
$tables = $this->Conn->GetCol('SHOW TABLES');
$mask_edit_table = '/'.TABLE_PREFIX.'ses_(.*)_edit_(.*)/';
$mask_search_table = '/'.TABLE_PREFIX.'ses_(.*?)_(.*)/';
$sql='SELECT COUNT(*) FROM '.$this->TableName.' WHERE '.$this->IDField.' = \'%s\'';
foreach($tables as $table)
{
if( preg_match($mask_edit_table,$table,$rets) || preg_match($mask_search_table,$table,$rets) )
{
$sid = preg_replace('/(.*)_(.*)/', '\\1', $rets[1]); // remove popup's wid from sid
$is_alive = $this->Conn->GetOne( sprintf($sql,$sid) );
if(!$is_alive) $this->Conn->Query('DROP TABLE IF EXISTS '.$table);
}
}
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/general/inp_ses_storage.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.23.2.3
\ No newline at end of property
+1.23.2.4
\ No newline at end of property
Index: branches/RC/core/admin_templates/js/frame_resizer.js
===================================================================
--- branches/RC/core/admin_templates/js/frame_resizer.js (revision 11427)
+++ branches/RC/core/admin_templates/js/frame_resizer.js (revision 11428)
@@ -1,73 +1,85 @@
function FrameResizer($show_title, $hide_title, $frameset, $save_url, open_width) {
this.StatusIcon = {0: 'img/list_arrow_desc.gif', 1 : 'img/list_arrow_no.gif'};
this.StatusText = {0: $hide_title, 1 : $show_title};
this.StatusImage = document.getElementById('menu_toggle_img');
this.StatusTextContainer = document.getElementById('menu_toggle_text');
this.StatusLink = document.getElementById('menu_toggle_link');
this.Frameset = $frameset;
this.SaveURL = $save_url;
this.OpenWidth = open_width ? open_width : 200;
this.SubFrameset = $frameset.document.getElementById('sub_frameset');
this.TopFrameset = $frameset.document.getElementById('top_frameset');
}
FrameResizer.prototype.InitControls = function ($instance) {
this.StatusLink.onclick = function () {
$instance.FrameToggle();
return false;
}
}
FrameResizer.prototype.MenuVisible = function () {
return new RegExp('(.*)' + this.StatusIcon[0] + '$').exec(this.StatusImage.src) ? true : false;
}
FrameResizer.prototype.SetStatus = function ($status, $ajax_save) {
this.StatusImage.src = this.StatusIcon[$status];
this.StatusImage.alt = this.StatusLink.title = this.StatusTextContainer.innerHTML = this.StatusText[$status];
document.getElementById('site_logo').style.display = $status ? 'none' : 'block';
if ($ajax_save) {
// save via ajax
var $url = this.SaveURL.replace('#NAME#', 'ShowAdminMenu').replace('#VALUE#', $status);
Request.makeRequest($url, false, '', this.successCallback, this.errorCallback, '', this);
}
}
FrameResizer.prototype.successCallback = function($request, $params, $object) {
/*var $responce = $request.responseText;
var $match_redirect = new RegExp('^#redirect#(.*)').exec($responce);
if ($match_redirect != null) {
$object.showProgress(100);
// redirect to external template requested
window.location.href = $match_redirect[1];
return false;
}*/
}
FrameResizer.prototype.errorCallback = function($request, $params, $object) {
alert('AJAX Error; class: FrameResizer; ' + Request.getErrorHtml($request));
}
FrameResizer.prototype.FrameToggle = function () {
if (this.MenuVisible()) {
this.setFullscreenMode(true, true);
}
else {
this.setFullscreenMode(false, true);
}
}
FrameResizer.prototype.setFullscreenMode = function ($full_screen, $ajax_save) {
if ($full_screen) {
this.TopFrameset.setAttribute('rows', '25,*');
this.SubFrameset.setAttribute('cols', '0,*');
this.SetStatus(1, $ajax_save);
}
else {
this.TopFrameset.setAttribute('rows', this.Frameset.$top_height + ',*');
this.SubFrameset.setAttribute('cols', this.OpenWidth+',*');
this.SetStatus(0, $ajax_save);
}
+}
+
+FrameResizer.prototype.fullScreen = function ($restore) {
+ if ($restore === undefined) {
+ $restore = false;
+ }
+
+ if (!$restore) {
+ this.lastMenuVisible = this.MenuVisible();
+ }
+
+ this.setFullscreenMode($restore ? !this.lastMenuVisible : true, false);
}
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/js/frame_resizer.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.4.4
\ No newline at end of property
+1.1.4.5
\ No newline at end of property
Index: branches/RC/core/admin_templates/incs/image_blocks.tpl
===================================================================
--- branches/RC/core/admin_templates/incs/image_blocks.tpl (revision 11427)
+++ branches/RC/core/admin_templates/incs/image_blocks.tpl (revision 11428)
@@ -1,152 +1,142 @@
<inp2:m_DefineElement name="image_block">
<img src="<inp2:m_param name="img_path" />" <inp2:m_param name="img_size"/> border="0" /><br />
</inp2:m_DefineElement>
<inp2:m_DefineElement name="thumbnail_section" prefix="" size="" class="">
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <td class="text">
- <inp2:m_phrase label="la_fld_Location"/><br>
- <span class="error"><inp2:{$prefix}_Error field="ThumbPath"/><inp2:{$prefix}_Error field="ThumbUrl"/></span>
+ <tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
+ <td class="label-cell">
+ <inp2:m_phrase label="la_fld_Location"/><!--<br>
+ <span class="error"><inp2:{$prefix}_Error field="ThumbPath"/><inp2:{$prefix}_Error field="ThumbUrl"/></span> -->
</td>
- <td>
+ <td class="control-mid"> </td>
+ <td class="control-cell">
<table border="0">
<tr>
<td>
<inp2:m_inc param="tab_index" by="1"/>
<input type="radio" <inp2:m_if check="{$prefix}_FieldEquals" field="LocalThumb" value="1">checked</inp2:m_if> name="<inp2:{$prefix}_InputName field="LocalThumb"/>" id="<inp2:{$prefix}_InputName field="LocalThumb"/>_1" value="1">
</td>
<td>
<inp2:m_phrase label="la_fld_Upload"/>:
</td>
<td>
<inp2:m_inc param="tab_index" by="1"/>
<input type="file" name="<inp2:{$prefix}_InputName field="ThumbPath"/>" id="<inp2:{$prefix}_InputName field="ThumbPath"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onclick="document.getElementById('<inp2:m_param name="prefix"/>[<inp2:{$prefix}_Field field="ImageId"/>][LocalThumb]_1').checked = true">
<input type="hidden" name="<inp2:{$prefix}_InputName field="ThumbPath"/>[upload]" id="<inp2:{$prefix}_InputName field="ThumbPath"/>[upload]" value="<inp2:{$prefix}_Field field="ThumbPath"/>">
</td>
</tr>
<tr>
<td>
<inp2:m_inc param="tab_index" by="1"/>
<input type="radio" <inp2:m_if check="{$prefix}_FieldEquals" field="LocalThumb" value="0">checked</inp2:m_if> name="<inp2:{$prefix}_InputName field="LocalThumb"/>" id="<inp2:{$prefix}_InputName field="LocalThumb"/>_0" value="0">
</td>
<td>
<inp2:m_phrase label="la_fld_RemoteUrl"/>:
</td>
<td>
<inp2:m_inc param="tab_index" by="1"/>
<input type="text" name="<inp2:{$prefix}_InputName field="ThumbUrl"/>" id="<inp2:{$prefix}_InputName field="ThumbUrl"/>" value="<inp2:{$prefix}_Field field="ThumbUrl"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onclick="document.getElementById('<inp2:m_param name="prefix"/>[<inp2:{$prefix}_Field field="ImageId"/>][LocalThumb]_0').checked = true">
</td>
</tr>
</table>
+ <inp2:{$prefix}_Image block="image_block" Thumbnail="1" DefaultImage="noimage.gif"/>
</td>
- <td>
- <inp2:{$prefix}_Image block="image_block" Thumbnail="1" DefaultImage="noimage.gif"/>
- </td>
+ <inp2:m_RenderElement name="inp_edit_error" prefix="$prefix" field="ThumbPath"/>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="fullsize_section" prefix="" size="" class="">
- <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
- <td class="text">
- <inp2:m_phrase label="la_fld_Location"/><br>
- <span class="error"><inp2:{$prefix}_Error field="LocalPath"/><inp2:{$prefix}_Error field="Url"/></span>
+ <tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
+ <td class="label-cell">
+ <inp2:m_phrase label="la_fld_Location"/><!--<br>
+ <span class="error"><inp2:{$prefix}_Error field="LocalPath"/><inp2:{$prefix}_Error field="Url"/></span> -->
</td>
- <td>
+ <td class="control-mid"> </td>
+ <td class="control-cell">
<table border="0">
<tr>
<td>
<inp2:m_inc param="tab_index" by="1"/>
<input type="radio" <inp2:m_if check="{$prefix}_FieldEquals" field="LocalImage" value="1">checked</inp2:m_if> name="<inp2:{$prefix}_InputName field="LocalImage"/>" id="<inp2:{$prefix}_InputName field="LocalImage"/>_1" value="1">
</td>
<td>
<inp2:m_phrase label="la_fld_Upload"/>:
</td>
<td>
<inp2:m_inc param="tab_index" by="1"/>
<input type="file" name="<inp2:{$prefix}_InputName field="LocalPath"/>" id="<inp2:{$prefix}_InputName field="LocalPath"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onclick="document.getElementById('<inp2:m_param name="prefix"/>[<inp2:{$prefix}_field field="ImageId"/>][LocalImage]_1').checked = true">
<input type="hidden" name="<inp2:{$prefix}_InputName field="LocalPath"/>[upload]" id="<inp2:{$prefix}_InputName field="LocalPath"/>[upload]" value="<inp2:{$prefix}_Field field="LocalPath"/>">
</td>
</tr>
<tr>
<td>
<inp2:m_inc param="tab_index" by="1"/>
<input type="radio" <inp2:m_if check="{$prefix}_FieldEquals" field="LocalImage" value="0">checked</inp2:m_if> name="<inp2:{$prefix}_InputName field="LocalImage"/>" id="<inp2:{$prefix}_InputName field="LocalImage"/>_0" value="0">
</td>
<td>
<inp2:m_phrase label="la_fld_RemoteUrl"/>:
</td>
<td>
<inp2:m_inc param="tab_index" by="1"/>
<input type="text" name="<inp2:{$prefix}_InputName field="Url"/>" id="<inp2:{$prefix}_InputName field="Url"/>" value="<inp2:{$prefix}_Field field="Url"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onclick="document.getElementById('<inp2:m_param name="prefix"/>[<inp2:{$prefix}_Field field="ImageId"/>][LocalImage]_0').checked = true">
</td>
</tr>
</table>
+ <inp2:{$prefix}_Image block="image_block" DefaultImage="noimage.gif"/>
</td>
- <td>
- <inp2:{$prefix}_Image block="image_block" DefaultImage="noimage.gif"/>
- </td>
+ <inp2:m_RenderElement name="inp_edit_error" prefix="$prefix" field="LocalPath"/>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="images_edit_js">
function FieldID($field_name) {
var $field_mask = '<inp2:{$prefix}_InputName field="#FIELD#"/>';
return $field_mask.replace('#FIELD#', $field_name);
}
function toggle_fullsize() {
if (document.getElementById('_cb_' + FieldID('SameImages')).checked) {
document.getElementById(FieldID('LocalImage') + '_0').disabled = true;
document.getElementById(FieldID('LocalImage') + '_1').disabled = true;
document.getElementById(FieldID('LocalPath')).disabled = true;
document.getElementById(FieldID('Url')).disabled = true;
}
else {
document.getElementById(FieldID('LocalImage') + '_0').disabled = false;
document.getElementById(FieldID('LocalImage') + '_1').disabled = false;
document.getElementById(FieldID('LocalPath')).disabled = false;
document.getElementById(FieldID('Url')).disabled = false;
}
}
if (document.getElementById('_cb_' + FieldID('DefaultImg')).checked) {
document.getElementById('_cb_' + FieldID('DefaultImg')).disabled = true;
document.getElementById('_cb_' + FieldID('Enabled')).disabled = true;
}
function check_status() {
if (document.getElementById('_cb_' + FieldID('DefaultImg')).checked) {
document.getElementById('_cb_' + FieldID('Enabled')).checked = true;
document.getElementById(FieldID('Enabled')).value = 1;
}
}
function check_primary() {
if (!document.getElementById('_cb_' + FieldID('Enabled')).checked) {
document.getElementById('_cb_' + FieldID('DefaultImg')).checked = false;
document.getElementById(FieldID('DefaultImg')).value = 0;
}
}
</inp2:m_DefineElement>
-<inp2:m_DefineElement name="image_caption_td" >
- <td valign="top" class="text">
- <input type="checkbox" name="<inp2:{$PrefixSpecial}_InputName field="$IdField" IdField="$IdField"/>" id="<inp2:{$PrefixSpecial}_InputName field="$IdField" IdField="$IdField"/>">
- <img src="<inp2:ModulePath module="In-Portal"/>img/itemicons/<inp2:{$PrefixSpecial}_ItemIcon grid="$grid"/>">
- <inp2:Field field="$field" grid="$grid"/><span class="priority"><inp2:m_if check="{$PrefixSpecial}_fieldequals" field="Priority" value="0"><inp2:m_else/><sup><inp2:{$PrefixSpecial}_field field="Priority" /></sup></inp2:m_if></span>
- </td>
+<inp2:m_DefineElement name="image_caption_td">
+ <inp2:Field field="$field" grid="$grid"/><span class="priority"><inp2:m_if check="FieldEquals" field="Priority" value="0"><inp2:m_else/><sup><inp2:Field field="Priority" /></sup></inp2:m_if></span>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="image_preview_td">
- <td>
- <inp2:Image block="image_block" Thumbnail="1" DefaultImage="noimage.gif" MaxWidth="120" MaxHeight="120"/>
- </td>
+ <inp2:Image block="image_block" Thumbnail="1" DefaultImage="noimage.gif" MaxWidth="120" MaxHeight="120"/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="image_url_td">
- <td valign="top" class="text">
- <inp2:ImageUrl local_phrase="!la_LocalImage!"/>
- </td>
-</inp2:m_DefineElement>
-
-
+ <inp2:ImageUrl local_phrase="!la_LocalImage!"/>
+</inp2:m_DefineElement>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/incs/image_blocks.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7.2.2
\ No newline at end of property
+1.7.2.3
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_list.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_list.tpl (revision 11427)
+++ branches/RC/core/admin_templates/regional/languages_list.tpl (revision 11428)
@@ -1,67 +1,69 @@
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:configure_lang" prefix="lang" module="core" title_preset="languages_list" pagination="1"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
//do not rename - this function is used in default grid for double click!
function edit()
{
std_edit_item('lang', 'regional/languages_edit');
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('new_language', '<inp2:m_phrase label="la_ToolTip_NewLanguage" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
function() {
std_precreate_item('lang', 'regional/languages_edit')
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('lang')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('primary_language', '<inp2:m_phrase label="la_ToolTip_SetPrimaryLanguage" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_SetPrimary" escape="1"/>', function() {
submit_event('lang','OnSetPrimary');
}
) );
a_toolbar.AddButton( new ToolBarButton('import_language', '<inp2:m_phrase label="la_ToolTip_ImportLanguage" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Import" escape="1"/>', function() {
redirect('<inp2:m_t t="regional/languages_import" phrases.import_event="OnNew" m_opener="d" pass="all,m,phrases.import" />');
}
) );
a_toolbar.AddButton( new ToolBarButton('export_language', '<inp2:m_phrase label="la_ToolTip_ExportLanguage" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Export" escape="1"/>', function() {
submit_event('lang','OnExportLanguage');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
</script>
</td>
+
+ <inp2:m_RenderElement name="search_main_toolbar" prefix="lang" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="lang" IdField="LanguageId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
Grids['lang'].SetDependantToolbarButtons( new Array('edit','delete','primary_language','export_language') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/regional/languages_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8
\ No newline at end of property
+1.8.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_edit_tabs.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_edit_tabs.tpl (revision 11427)
+++ branches/RC/core/admin_templates/regional/languages_edit_tabs.tpl (revision 11428)
@@ -1,13 +1,7 @@
-<table style="padding: 2px 0px 0px 0px; margin: 0px; border: none; border-collapse: collapse" width="100%">
-<tr>
- <td align="right" width="100%">
- <table cellpadding="0" cellspacing="0" border="0" height="23">
- <tr>
- <inp2:m_RenderElement name="tab" title="la_tab_General" t="regional/languages_edit" main_prefix="lang"/>
- <inp2:m_RenderElement name="tab" title="la_tab_Labels" t="regional/languages_edit_phrases" main_prefix="lang"/>
- <inp2:m_RenderElement name="tab" title="la_tab_EmailEvents" t="regional/languages_edit_email_events" main_prefix="lang"/>
- </tr>
- </table>
- </td>
-</tr>
-</table>
\ No newline at end of file
+<inp2:m_DefineElement name="language_tabs">
+ <inp2:m_RenderElement name="tab" title="la_tab_General" t="regional/languages_edit" main_prefix="lang"/>
+ <inp2:m_RenderElement name="tab" title="la_tab_Labels" t="regional/languages_edit_phrases" main_prefix="lang"/>
+ <inp2:m_RenderElement name="tab" title="la_tab_EmailEvents" t="regional/languages_edit_email_events" main_prefix="lang"/>
+</inp2:m_DefineElement>
+
+<inp2:m_RenderElement name="tabs_container" tabs_render_as="language_tabs"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/regional/languages_edit_tabs.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.3.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_edit_email_events.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_edit_email_events.tpl (revision 11427)
+++ branches/RC/core/admin_templates/regional/languages_edit_email_events.tpl (revision 11428)
@@ -1,78 +1,79 @@
+<inp2:adm_SetPopupSize width="850" height="600"/>
<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_RegionalSettings!"/>
<inp2:m_include t="regional/languages_edit_tabs"/>
<inp2:m_RenderElement name="blue_bar" prefix="lang" title_preset="events_list" emailevents[grid]="Default" module="in-portal" icon="icon46_conf_regional"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function edit()
{
std_edit_temp_item('phrases', 'regional/email_messages_edit');
}
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('lang','<inp2:lang_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('lang','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('lang', '<inp2:lang_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('lang', '<inp2:lang_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
<inp2:m_if check="lang_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="lang_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="lang_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="emailevents" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="emailevents" IdField="EventId" grid="Default" menu_filters="yes" main_prefix="lang"/>
<script type="text/javascript">
Grids['emailevents'].SetDependantToolbarButtons( new Array('edit') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/regional/languages_edit_email_events.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.1
\ No newline at end of property
+1.3.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/regional/languages_edit_phrases.tpl
===================================================================
--- branches/RC/core/admin_templates/regional/languages_edit_phrases.tpl (revision 11427)
+++ branches/RC/core/admin_templates/regional/languages_edit_phrases.tpl (revision 11428)
@@ -1,87 +1,88 @@
+<inp2:adm_SetPopupSize width="850" height="600"/>
<inp2:m_RequireLogin permissions="in-portal:configure_lang.view" system="1"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="section_header" icon="icon46_conf_regional" title="!la_title_RegionalSettings!"/>
<inp2:m_include t="regional/languages_edit_tabs"/>
<inp2:m_RenderElement name="blue_bar" prefix="lang" phrases[grid]="Default" pagination="0" title_preset="phrases_list" module="in-portal" icon="icon46_conf_regional"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function edit()
{
std_edit_temp_item('phrases', 'regional/phrases_edit');
}
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('lang','<inp2:lang_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('lang','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('lang', '<inp2:lang_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('lang', '<inp2:lang_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('new_language_var', '<inp2:m_phrase label="la_ToolTip_NewLabel" escape="1"/>::<inp2:m_phrase label="la_Add" escape="1"/>',
function() {
std_new_item('phrases', 'regional/phrases_edit')
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('phrases')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
<inp2:m_if check="lang_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="lang_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="lang_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="phrases" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="phrases" IdField="PhraseId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
Grids['phrases'].SetDependantToolbarButtons( new Array('edit','delete') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/regional/languages_edit_phrases.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.3.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/stylesheets_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/stylesheets_edit.tpl (revision 11427)
+++ branches/RC/core/admin_templates/stylesheets/stylesheets_edit.tpl (revision 11428)
@@ -1,69 +1,70 @@
+<inp2:adm_SetPopupSize width="750" height="400"/>
<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
<inp2:m_include t="incs/header" nobody="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_RenderElement name="section_header" prefix="css" icon="icon46_style" module="in-portal" title="!la_title_Stylesheets!"/>
<inp2:m_include t="stylesheets/stylesheets_tabs"/>
<inp2:m_RenderElement name="blue_bar" prefix="css" title_preset="stylesheets_edit" module="in-portal" icon="icon46_style"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('css','<inp2:css_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('css','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('css', '<inp2:css_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('css', '<inp2:css_NextId/>');
}
) );
a_toolbar.Render();
<inp2:m_if check="css_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="css_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="css_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:css_SaveWarning name="grid_save_warning"/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
<inp2:m_RenderElement name="inp_id_label" prefix="css" field="StylesheetId" title="!la_fld_StylesheetId!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="css" field="Name" title="!la_fld_Name!" size="40"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="css" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="css" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="css" field="Enabled" title="!la_fld_Enabled!"/>
</table>
<inp2:m_include t="incs/footer"/>
Property changes on: branches/RC/core/admin_templates/stylesheets/stylesheets_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8.2.1
\ No newline at end of property
+1.8.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/style_editor.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/style_editor.tpl (revision 11427)
+++ branches/RC/core/admin_templates/stylesheets/style_editor.tpl (revision 11428)
@@ -1,146 +1,147 @@
+<inp2:adm_SetPopupSize width="750" height="400"/>
<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
<inp2:m_include t="incs/header" nobody="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_RenderElement name="blue_bar" prefix="css" title_preset="style_edit" module="in-portal" icon="icon46_style"/>
<script src="js/colorselector.js" type="text/javascript"></script>
<style type="text/css">
.ColorBox
{
font-size: 1px;
border: #808080 1px solid;
width: 10px;
position: static;
height: 10px;
}
</style>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('selectors','OnSaveStyle');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
window.close();
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_ResetToBase" escape="1"/>', function() {
submit_event('selectors','OnResetToBase');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="inp_edit_color">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title_phrase="$title_phrase" title="$title" is_last="$is_last"/>
<td>
<input type="text"
name="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>"
id="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>"
value="<inp2:{$prefix}_Field field="$field" subfield="$subfield"/>"
tabindex="<inp2:m_get param="tab_index"/>"
size="<inp2:m_param name="size"/>"
maxlength="<inp2:m_param name="maxlength"/>"
class="<inp2:m_param name="class"/>"
onkeyup="updateColor(event,'<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>')"
onblur="<inp2:m_Param name="onblur"/>">
<div id="color_<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>" style="display: inline; border: 1px solid #000000;" onclick="openColorSelector(event,'<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>');"> </div>
<script language="javascript">
updateColor(null,'<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>');
</script>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/> </td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="inp_edit_options_style">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="$prefix" field="$field" title_phrase="$title_phrase" title="$title" is_last="$is_last"/>
<td>
<select tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>" id="<inp2:{$prefix}_InputName field="$field" subfield="$subfield"/>" onchange="<inp2:m_Param name="onchange"/>">
<inp2:{$prefix}_PredefinedOptions field="$field" value_field="$value_field" subfield="$subfield" block="inp_option_item" selected="selected"/>
</select>
</td>
<td class="error"><inp2:{$prefix}_Error field="$field"/> </td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="subsection_collapse">
<tr class="subsectiontitle">
<td colspan="5"><inp2:m_phrase label="$title"/></td>
</tr>
</inp2:m_DefineElement>
<inp2:selectors_SaveWarning name="grid_save_warning"/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<inp2:m_RenderElement name="subsection_collapse" title="!la_Font!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font" title="!la_fld_Font!" size="50"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font-family" title="!la_fld_FontFamily!" size="40"/>
<inp2:m_RenderElement name="inp_edit_color" prefix="selectors" field="SelectorData" subfield="color" title="!la_fld_FontColor!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="font-size" title="!la_fld_FontSize!"/>
<inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="font-style" value_field="FontStyle" title="!la_fld_FontStyle!"/>
<inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="font-weight" value_field="FontWeight" title="!la_fld_FontWeight!"/>
<inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="text-align" value_field="TextAlign" title="!la_fld_TextAlign!"/>
<inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="text-decoration" value_field="TextDecoration" title="!la_fld_TextDecoration!"/>
<inp2:m_RenderElement name="subsection_collapse" title="!la_Background!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background" title="!la_fld_Background!" size="50"/>
<inp2:m_RenderElement name="inp_edit_color" prefix="selectors" field="SelectorData" subfield="background-color" title="!la_fld_BackgroundColor!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-image" title="!la_fld_BackgroundImage!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-repeat" title="!la_fld_BackgroundRepeat!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-attachment" title="!la_fld_BackgroundAttachment!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="background-position" title="!la_fld_BackgroundPosition!"/>
<inp2:m_RenderElement name="subsection_collapse" title="!la_Borders!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border" title="!la_fld_Borders!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-top" title="!la_fld_BorderTop!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-right" title="!la_fld_BorderRight!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-bottom" title="!la_fld_BorderBottom!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="border-left" title="!la_fld_BorderLeft!"/>
<inp2:m_RenderElement name="subsection_collapse" title="!la_Paddings!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding" title="!la_fld_Paddings!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-top" title="!la_fld_PaddingTop!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-right" title="!la_fld_PaddingRight!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-bottom" title="!la_fld_PaddingBottom!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="padding-left" title="!la_fld_PaddingLeft!"/>
<inp2:m_RenderElement name="subsection_collapse" title="!la_Margins!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin" title="!la_fld_Margins!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-top" title="!la_fld_MarginTop!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-right" title="!la_fld_MarginRight!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-bottom" title="!la_fld_MarginBottom!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="margin-left" title="!la_fld_MarginLeft!"/>
<inp2:m_RenderElement name="subsection_collapse" title="!la_PositionAndVisibility!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="width" title="!la_fld_Width!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="height" title="!la_fld_Height!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="left" title="!la_fld_Left!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="top" title="!la_fld_Top!"/>
<inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="position" value_field="StylePosition" title="!la_fld_Position!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorData" subfield="z-index" title="!la_fld_Z-Index!"/>
<inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="display" value_field="StyleDisplay" title="!la_fld_Display!"/>
<inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="visibility" value_field="StyleVisibility" title="!la_fld_Visibility!"/>
<inp2:m_RenderElement name="inp_edit_options_style" prefix="selectors" field="SelectorData" subfield="cursor" value_field="StyleCursor" title="!la_fld_Cursor!"/>
</table>
<script language="javascript" type="text/javascript">
InitColorSelector();
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/style_editor.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.12.2.1
\ No newline at end of property
+1.12.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/stylesheets_edit_base.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/stylesheets_edit_base.tpl (revision 11427)
+++ branches/RC/core/admin_templates/stylesheets/stylesheets_edit_base.tpl (revision 11428)
@@ -1,103 +1,104 @@
+<inp2:adm_SetPopupSize width="750" height="400"/>
<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
<inp2:m_include t="incs/header" nobody="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_RenderElement name="section_header" prefix="css" icon="icon46_style" module="in-portal" title="!la_title_Stylesheets!"/>
<inp2:m_include t="stylesheets/stylesheets_tabs"/>
<inp2:m_RenderElement name="blue_bar" prefix="css" title_preset="base_styles" module="in-portal" icon="icon46_style"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('css','<inp2:css_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('css','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('css', '<inp2:css_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('css', '<inp2:css_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('new_selector', '<inp2:m_phrase label="la_ToolTip_NewBaseStyle" escape="1"/>',
function() {
set_hidden_field('remove_specials[selectors.base]',1);
std_new_item('selectors.base', 'stylesheets/base_style_edit')
} ) );
function edit()
{
set_hidden_field('remove_specials[selectors.base]',1);
std_edit_temp_item('selectors.base', 'stylesheets/base_style_edit');
}
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('selectors.base')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>', function() {
set_hidden_field('remove_specials[selectors.base]',1);
submit_event('selectors.base','OnMassClone');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep4') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
<inp2:m_if check="css_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
//a_toolbar.HideButton('sep2');
<inp2:m_else/>
<inp2:m_if check="css_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="css_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="grid_description_td" >
- <td valign="top" class="text"><inp2:{$PrefixSpecial}_field field="$field" grid="$grid" no_special="$no_special" cut_first="100"/></td>
+ <inp2:Field field="$field" grid="$grid" no_special="$no_special" cut_first="100"/>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="grid" PrefixSpecial="selectors.base" IdField="SelectorId" grid="Default" header_block="grid_column_title" data_block="grid_data_td" search="on"/>
<script type="text/javascript">
Grids['selectors.base'].SetDependantToolbarButtons( new Array('edit','delete','clone') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/stylesheets_edit_base.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.9.2.1
\ No newline at end of property
+1.9.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/stylesheets_edit_block.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/stylesheets_edit_block.tpl (revision 11427)
+++ branches/RC/core/admin_templates/stylesheets/stylesheets_edit_block.tpl (revision 11428)
@@ -1,111 +1,112 @@
+<inp2:adm_SetPopupSize width="750" height="400"/>
<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
<inp2:m_include t="incs/header" nobody="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_RenderElement name="section_header" prefix="css" icon="icon46_style" module="in-portal" title="!la_title_Stylesheets!"/>
<inp2:m_include t="stylesheets/stylesheets_tabs"/>
<inp2:m_RenderElement name="blue_bar" prefix="css" title_preset="block_styles" module="in-portal" icon="icon46_style"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('css','<inp2:css_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('css','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('css', '<inp2:css_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('css', '<inp2:css_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
//Relations related:
a_toolbar.AddButton( new ToolBarButton('new_selector', '<inp2:m_phrase label="la_ToolTip_NewBlockStyle" escape="1"/>',
function() {
set_hidden_field('remove_specials[selectors.block]',1);
std_new_item('selectors.block', 'stylesheets/block_style_edit')
} ) );
function edit()
{
set_hidden_field('remove_specials[selectors.block]',1);
std_edit_temp_item('selectors.block', 'stylesheets/block_style_edit');
}
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('selectors.block')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>', function() {
set_hidden_field('remove_specials[selectors.block]',1);
submit_event('selectors.block','OnMassClone');
}
) );
a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_ResetToBase" escape="1"/>', function() {
set_hidden_field('remove_specials[selectors.block]',1);
submit_event('selectors.block','OnMassResetToBase');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep4') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
<inp2:m_if check="css_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
//a_toolbar.HideButton('sep2');
<inp2:m_else/>
<inp2:m_if check="css_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="css_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="grid_description_td" >
<td valign="top" class="text"><inp2:{$PrefixSpecial}_field field="$field" grid="$grid" no_special="$no_special" cut_first="100"/></td>
</inp2:m_DefineElement>
<inp2:m_RenderElement name="grid" PrefixSpecial="selectors.block" IdField="SelectorId" grid="BlockStyles" header_block="grid_column_title" data_block="grid_data_td" search="on"/>
<script type="text/javascript">
Grids['selectors.block'].SetDependantToolbarButtons( new Array('edit','delete','clone','reset_to_base') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/stylesheets_edit_block.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.10.2.1
\ No newline at end of property
+1.10.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/base_style_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/base_style_edit.tpl (revision 11427)
+++ branches/RC/core/admin_templates/stylesheets/base_style_edit.tpl (revision 11428)
@@ -1,103 +1,104 @@
+<inp2:adm_SetPopupSize width="750" height="400"/>
<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
<inp2:m_include t="incs/header" nobody="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_RenderElement name="section_header" prefix="css" icon="icon46_style" module="in-portal" title="!la_title_Stylesheets!"/>
<inp2:m_RenderElement name="blue_bar" prefix="css" title_preset="base_style_edit" module="in-portal" icon="icon46_style"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('selectors','<inp2:selectors_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('selectors','OnCancel');
}
) );
a_toolbar.Render();
function ValidateRequired()
{
var $fields = new Array('<inp2:selectors_InputName field="Name"/>',
'<inp2:selectors_InputName field="SelectorName"/>');
var $ret = true;
var $i = 0;
var $value = '';
while($i < $fields.length)
{
$value = document.getElementById( $fields[$i] ).value;
$value = $value.replace(' ','');
if($value.length == 0)
{
$ret = false;
break;
}
$i++;
}
return $ret;
}
function editStyle()
{
if( ValidateRequired() )
{
openSelector('selectors', '<inp2:m_t t="stylesheets/style_editor" pass="all"/>', '', '850x460', 'OnOpenStyleEditor');
}
else
{
alert( RemoveTranslationLink('<inp2:m_phrase name="la_RequiredWarning"/>') );
}
}
</script>
</td>
</tr>
</tbody>
</table>
<inp2:selectors_SaveWarning name="grid_save_warning"/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="selectors" field="StylesheetId"/>
<input type="hidden" name="<inp2:selectors_InputName field="Type"/>" value="1">
<inp2:m_RenderElement name="inp_id_label" prefix="selectors" field="SelectorId" title="!la_fld_SelectorId!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorName" title="!la_fld_SelectorName!" size="40"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="Name" title="!la_fld_Name!" size="40"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="selectors" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="selectors" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text" valign="top">
<inp2:m_phrase name="la_fld_SelectorData"/>:<br>
<a href="javascript:editStyle();"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
</td>
<td>
<table width="100%">
<tr>
<td><inp2:m_phrase name="la_StyleDefinition"/>:</td>
<td>
<inp2:selectors_PrintStyle field="SelectorData"/>
</td>
<td><inp2:m_phrase name="la_StylePreview"/>:</td>
<td style="<inp2:selectors_PrintStyle field="SelectorData" inline="inline"/>">
<inp2:m_phrase name="la_SampleText"/>
</td>
</tr>
</table>
</td>
<td class="error"> </td>
</tr>
</table>
<input type="hidden" name="main_prefix" id="main_prefix" value="selectors">
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/base_style_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11.2.1
\ No newline at end of property
+1.11.2.2
\ No newline at end of property
Index: branches/RC/core/admin_templates/stylesheets/block_style_edit.tpl
===================================================================
--- branches/RC/core/admin_templates/stylesheets/block_style_edit.tpl (revision 11427)
+++ branches/RC/core/admin_templates/stylesheets/block_style_edit.tpl (revision 11428)
@@ -1,113 +1,114 @@
+<inp2:adm_SetPopupSize width="750" height="400"/>
<inp2:m_RequireLogin permissions="in-portal:configure_styles.view" system="1"/>
<inp2:m_include t="incs/header" nobody="yes"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_RenderElement name="section_header" prefix="css" icon="icon46_style" module="in-portal" title="!la_title_Stylesheets!"/>
<inp2:m_RenderElement name="blue_bar" prefix="css" title_preset="block_style_edit" module="in-portal" icon="icon46_style"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('selectors','<inp2:selectors_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('selectors','OnCancel');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('reset_to_base', '<inp2:m_phrase label="la_ToolTip_ResetToBase" escape="1"/>', function() {
submit_event('selectors','OnResetToBase');
}
) );
a_toolbar.Render();
function ValidateRequired()
{
var $fields = new Array('<inp2:selectors_InputName field="Name"/>',
'<inp2:selectors_InputName field="SelectorName"/>');
var $ret = true;
var $i = 0;
var $value = '';
while($i < $fields.length)
{
$value = document.getElementById( $fields[$i] ).value;
$value = $value.replace(' ','');
if($value.length == 0)
{
$ret = false;
break;
}
$i++;
}
return $ret;
}
function editStyle()
{
if( ValidateRequired() )
{
openSelector('selectors', '<inp2:m_t t="stylesheets/style_editor" pass="all"/>', '', '850x460', 'OnOpenStyleEditor');
}
else
{
alert( RemoveTranslationLink('<inp2:m_phrase name="la_RequiredWarning"/>') );
}
}
</script>
</td>
</tr>
</tbody>
</table>
<inp2:selectors_SaveWarning name="grid_save_warning"/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
<inp2:m_RenderElement name="inp_edit_hidden" prefix="selectors" field="StylesheetId"/>
<input type="hidden" name="<inp2:selectors_InputName field="Type"/>" value="2">
<inp2:m_RenderElement name="inp_id_label" prefix="selectors" field="SelectorId" title="!la_fld_SelectorId!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="SelectorName" title="!la_fld_SelectorName!" size="40"/>
<inp2:m_RenderElement name="inp_edit_options" prefix="selectors" field="ParentId" title="!la_fld_SelectorBase!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="selectors" field="Name" title="!la_fld_Name!" size="40"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="selectors" field="Description" title="!la_fld_Description!" rows="10" cols="40"/>
<inp2:m_RenderElement name="inp_edit_textarea" prefix="selectors" field="AdvancedCSS" title="!la_fld_AdvancedCSS!" rows="10" cols="40"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="text" valign="top">
<inp2:m_phrase name="la_fld_SelectorData"/>:<br>
<a href="javascript:editStyle();"><img src="img/icons/icon24_link_editor.gif" style="cursor:hand" border="0"></a>
</td>
<td>
<table width="100%">
<tr>
<td><inp2:m_phrase name="la_StyleDefinition"/>:</td>
<td>
<inp2:selectors_PrintStyle field="SelectorData"/>
</td>
<td><inp2:m_phrase name="la_StylePreview"/>:</td>
<td style="<inp2:selectors_PrintStyle field="SelectorData" inline="inline"/>">
<inp2:m_phrase name="la_SampleText"/>
</td>
</tr>
</table>
</td>
<td class="error"> </td>
</tr>
</table>
<input type="hidden" name="main_prefix" id="main_prefix" value="selectors">
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/stylesheets/block_style_edit.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.11.2.1
\ No newline at end of property
+1.11.2.2
\ No newline at end of property
Event Timeline
Log In to Comment