mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 16:59:55 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1665 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
00c9be280d
commit
dd8ce2be92
12 changed files with 0 additions and 0 deletions
64
modules/widget/widget.controller.php
Normal file
64
modules/widget/widget.controller.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
/**
|
||||
* @class widgetController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief widget 모듈의 Controller class
|
||||
**/
|
||||
|
||||
class widgetController extends widget {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 위젯의 생성된 코드를 return
|
||||
**/
|
||||
function procWidgetGenerateCode() {
|
||||
// 변수 정리
|
||||
$vars = Context::getRequestVars();
|
||||
$widget = $vars->selected_widget;
|
||||
|
||||
unset($vars->module);
|
||||
unset($vars->act);
|
||||
unset($vars->selected_widget);
|
||||
|
||||
$attribute = array();
|
||||
if($vars) {
|
||||
foreach($vars as $key => $val) {
|
||||
if(strpos($val,'|@|')>0) $val = str_replace('|@|',',',$val);
|
||||
$attribute[] = sprintf('%s="%s"', $key, str_replace('"','\"',$val));
|
||||
}
|
||||
}
|
||||
|
||||
$blank_img_path = "./common/tpl/images/blank.gif";
|
||||
$widget_code = sprintf('<img src="%s" class="zbxe_widget_output" widget="%s" %s style="width:100px;height:100px;"/>', $blank_img_path, $widget, implode(' ',$attribute));
|
||||
|
||||
// 코드 출력
|
||||
$this->add('widget_code', $widget_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 선택된 위젯 - 스킨의 컬러셋을 return
|
||||
**/
|
||||
function procWidgetGetColorsetList() {
|
||||
$widget = Context::get('selected_widget');
|
||||
$skin = Context::get('skin');
|
||||
|
||||
$path = sprintf('./widgets/%s/', $widget);
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($path, $skin);
|
||||
|
||||
for($i=0;$i<count($skin_info->colorset);$i++) {
|
||||
$colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title);
|
||||
$colorset_list[] = $colorset;
|
||||
}
|
||||
|
||||
if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
|
||||
$this->add('colorset_list', $colorsets);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue