mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
NOISSUE code rearrange layout.model.php
This commit is contained in:
parent
c413dc795e
commit
4a7c889981
1 changed files with 97 additions and 108 deletions
|
|
@ -163,7 +163,7 @@ class layoutModel extends layout
|
|||
|
||||
if($layout)
|
||||
{
|
||||
if(!count($instanceList) && $downloadedList[$layout])
|
||||
if(count($instanceList) < 1 && $downloadedList[$layout])
|
||||
{
|
||||
$insertArgs = new stdClass();
|
||||
$insertArgs->site_srl = $siteSrl;
|
||||
|
|
@ -496,7 +496,7 @@ class layoutModel extends layout
|
|||
}
|
||||
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
|
||||
{
|
||||
@include($cache_file);
|
||||
include($cache_file);
|
||||
|
||||
if($layout_info->extra_var && $vars)
|
||||
{
|
||||
|
|
@ -524,36 +524,35 @@ class layoutModel extends layout
|
|||
|
||||
if(!$xml_obj) return;
|
||||
|
||||
$buff = '';
|
||||
$buff .= sprintf('$layout_info->site_srl = "%s";', $site_srl);
|
||||
$buff = array(sprintf('$layout_info->site_srl = "%s";', $site_srl));
|
||||
|
||||
if($xml_obj->version && $xml_obj->attrs->version == '0.2')
|
||||
{
|
||||
// Layout title, version and other information
|
||||
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$layout_info->layout = "%s";', $layout);
|
||||
$buff .= sprintf('$layout_info->type = "%s";', $xml_obj->attrs->type);
|
||||
$buff .= sprintf('$layout_info->path = "%s";', $layout_path);
|
||||
$buff .= sprintf('$layout_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$layout_info->description = "%s";', $xml_obj->description->body);
|
||||
$buff .= sprintf('$layout_info->version = "%s";', $xml_obj->version->body);
|
||||
$buff .= sprintf('$layout_info->date = "%s";', $date);
|
||||
$buff .= sprintf('$layout_info->homepage = "%s";', $xml_obj->link->body);
|
||||
$buff .= sprintf('$layout_info->layout_srl = $layout_srl;');
|
||||
$buff .= sprintf('$layout_info->layout_title = $layout_title;');
|
||||
$buff .= sprintf('$layout_info->license = "%s";', $xml_obj->license->body);
|
||||
$buff .= sprintf('$layout_info->license_link = "%s";', $xml_obj->license->attrs->link);
|
||||
$buff .= sprintf('$layout_info->layout_type = "%s";', $layout_type);
|
||||
$buff[] = sprintf('$layout_info->layout = "%s";', $layout);
|
||||
$buff[] = sprintf('$layout_info->type = "%s";', $xml_obj->attrs->type);
|
||||
$buff[] = sprintf('$layout_info->path = "%s";', $layout_path);
|
||||
$buff[] = sprintf('$layout_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff[] = sprintf('$layout_info->description = "%s";', $xml_obj->description->body);
|
||||
$buff[] = sprintf('$layout_info->version = "%s";', $xml_obj->version->body);
|
||||
$buff[] = sprintf('$layout_info->date = "%s";', $date);
|
||||
$buff[] = sprintf('$layout_info->homepage = "%s";', $xml_obj->link->body);
|
||||
$buff[] = sprintf('$layout_info->layout_srl = $layout_srl;');
|
||||
$buff[] = sprintf('$layout_info->layout_title = $layout_title;');
|
||||
$buff[] = sprintf('$layout_info->license = "%s";', $xml_obj->license->body);
|
||||
$buff[] = sprintf('$layout_info->license_link = "%s";', $xml_obj->license->attrs->link);
|
||||
$buff[] = sprintf('$layout_info->layout_type = "%s";', $layout_type);
|
||||
// Author information
|
||||
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
|
||||
else $author_list = $xml_obj->author;
|
||||
|
||||
for($i=0; $i < count($author_list); $i++)
|
||||
for($i=0, $c=count($author_list); $i<$c; $i++)
|
||||
{
|
||||
$buff .= sprintf('$layout_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
|
||||
$buff .= sprintf('$layout_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
|
||||
$buff .= sprintf('$layout_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link);
|
||||
$buff[] = sprintf('$layout_info->author[%d]->name = "%s";', $i, $author_list[$i]->name->body);
|
||||
$buff[] = sprintf('$layout_info->author[%d]->email_address = "%s";', $i, $author_list[$i]->attrs->email_address);
|
||||
$buff[] = sprintf('$layout_info->author[%d]->homepage = "%s";', $i, $author_list[$i]->attrs->link);
|
||||
}
|
||||
// Extra vars (user defined variables to use in a template)
|
||||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
|
|
@ -568,19 +567,18 @@ class layoutModel extends layout
|
|||
|
||||
$extra_var_count = count($extra_vars);
|
||||
|
||||
$buff .= sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
|
||||
$buff[] = sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++)
|
||||
{
|
||||
unset($var);
|
||||
unset($options);
|
||||
unset($var, $options);
|
||||
$var = $extra_vars[$i];
|
||||
$name = $var->attrs->name;
|
||||
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->group = "%s";', $name, $group->title->body);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->group = "%s";', $name, $group->title->body);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
|
||||
|
||||
$options = $var->options;
|
||||
if(!$options) continue;
|
||||
|
|
@ -596,15 +594,15 @@ class layoutModel extends layout
|
|||
$thumbnail = $layout_path.$thumbnail;
|
||||
if(file_exists($thumbnail))
|
||||
{
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"]->thumbnail = "%s";', $var->attrs->name, $options[$j]->attrs->value, $thumbnail);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->options["%s"]->thumbnail = "%s";', $var->attrs->name, $options[$j]->attrs->value, $thumbnail);
|
||||
if(!$thumbnail_exist)
|
||||
{
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->thumbnail_exist = true;', $var->attrs->name);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->thumbnail_exist = true;', $var->attrs->name);
|
||||
$thumbnail_exist = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"]->val = "%s";', $var->attrs->name, $options[$j]->attrs->value, $options[$j]->title->body);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->options["%s"]->val = "%s";', $var->attrs->name, $options[$j]->attrs->value, $options[$j]->title->body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -616,18 +614,18 @@ class layoutModel extends layout
|
|||
if(!is_array($menus)) $menus = array($menus);
|
||||
|
||||
$menu_count = count($menus);
|
||||
$buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count);
|
||||
$buff[] = sprintf('$layout_info->menu_count = "%s";', $menu_count);
|
||||
for($i=0;$i<$menu_count;$i++)
|
||||
{
|
||||
$name = $menus[$i]->attrs->name;
|
||||
if($menus[$i]->attrs->default == "true") $buff .= sprintf('$layout_info->default_menu = "%s";', $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
|
||||
$buff .= sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->attrs->maxdepth);
|
||||
if($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->attrs->maxdepth);
|
||||
|
||||
$buff .= sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -637,23 +635,23 @@ class layoutModel extends layout
|
|||
if(!is_array($xml_obj->history)) $history_list[] = $xml_obj->history;
|
||||
else $history_list = $xml_obj->history;
|
||||
|
||||
for($i=0; $i < count($history_list); $i++)
|
||||
for($i=0, $c=count($history_list); $i<$c; $i++)
|
||||
{
|
||||
sscanf($history_list[$i]->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->date = "%s";', $date);
|
||||
$buff[] = sprintf('$layout_info->history[%d]->description = "%s";', $i, $history_list[$i]->description->body);
|
||||
$buff[] = sprintf('$layout_info->history[%d]->version = "%s";', $i , $history_list[$i]->attrs->version);
|
||||
$buff[] = sprintf('$layout_info->history[%d]->date = "%s";', $i, $date);
|
||||
|
||||
if($history_list[$i]->author)
|
||||
{
|
||||
(!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author;
|
||||
|
||||
for($j=0; $j < count($obj->author_list); $j++)
|
||||
for($j=0, $jc=count($obj->author_list); $j<$jc; $j++)
|
||||
{
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link);
|
||||
$buff[] = sprintf('$layout_info->history[%d]->author[%d]->name = "%s";', $i, $j, $obj->author_list[$j]->name->body);
|
||||
$buff[] = sprintf('$layout_info->history[%d]->author[%d]->email_address = "%s";', $i, $j, $obj->author_list[$j]->attrs->email_address);
|
||||
$buff[] = sprintf('$layout_info->history[%d]->author[%d]->homepage = "%s";', $i, $j, $obj->author_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -661,10 +659,10 @@ class layoutModel extends layout
|
|||
{
|
||||
(!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log;
|
||||
|
||||
for($j=0; $j < count($obj->log_list); $j++)
|
||||
for($j=0, $jc=count($obj->log_list); $j<$jc; $j++)
|
||||
{
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body);
|
||||
$buff .= sprintf('$layout_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link);
|
||||
$buff[] = sprintf('$layout_info->history[%d]->logs[%d]->text = "%s";', $i, $j, $obj->log_list[$j]->body);
|
||||
$buff[] = sprintf('$layout_info->history[%d]->logs[%d]->link = "%s";', $i, $j, $obj->log_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -675,18 +673,18 @@ class layoutModel extends layout
|
|||
// Layout title, version and other information
|
||||
sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$layout_info->layout = "%s";', $layout);
|
||||
$buff .= sprintf('$layout_info->path = "%s";', $layout_path);
|
||||
$buff .= sprintf('$layout_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$layout_info->description = "%s";', $xml_obj->author->description->body);
|
||||
$buff .= sprintf('$layout_info->version = "%s";', $xml_obj->attrs->version);
|
||||
$buff .= sprintf('$layout_info->date = "%s";', $date);
|
||||
$buff .= sprintf('$layout_info->layout_srl = $layout_srl;');
|
||||
$buff .= sprintf('$layout_info->layout_title = $layout_title;');
|
||||
$buff[] = sprintf('$layout_info->layout = "%s";', $layout);
|
||||
$buff[] = sprintf('$layout_info->path = "%s";', $layout_path);
|
||||
$buff[] = sprintf('$layout_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff[] = sprintf('$layout_info->description = "%s";', $xml_obj->author->description->body);
|
||||
$buff[] = sprintf('$layout_info->version = "%s";', $xml_obj->attrs->version);
|
||||
$buff[] = sprintf('$layout_info->date = "%s";', $date);
|
||||
$buff[] = sprintf('$layout_info->layout_srl = $layout_srl;');
|
||||
$buff[] = sprintf('$layout_info->layout_title = $layout_title;');
|
||||
// Author information
|
||||
$buff .= sprintf('$layout_info->author[0]->name = "%s";', $xml_obj->author->name->body);
|
||||
$buff .= sprintf('$layout_info->author[0]->email_address = "%s";', $xml_obj->author->attrs->email_address);
|
||||
$buff .= sprintf('$layout_info->author[0]->homepage = "%s";', $xml_obj->author->attrs->link);
|
||||
$buff[] = sprintf('$layout_info->author[0]->name = "%s";', $xml_obj->author->name->body);
|
||||
$buff[] = sprintf('$layout_info->author[0]->email_address = "%s";', $xml_obj->author->attrs->email_address);
|
||||
$buff[] = sprintf('$layout_info->author[0]->homepage = "%s";', $xml_obj->author->attrs->link);
|
||||
// Extra vars (user defined variables to use in a template)
|
||||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
|
|
@ -700,19 +698,18 @@ class layoutModel extends layout
|
|||
|
||||
$extra_var_count = count($extra_vars);
|
||||
|
||||
$buff .= sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
|
||||
$buff[] = sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++)
|
||||
{
|
||||
unset($var);
|
||||
unset($options);
|
||||
unset($var, $options);
|
||||
$var = $extra_vars[$i];
|
||||
$name = $var->attrs->name;
|
||||
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->group = "%s";', $name, $group->title->body);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->group = "%s";', $name, $group->title->body);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
|
||||
|
||||
$options = $var->options;
|
||||
if(!$options) continue;
|
||||
|
|
@ -721,7 +718,7 @@ class layoutModel extends layout
|
|||
$options_count = count($options);
|
||||
for($j=0;$j<$options_count;$j++)
|
||||
{
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"]->val = "%s";', $var->attrs->name, $options[$j]->value->body, $options[$j]->title->body);
|
||||
$buff[] = sprintf('$layout_info->extra_var->%s->options["%s"]->val = "%s";', $var->attrs->name, $options[$j]->value->body, $options[$j]->title->body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -733,17 +730,17 @@ class layoutModel extends layout
|
|||
if(!is_array($menus)) $menus = array($menus);
|
||||
|
||||
$menu_count = count($menus);
|
||||
$buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count);
|
||||
$buff[] = sprintf('$layout_info->menu_count = "%s";', $menu_count);
|
||||
for($i=0;$i<$menu_count;$i++)
|
||||
{
|
||||
$name = $menus[$i]->attrs->name;
|
||||
if($menus[$i]->attrs->default == "true") $buff .= sprintf('$layout_info->default_menu = "%s";', $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
|
||||
$buff .= sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->maxdepth->body);
|
||||
$buff .= sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
|
||||
if($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->name = "%s";',$name, $name);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->maxdepth->body);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
|
||||
$buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -755,11 +752,10 @@ class layoutModel extends layout
|
|||
|
||||
if($header_script)
|
||||
{
|
||||
$buff .= sprintf(' $layout_info->header_script = "%s"; ', str_replace(array('$','"'),array('\$','\\"'),$header_script));
|
||||
$buff[] = sprintf(' $layout_info->header_script = "%s"; ', str_replace(array('$','"'),array('\$','\\"'),$header_script));
|
||||
}
|
||||
|
||||
$buff = '<?php if(!defined("__XE__")) exit(); '.$buff.' ?>';
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
FileHandler::writeFile($cache_file, '<?php if(!defined("__XE__")) exit(); ' . join(PHP_EOL, $buff));
|
||||
if(FileHandler::exists($cache_file)) include($cache_file);
|
||||
|
||||
if(!$layout_info->title)
|
||||
|
|
@ -777,9 +773,7 @@ class layoutModel extends layout
|
|||
*/
|
||||
function getUserLayoutImageList($layout_srl)
|
||||
{
|
||||
$path = $this->getUserLayoutImagePath($layout_srl);
|
||||
$list = FileHandler::readDir($path);
|
||||
return $list;
|
||||
return FileHandler::readDir($this->getUserLayoutImagePath($layout_srl));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -791,13 +785,12 @@ class layoutModel extends layout
|
|||
function getUserLayoutIniConfig($layout_srl, $layout_name=null)
|
||||
{
|
||||
$file = $this->getUserLayoutIni($layout_srl);
|
||||
if($layout_name && !file_exists(FileHandler::getRealPath($file)))
|
||||
if($layout_name && FileHandler::exists($file) === FALSE)
|
||||
{
|
||||
FileHandler::copyFile($this->getDefaultLayoutIni($layout_name),$this->getUserLayoutIni($layout_srl));
|
||||
}
|
||||
|
||||
$output = FileHandler::readIniFile($file);
|
||||
return $output;
|
||||
return FileHandler::readIniFile($file);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -837,9 +830,8 @@ class layoutModel extends layout
|
|||
*/
|
||||
function getUserLayoutFaceOffCss($layout_srl)
|
||||
{
|
||||
$src = $this->_getUserLayoutFaceOffCss($layout_srl);
|
||||
if($this->useUserLayoutTemp == 'temp') return;
|
||||
return $src;
|
||||
return $this->_getUserLayoutFaceOffCss($layout_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -873,13 +865,11 @@ class layoutModel extends layout
|
|||
if($this->useUserLayoutTemp == 'temp')
|
||||
{
|
||||
$temp = $this->getUserLayoutTempHtml($layout_srl);
|
||||
if(!file_exists(FileHandler::getRealPath($temp))) FileHandler::copyFile($src,$temp);
|
||||
if(FileHandler::exists($temp) === FALSE) FileHandler::copyFile($src,$temp);
|
||||
return $temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $src;
|
||||
}
|
||||
|
||||
return $src;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -900,16 +890,14 @@ class layoutModel extends layout
|
|||
function getUserLayoutIni($layout_srl)
|
||||
{
|
||||
$src = $this->getUserLayoutPath($layout_srl). 'layout.ini';
|
||||
$temp = $this->getUserLayoutTempIni($layout_srl);
|
||||
if($this->useUserLayoutTemp == 'temp')
|
||||
{
|
||||
$temp = $this->getUserLayoutTempIni($layout_srl);
|
||||
if(!file_exists(FileHandler::getRealPath($temp))) FileHandler::copyFile($src,$temp);
|
||||
return $temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $src;
|
||||
}
|
||||
|
||||
return $src;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -993,8 +981,7 @@ class layoutModel extends layout
|
|||
function useDefaultLayout($layout_name)
|
||||
{
|
||||
$info = $this->getLayoutInfo($layout_name);
|
||||
if($info->type == 'faceoff') return true;
|
||||
else return false;
|
||||
return ($info->type == 'faceoff');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1014,12 +1001,11 @@ class layoutModel extends layout
|
|||
*/
|
||||
function getUserLayoutTempFileList($layout_srl)
|
||||
{
|
||||
$file_list = array(
|
||||
$this->getUserLayoutTempHtml($layout_srl)
|
||||
,$this->getUserLayoutTempFaceOffCss($layout_srl)
|
||||
,$this->getUserLayoutTempIni($layout_srl)
|
||||
return array(
|
||||
$this->getUserLayoutTempHtml($layout_srl),
|
||||
$this->getUserLayoutTempFaceOffCss($layout_srl),
|
||||
$this->getUserLayoutTempIni($layout_srl)
|
||||
);
|
||||
return $file_list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1039,7 +1025,10 @@ class layoutModel extends layout
|
|||
$image_path = $this->getUserLayoutImagePath($layout_srl);
|
||||
$image_list = FileHandler::readDir($image_path,'/(.*(?:swf|jpg|jpeg|gif|bmp|png)$)/i');
|
||||
|
||||
for($i=0,$c=count($image_list);$i<$c;$i++) $file_list[] = 'images/' . $image_list[$i];
|
||||
foreach($image_list as $image)
|
||||
{
|
||||
$file_list[] = 'images/' . $image;
|
||||
}
|
||||
return $file_list;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue