mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-26 22:59:57 +09:00
merge from 1.5.3 (~r10943)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@10951 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7aa4798373
commit
54e3a72065
334 changed files with 13011 additions and 5561 deletions
|
|
@ -11,8 +11,8 @@
|
|||
<action name="dispLayoutAdminMobileContent" type="view" standalone="true" />
|
||||
|
||||
<action name="dispLayoutAdminInstalledList" type="view" admin_index="true" menu_name="installedLayout" menu_index="true" />
|
||||
<action name="dispLayoutAdminInstalledMobileList" type="view" menu_name="installedLayout" />
|
||||
<action name="dispLayoutAdminInstanceList" type="view" menu_name="installedLayout" />
|
||||
<action name="dispLayoutAdminAllInstanceList" type="view" menu_name="installedLayout" />
|
||||
<action name="dispLayoutAdminInsert" type="view" menu_name="installedLayout" />
|
||||
<action name="dispLayoutAdminModify" type="view" menu_name="installedLayout" />
|
||||
<action name="dispLayoutAdminEdit" type="view" menu_name="installedLayout" />
|
||||
|
|
|
|||
|
|
@ -1004,6 +1004,12 @@
|
|||
<value xml:lang="en"><![CDATA[Layouts]]></value>
|
||||
<value xml:lang="jp"><![CDATA[インストールされているレイアウト]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[已安裝版面]]></value>
|
||||
</item>
|
||||
<item name="instance_layout">
|
||||
<value xml:lang="ko"><![CDATA[생성된 레이아웃]]></value>
|
||||
<value xml:lang="en"><![CDATA[Instance of layout]]></value>
|
||||
<value xml:lang="jp"><![CDATA[インストールされているレイアウト]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[已安裝版面]]></value>
|
||||
|
||||
</item>
|
||||
<item name="faceoff_export">
|
||||
|
|
|
|||
|
|
@ -2,21 +2,23 @@
|
|||
/**
|
||||
* @class layoutAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief admin controller class of the layout module
|
||||
* admin controller class of the layout module
|
||||
**/
|
||||
|
||||
class layoutAdminController extends layout {
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
* Initialization
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
// deprecated
|
||||
/**
|
||||
* @brief Create a new layout
|
||||
* Create a new layout
|
||||
* Insert a title into "layouts" table in order to create a layout
|
||||
* @deprecated
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procLayoutAdminInsert() {
|
||||
if(Context::get('layout') == 'faceoff') return $this->stop('not supported');
|
||||
|
|
@ -42,16 +44,25 @@
|
|||
$output = $this->procLayoutAdminUpdate();
|
||||
if (!$output->toBool()) return $output;
|
||||
|
||||
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||
return $this->setRedirectUrl(Context::get('success_return_url'), $output);
|
||||
}
|
||||
|
||||
// Insert layout information into the DB
|
||||
/**
|
||||
* Insert layout information into the DB
|
||||
* @param object $args layout information
|
||||
* @return Object
|
||||
**/
|
||||
function insertLayout($args) {
|
||||
$output = executeQuery("layout.insertLayout", $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Initiate if it is faceoff layout
|
||||
/**
|
||||
* Initiate if it is faceoff layout
|
||||
* @param int $layout_srl
|
||||
* @param string $layout_name
|
||||
* @return void
|
||||
**/
|
||||
function initLayout($layout_srl, $layout_name){
|
||||
$oLayoutModel = &getModel('layout');
|
||||
// Import a sample layout if it is faceoff
|
||||
|
|
@ -64,8 +75,9 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Update layout information
|
||||
* Update layout information
|
||||
* Apply a title of the new layout and extra vars
|
||||
* @return Object
|
||||
**/
|
||||
function procLayoutAdminUpdate() {
|
||||
// Consider the rest of items as extra vars, except module, act, layout_srl, layout, and title .. Some gurida ..
|
||||
|
|
@ -177,9 +189,14 @@
|
|||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
return new Object();
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update layout information into the DB
|
||||
* @param object $args
|
||||
* @return Object
|
||||
**/
|
||||
function updateLayout($args) {
|
||||
$output = executeQuery('layout.updateLayout', $args);
|
||||
if($output->toBool()) {
|
||||
|
|
@ -198,8 +215,9 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Delete Layout
|
||||
* Delete Layout
|
||||
* Delete xml cache file too when deleting a layout
|
||||
* @return Object
|
||||
**/
|
||||
function procLayoutAdminDelete() {
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
|
|
@ -207,6 +225,11 @@
|
|||
return $this->deleteLayout($layout_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete layout xml cache file
|
||||
* @param int $layout_srl
|
||||
* @return Object
|
||||
**/
|
||||
function deleteLayout($layout_srl) {
|
||||
$oLayoutModel = &getModel('layout');
|
||||
|
||||
|
|
@ -231,7 +254,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Adding Layout Code
|
||||
* Adding Layout Code
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procLayoutAdminCodeUpdate() {
|
||||
$mode = Context::get('mode');
|
||||
|
|
@ -264,7 +288,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Reset layout code
|
||||
* Reset layout code
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procLayoutAdminCodeReset() {
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
|
|
@ -291,8 +316,8 @@
|
|||
|
||||
|
||||
/**
|
||||
* @brief Layout setting page -> Upload an image
|
||||
*
|
||||
* Layout setting page -> Upload an image
|
||||
* @return void
|
||||
**/
|
||||
function procLayoutAdminUserImageUpload(){
|
||||
if(!Context::isUploaded()) exit();
|
||||
|
|
@ -309,8 +334,10 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Layout setting page -> Upload an image
|
||||
*
|
||||
* insert image into user layout
|
||||
* @param int $layout_srl
|
||||
* @param object $source file data
|
||||
* @return boolean (true : success, false : fail)
|
||||
**/
|
||||
function insertUserLayoutImage($layout_srl,$source){
|
||||
$oLayoutModel = &getModel('layout');
|
||||
|
|
@ -328,20 +355,9 @@
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Layout setting page -> Delete an image
|
||||
*
|
||||
**/
|
||||
function removeUserLayoutImage($layout_srl,$filename){
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$path = $oLayoutModel->getUserLayoutImagePath($layout_srl);
|
||||
@unlink($path . $filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Layout setting page -> Delete an image
|
||||
*
|
||||
* Layout setting page -> Delete an image
|
||||
* @return void
|
||||
**/
|
||||
function procLayoutAdminUserImageDelete(){
|
||||
$filename = Context::get('filename');
|
||||
|
|
@ -351,10 +367,24 @@
|
|||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
}
|
||||
|
||||
/**
|
||||
* delete image into user layout
|
||||
* @param int $layout_srl
|
||||
* @param string $filename
|
||||
* @return void
|
||||
**/
|
||||
function removeUserLayoutImage($layout_srl,$filename){
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$path = $oLayoutModel->getUserLayoutImagePath($layout_srl);
|
||||
@unlink($path . $filename);
|
||||
}
|
||||
|
||||
// deprecated
|
||||
/**
|
||||
* @brief Save layout configuration
|
||||
* Save layout configuration
|
||||
* save in "ini" format for faceoff
|
||||
* @deprecated
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function procLayoutAdminUserValueInsert(){
|
||||
$oModuleModel = &getModel('module');
|
||||
|
|
@ -404,8 +434,10 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Layout setting, save "ini"
|
||||
*
|
||||
* Layout setting, save "ini"
|
||||
* @param int $layout_srl
|
||||
* @param object $arr layout ini
|
||||
* @return void
|
||||
**/
|
||||
function insertUserLayoutValue($layout_srl,$arr){
|
||||
$oLayoutModel = &getModel('layout');
|
||||
|
|
@ -413,13 +445,12 @@
|
|||
FileHandler::writeIniFile($file, $arr);
|
||||
}
|
||||
|
||||
function writeUserLayoutCss(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add the widget code for faceoff into user layout file
|
||||
*
|
||||
* Add the widget code for faceoff into user layout file
|
||||
* @param int $layout_srl
|
||||
* @param object $arg
|
||||
* @param string $content
|
||||
* @return string
|
||||
**/
|
||||
function addExtension($layout_srl,$arg,$content){
|
||||
$oLayoutModel = &getModel('layout');
|
||||
|
|
@ -443,8 +474,9 @@
|
|||
|
||||
|
||||
/**
|
||||
* @brief Delete temp files for faceoff
|
||||
*
|
||||
* Delete temp files for faceoff
|
||||
* @param int $layout_srl
|
||||
* @return void
|
||||
**/
|
||||
function deleteUserLayoutTempFile($layout_srl){
|
||||
$oLayoutModel = &getModel('layout');
|
||||
|
|
@ -455,8 +487,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief faceoff export
|
||||
*
|
||||
* export user layout
|
||||
* @return void
|
||||
**/
|
||||
function procLayoutAdminUserLayoutExport(){
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
|
|
@ -548,10 +580,10 @@
|
|||
exit();
|
||||
}
|
||||
|
||||
// deprecated
|
||||
/**
|
||||
* @brief faceoff import
|
||||
*
|
||||
* faceoff import
|
||||
* @deprecated
|
||||
* @return void
|
||||
**/
|
||||
function procLayoutAdminUserLayoutImport(){
|
||||
return $this->stop('not supported');
|
||||
|
|
@ -574,6 +606,12 @@
|
|||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
}
|
||||
|
||||
/**
|
||||
* import layout
|
||||
* @param int $layout_srl
|
||||
* @param string $source_file path of imported file
|
||||
* @return void
|
||||
**/
|
||||
function importLayout($layout_srl, $source_file) {
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$user_layout_path = FileHandler::getRealPath($oLayoutModel->getUserLayoutPath($layout_srl));
|
||||
|
|
|
|||
|
|
@ -2,41 +2,48 @@
|
|||
/**
|
||||
* @class layoutAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief admin view class of the layout module
|
||||
* admin view class of the layout module
|
||||
**/
|
||||
|
||||
class layoutAdminView extends layout {
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
* Initialization
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Display a installed layout list
|
||||
* Display a installed layout list
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminInstalledList() {
|
||||
$type = Context::get('type');
|
||||
$type = ($type != 'M') ? 'P' : 'M';
|
||||
|
||||
// Set a layout list
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_list = $oLayoutModel->getDownloadedLayoutList('P', true);
|
||||
$layout_list = $oLayoutModel->getDownloadedLayoutList($type, true);
|
||||
if(!is_array($layout_list))
|
||||
{
|
||||
$layout_list = array();
|
||||
}
|
||||
|
||||
// get Theme layout
|
||||
$oAdminModel = &getAdminModel('admin');
|
||||
$themeList = $oAdminModel->getThemeList();
|
||||
$themeLayoutList = array();
|
||||
foreach($themeList as $themeInfo){
|
||||
if(strpos($themeInfo->layout_info->name, '.') === false) continue;
|
||||
$themeLayoutList[] = $oLayoutModel->getLayoutInfo($themeInfo->layout_info->name, null, 'P');
|
||||
if($type == 'P')
|
||||
{
|
||||
// get Theme layout
|
||||
$oAdminModel = &getAdminModel('admin');
|
||||
$themeList = $oAdminModel->getThemeList();
|
||||
$themeLayoutList = array();
|
||||
foreach($themeList as $themeInfo){
|
||||
if(strpos($themeInfo->layout_info->name, '.') === false) continue;
|
||||
$themeLayoutList[] = $oLayoutModel->getLayoutInfo($themeInfo->layout_info->name, null, 'P');
|
||||
}
|
||||
$layout_list = array_merge($layout_list, $themeLayoutList);
|
||||
$layout_list[] = $oLayoutModel->getLayoutInfo('faceoff', null, 'P');
|
||||
}
|
||||
$layout_list = array_merge($layout_list, $themeLayoutList);
|
||||
$layout_list[] = $oLayoutModel->getLayoutInfo('faceoff', null, 'P');
|
||||
Context::set('type', 'P');
|
||||
|
||||
$pcLayoutCount = $oLayoutModel->getInstalledLayoutCount('P');
|
||||
$mobileLayoutCount = $oLayoutModel->getInstalledLayoutCount('M');
|
||||
|
|
@ -59,32 +66,52 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Display a installed mobile layout list
|
||||
* Display list of pc layout all instance
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
*/
|
||||
function dispLayoutAdminInstalledMobileList() {
|
||||
// Set a layout list
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_list = $oLayoutModel->getDownloadedLayoutList('M', true);
|
||||
Context::set('type', 'M');
|
||||
function dispLayoutAdminAllInstanceList()
|
||||
{
|
||||
$type = Context::get('type');
|
||||
|
||||
if (!in_array($type, array('P', 'M'))) $type = 'P';
|
||||
|
||||
$oLayoutModel = &getModel('layout');
|
||||
|
||||
$pcLayoutCount = $oLayoutModel->getInstalledLayoutCount('P');
|
||||
$mobileLayoutCount = $oLayoutModel->getInstalledLayoutCount('M');
|
||||
Context::set('pcLayoutCount', $pcLayoutCount);
|
||||
Context::set('mobileLayoutCount', $mobileLayoutCount);
|
||||
$this->setTemplateFile('installed_layout_list');
|
||||
|
||||
$security = new Security($layout_list);
|
||||
$layout_info = $security->encodeHTML('..', '..author..');
|
||||
$columnList = array('layout_srl', 'layout', 'module_srl', 'title', 'regdate');
|
||||
$_layout_list = $oLayoutModel->getLayoutInstanceList(0, $type, null, $columnList);
|
||||
|
||||
foreach($layout_list as $no => $layout_info)
|
||||
$layout_list = array();
|
||||
foreach($_layout_list as $item)
|
||||
{
|
||||
$layout_list[$no]->description = nl2br(trim($layout_info->description));
|
||||
if(!$layout_list[$item->layout])
|
||||
{
|
||||
$layout_list[$item->layout] = array();
|
||||
$layout_info = $oLayoutModel->getLayoutInfo($item->layout, null, $type);
|
||||
if ($layout_info)
|
||||
{
|
||||
$layout_list[$item->layout]['title'] = $layout_info->title;
|
||||
}
|
||||
}
|
||||
|
||||
$layout_list[$item->layout][] = $item;
|
||||
}
|
||||
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
$this->setTemplateFile('layout_all_instance_list');
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('layout_list..');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Display list of pc layout instance
|
||||
* Display list of pc layout instance
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
*/
|
||||
function dispLayoutAdminInstanceList()
|
||||
{
|
||||
|
|
@ -111,8 +138,9 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Layout setting page
|
||||
* Layout setting page
|
||||
* Once select a layout with empty value in the DB, then adjust values
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function dispLayoutAdminInsert() {
|
||||
$oModel = &getModel('layout');
|
||||
|
|
@ -154,7 +182,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Insert Layout details
|
||||
* Insert Layout details
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminModify() {
|
||||
// Set the layout after getting layout information
|
||||
|
|
@ -193,9 +222,10 @@
|
|||
$this->setTemplateFile('layout_modify');
|
||||
}
|
||||
|
||||
// deprecated
|
||||
/**
|
||||
* @brief The first page of the layout admin
|
||||
* The first page of the layout admin
|
||||
* @deprecated
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function dispLayoutAdminContent() {
|
||||
$path = Context::get('path');
|
||||
|
|
@ -209,7 +239,11 @@
|
|||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
// deprecated
|
||||
/**
|
||||
* The first page of the mobile layout admin
|
||||
* @deprecated
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminMobileContent() {
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$columnList = array('layout_srl', 'layout', 'module_srl', 'title', 'regdate');
|
||||
|
|
@ -221,7 +255,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Edit layout codes
|
||||
* Edit layout codes
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminEdit() {
|
||||
// Set the layout with its information
|
||||
|
|
@ -230,7 +265,7 @@
|
|||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
// Error appears if there is no layout information is registered
|
||||
if(!$layout_info) return $this->dispLayoutAdminContent();
|
||||
if(!$layout_info) return $this->dispLayoutAdminInstalledList();
|
||||
|
||||
// Get Layout Code
|
||||
$oLayoutModel = &getModel('layout');
|
||||
|
|
@ -280,7 +315,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Preview a layout
|
||||
* Preview a layout
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function dispLayoutAdminPreview() {
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
|
|
@ -332,9 +368,10 @@
|
|||
|
||||
}
|
||||
|
||||
// deprecated
|
||||
/**
|
||||
* @brief Pop-up details of the layout(conf/info.xml)
|
||||
* Pop-up details of the layout(conf/info.xml)
|
||||
* @deprecated
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminInfo() {
|
||||
// Get the layout information
|
||||
|
|
@ -353,9 +390,10 @@
|
|||
$this->setTemplateFile('layout_detail_info');
|
||||
}
|
||||
|
||||
// deprecated
|
||||
/**
|
||||
* @brief Modify admin layout of faceoff
|
||||
* Modify admin layout of faceoff
|
||||
* @deprecated
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminLayoutModify(){
|
||||
// Get layout_srl
|
||||
|
|
@ -400,7 +438,11 @@
|
|||
$this->setTemplateFile('faceoff_layout_edit');
|
||||
}
|
||||
|
||||
// deprecated
|
||||
/**
|
||||
* display used images info for faceoff
|
||||
* @deprecated
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutAdminLayoutImageList(){
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$oLayoutModel = &getModel('layout');
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@
|
|||
/**
|
||||
* @class layout
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief high class of the layout module
|
||||
* high class of the layout module
|
||||
**/
|
||||
|
||||
class layout extends ModuleObject {
|
||||
|
||||
/**
|
||||
* @brief Implement if additional tasks are necessary when installing
|
||||
* Implement if additional tasks are necessary when installing
|
||||
* @return Object
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// Create a directory to be used in the layout
|
||||
|
|
@ -18,7 +19,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief a method to check if successfully installed
|
||||
* a method to check if successfully installed
|
||||
* @return boolean
|
||||
**/
|
||||
function checkUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
|
|
@ -37,7 +39,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Execute update
|
||||
* Execute update
|
||||
* @return Object
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
|
|
@ -68,7 +71,8 @@
|
|||
|
||||
|
||||
/**
|
||||
* @brief Re-generate the cache file
|
||||
* Re-generate the cache file
|
||||
* @return void
|
||||
**/
|
||||
function recompileCache() {
|
||||
$path = './files/cache/layout';
|
||||
|
|
|
|||
|
|
@ -3,22 +3,32 @@
|
|||
* @class layoutModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @version 0.1
|
||||
* @brief Model class of the layout module
|
||||
* Model class of the layout module
|
||||
**/
|
||||
|
||||
class layoutModel extends layout {
|
||||
|
||||
/**
|
||||
* Check user layout temp
|
||||
* @var string
|
||||
**/
|
||||
var $useUserLayoutTemp = null;
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
* Initialization
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
// deprecated
|
||||
/**
|
||||
* @brief Get a layout list created in the DB
|
||||
* Get a layout list created in the DB
|
||||
* If you found a new list, it means that the layout list is inserted to the DB
|
||||
* @deprecated
|
||||
* @param int $site_srl
|
||||
* @param string $layout_type (P : PC, M : Mobile)
|
||||
* @param array $columnList
|
||||
* @return array layout lists in site
|
||||
**/
|
||||
function getLayoutList($site_srl = 0, $layout_type="P", $columnList = array()) {
|
||||
if(!$site_srl) {
|
||||
|
|
@ -32,7 +42,12 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Get layout instance list
|
||||
* Get layout instance list
|
||||
* @param int $siteSrl
|
||||
* @param string $layoutType (P : PC, M : Mobile)
|
||||
* @param string $layout name of layout
|
||||
* @param array $columnList
|
||||
* @return array layout lists in site
|
||||
**/
|
||||
function getLayoutInstanceList($siteSrl = 0, $layoutType = 'P', $layout = null, $columnList = array())
|
||||
{
|
||||
|
|
@ -49,8 +64,10 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Get one of layout information created in the DB
|
||||
* Get one of layout information created in the DB
|
||||
* Return DB info + XML info of the generated layout
|
||||
* @param int $layout_srl
|
||||
* @return object info of layout
|
||||
**/
|
||||
function getLayout($layout_srl) {
|
||||
// cache controll
|
||||
|
|
@ -68,21 +85,23 @@
|
|||
$layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type);
|
||||
|
||||
// If deleted layout files, delete layout instance
|
||||
if (!$layout_info) {
|
||||
$oLayoutController = &getAdminController('layout');
|
||||
$oLayoutController->deleteLayout($layout_srl);
|
||||
return;
|
||||
}
|
||||
// if (!$layout_info) {
|
||||
// $oLayoutController = &getAdminController('layout');
|
||||
// $oLayoutController->deleteLayout($layout_srl);
|
||||
// return;
|
||||
// }
|
||||
|
||||
//insert in cache
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$layout_info);
|
||||
}
|
||||
return $layout_info;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get a layout path
|
||||
* Get a layout path
|
||||
* @param string $layout_name
|
||||
* @param string $layout_type (P : PC, M : Mobile)
|
||||
* @return string path of layout
|
||||
**/
|
||||
function getLayoutPath($layout_name, $layout_type = "P") {
|
||||
$layout_parse = explode('.', $layout_name);
|
||||
|
|
@ -100,8 +119,11 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Get a type and information of the layout
|
||||
* Get a type and information of the layout
|
||||
* A type of downloaded layout
|
||||
* @param string $layout_type (P : PC, M : Mobile)
|
||||
* @param boolean $withAutoinstallInfo
|
||||
* @return array info of layout
|
||||
**/
|
||||
function getDownloadedLayoutList($layout_type = "P", $withAutoinstallInfo = false) {
|
||||
if ($withAutoinstallInfo) $oAutoinstallModel = &getModel('autoinstall');
|
||||
|
|
@ -142,8 +164,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Get a count of layout
|
||||
* @param $layout_type: a type of layout(P|M)
|
||||
* Get a count of layout
|
||||
* @param string $layoutType (P : PC, M : Mobile)
|
||||
* @return int
|
||||
**/
|
||||
function getInstalledLayoutCount($layoutType = 'P')
|
||||
|
|
@ -153,8 +175,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Get list of layouts directory
|
||||
* @param $layoutType: a type of layout(P|M)
|
||||
* Get list of layouts directory
|
||||
* @param string $layoutType (P : PC, M : Mobile)
|
||||
* @return array
|
||||
**/
|
||||
function _getInstalledLayoutDirectories($layoutType = 'P')
|
||||
|
|
@ -180,8 +202,12 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Get information by reading conf/info.xml in the module
|
||||
* Get information by reading conf/info.xml in the module
|
||||
* It uses caching to reduce time for xml parsing ..
|
||||
* @param string $layout
|
||||
* @param object $info
|
||||
* @param string $layoutType (P : PC, M : Mobile)
|
||||
* @return object info of layout
|
||||
**/
|
||||
function getLayoutInfo($layout, $info = null, $layout_type = "P") {
|
||||
if($info) {
|
||||
|
|
@ -441,7 +467,6 @@
|
|||
|
||||
}
|
||||
|
||||
|
||||
// header_script
|
||||
$oModuleModel = &getModel('module');
|
||||
$layout_config = $oModuleModel->getModulePartConfig('layout', $layout_srl);
|
||||
|
|
@ -455,9 +480,10 @@
|
|||
return $layout_info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Return a list of images which are uploaded on the layout setting page
|
||||
* Return a list of images which are uploaded on the layout setting page
|
||||
* @param int $layout_srl
|
||||
* @return array image list in layout
|
||||
**/
|
||||
function getUserLayoutImageList($layout_srl){
|
||||
$path = $this->getUserLayoutImagePath($layout_srl);
|
||||
|
|
@ -465,9 +491,11 @@
|
|||
return $list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get ini configurations and make them an array.
|
||||
* Get ini configurations and make them an array.
|
||||
* @param int $layout_srl
|
||||
* @param string $layout_name
|
||||
* @return array
|
||||
**/
|
||||
function getUserLayoutIniConfig($layout_srl, $layout_name=null){
|
||||
$file = $this->getUserLayoutIni($layout_srl);
|
||||
|
|
@ -480,29 +508,36 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief user layout path
|
||||
* get user layout path
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutPath($layout_srl){
|
||||
return sprintf("./files/faceOff/%s",getNumberingPath($layout_srl,3));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief user layout image path
|
||||
* get user layout image path
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutImagePath($layout_srl){
|
||||
return $this->getUserLayoutPath($layout_srl). 'images/';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief css which is set by an administrator on the layout setting page
|
||||
* css which is set by an administrator on the layout setting page
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutCss($layout_srl){
|
||||
return $this->getUserLayoutPath($layout_srl). 'layout.css';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Import faceoff css from css module handler
|
||||
* Import faceoff css from css module handler
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutFaceOffCss($layout_srl){
|
||||
$src = $this->_getUserLayoutFaceOffCss($layout_srl);
|
||||
|
|
@ -510,25 +545,28 @@
|
|||
return $src;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Import faceoff css from css module handler
|
||||
* Import faceoff css from css module handler
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function _getUserLayoutFaceOffCss($layout_srl){
|
||||
return $this->getUserLayoutPath($layout_srl). 'faceoff.css';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief user layout tmp html
|
||||
* get user layout tmp html
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutTempFaceOffCss($layout_srl){
|
||||
return $this->getUserLayoutPath($layout_srl). 'tmp.faceoff.css';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief user layout html
|
||||
* user layout html
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutHtml($layout_srl){
|
||||
$src = $this->getUserLayoutPath($layout_srl). 'layout.html';
|
||||
|
|
@ -542,15 +580,18 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief user layout tmp html
|
||||
* user layout tmp html
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutTempHtml($layout_srl){
|
||||
return $this->getUserLayoutPath($layout_srl). 'tmp.layout.html';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief user layout ini
|
||||
* user layout ini
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutIni($layout_srl){
|
||||
$src = $this->getUserLayoutPath($layout_srl). 'layout.ini';
|
||||
|
|
@ -564,58 +605,75 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief user layout tmp ini
|
||||
* user layout tmp ini
|
||||
* @param int $layout_srl
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutTempIni($layout_srl){
|
||||
return $this->getUserLayoutPath($layout_srl). 'tmp.layout.ini';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief user layout cache
|
||||
* todo It may need to remove the file itself
|
||||
* user layout cache
|
||||
* TODO It may need to remove the file itself
|
||||
* @param int $layout_srl
|
||||
* @param string $lang_type
|
||||
* @return string
|
||||
**/
|
||||
function getUserLayoutCache($layout_srl,$lang_type){
|
||||
return $this->getUserLayoutPath($layout_srl). "{$lang_type}.cache.php";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief layout cache
|
||||
* layout cache
|
||||
* @param int $layout_srl
|
||||
* @param string $lang_type
|
||||
* @return string
|
||||
**/
|
||||
function getLayoutCache($layout_name,$lang_type){
|
||||
return sprintf("./files/cache/layout/%s.%s.cache.php",$layout_name,$lang_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief default layout ini to prevent arbitrary changes by a user
|
||||
* default layout ini to prevent arbitrary changes by a user
|
||||
* @param string $layout_name
|
||||
* @return string
|
||||
**/
|
||||
function getDefaultLayoutIni($layout_name){
|
||||
return $this->getDefaultLayoutPath($layout_name). 'layout.ini';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief default layout html to prevent arbitrary changes by a user
|
||||
* default layout html to prevent arbitrary changes by a user
|
||||
* @param string $layout_name
|
||||
* @return string
|
||||
**/
|
||||
function getDefaultLayoutHtml($layout_name){
|
||||
return $this->getDefaultLayoutPath($layout_name). 'layout.html';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief default layout css to prevent arbitrary changes by a user
|
||||
* default layout css to prevent arbitrary changes by a user
|
||||
* @param string $layout_name
|
||||
* @return string
|
||||
**/
|
||||
function getDefaultLayoutCss($layout_name){
|
||||
return $this->getDefaultLayoutPath($layout_name). 'css/layout.css';
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief default layout path to prevent arbitrary changes by a user
|
||||
* default layout path to prevent arbitrary changes by a user
|
||||
* @deprecated
|
||||
* @return string
|
||||
**/
|
||||
function getDefaultLayoutPath() {
|
||||
return "./modules/layout/faceoff/";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief faceoff is
|
||||
* faceoff is
|
||||
* @param string $layout_name
|
||||
* @return boolean (true : faceoff, false : layout)
|
||||
**/
|
||||
function useDefaultLayout($layout_name){
|
||||
$info = $this->getLayoutInfo($layout_name);
|
||||
|
|
@ -623,17 +681,19 @@
|
|||
else return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Set user layout as temporary save mode
|
||||
* Set user layout as temporary save mode
|
||||
* @param string $flag (default 'temp')
|
||||
* @return void
|
||||
**/
|
||||
function setUseUserLayoutTemp($flag='temp'){
|
||||
$this->useUserLayoutTemp = $flag;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Temp file list for User Layout
|
||||
* Temp file list for User Layout
|
||||
* @param int $layout_srl
|
||||
* @return array temp files info
|
||||
**/
|
||||
function getUserLayoutTempFileList($layout_srl){
|
||||
$file_list = array(
|
||||
|
|
@ -644,9 +704,10 @@
|
|||
return $file_list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Saved file list for User Layout
|
||||
* Saved file list for User Layout
|
||||
* @param int $layout_srl
|
||||
* @return array files info
|
||||
**/
|
||||
function getUserLayoutFileList($layout_srl){
|
||||
$file_list = array(
|
||||
|
|
@ -664,7 +725,10 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief faceOff related services for the operation run out
|
||||
* faceOff related services for the operation run out
|
||||
* @deprecated
|
||||
* @param object $layout_info
|
||||
* @return void
|
||||
**/
|
||||
function doActivateFaceOff(&$layout_info) {
|
||||
$layout_info->faceoff_ini_config = $this->getUserLayoutIniConfig($layout_info->layout_srl, $layout_info->layout);
|
||||
|
|
|
|||
|
|
@ -2,20 +2,22 @@
|
|||
/**
|
||||
* @class layoutView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief admin view class of the layout module
|
||||
* admin view class of the layout module
|
||||
**/
|
||||
|
||||
class layoutView extends layout {
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
* Initialization
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pop-up layout details(conf/info.xml)
|
||||
* Pop-up layout details(conf/info.xml)
|
||||
* @return void
|
||||
**/
|
||||
function dispLayoutInfo() {
|
||||
// Get the layout information
|
||||
|
|
@ -30,7 +32,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Preview a layout
|
||||
* Preview a layout
|
||||
* @return void|Object (void : success, Object : fail)
|
||||
**/
|
||||
function dispLayoutPreview() {
|
||||
// admin check
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
<include target="header.html" />
|
||||
<div class="table even easyList dsTg">
|
||||
<include target="sub_tab.html" />
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<caption>
|
||||
<a cond="$act != 'dispLayoutAdminInstalledList'" href="{getUrl('act', 'dispLayoutAdminInstalledList')}">PC({$pcLayoutCount})</a>
|
||||
<block cond="$act == 'dispLayoutAdminInstalledList'">PC({$pcLayoutCount})</block>
|
||||
|
|
||||
<a cond="$act != 'dispLayoutAdminInstalledMobileList'" href="{getUrl('act', 'dispLayoutAdminInstalledMobileList')}">Mobile({$mobileLayoutCount})</a>
|
||||
<block cond="$act == 'dispLayoutAdminInstalledMobileList'">Mobile({$mobileLayoutCount})</block>
|
||||
<span class="side"><button type="button" class="text"><span class="hide">{$lang->simple_view}</span><span class="show">{$lang->detail_view}</span></button></span>
|
||||
</caption>
|
||||
<thead>
|
||||
|
|
@ -55,4 +51,4 @@
|
|||
</block>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
48
modules/layout/tpl/layout_all_instance_list.html
Normal file
48
modules/layout/tpl/layout_all_instance_list.html
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<script type="text/javascript">
|
||||
xe.lang.confirm_delete = '{$lang->confirm_delete}';
|
||||
</script>
|
||||
<include target="header.html" />
|
||||
<load target="js/adminList.js" usecdn="true" />
|
||||
<div class="table even easyList">
|
||||
<include target="sub_tab.html" />
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<caption>
|
||||
<span class="side"><button type="button" class="text"><span class="hide">{$lang->simple_view}</span><span class="show">{$lang->detail_view}</span></button></span>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="nowr">{$lang->number}</th>
|
||||
<th scope="col" class="nowr">{$lang->layout_name}</th>
|
||||
<th scope="col" class="title">{$lang->title}</th>
|
||||
<th scope="col" class="nowr">{$lang->regdate}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_layout_management}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_layout_edit}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_delete}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{@$count=1}
|
||||
<!--@foreach($layout_list as $layout)-->
|
||||
{@$layout_name = $layout['title']}
|
||||
{@unset($layout['title'])}
|
||||
<tr loop="$layout => $no, $item">
|
||||
<td class="nowr" rowspan="{count($layout)}" cond="$no === 0" >{$count++}</td>
|
||||
<td class="nowr" rowspan="{count($layout)}" cond="$no === 0" >{$layout_name}</td>
|
||||
<td class="title">{$item->title}</td>
|
||||
<td class="nowr">{zdate($item->regdate, "Y-m-d")}</td>
|
||||
<td class="nowr"><a href="{getUrl('act', 'dispLayoutAdminModify', 'layout_srl', $item->layout_srl)}">{$lang->cmd_layout_management}</a></td>
|
||||
<td class="nowr"><a href="{getUrl('act', 'dispLayoutAdminEdit', 'layout_srl', $item->layout_srl)}">{$lang->cmd_layout_edit}</a></td>
|
||||
<td class="nowr">
|
||||
<form class="layout_delete_form" ruleset="deleteLayout" action="./" method="post">
|
||||
<input type="hidden" name="module" value="layout" />
|
||||
<input type="hidden" name="act" value="procLayoutAdminDelete" />
|
||||
<input type="hidden" name="layout_srl" value="{$item->layout_srl}" />
|
||||
|
||||
<input class="text" type="submit" value="{$lang->cmd_delete}" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
14
modules/layout/tpl/sub_tab.html
Normal file
14
modules/layout/tpl/sub_tab.html
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<div class="cnb">
|
||||
<a cond="$type == 'M'" href="{getUrl('act', 'dispLayoutAdminInstalledList', 'type', 'P')}">PC({$pcLayoutCount})</a>
|
||||
<block cond="$type != 'M'">PC({$pcLayoutCount})</block>
|
||||
|
|
||||
<a cond="$type != 'M'" href="{getUrl('act', 'dispLayoutAdminInstalledList', 'type', 'M')}">Mobile({$mobileLayoutCount})</a>
|
||||
<block cond="$type == 'M'">Mobile({$mobileLayoutCount})</block>
|
||||
</div>
|
||||
<div class="cnb">
|
||||
<a cond="$act != 'dispLayoutAdminAllInstanceList'" href="{getUrl('act', 'dispLayoutAdminAllInstanceList', 'layout_srl', '')}">{$lang->instance_layout}</a>
|
||||
<block cond="$act == 'dispLayoutAdminAllInstanceList'">{$lang->instance_layout}</block>
|
||||
|
|
||||
<a cond="$act != 'dispLayoutAdminInstalledList'" href="{getUrl('act', 'dispLayoutAdminInstalledList')}">{$lang->installed_layout}</a>
|
||||
<block cond="$act == 'dispLayoutAdminInstalledList'">{$lang->installed_layout}</block>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue