faceoff support

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8953 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-08-30 09:54:47 +00:00
parent 236bb1528b
commit 56b95cdb40
5 changed files with 55 additions and 50 deletions

View file

@ -496,6 +496,8 @@
if(!move_uploaded_file($file['tmp_name'], $user_layout_path . 'faceoff.tar')) exit(); if(!move_uploaded_file($file['tmp_name'], $user_layout_path . 'faceoff.tar')) exit();
$this->importLayout($layout_srl, $user_layout_path.'faceoff.tar'); $this->importLayout($layout_srl, $user_layout_path.'faceoff.tar');
$this->setRedirectUrl(Context::get('error_return_url'));
} }
function importLayout($layout_srl, $source_file) { function importLayout($layout_srl, $source_file) {

View file

@ -21,6 +21,7 @@
// Set a layout list // Set a layout list
$oLayoutModel = &getModel('layout'); $oLayoutModel = &getModel('layout');
$layout_list = $oLayoutModel->getDownloadedLayoutList('P', true); $layout_list = $oLayoutModel->getDownloadedLayoutList('P', true);
$layout_list[] = $oLayoutModel->getLayoutInfo('faceoff', null, 'P');
Context::set('type', 'P'); Context::set('type', 'P');
$pcLayoutCount = $oLayoutModel->getInstalledLayoutCount('P'); $pcLayoutCount = $oLayoutModel->getInstalledLayoutCount('P');

View file

@ -672,7 +672,7 @@
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
// Display edit button for faceoff layout // Display edit button for faceoff layout
if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')===false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) { if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')===false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) {
Context::addHtmlFooter("<div class=\"faceOffManager\"><a href=\"".getUrl('','mid',Context::get('mid'),'act','dispLayoutAdminLayoutModify','delete_tmp','Y')."\" class=\"buttonSet buttonLayoutEditor\"><span>".Context::getLang('cmd_layout_edit')."</span></a></div>"); Context::addHtmlFooter('<div class="faceOffManager" style="height: 23px; position: fixed; right: 3px; top: 3px;"><a href="'.getUrl('','mid',Context::get('mid'),'act','dispLayoutAdminLayoutModify','delete_tmp','Y').'">'.Context::getLang('cmd_layout_edit').'</a></div>');
} }
// Display menu when editing the faceOff page // Display menu when editing the faceOff page
if(Context::get('act')=='dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) { if(Context::get('act')=='dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) {

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0"> <ruleset version="1.5.0">
<customrules> <customrules>
<rule name="importExtension" type="regex" test="/\.(tar)$/i" /> <rule name="importExtension" type="regex" test="/\.tar$/i" />
</customrules> </customrules>
<fields> <fields>
<field name="file['name']" required="true" rule="importExtension" /> <field name="file" required="true" rule="importExtension" />
<field name="layout_srl" required="true" rule="number" /> <field name="layout_srl" required="true" rule="number" />
</fields> </fields>
</ruleset> </ruleset>

View file

@ -33,7 +33,7 @@
</form> </form>
</li> </li>
</ul> </ul>
<form class="form" action="./" method="post" enctype="multipart/form-data"> <form class="form" ruleset="imageUpload" action="./" method="post" enctype="multipart/form-data">
<input type="hidden" name="module" value="layout" /> <input type="hidden" name="module" value="layout" />
<input type="hidden" name="act" value="procLayoutAdminUserImageUpload" /> <input type="hidden" name="act" value="procLayoutAdminUserImageUpload" />
<input type="hidden" name="layout_srl" value="{$layout_srl}" /> <input type="hidden" name="layout_srl" value="{$layout_srl}" />
@ -49,54 +49,56 @@
</fieldset> </fieldset>
<block cond="$selected_layout->type == 'faceoff'"> <block cond="$selected_layout->type == 'faceoff'">
<h3 class="h3">{$lang->layout_migration}</h3> <fieldset class="section">
<p>{nl2br($lang->about_layout_migration)}</p> <h3 class="h3">{$lang->layout_migration}</h3>
<p>{nl2br($lang->about_layout_migration)}</p>
<table cellspacing="0" class="rowTable"> <form class="form" ruleset="userLayoutImport" action="./" method="post" enctype="multipart/form-data">
<tr> <input type="hidden" name="module" value="layout" />
<th scope="row"><div>{$lang->layout_export}</div></th> <input type="hidden" name="act" value="procLayoutAdminUserLayoutImport" />
<td> <input type="hidden" name="layout_srl" value="{$layout_srl}" />
<a href="{getUrl('','act','procLayoutAdminUserLayoutExport','layout_srl',$layout_srl)}" class="button black strong"><span>{$lang->layout_btn_export}</span></a> <ul>
<p>{$lang->about_layout_export}</p> <li>
</td> <p class="q">{$lang->layout_export}</p>
</tr> <p class="a"><span class="btn small"><a href="{getUrl('', 'act', 'procLayoutAdminUserLayoutExport', 'layout_srl', $layout_srl)}">{$lang->layout_btn_export}</a></span></p>
<tr> <p class="desc">{$lang->about_layout_export}</p>
<th scope="row"><div>{$lang->layout_import}</div></th> </li>
<td> <li>
<form ruleset="userLayoutImport" action="{getUrl('')}" method="post" enctype="multipart/form-data"> <p class="q">{$lang->layout_import}</p>
<input type="hidden" name="module" value="layout" /> <p class="a"><input type="file" name="file" /></p>
<input type="hidden" name="act" value="procLayoutAdminUserLayoutImport" /> <p class="desc">{$lang->about_layout_import}</p>
<input type="hidden" name="layout_srl" value="{$layout_srl}" /> </li>
<input type="file" name="file" /> </ul>
<span class="button black strong"><button type="submit">{$lang->cmd_submit}</button></span> <div class="btnArea">
</form> <span class="btn medium"><input type="submit" value="{$lang->cmd_submit}" /></span>
<p>{$lang->about_layout_import}</p> </div>
</td> </form>
</tr> </fieldset>
</table>
</block> </block>
<form id="fo_layout" class="form" ruleset="codeUpdate" action="./" method="post"> <fieldset class="section">
<input type="hidden" name="layout_srl" value="{$layout_srl}" /> <form id="fo_layout" class="form" ruleset="codeUpdate" action="./" method="post">
<input type="hidden" name="act" value="procLayoutAdminCodeUpdate" /> <input type="hidden" name="layout_srl" value="{$layout_srl}" />
<input type="hidden" name="act" value="procLayoutAdminCodeUpdate" />
<h3 class="h3">HTML</h3> <h3 class="h3">HTML</h3>
<div> <div>
<textarea name="code" style="width:100%;height:300px;font-size:11px;">{$layout_code}</textarea> <textarea name="code" style="width:100%;height:300px;font-size:11px;">{$layout_code}</textarea>
<!--@foreach($widget_list as $widget)--> <!--@foreach($widget_list as $widget)-->
<span class="btn"><a href="{getUrl('','module','widget','act','dispWidgetGenerateCode','selected_widget',$widget->widget,'module_srl',$module_srl)}" onclick="popopen(this.href,'GenerateCodeInPage');return false;">{$widget->title}</a></span> <span class="btn"><a href="{getUrl('','module','widget','act','dispWidgetGenerateCode','selected_widget',$widget->widget,'module_srl',$module_srl)}" onclick="popopen(this.href,'GenerateCodeInPage');return false;">{$widget->title}</a></span>
<!--@end--> <!--@end-->
</div> </div>
<h3 class="h3">CSS</h3> <h3 class="h3">CSS</h3>
<div> <div>
<textarea name="code_css" style="width:100%;height:300px;font-size:11px;">{$layout_code_css}</textarea> <textarea name="code_css" style="width:100%;height:300px;font-size:11px;">{$layout_code_css}</textarea>
</div> </div>
<div class="btnArea" style="float: left" > <div class="btnArea" style="float: left" >
<span class="btn medium"><button type="submit" name="mode" value="reset">{$lang->cmd_reset}</button></span> <span class="btn medium"><button type="submit" name="mode" value="reset">{$lang->cmd_reset}</button></span>
</div> </div>
<div class="btnArea"> <div class="btnArea">
<span class="btn medium"><button type="button" onclick="doPreviewLayoutCode();">{$lang->cmd_preview}</button></span> <span class="btn medium"><button type="button" onclick="doPreviewLayoutCode();">{$lang->cmd_preview}</button></span>
<span class="btn medium"><button type="submit" name="mode" value="save">{$lang->cmd_save}</button></span> <span class="btn medium"><button type="submit" name="mode" value="save">{$lang->cmd_save}</button></span>
</div> </div>
</form> </form>
</fieldset>