mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
Enhanced filebox to add multiple attributes per image and also improved the filebox controlled used for widgets to add multiple images at the same time if you set the parameter allow_multiple=Y
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9929 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c424fdbceb
commit
41a5b57344
11 changed files with 305 additions and 59 deletions
|
|
@ -993,4 +993,16 @@ Le module [Administration des Modules] montera tous les modules installés et vo
|
|||
<value xml:lang="ko"><![CDATA[시작 모듈은 삭제할 수 없습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Cannot delete a start module.]]></value>
|
||||
</item>
|
||||
<item name="attribute_name">
|
||||
<value xml:lang="en"><![CDATA[Attribute name]]></value>
|
||||
</item>
|
||||
<item name="attribute_value">
|
||||
<value xml:lang="en"><![CDATA[Attribute value]]></value>
|
||||
</item>
|
||||
<item name="add">
|
||||
<value xml:lang="en"><![CDATA[Add]]></value>
|
||||
</item>
|
||||
<item name="delete">
|
||||
<value xml:lang="en"><![CDATA[Delete]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
|
|
|
|||
|
|
@ -720,7 +720,13 @@
|
|||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
$vars = Context::gets('comment','addfile','filter');
|
||||
$vars = Context::gets('addfile','filter');
|
||||
$attributes = Context::getRequestVars();
|
||||
foreach($attributes as $key => $value){
|
||||
if(!(strpos($key, 'attribute_name') === false)) $vars->comment = $vars->comment.';'.$value;
|
||||
if(!(strpos($key, 'attribute_value') ===false)) $vars->comment = $vars->comment.':'.$value;
|
||||
}
|
||||
$vars->comment = substr($vars->comment, 1);
|
||||
$module_filebox_srl = Context::get('module_filebox_srl');
|
||||
|
||||
$ext = strtolower(substr(strrchr($vars->addfile['name'],'.'),1));
|
||||
|
|
|
|||
|
|
@ -1436,16 +1436,47 @@
|
|||
}
|
||||
|
||||
function getModuleFileBoxList(){
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
$args->page = Context::get('page');
|
||||
$args->list_count = 5;
|
||||
$args->page_count = 5;
|
||||
return executeQuery('module.getModuleFileBoxList', $args);
|
||||
$output = executeQuery('module.getModuleFileBoxList', $args);
|
||||
$output = $oModuleModel->unserializeAttributes($output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
function unserializeAttributes($module_filebox_list){
|
||||
foreach($module_filebox_list->data as $item){
|
||||
$attributes = explode(';', $item->comment);
|
||||
foreach($attributes as $attribute){
|
||||
$values = explode(':', $attribute);
|
||||
if((count($values) % 2) ==1) {
|
||||
for($i=2;$i<count($values);$i++){
|
||||
$values[1].=":".$values[$i];
|
||||
}
|
||||
}
|
||||
$atts[$values[0]]=$values[1];
|
||||
}
|
||||
$item->attributes = $atts;
|
||||
unset($atts);
|
||||
}
|
||||
return $module_filebox_list;
|
||||
}
|
||||
|
||||
function getFileBoxListHtml()
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
|
||||
$link = parse_url($_SERVER["HTTP_REFERER"]);
|
||||
$link_params = explode('&',$link['query']);
|
||||
foreach ($link_params as $param){
|
||||
$param = explode("=",$param);
|
||||
if($param[0] == 'selected_widget') $selected_widget = $param[1];
|
||||
}
|
||||
$oWidgetModel = &getModel('widget');
|
||||
if($selected_widget) $widget_info = $oWidgetModel->getWidgetInfo($selected_widget);
|
||||
Context::set('allow_multiple', $widget_info->extra_var->images->allow_multiple);
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$output = $oModuleModel->getModuleFileBoxList();
|
||||
|
|
|
|||
|
|
@ -10,10 +10,23 @@
|
|||
<h2>{$lang->upload_file}</h2>
|
||||
<span class="more"><a href="#fileUp" class="tgAnchor" data-effect="slide" data-duration="200">{$lang->cmd_show_hide}</a></span>
|
||||
<div class="tgContent" id="fileUp">
|
||||
<p>
|
||||
<label for="fileDescription">{$lang->description}</label> <input type="text" name="comment" id="fileDescription" /><br />
|
||||
<label for="file">{$lang->file}</label> <input type="file" name="addfile" id="file"/>
|
||||
</p>
|
||||
<table cellspacing="0" id="attributes">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="attribute_name1">{$lang->attribute_name} </label><input type="text" name="attribute_name1" id="attribute_name1" />
|
||||
</td>
|
||||
<td>
|
||||
<label for="attribute_value1">{$lang->attribute_value} </label><input type="text" name="attribute_value1" id="attribute_value1" />
|
||||
</td>
|
||||
<td><a href="javascript:addRow('attributes')">{$lang->add}</a></td>
|
||||
<td><a href="javascript:clearRow('attributes',1)">{$lang->delete}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="file">{$lang->file}</label><input type="file" name="addfile" id="file"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
</div>
|
||||
|
|
@ -22,7 +35,9 @@
|
|||
<form action="" class="form">
|
||||
<ul>
|
||||
<li loop="$filebox_list=>$key,$val">
|
||||
<p class="q">{$val->comment}</p>
|
||||
<!--@foreach($val->attributes as $key => $value)-->
|
||||
<p class="q">{$key} : {$value}</p>
|
||||
<!--@end-->
|
||||
<p class="a">
|
||||
<!--@if($val->fileextension=='swf')-->
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
<p cond="!$filebox_list">등록된 파일이 없습니다.</p>
|
||||
<p cond="!$filebox_list">Not a registered file.</p>
|
||||
<ul cond="$filebox_list" class="lined">
|
||||
<li loop="$filebox_list=>$key,$fileInfo">
|
||||
<a href="#" class="select"><img class="filebox_item" src="{$fileInfo->filename}" title="{$fileInfo->comment}" /></a>
|
||||
<span>{$fileInfo->comment}</span>
|
||||
<!--@if(!$allow_multiple)--><a href="#" class="select"><!--@end--><img class="filebox_item" src="{$fileInfo->filename}" /><!--@if(!$allow_multiple)--></a><!--@end-->
|
||||
<!--@if($allow_multiple)--><input class="select_checkbox" type="checkbox" name="{$fileInfo->filename}" id="{$fileInfo->filename}"><!--@end-->
|
||||
<!--@foreach($fileInfo->attributes as $key => $value)-->
|
||||
<p class="q">{$key} : {$value}</p>
|
||||
<!--@end-->
|
||||
</li>
|
||||
<!--@if($allow_multiple)--><li><a href="#" class="select">Select</a></li><!--@end-->
|
||||
</ul>
|
||||
<div class="pagination" cond="$page_navigation">
|
||||
<a href="#" class="direction" page="1">« FIRST</a>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue