Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Feb 2, 9:51 AM

in-portal

Index: trunk/admin/config/addtheme.php
===================================================================
--- trunk/admin/config/addtheme.php (revision 1073)
+++ trunk/admin/config/addtheme.php (revision 1074)
@@ -1,257 +1,258 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
if(!strlen($pathtoroot))
{
$path=dirname(realpath(__FILE__));
if(strlen($path))
{
/* determine the OS type for path parsing */
$pos = strpos($path,":");
if ($pos === false)
{
$gOS_TYPE="unix";
$pathchar = "/";
}
else
{
$gOS_TYPE="win";
$pathchar="\\";
}
$p = $path.$pathchar;
/*Start looking for the root flag file */
while(!strlen($pathtoroot) && strlen($p))
{
$sub = substr($p,strlen($pathchar)*-1);
if($sub==$pathchar)
{
$filename = $p."root.flg";
}
else
$filename = $p.$pathchar."root.flg";
if(file_exists($filename))
{
$pathtoroot = $p;
}
else
{
$parent = realpath($p.$pathchar."..".$pathchar);
if($parent!=$p)
{
$p = $parent;
}
else
$p = "";
}
}
if(!strlen($pathtoroot))
$pathtoroot = ".".$pathchar;
}
else
{
$pathtoroot = ".".$pathchar;
}
}
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if($sub!=$pathchar)
{
$pathtoroot = $pathtoroot.$pathchar;
}
//echo $pathtoroot;
//print_r($_GET);
//print_r($_POST);
require_once($pathtoroot."kernel/startup.php");
//admin only util
/* set the destination of the image upload, relative to the root path */
$DestDir = "kernel/images/";
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
$browseURL = $adminURL."/browse";
$pathtolocal = $pathtoroot."kernel/";
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/browse/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
$m = GetModuleArray();
foreach($m as $key=>$value)
{
$path = $pathtoroot. $value."admin/include/parser.php";
if(file_exists($path))
{
include_once($path);
}
}
unset($objEditItems);
$objEditItems = new clsThemeList();
$objEditItems->SourceTable = $objSession->GetEditTable("Theme");
$objEditItems->EnablePaging = FALSE;
if ($_GET["new"] == 1)
{
$c = new clsTheme(NULL);
$en = 0;
$action = "m_theme_add";
$name = prompt_language("la_Text_NewTheme");
$objThemes->CreateEmptyEditTable("ThemeId");
}
else
{
$en = (int)$_GET["en"];
if (isset($_POST["itemlist"]))
{
$objThemes->CopyToEditTable("ThemeId",$_POST["itemlist"]);
}
$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable);
$itemcount=$objEditItems->NumItems();
$c = $objEditItems->GetItemByIndex($en);
if($itemcount>1)
{
if ($en+1 == $itemcount)
$en_next = -1;
else
$en_next = $en+1;
if ($en == 0)
$en_prev = -1;
else
$en_prev = $en-1;
}
$action = "m_theme_edit";
$name = $c->Get("Name");
}
$section = "in-portal:theme_general";
$envar = "env=".BuildEnv();
$title = GetTitle("la_Text_Theme", "la_tab_General", $c->Get('ThemeId'), $c->Get('Name'));//prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Theme")." -'".$name."'";
//Display header
$sec = $objSections->GetSection($section);
$objCatToolBar = new clsToolBar();
$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","edit_submit('theme','ThemeEditStatus','".$admin."/config/config_theme.php',1);","/toolbar/tool_select.gif");
$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","edit_submit('theme','ThemeEditStatus','".$admin."/config/config_theme.php',2);",$imagesURL."/toolbar/tool_cancel.gif");
if ( isset($en_prev) || isset($en_next) )
{
$url = $RootUrl.$admin."/config/addtheme.php";
$StatusField = "ThemeEditStatus";
$form = "theme";
MultiEditButtons($objCatToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick"));
$objCatToolBar->Add("divider");
}
int_header($objCatToolBar,NULL,$title);
$c->Data=inp_htmlize($c->Data);
if ($objSession->GetVariable("HasChanges") == 1) {
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
<tr>
<td valign="top">
<?php int_hint_red(admin_language("la_Warning_Save_Item")); ?>
</td>
</tr>
</table>
<?php } ?>
<FORM enctype="multipart/form-data" ID="theme" NAME="theme" method="POST" ACTION="">
<TABLE cellSpacing="0" cellPadding="2" width="100%" class="tableborder">
<?php int_subsection_title(prompt_language("la_tab_General")); ?>
<TR <?php int_table_color(); ?> >
<TD><?php echo prompt_language("la_prompt_ThemeId"); ?></TD>
<TD><?php echo $c->Get("ThemeId"); ?></TD>
<TD></TD>
</TR>
<TR <?php int_table_color(); ?> >
<TD><SPAN id="prompt_name" CLASS="text"><?php echo prompt_language("la_prompt_Name"); ?></SPAN></TD>
<TD><input type=text ValidationType="theme_name" NAME="name" VALUE="<?php echo $c->Get("Name"); ?>" maxlength="16"></TD>
<TD></TD>
</TR>
<TR <?php int_table_color(); ?> >
<TD><SPAN id="prompt_description"><?php echo prompt_language("la_prompt_Description"); ?></SPAN></TD>
<TD><input type=text NAME="description" VALUE="<?php echo $c->Get("Description"); ?>"></TD>
<TD></TD>
</TR>
<tr <?php int_table_color(); ?>>
<td valign="top" class="text"><?php echo prompt_language("la_prompt_Enabled"); ?></td>
<td>
<input type="checkbox" id="enabled_prompt" name="enabled_prompt" class="text" value="1" <?php if($c->Get("Enabled") == 1) echo "checked "; if($c->Get("PrimaryTheme") == 1) echo 'disabled ';?> onchange="align_enabled_value()">
<input type="hidden" id="enabled" name="enabled" class="text" <?php echo 'value="'.$c->Get("Enabled").'"'; ?>>
</td>
<td class="text">&nbsp;</td>
</tr>
<tr <?php int_table_color(); ?>>
<td valign="top" class="text"><?php echo prompt_language("la_prompt_lang_cache_timeout"); ?></td>
<td>
<input type=text NAME="CacheTimeout" VALUE="<?php echo $c->Get("CacheTimeout"); ?>">
</td>
<td class="text">&nbsp;</td>
</tr>
<tr <?php int_table_color(); ?>>
<td valign="top" class="text"><?php echo prompt_language("la_prompt_Primary"); ?></td>
<td>
- <input type="checkbox" name="primary_prompt" id="primary_prompt" class="text" value="1" <?php if($c->Get("PrimaryTheme") == 1) echo 'checked disabled'; ?> onchange="align_primary_value()">
+ <input type="checkbox" name="primary_prompt" id="primary_prompt" class="text" value="1" <?php if($c->Get("PrimaryTheme") == 1) echo 'checked disabled';
+ elseif (!$c->Get("ThemeId")) echo 'disabled'; ?> onchange="align_primary_value()">
<input type="hidden" name="primary" id="primary" <?php echo 'value="'.$c->Get("PrimaryTheme").'"'; ?>>
</td>
<td class="text">&nbsp;</td>
<input type=hidden NAME="Action" VALUE="<?php echo $action; ?>">
<INPUT TYPE="hidden" NAME="ThemeId" VALUE="<?php echo $c->Get("ThemeId"); ?>">
<input TYPE="HIDDEN" NAME="DataType" VALUE="<?php echo $DataType; ?>">
<input type="hidden" name="ThemeEditStatus" VALUE="0">
</FORM>
</tr>
<FORM>
<TR <?php int_table_color(); ?> >
<td colspan="3">
</td>
</tr>
</FORM>
</TABLE>
<!-- CODE FOR VIEW MENU -->
<form method="post" action="user_groups.php?<?php echo $envar; ?>" name="viewmenu">
<input type="hidden" name="fieldname" value="">
<input type="hidden" name="varvalue" value="">
<input type="hidden" name="varvalue2" value="">
<input type="hidden" name="Action" value="">
</form>
<!-- END CODE-->
<?php int_footer(); ?>
Property changes on: trunk/admin/config/addtheme.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.7
\ No newline at end of property
+1.8
\ No newline at end of property

Event Timeline