?PNG
IHDR ? f ??C1 sRGB ?? gAMA ?a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning : file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning : Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning : Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning : Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning : Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning : Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning : Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
PK 9[a(z z function.inc.phpnu W+A
function InsertObject_FieldsFromBaseObject($BaseObjectID,$NewObjectID){
global $LinkID;
mysql_query("INSERT INTO `".(LOWER_CASE_TABLES ? "object_field" : "Object_Field")."` (`Object_ID`, `Object_Field_Name`, `Description`, `TypeOfData_ID`, `Format`, `NotNull`, `Priority`, `DoSearch`, `DefaultState`, `Inheritance`, `System_ID`, `TypeOfEdit_ID`) SELECT $NewObjectID, `Object_Field_Name`, `Description`, `TypeOfData_ID`, `Format`, `NotNull`, `Priority`, `DoSearch`, `DefaultState`, `Inheritance`, `System_ID`, `TypeOfEdit_ID` FROM `".(LOWER_CASE_TABLES ? "object_field" : "Object_Field")."` WHERE `Object_ID`=$BaseObjectID",$LinkID);
$Result=mysql_query("SELECT `Object_Field_ID` FROM `".(LOWER_CASE_TABLES ? "object_field" : "Object_Field")."` WHERE `Object_ID`='$NewObjectID'",$LinkID);
if (mysql_num_rows($Result)) {
while($Array=mysql_fetch_assoc($Result)) ColumnInData($Array['Object_Field_ID'],1,$LinkID);
mysql_free_result($Result);
}
}
function InsertActionsFromBaseObject($BaseObjectID,$NewObjectID){
global $LinkID;
$Result=mysql_query("SELECT `AddTemplate`, `EditTemplate`, `AddActionTemplate`, `EditActionTemplate`, `SearchTemplate`, `FullSearchTemplate`, `SubscribeTemplate`, `AddCond`, `EditCond`, `SubscribeCond`, `CheckActionTemplate`, `DeleteActionTemplate`, `for_content` FROM `".(LOWER_CASE_TABLES ? "object" : "Object")."` WHERE `Object_ID`='$BaseObjectID'",$LinkID);
if (mysql_num_rows($Result)) {
$Array=mysql_fetch_assoc($Result);
mysql_free_result($Result);
}
while (list ($key, $val) = each ($Array)) if($val!="") $q.="`".$key."`=\"".addslashes($val)."\" ,";
$q=substr($q,0,strlen($q)-1);
$query="UPDATE `".(LOWER_CASE_TABLES ? "object" : "Object")."` SET ".$q. " WHERE `Object_ID`='$NewObjectID';";
mysql_query($query,$LinkID);
}
function ObjectList ($msg = null)
{
global $LinkID;
global $ADMIN_DOMAIN;
$select = "SELECT `Object_ID`, `Object_Name`, IF(`AddTemplate`<>'' OR `AddCond`<>'' OR `AddActionTemplate`<>'',1,0) AS IsAdd, IF(`EditTemplate`<>'' OR `EditCond`<>'' OR `EditActionTemplate`<>'' OR `CheckActionTemplate`<>'' OR `DeleteActionTemplate`<>'',1,0) AS IsEdit, IF(`SearchTemplate`<>'' OR `FullSearchTemplate`<>'',1,0) AS IsSearch, IF(`SubscribeTemplate`<>'' OR `SubscribeCond`<>'',1,0) AS `IsSubscribe`, `for_content` FROM `".(LOWER_CASE_TABLES ? "object" : "Object")."` ORDER BY `for_content` DESC,`Object_ID`";
$Result = mysql_query ($select, $LinkID);
if ($countObject=mysql_num_rows($Result)) {
?>
}
}
##############################################################################
function ObjectForm ($ObjectID, $action, $step, $type, $BaseObjectID )
{
# type = 1 - это insert
# type = 2 - это update
# type = 3 - это update для System,
# при type = 3 ObjectID имеет смысл SystemTableID
global $LinkID, $ROOT_FOLDER, $ADMIN_DOMAIN;
// DebugBreak();
$select = "SELECT `Object_Name`, `DaysToHold`, `AllowTags`, `NL2BR`, ";
$select .= "`FormPrefix`, `FormSuffix`, `RecordTemplate`, `RecordsPerPage`,";
$select .= "`SortBy`, `RecordTemplateFull`, `RecordLogic`,`RecordFullLogic`, `TitleTemplate`, `System_Config`, `System_ID`, `for_content`";
$select .= " FROM `".(LOWER_CASE_TABLES ? "object" : "Object")."` WHERE ";
if($BaseObjectID){
$type=2;
$ObjectID=$BaseObjectID;
}
if ($type == 1) {
if (!$Array["Object_Name"]) $Array["Object_Name"] = _LANG_OBJ_NEW;
if (!$Array["FormPrefix"]) $Array["FormPrefix"] = "\$as_AdminCommon";
if (!$Array["RecordTemplate"]) $Array["RecordTemplate"] = "\$as_admin_buttons\n\$as_admin_record_begin\n\n\$as_admin_record_end";
if (!$Array["RecordsPerPage"]) $Array["RecordsPerPage"] = "20";
} elseif ($type == 2) {
$select .= " Object_ID=".$ObjectID;
$Result = mysql_query ($select, $LinkID);
if (!$Result) print " "._LANG_ERROR_DB_SELECT." \n";
$Array = mysql_fetch_assoc ($Result);
} elseif ($type == 3) {
$select .= " `System_ID`=".$ObjectID;
$Result = mysql_query ($select, $LinkID);
if (!$Result) print " "._LANG_ERROR_DB_SELECT." \n";
$Array = mysql_fetch_assoc ($Result);
}
jsinit();
?>
}
function ActionObjectComleted ($type)
{
global $LinkID, $ROOT_FOLDER, $HTTP_POST_VARS;
global $perm;
if(!$HTTP_POST_VARS) $HTTP_POST_VARS = $_POST;
reset($HTTP_POST_VAR);
while (list($key, $val) = each($HTTP_POST_VARS)) eval("global \$".$key.";"); // дыра в безопасности !!!!
$AllowTags += 0;
$NL2BR += 0;
$DaysToHold += 0;
$RecordsPerPage += 0;
if ($type == 1) {
$insert = "INSERT INTO `".(LOWER_CASE_TABLES ? "object" : "Object")."` (`Object_Name`,`DaysToHold`,`AllowTags`,`NL2BR`,`FormPrefix`,`FormSuffix`,`RecordTemplate`,`RecordLogic`,`RecordFullLogic`,`RecordTemplateFull`,`RecordsPerPage`,`SortBy`,`TitleTemplate`,`System_Config`,`AddTemplate`,`EditTemplate`,`AddActionTemplate`,`EditActionTemplate`,`SearchTemplate`,`FullSearchTemplate`,`SubscribeTemplate`,`AddCond`,`EditCond`,`SubscribeCond`,`CheckActionTemplate`,`DeleteActionTemplate`,`for_content`) ";
$insert .= "VALUES (";
$insert .= "\"".$ObjectName."\",";
$insert .= "\"".$DaysToHold."\",";
$insert .= $AllowTags.",";
$insert .= $NL2BR.",";
$insert .= "\"".$FormPrefix."\",";
$insert .= "\"".$FormSuffix."\",";
$insert .= "\"".$RecordTemplate."\",";
$insert .= "\"".$RecordLogic."\",";
$insert .= "\"".$RecordFullLogic."\",";
$insert .= "\"".$RecordTemplateFull."\",";
$insert .= "\"".$RecordsPerPage."\",";
$insert .= "\"".$SortBy."\",";
$insert .= "\"".$TitleTemplate."\",";
$insert .= "\"".$System_Config."\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"\",";
$insert .= "\"".((int)$for_content)."\")";
$Result = mysql_query ($insert, $LinkID);
$CurrentObjectID = mysql_insert_id ($LinkID);
//InsertActionsFromBaseObject($____,$CurrentObjectID)
CreateDataTable ($CurrentObjectID, $LinkID);
$Ret=$CurrentObjectID;
}
if ( ($type == 2) or ($type == 3) ) {
$update = "UPDATE `".(LOWER_CASE_TABLES ? "object" : "Object")."` SET ";
if ($type == 2) $update .= "`Object_Name`=\"".$ObjectName."\",";
$update .= "`DaysToHold`=\"".$DaysToHold."\",";
$update .= "`for_content`=\"".((int)$for_content)."\",";
$update .= "`AllowTags`=\"".$AllowTags."\",";
$update .= "`NL2BR`=\"".$NL2BR."\",";
$update .= "`FormPrefix`=\"".$FormPrefix."\",";
$update .= "`FormSuffix`=\"".$FormSuffix."\",";
$update .= "`RecordTemplate`=\"".$RecordTemplate."\",";
$update .= "`RecordLogic`=\"".$RecordLogic."\",";
$update .= "`RecordFullLogic`=\"".$RecordFullLogic."\",";
$update .= "`RecordTemplateFull`=\"".$RecordTemplateFull."\",";
$update .= "`RecordsPerPage`=\"".$RecordsPerPage."\",";
$update .= "`SortBy`=\"".$SortBy."\",";
$update .= "`TitleTemplate`=\"".$TitleTemplate."\",";
$update .= "`System_Config`=\"".$System_Config."\",";
$update .= "`AddTemplate`=\"".$AddTemplate."\",";
$update .= "`AddCond`=\"".$AddCond."\",";
$update .= "`AddActionTemplate`=\"".$AddActionTemplate."\",";
$update .= "`EditTemplate`=\"".$EditTemplate."\",";
$update .= "`EditCond`=\"".$EditCond."\",";
$update .= "`EditActionTemplate`=\"".$EditActionTemplate."\",";
$update .= "`CheckActionTemplate`=\"".$CheckActionTemplate."\",";
$update .= "`DeleteActionTemplate`=\"".$DeleteActionTemplate."\"";
/* $update .= "FullSearchTemplate=\"".$FullSearchTemplate."\",";
$update .= "SearchTemplate=\"".$SearchTemplate."\",";
$update .= "SubscribeCond=\"".$SubscribeCond."\",";
$update .= "SubscribeTemplate=\"".$SubscribeTemplate."\""; */
if ($type == 2) $update .= " WHERE `Object_ID`=".$ObjectID;
if ($type == 3) $update .= " WHERE `System_ID`=".$ObjectID;
$Ret=$ObjectID;
//print $update." \n";
$Result = mysql_query ($update, $LinkID);
if (mysql_errno()) {
echo "MySQL Error : ".mysql_error()."
";
}
}
return $Ret;
}
function addNewTemplate()
{
global $LinkID;
global $ADMIN_DOMAIN;
$select = "SELECT `Object_ID`, `Object_Name`, IF(`AddTemplate`<>'' OR `AddCond`<>'' OR `AddActionTemplate`<>'',1,0) AS `IsAdd`, IF(`EditTemplate`<>'' OR `EditCond`<>'' OR `EditActionTemplate`<>'' OR `CheckActionTemplate`<>'' OR `DeleteActionTemplate`<>'',1,0) AS `IsEdit`, IF(`SearchTemplate`<>'' OR `FullSearchTemplate`<>'',1,0) AS `IsSearch`, IF(`SubscribeTemplate`<>'' OR `SubscribeCond`<>'',1,0) AS `IsSubscribe` FROM `".(LOWER_CASE_TABLES ? "object" : "Object")."` WHERE `System_ID`=0 ORDER by `Object_ID`";
$Result = mysql_query ($select, $LinkID);
if (mysql_num_rows($Result)>0) {
while($Array = mysql_fetch_row ($Result)){
$opt=$opt."".$Array[1]." \n";
}
mysql_free_result($Result);
}
?>
=_LANG_OBJ_CREATE?>
print $opt; ?>
=_LANG_CONTINUE?>
=_LANG_OBJ_EMPTY_OBJ?>
}
##############################################################################
function ConfirmDeletion ()
{
global $LinkID;
global $HTTP_POST_VARS, $HTTP_GET_VARS;
$ask = false;
if(!$HTTP_POST_VARS) $HTTP_POST_VARS = $_POST;
reset($HTTP_POST_VARS);
?>
=_LANG_CONFIRM_OBJ_DELETE?>
return true;
}
##############################################################################
function CascadeDeleteObject ($ObjectID)
{
global $LinkID;
$LockTables = "LOCK TABLES `".(LOWER_CASE_TABLES ? "object" : "Object")."` WRITE, `".(LOWER_CASE_TABLES ? "object_field" : "Object_Field")."` WRITE,";
$LockTables .= "`".(LOWER_CASE_TABLES ? "cat_object" : "Cat_Object")."` WRITE, `".(LOWER_CASE_TABLES ? "data" : "Data")."".$ObjectID."` WRITE,";
$LockTables .= "`".(LOWER_CASE_TABLES ? "section_object" : "Section_Object")."` WRITE";
$LockResult = mysql_query ($LockTables.$AddLockTables, $LinkID);
$DeleteObject = "DELETE FROM `Object` WHERE `Object_ID`=".$ObjectID;
$DeleteObject_Field = "DELETE FROM `".(LOWER_CASE_TABLES ? "object_field" : "Object_Field")."` WHERE `Object_ID`=".$ObjectID;
$DeleteCatObject = "DELETE FROM `".(LOWER_CASE_TABLES ? "cat_object" : "Cat_Object")."` WHERE `Object_ID`=".$ObjectID;
$DeleteSectionObject = "DELETE FROM `".(LOWER_CASE_TABLES ? "section_object" : "Section_Object")."` WHERE `Object_ID`=".$ObjectID;
$DropData = "DROP TABLE `".(LOWER_CASE_TABLES ? "data" : "Data")."".$ObjectID."`";
mysql_query ($DropData, $LinkID);
mysql_query ($DeleteCatObject, $LinkID);
mysql_query ($DeleteSectionObject, $LinkID);
mysql_query ($DeleteObject_Field, $LinkID);
mysql_query ($DeleteObject, $LinkID);
$UnlockResult = mysql_query ("UNLOCK TABLES", $LinkID);
}
##############################################################################
function ObjectActionForm ($ObjectID, $action, $step, $type, $myaction)
{
global $LinkID;
global $ADMIN_DOMAIN;
# type=1 - its
# type=2 - its system table
# on type=2 ObjectID - is SystemTableID
?>
$select = "SELECT `AddTemplate`, `AddCond`, `AddActionTemplate`, `EditTemplate`, `EditCond`, `EditActionTemplate`, `CheckActionTemplate`, `DeleteActionTemplate`, ";
$select .= "`SearchTemplate`, `FullSearchTemplate`, `SubscribeTemplate`, `SubscribeCond`";
if ($type == 1) $select .= " FROM `".(LOWER_CASE_TABLES ? "object" : "Object")."` WHERE `Object_ID`=";
if ($type == 2) $select .= " FROM `".(LOWER_CASE_TABLES ? "object" : "Object")."` WHERE `System_ID`=";
$select .= $ObjectID;
$Result = mysql_query ($select, $LinkID);
#echo mysql_errno().": ".mysql_error()." ";
if (!$Result) { print " "._LANG_ERROR_DB_SELECT." \n"; }
$Array = mysql_fetch_assoc ($Result);
?>
=_LANG_ADD?>
=_LANG_CHANGE?>
=_LANG_SEARCH?>
=_LANG_SUBSCRIBE?>
print _LANG_OBJ_ADD_ALTER.":".htmlspecialchars($Array["AddTemplate"])." ";
print _LANG_OBJ_ADD_COND.":".htmlspecialchars($Array["AddCond"])." ";
print _LANG_OBJ_ADD_AFTER_ACTION.":".htmlspecialchars($Array["AddActionTemplate"])." ";
?>
print _LANG_OBJ_EDIT_ALTER.":".htmlspecialchars($Array["EditTemplate"])." ";
print _LANG_OBJ_EDIT_COND.":".htmlspecialchars($Array["EditCond"])." ";
print _LANG_OBJ_EDIT_AFTER_ACTION.":".htmlspecialchars($Array["EditActionTemplate"])." ";
print _LANG_OBJ_TURNON_AFTER_ACTION.":".htmlspecialchars($Array["CheckActionTemplate"])." ";
print _LANG_OBJ_DEL_AFTER_ACTION.":".htmlspecialchars($Array["DeleteActionTemplate"])." ";
?>
print _LANG_FORM_OBJ_SEARCH.":".htmlspecialchars($Array["FullSearchTemplate"])." ";
print _LANG_FORM_EXT_SEARCH.":".htmlspecialchars($Array["SearchTemplate"])." ";
?>
print _LANG_SUBSCRIBE_COND.":".htmlspecialchars($Array["SubscribeCond"])." ";
print _LANG_LETTER_TEMPLATE.":".htmlspecialchars($Array["SubscribeTemplate"])." ";
?>
print " \n";
print " ";
print " ";
print " ";
?>
}
##############################################################################
function ObjectActionCompleted ($myaction,$type)
{
global $LinkID, $HTTP_POST_VARS;
# type=1 - это класс
# type=2 - это системная таблица
# при type=2 ObjectID - это на самом деле SystemTableID
if(!$HTTP_POST_VARS) $HTTP_POST_VARS = $_POST;
reset($HTTP_POST_VARS);
while (list($key, $val) = each($HTTP_POST_VARS)) eval("global \$".$key.";");
$update = "UPDATE `".(LOWER_CASE_TABLES ? "object" : "Object")."` SET ";
$update .= "`AddTemplate`=\"".$AddTemplate."\",";
$update .= "`AddCond`=\"".$AddCond."\",";
$update .= "`AddActionTemplate`=\"".$AddActionTemplate."\",";
$update .= "`EditTemplate`=\"".$EditTemplate."\",";
$update .= "`EditCond`=\"".$EditCond."\",";
$update .= "`EditActionTemplate`=\"".$EditActionTemplate."\",";
$update .= "`CheckActionTemplate`=\"".$CheckActionTemplate."\",";
$update .= "`DeleteActionTemplate`=\"".$DeleteActionTemplate."\",";
$update .= "`FullSearchTemplate`=\"".$FullSearchTemplate."\",";
$update .= "`SearchTemplate`=\"".$SearchTemplate."\",";
$update .= "`SubscribeCond`=\"".$SubscribeCond."\",";
$update .= "`SubscribeTemplate`=\"".$SubscribeTemplate."\"";
/*
switch ($myaction) {
case 1: {
$update .= "AddTemplate=\"".$AddTemplate."\",";
$update .= "AddCond=\"".$AddCond."\",";
$update .= "AddActionTemplate=\"".$AddActionTemplate."\"";
} break;
case 2: {
$update .= "EditTemplate=\"".$EditTemplate."\",";
$update .= "EditCond=\"".$EditCond."\",";
$update .= "EditActionTemplate=\"".$EditActionTemplate."\",";
$update .= "CheckActionTemplate=\"".$CheckActionTemplate."\",";
$update .= "DeleteActionTemplate=\"".$DeleteActionTemplate."\"";
} break;
case 3: {
$update .= "FullSearchTemplate=\"".$FullSearchTemplate."\",";
$update .= "SearchTemplate=\"".$SearchTemplate."\"";
} break;
case 4: {
$update .= "SubscribeCond=\"".$SubscribeCond."\",";
$update .= "SubscribeTemplate=\"".$SubscribeTemplate."\"";
} break;
}
*/
if ($type == 1) $update .= " WHERE `Object_ID`=".$ObjectID;
if ($type == 2) $update .= " WHERE `System_ID`=".$ObjectID;
$Result = mysql_query ($update, $LinkID);
}
function CreateDataTable ($classid, $LinkID)
{
$TableName = "".(LOWER_CASE_TABLES ? "data" : "Data")."".$classid;
$Creat = "CREATE TABLE `".$TableName."` (";
$Creat .= " `Data_ID` int AUTO_INCREMENT PRIMARY KEY,";
$Creat .= " `User_ID` int NOT NULL,";
$Creat .= " `Section_ID` int NOT NULL,";
$Creat .= " `Section_Object_ID` int NOT NULL,";
$Creat .= " `Priority` int NOT NULL DEFAULT 0,";
$Creat .= " `Keyword` char(255) NOT NULL,";
$Creat .= " `Checked` tinyint NOT NULL DEFAULT 1,";
$Creat .= " `TimeToDelete` date NULL,";
$Creat .= " `TimeToUncheck` date NULL,";
$Creat .= " `IP` char(15) NULL,";
$Creat .= " `UserAgent` char(255) NULL,";
$Creat .= " `Parent_Data_ID` int NOT NULL DEFAULT 0,";
$Creat .= " `Created` datetime NOT NULL,";
$Creat .= " `LastSystem_Updated` timestamp NOT NULL,";
$Creat .= " `LastUser_ID` int NOT NULL,";
$Creat .= " `LastIP` char(15) NULL,";
$Creat .= " `LastUserAgent` char(255) NULL,";
$Creat .= " index (`User_ID`),";
$Creat .= " index (`LastUser_ID`),";
$Creat .= " index (`Section_Object_ID`),";
$Creat .= " index (`Section_ID`),";
$Creat .= " index (`Parent_Data_ID`), ";
$Creat .= " unique (`Section_Object_ID`,`Data_ID`,`Keyword`)";
$Creat .= ")\n";
#print $Creat." \n";
$QueryResult = mysql_query ($Creat, $LinkID);
if ($QueryResult) {
# print "Таблица ".$TableName." успешно добавлена. \n";
} else {
# print "errno=".mysql_errno().": ".mysql_error()." \n";
# print "Таблица ".$TableName." не добавлена. Ошибка! \n";
}
}
function DropDataTable ($classid, $LinkID)
{
$TableName = "".(LOWER_CASE_TABLES ? "data" : "Data")."".$classid;
$drop = "DROP TABLE `".$TableName."`";
$QueryResult = mysql_query ($drop, $LinkID);
if ($QueryResult) {
# print "Таблица ".$TableName." успешно удалена. \n";
} else {
# print "errno=".mysql_errno().": ".mysql_error()." \n";
# print "Таблица ".$TableName." не удалена. Ошибка! PK 9[1] index.phpnu W+A
require_once ("../../../cms.conf");
require_once ("../function.inc.php");
require_once ("../field/function.inc.php");
require_once ("function.inc.php");
$main_section = "control";
$item_id = 8;
$Delimeter = " > ";
$Title2 = _LANG_DATA_OBJ;
$Title3 = ""._LANG_DATA_OBJ." ";
$Title4 = _LANG_OBJ_ADD2;
$Title5 = GetObjectNameByID ($ObjectID);
$Title6 = _LANG_OBJ_DELETE_CONFIRM;
$Title7 = _LANG_OBJ_PROPERTIES;
$Title8 = _LANG_OBJ_ACTIONS;
if (! ($perm->isSupervisor() || $perm->isGuest()) ) {
BeginHtml ($Title2, $Title2);
NoRightsMessage();
EndHtml ();
exit;
}
if (!isset($step)) $step=1;
switch ($step) {
case 1:
# покажем список классов
BeginHtml ($Title2, $Title2, 40);
ObjectList ();
break;
case 2:
# покажем форму добавления класса
BeginHtml ($Title2, $Title3.$Delimeter.$Title4, 41);
ObjectForm (0, "./", 3, 1,$BaseObjectID);
break;
case 3:
# собственно добавление класса
BeginHtml ($Title2, $Title2, 40);
$perm->ExitIfGuest ();
$NewID=ActionObjectComleted ($type);
if ($BaseObjectID) {
InsertActionsFromBaseObject($BaseObjectID,$NewID);
InsertObject_FieldsFromBaseObject($BaseObjectID,$NewID);
}
unset($ObjectID);
ObjectList ('Объект добавлен');
break;
case 4:
# покажем форму редактирования класса
BeginHtml ($Title7, $Title3.$Delimeter.$Title5, 42);
#System_UpdateObjectForm ($ObjectID);
ObjectForm ($ObjectID, "./", 5, 2, 0);
break;
case 5:
# собственно проапдейтим класс
if ($submit_type == 1)
BeginHtml ($Title2, $Title2, 40);
if ( $perm->isGuest () ) {
unset($ObjectID);
ObjectList (_LANG_NO_RIGHTS);
EndHtml ();
exit;
}
ActionObjectComleted ($type);
#System_UpdateObjectComleted ();
if ($submit_type == 1) {
unset($ObjectID);
ObjectList ('Объект обновлен');
} else {
jsinitpage();
jsclear('status_text');
jsprint('status_text', 'Сохранено в '.date("H:i:s"));
jsclear('status_text2');
jsprint('status_text2', 'Сохранено в '.date("H:i:s"));
}
break;
case 6:
# спросить, действительно ли удалять класса
BeginHtml ($Title6, $Title3.$Delimeter.$Title6, 40);
ConfirmDeletion ();
break;
case 7:
# собственно удалить классы
BeginHtml ($Title2, $Title2, 40);
if ( $perm->isGuest () ) {
unset($ObjectID);
ObjectList (_LANG_NO_RIGHTS);
EndHtml ();
exit;
}
while (list($key, $val) = each($HTTP_POST_VARS)) {
#echo "$key => $val ";
if ($key == 'Sectionmit') continue;
if ($key == 'step') continue;
CascadeDeleteObject ($val);
}
if (isset($_POST['ObjectID'])) CascadeDeleteObject ($_POST['ObjectID']);
unset($ObjectID);
ObjectList ('Объект удален');
break;
case 8:
# покажем форму редактирования нескольких полей класса
BeginHtml ($Title8, $Title3.$Delimeter.$Title5, 41);
ObjectActionForm ($ObjectID, "./", 9, 1, $myaction);
break;
case 9:
# собственно проапдейтим класс
BeginHtml ($Title2, $Title2, 41);
if ( $perm->isGuest () ) {
unset($ObjectID);
ObjectList (_LANG_NO_RIGHTS);
EndHtml ();
exit;
}
ObjectActionCompleted ($myaction,$type);
unset($ObjectID);
ObjectList ();
break;
case 10:
BeginHtml ($Title4, $Title3.$Delimeter.$Title4, 41);
addNewTemplate();
break;
}
EndHtml ();
?>PK 9[ӿ% % import/function.inc.phpnu W+A
function AddObjectForm ()
{
global $LinkID;
?>
Импорт шаблона
}
###############################################################
function ParseObjectFile ($file)
{
global $LinkID, $VERSION_ID;
$insert_flag = "%INSERT_ID%";
$f = fopen($file,"r");
$insert_into_class = trim(fgets($f,65536));
$res1 = mysql_query($insert_into_class,$LinkID);
if ($res1)
$insert_id = mysql_insert_id($LinkID);
else
return false;
$create_message = trim(fgets($f,4096));
$create_message = str_replace($insert_flag,$insert_id,$create_message);
$res2 = mysql_query($create_message,$LinkID);
if (!$res2) {
mysql_query("DELETE FROM `".(LOWER_CASE_TABLES ? "object" : "Object")."` WHERE `Object_ID`=".$insert_id,$LinkID);
return false;
}
while(!feof($f)) {
$insert_into_field = trim(fgets($f,4096));
$insert_into_field = str_replace($insert_flag,$insert_id,$insert_into_field);
if ($insert_into_field) {
$res3 = mysql_query($insert_into_field,$LinkID);
if (!$res3) {
mysql_query("DELETE FROM `".(LOWER_CASE_TABLES ? "object" : "Object")."` WHERE `Object_ID`=".$insert_id,$LinkID);
mysql_query("DROP TABLE `".(LOWER_CASE_TABLES ? "data" : "Data")."".$insert_id."`",$LinkID);
mysql_query("DELETE FROM `".(LOWER_CASE_TABLES ? "object_field" : "Object_Field")."` WHERE `Object_ID`=".$insert_id,$LinkID);
return false;
}
}
}
return $insert_id;
}
?>PK 9[(v v import/index.phpnu W+A
require_once ("../../../../cms.conf");
require_once ("../../function.inc.php");
require_once ("../function.inc.php");
require_once ("function.inc.php");
$main_section = "control";
$item_id = 9;
$Delimeter = " > ";
$Title2 = "Импорт шаблонов";
$Title3 = "Импорт шаблонов ";
if ( !($perm->isSupervisor() || $perm->isGuest()) ) {
BeginHtml ($Title2, $Title2, "");
NoRightsMessage();
EndHtml ();
exit;
}
if (!isset($step)) $step=1;
switch ($step) {
case 1:
# покажем форму закачки
BeginHtml ($Title2, $Title2);
$perm->ExitIfGuest ();
AddObjectForm();
break;
case 2:
# добавим шаблон
BeginHtml ($Title2, $Title2);
$perm->ExitIfGuest ();
if (strlen ($FileSystem_Update) == 0) {
print "Файл не закачан."." \n";
InstallationAborted ();
}
$res = ParseObjectFile($FileSystem_Update);
if ($res) {
ObjectList();
} else {
echo "Шаблон не может быть установлен.";
}
break;
end;
}
EndHtml ();
?>PK 9[a(z z function.inc.phpnu W+A PK 9[1] index.phpnu W+A PK 9[ӿ% % ݞ import/function.inc.phpnu W+A PK 9[(v v I import/index.phpnu W+A PK @