mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
addon module not yet complete
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9029 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
a9cc4543fe
commit
425b02531f
14 changed files with 352 additions and 209 deletions
|
|
@ -14,6 +14,88 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set addon activate
|
||||
**/
|
||||
function procAddonAdminSaveActivate()
|
||||
{
|
||||
$pc = Context::get('pc');
|
||||
$mobile = Context::get('mobile');
|
||||
$fixed = Context::get('fixed');
|
||||
$favorite = Context::get('favorite');
|
||||
|
||||
if (!$pc) $pc = array();
|
||||
if (!$mobile) $mobile = array();
|
||||
if (!$fixed) $fixed = array();
|
||||
if (!$favorite) $favorite = array();
|
||||
|
||||
// get current addon info
|
||||
$oModel = &getAdminModel('addon');
|
||||
$currentAddonList = $oModel->getAddonList(0, 'global');
|
||||
|
||||
// get need update addon list
|
||||
$updateList = array();
|
||||
foreach($currentAddonList as $addon)
|
||||
{
|
||||
if ($addon->activated !== in_array($addon->addon_name, $pc))
|
||||
{
|
||||
$updateList[] = $addon->addon_name;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($addon->mactivated !== in_array($addon->addon_name, $mobile))
|
||||
{
|
||||
$updateList[] = $addon->addon_name;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($addon->fixed !== in_array($addon->addon_name, $fixed))
|
||||
{
|
||||
$updateList[] = $addon->addon_name;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// update
|
||||
foreach($updateList as $targetAddon)
|
||||
{
|
||||
unset($args);
|
||||
|
||||
if (in_array($targetAddon, $pc))
|
||||
$args->is_used = 'Y';
|
||||
else
|
||||
$args->is_used = 'N';
|
||||
|
||||
if (in_array($targetAddon, $mobile))
|
||||
$args->is_used_m = 'Y';
|
||||
else
|
||||
$args->is_used_m = 'N';
|
||||
|
||||
if (in_array($targetAddon, $fixed))
|
||||
$args->fixed = 'Y';
|
||||
else
|
||||
$args->fixed = 'N';
|
||||
|
||||
$args->addon = $targetAddon;
|
||||
|
||||
$output = executeQuery('addon.updateAddon', $args);
|
||||
if (!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
if (count($updateList))
|
||||
{
|
||||
$this->makeCacheFile(0, 'pc', 'global');
|
||||
$this->makeCacheFile(0, 'mobile', 'global');
|
||||
}
|
||||
|
||||
// set favorite
|
||||
$oAdminController = &getAdminController('admin');
|
||||
$output = $oAdminController->setFavoritesByModule(-1, 'addon', $favorite);
|
||||
if (!$output->toBool()) return $output;
|
||||
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAddonAdminIndex'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add active/inactive change
|
||||
**/
|
||||
|
|
@ -45,13 +127,17 @@
|
|||
unset($args->act);
|
||||
unset($args->addon_name);
|
||||
unset($args->body);
|
||||
unset($args->error_return_url);
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
$this->doSetup($addon_name, $args, $site_module_info->site_srl);
|
||||
$output = $this->doSetup($addon_name, $args, $site_module_info->site_srl, 'global');
|
||||
if (!$output->toBool()) return $output;
|
||||
|
||||
$this->makeCacheFile($site_module_info->site_srl, "pc");
|
||||
$this->makeCacheFile($site_module_info->site_srl, "mobile");
|
||||
$this->makeCacheFile($site_module_info->site_srl, "pc", 'global');
|
||||
$this->makeCacheFile($site_module_info->site_srl, "mobile", 'global');
|
||||
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAddonAdminSetup', 'selected_addon', $addon_name));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -60,10 +146,10 @@
|
|||
* @brief Add-on
|
||||
* Adds Add to DB
|
||||
**/
|
||||
function doInsert($addon, $site_srl = 0) {
|
||||
function doInsert($addon, $site_srl = 0, $gtype = 'site') {
|
||||
$args->addon = $addon;
|
||||
$args->is_used = 'N';
|
||||
if(!$site_srl) return executeQuery('addon.insertAddon', $args);
|
||||
if($gtype == 'global') return executeQuery('addon.insertAddon', $args);
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.insertSiteAddon', $args);
|
||||
}
|
||||
|
|
@ -72,11 +158,11 @@
|
|||
* @brief Add-activated
|
||||
* addons add-ons to the table on the activation state sikyeojum
|
||||
**/
|
||||
function doActivate($addon, $site_srl = 0, $type = "pc") {
|
||||
function doActivate($addon, $site_srl = 0, $type = "pc", $gtype = 'site') {
|
||||
$args->addon = $addon;
|
||||
if($type == "pc") $args->is_used = 'Y';
|
||||
else $args->is_used_m = "Y";
|
||||
if(!$site_srl) return executeQuery('addon.updateAddon', $args);
|
||||
if($gtype == 'global') return executeQuery('addon.updateAddon', $args);
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
|
@ -86,11 +172,11 @@
|
|||
*
|
||||
* addons add a table to remove the name of the deactivation is sikige
|
||||
**/
|
||||
function doDeactivate($addon, $site_srl = 0, $type = "pc") {
|
||||
function doDeactivate($addon, $site_srl = 0, $type = "pc", $gtype = 'site') {
|
||||
$args->addon = $addon;
|
||||
if($type == "pc") $args->is_used = 'N';
|
||||
else $args->is_used_m = 'N';
|
||||
if(!$site_srl) return executeQuery('addon.updateAddon', $args);
|
||||
if($gtype == 'global') return executeQuery('addon.updateAddon', $args);
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,12 +22,40 @@
|
|||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get addon list for super admin
|
||||
**/
|
||||
function getAddonListForSuperAdmin()
|
||||
{
|
||||
$addonList = $this->getAddonList(0, 'global');
|
||||
|
||||
$oAutoinstallModel = &getModel('autoinstall');
|
||||
foreach($addonList as $key => $addon)
|
||||
{
|
||||
// get easyinstall remove url
|
||||
$packageSrl = $oAutoinstallModel->getPackageSrlByPath($addon->path);
|
||||
$addonList[$key]->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl);
|
||||
|
||||
// get easyinstall need update
|
||||
$package = $oAutoinstallModel->getInstalledPackages($packageSrl);
|
||||
$addonList[$key]->need_update = $package[$packageSrl]->need_update;
|
||||
|
||||
// get easyinstall update url
|
||||
if ($addonList[$key]->need_update == 'Y')
|
||||
{
|
||||
$addonList[$key]->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
|
||||
}
|
||||
}
|
||||
|
||||
return $addonList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wanted to add the kind of information and
|
||||
**/
|
||||
function getAddonList($site_srl = 0) {
|
||||
function getAddonList($site_srl = 0, $gtype = 'site') {
|
||||
// Wanted to add a list of activated
|
||||
$inserted_addons = $this->getInsertedAddons($site_srl);
|
||||
$inserted_addons = $this->getInsertedAddons($site_srl, $gtype);
|
||||
// Downloaded and installed add-on to the list of Wanted
|
||||
$searched_list = FileHandler::readDir('./addons','/^([a-zA-Z0-9-_]+)$/');
|
||||
$searched_count = count($searched_list);
|
||||
|
|
@ -44,20 +72,22 @@
|
|||
$path = $this->getAddonPath($addon_name);
|
||||
// Wanted information on the add-on
|
||||
unset($info);
|
||||
$info = $this->getAddonInfoXml($addon_name, $site_srl);
|
||||
$info = $this->getAddonInfoXml($addon_name, $site_srl, $gtype);
|
||||
|
||||
$info->addon = $addon_name;
|
||||
$info->path = $path;
|
||||
$info->activated = false;
|
||||
$info->mactivated = false;
|
||||
$info->fixed = false;
|
||||
// Check if a permossion is granted entered in DB
|
||||
if(!in_array($addon_name, array_keys($inserted_addons))) {
|
||||
// If not, type in the DB type (model, perhaps because of the hate doing this haneungeo .. ㅡ. ㅜ)
|
||||
$oAddonAdminController->doInsert($addon_name, $site_srl);
|
||||
$oAddonAdminController->doInsert($addon_name, $site_srl, $type);
|
||||
// Is activated
|
||||
} else {
|
||||
if($inserted_addons[$addon_name]->is_used=='Y') $info->activated = true;
|
||||
if($inserted_addons[$addon_name]->is_used_m=='Y') $info->mactivated = true;
|
||||
if ($gtype == 'global' && $inserted_addons[$addon_name]->is_fixed == 'Y') $info->fixed = true;
|
||||
}
|
||||
|
||||
$list[] = $info;
|
||||
|
|
@ -68,7 +98,7 @@
|
|||
/**
|
||||
* @brief Modules conf/info.xml wanted to read the information
|
||||
**/
|
||||
function getAddonInfoXml($addon, $site_srl = 0) {
|
||||
function getAddonInfoXml($addon, $site_srl = 0, $gtype = 'site') {
|
||||
// Get a path of the requested module. Return if not exists.
|
||||
$addon_path = $this->getAddonPath($addon);
|
||||
if(!$addon_path) return;
|
||||
|
|
@ -85,7 +115,7 @@
|
|||
|
||||
// DB is set to bring history
|
||||
$db_args->addon = $addon;
|
||||
if(!$site_srl) $output = executeQuery('addon.getAddonInfo',$db_args);
|
||||
if($gtype == 'global') $output = executeQuery('addon.getAddonInfo',$db_args);
|
||||
else {
|
||||
$db_args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.getSiteAddonInfo',$db_args);
|
||||
|
|
@ -267,9 +297,9 @@
|
|||
/**
|
||||
* @brief Add to the list of active guhaeom
|
||||
**/
|
||||
function getInsertedAddons($site_srl = 0) {
|
||||
function getInsertedAddons($site_srl = 0, $gtype = 'site') {
|
||||
$args->list_order = 'addon';
|
||||
if(!$site_srl) $output = executeQuery('addon.getAddons', $args);
|
||||
if($gtype == 'global') $output = executeQuery('addon.getAddons', $args);
|
||||
else {
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.getSiteAddons', $args);
|
||||
|
|
@ -288,9 +318,9 @@
|
|||
/**
|
||||
* @brief Add-on is enabled, check whether
|
||||
**/
|
||||
function isActivatedAddon($addon, $site_srl = 0, $type = "pc") {
|
||||
function isActivatedAddon($addon, $site_srl = 0, $type = "pc", $gtype = 'site') {
|
||||
$args->addon = $addon;
|
||||
if(!$site_srl) {
|
||||
if($gtype == 'global') {
|
||||
if($type == "pc") $output = executeQuery('addon.getAddonIsActivated', $args);
|
||||
else $output = executeQuery('addon.getMAddonIsActivated', $args);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,11 +18,20 @@
|
|||
* @brief Add Management main page (showing the list)
|
||||
**/
|
||||
function dispAddonAdminIndex() {
|
||||
$oAdminModel = &getAdminModel('admin');
|
||||
$siteModuleInfo = Context::get('site_module_info');
|
||||
$output = $oAdminModel->getFavoriteListByModule(-1, 'addon');
|
||||
if (!$output->toBool()) return $output;
|
||||
|
||||
$favoriteList = $output->get('list');
|
||||
Context::set('favoriteList', $favoriteList);
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
// Add to the list settings
|
||||
$oAddonModel = &getAdminModel('addon');
|
||||
$addon_list = $oAddonModel->getAddonList($site_module_info->site_srl);
|
||||
$addon_list = $oAddonModel->getAddonListForSuperAdmin();
|
||||
Context::set('addon_list', $addon_list);
|
||||
Context::set('addon_count', count($addon_list));
|
||||
// Template specifies the path and file
|
||||
$this->setTemplateFile('addon_list');
|
||||
}
|
||||
|
|
@ -36,7 +45,7 @@
|
|||
$selected_addon = Context::get('selected_addon');
|
||||
// Wanted to add the requested information
|
||||
$oAddonModel = &getAdminModel('addon');
|
||||
$addon_info = $oAddonModel->getAddonInfoXml($selected_addon, $site_module_info->site_srl);
|
||||
$addon_info = $oAddonModel->getAddonInfoXml($selected_addon, $site_module_info->site_srl, 'global');
|
||||
Context::set('addon_info', $addon_info);
|
||||
// Get a mid list
|
||||
$oModuleModel = &getModel('module');
|
||||
|
|
@ -52,7 +61,7 @@
|
|||
|
||||
if($mid_list) {
|
||||
foreach($mid_list as $module_srl => $module) {
|
||||
$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
|
||||
$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -60,8 +69,7 @@
|
|||
}
|
||||
|
||||
Context::set('mid_list',$module_categories);
|
||||
// Set the layout to be pop-up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
// Template specifies the path and file
|
||||
$this->setTemplateFile('setup_addon');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@
|
|||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isColumnExists("addons", "is_used_m")) return true;
|
||||
if(!$oDB->isColumnExists("addons_site", "is_used_m")) return true;
|
||||
|
||||
// 2011. 7. 29. add is_fixed column
|
||||
if (!$oDB->isColumnExists('addons', 'is_fixed')) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -53,10 +57,32 @@
|
|||
if(!$oDB->isColumnExists("addons", "is_used_m")) {
|
||||
$oDB->addColumn("addons", "is_used_m", "char", 1, "N", true);
|
||||
}
|
||||
if(!$oDB->isColumnExists("addons_site", "is_used_m")) {
|
||||
if(!$oDB->isColumnExists("addons_site", "is_used_m")) {
|
||||
$oDB->addColumn("addons_site", "is_used_m", "char", 1, "N", true);
|
||||
}
|
||||
return new Object();
|
||||
|
||||
// 2011. 7. 29. add is_fixed column
|
||||
if (!$oDB->isColumnExists('addons', 'is_fixed'))
|
||||
{
|
||||
$oDB->addColumn('addons', 'is_fixed', 'char', 1, 'N', true);
|
||||
|
||||
// move addon info to addon_site table
|
||||
$output = executeQueryArray('addon.getAddons');
|
||||
if ($output->data)
|
||||
{
|
||||
foreach($output->data as $row)
|
||||
{
|
||||
$args->site_srl = 0;
|
||||
$args->addon = $row->addon;
|
||||
$args->is_used = $row->is_used;
|
||||
$args->is_used_m = $row->is_used_m;
|
||||
$args->extra_vars = $row->extra_vars;
|
||||
executeQuery('addon.insertSiteAddon', $args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -118,15 +118,15 @@
|
|||
/**
|
||||
* @brief Re-generate the cache file
|
||||
**/
|
||||
function makeCacheFile($site_srl = 0, $type = "pc") {
|
||||
function makeCacheFile($site_srl = 0, $type = "pc", $gtype = 'site') {
|
||||
// Add-on module for use in creating the cache file
|
||||
$buff = "";
|
||||
$oAddonModel = &getAdminModel('addon');
|
||||
$addon_list = $oAddonModel->getInsertedAddons($site_srl, $type);
|
||||
$addon_list = $oAddonModel->getInsertedAddons($site_srl, $gtype);
|
||||
foreach($addon_list as $addon => $val) {
|
||||
if($val->addon == "smartphone") continue;
|
||||
if(!is_dir(_XE_PATH_.'addons/'.$addon)) continue;
|
||||
if(($type == "pc" && $val->is_used != 'Y') || ($type == "mobile" && $val->is_used_m != 'Y')) continue;
|
||||
if(($type == "pc" && $val->is_used != 'Y') || ($type == "mobile" && $val->is_used_m != 'Y') || ($gtype == 'global' && $val->is_fixed != 'Y')) continue;
|
||||
|
||||
$extra_vars = unserialize($val->extra_vars);
|
||||
$mid_list = $extra_vars->mid_list;
|
||||
|
|
@ -146,7 +146,7 @@
|
|||
$addon_path = _XE_PATH_.'files/cache/addons/';
|
||||
if(!is_dir($addon_path)) FileHandler::makeDir($addon_path);
|
||||
|
||||
if($site_srl) $addon_file = $addon_path.$site_srl.$type.'.acivated_addons.cache.php';
|
||||
if($gtype == 'site') $addon_file = $addon_path.$site_srl.$type.'.acivated_addons.cache.php';
|
||||
else $addon_file = $addon_path.$type.'acivated_addons.cache.php';
|
||||
|
||||
FileHandler::writeFile($addon_file, $buff);
|
||||
|
|
@ -155,11 +155,15 @@
|
|||
/**
|
||||
* @brief Add-On Set
|
||||
**/
|
||||
function doSetup($addon, $extra_vars,$site_srl=0) {
|
||||
if($extra_vars->mid_list) $extra_vars->mid_list = explode('|@|', $extra_vars->mid_list);
|
||||
function doSetup($addon, $extra_vars,$site_srl=0, $gtype = 'site') {
|
||||
if($gtype == 'site' && $extra_vars->mid_list)
|
||||
$extra_vars->mid_list = explode('|@|', $extra_vars->mid_list);
|
||||
else
|
||||
unset($extra_vars->mid_list);
|
||||
|
||||
$args->addon = $addon;
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
if(!$site_srl) return executeQuery('addon.updateAddon', $args);
|
||||
if($gtype == 'global') return executeQuery('addon.updateAddon', $args);
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,18 +3,19 @@
|
|||
<grants />
|
||||
<permissions />
|
||||
<actions>
|
||||
<action name="dispAddonAdminIndex" type="view" standalone="true" admin_index="true" />
|
||||
<action name="dispAddonAdminIndex" type="view" standalone="true" admin_index="true" menu_name="installedAddon" menu_index="true" />
|
||||
<action name="dispAddonAdminInfo" type="view" standalone="true" />
|
||||
<action name="dispAddonAdminSetup" type="view" standalone="true" />
|
||||
<action name="dispAddonAdminSetup" type="view" standalone="true" menu_name="installedAddon" />
|
||||
<action name="procAddonAdminToggleActivate" type="controller" standalone="true" />
|
||||
<action name="procAddonAdminSetupAddon" type="controller" standalone="true" />
|
||||
<action name="procAddonAdminSetupAddon" type="controller" standalone="true" ruleset="updateAddonSetup" />
|
||||
<action name="procAddonSetupAddonAddMid" type="controller" />
|
||||
<action name="procAddonSetupAddonDelMid" type="controller" />
|
||||
<action name="procAddonAdminSaveActivate" type="controller" />
|
||||
</actions>
|
||||
<menus>
|
||||
<menu name="installedAddon">
|
||||
<title xml:lang="en">Installed Addon</title>
|
||||
<title xml:lang="ko">애드온</title>
|
||||
<title xml:lang="ko">설치된 애드온</title>
|
||||
<title xml:lang="zh-CN">Installed Addon</title>
|
||||
<title xml:lang="jp">Installed Addon</title>
|
||||
<title xml:lang="es">Installed Addon</title>
|
||||
|
|
|
|||
20
modules/addon/lang/ko.lang.php
Normal file
20
modules/addon/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
/**
|
||||
* @file ko.lang.php
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief Korean Language Pack
|
||||
**/
|
||||
$lang->addon = '애드온';
|
||||
$lang->addon_info = '애드온 정보';
|
||||
$lang->addon_maker = '애드온 제작자';
|
||||
$lang->addon_license = '라이선스';
|
||||
$lang->addon_history = '변경 이력';
|
||||
$lang->about_addon_mid = '애드온이 사용될 대상을 지정할 수 있습니다.<br />(모두 해제 시 모든 대상에서 사용 가능합니다.)';
|
||||
$lang->about_addon = '애드온은 HTML결과물을 출력하기보다는 동작을 제어하는 역할을 합니다.<br />원하시는 애드온을 ON/OFF 하시는 것만으로도 사이트 운영에 유용한 기능을 연동할 수 있습니다.';
|
||||
|
||||
$lang->installed_addon = '설치된 애드온';
|
||||
$lang->about_installed_addon = 'PC, Mobile에 체크하면 애드온을 켤 수 있습니다.';
|
||||
$lang->fixed = '고정';
|
||||
$lang->about_fixed = '체크하면 사이트 관리자가 이 설정을 변경할 수 없음.';
|
||||
$lang->msg_not_exist_option = '이 애드온은 설정이 존재하지 않습니다.';
|
||||
?>
|
||||
|
|
@ -80,4 +80,20 @@
|
|||
<value xml:lang="tr"><![CDATA[Eklentiler, HTML sonuçlarını göstermek yerine sitenizde gerçekleştirilen birçok eylemi kontrol ederler, .<br />Kullanışlı işlevleri, AÇIK/KAPALI anahtarını değiştirerek, kolayca kontrol edebilirsiniz.]]></value>
|
||||
<value xml:lang="vi"><![CDATA[Addon có nhiệm vụ hiển thị và kiểm soát kết quả HTML.<br />Bạn có thể mở hoặc tắt bất cứ Addon nào bạn muốn.]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
<item name="installed_addon">
|
||||
<value xml:lang="ko"><![CDATA[설치된 애드온]]></value>
|
||||
<value xml:lang="en"><![CDATA[Installed Addon]]></value>
|
||||
</item>
|
||||
<item name="about_installed_addon">
|
||||
<value xml:lang="ko"><![CDATA[PC, Mobile에 체크하면 애드온을 켤 수 있습니다.]]></value>
|
||||
</item>
|
||||
<item name="fixed">
|
||||
<value xml:lang="ko"><![CDATA[고정]]></value>
|
||||
</item>
|
||||
<item name="about_fixed">
|
||||
<value xml:lang="ko"><![CDATA[체크하면 사이트 관리자가 이 설정을 변경할 수 없음.]]></value>
|
||||
</item>
|
||||
<item name="msg_not_exist_option">
|
||||
<value xml:lang="ko"><![CDATA[이 애드온은 설정이 존재하지 않습니다.]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
<column name="site_srl" var="site_srl" notnull="notnull" />
|
||||
<column name="addon" var="addon" notnull="notnull" />
|
||||
<column name="is_used" var="is_used" default="N" notnull="notnull" />
|
||||
<column name="is_used_m" var="is_used_m" default="N" />
|
||||
<column name="extra_vars" var="extra_vars" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
<columns>
|
||||
<column name="is_used" var="is_used" />
|
||||
<column name="is_used_m" var="is_used_m" />
|
||||
<column name="is_fixed" var="fixed" />
|
||||
<column name="extra_vars" var="extra_vars" />
|
||||
</columns>
|
||||
<conditions>
|
||||
|
|
|
|||
8
modules/addon/ruleset/updateAddonSetup.xml
Normal file
8
modules/addon/ruleset/updateAddonSetup.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="addon_name" required="true" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
<column name="addon" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="is_used" type="char" size="1" default="Y" notnull="notnull" />
|
||||
<column name="is_used_m" type="char" size="1" default="N" notnull="notnull" />
|
||||
<column name="is_fixed" type="char" size="1" default="N" notnull="notnull" />
|
||||
<column name="extra_vars" type="text" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,70 +1,64 @@
|
|||
<!--%import("filter/toggle_activate_addon.xml")-->
|
||||
<!--%import("js/addon.js")-->
|
||||
<form action="./" method="post">
|
||||
<input type="hidden" name="module" value="addon" />
|
||||
<input type="hidden" name="act" value="procAddonAdminSaveActivate" />
|
||||
|
||||
<h3 class="xeAdmin">{$lang->addon} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
<div class="infoText">{nl2br($lang->about_addon)}</div>
|
||||
|
||||
<!-- xml js filter를 이용하기 위한 데이터 전달용 form -->
|
||||
<form id="fo_addon" action="./" method="get">
|
||||
<input type="hidden" name="addon" value="" />
|
||||
<input type="hidden" name="type" value="" />
|
||||
</form>
|
||||
|
||||
<!-- 애드온의 목록 -->
|
||||
<table cellspacing="0" class="crossTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><div>{$lang->addon_name}</div></th>
|
||||
<th scope="col"><div>{$lang->version}</div></th>
|
||||
<th scope="col"><div>{$lang->author}</div></th>
|
||||
<th scope="col"><div>{$lang->date}</div></th>
|
||||
<th scope="col" class="wide"><div>{$lang->installed_path}</div></th>
|
||||
<th scope="col"><div>{$lang->cmd_setup}</div></th>
|
||||
<th scope="col"><div>PC</div></th>
|
||||
<th scope="col"><div>Mobile</div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<!--@foreach($addon_list as $key => $val)-->
|
||||
<tr>
|
||||
<th scope="row" rowspan="2">
|
||||
<div>
|
||||
<a href="{getUrl('','module','addon','act','dispAddonAdminInfo','selected_addon',$val->addon)}" onclick="popopen(this.href,'addon_info');return false">{$val->title}</a> <br />
|
||||
({$val->addon})
|
||||
</div>
|
||||
</th>
|
||||
<td>{$val->version}</td>
|
||||
<td>
|
||||
<!--@foreach($val->author as $author)-->
|
||||
<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->name}</a>
|
||||
<!--@endforeach-->
|
||||
</td>
|
||||
<td>{zdate($val->date, 'Y-m-d')}</td>
|
||||
<td>{$val->path}</td>
|
||||
<td><a href="{getUrl('','module','addon','act','dispAddonAdminSetup','selected_addon',$val->addon)}" onclick="popopen(this.href,'addon_info');return false" title="{htmlspecialchars($lang->cmd_setup)}" class="buttonSet buttonSetting"><span>{$lang->cmd_setup}</span></a></td>
|
||||
<td>
|
||||
<!--@if($val->activated)-->
|
||||
<a href="#" onclick="doToggleAddon('{$val->addon}');return false;" title="{htmlspecialchars($lang->use)}" class="buttonSet buttonActive"><span>{$lang->use}</span></a>
|
||||
<!--@else-->
|
||||
<a href="#" onclick="doToggleAddon('{$val->addon}');return false;" title="{htmlspecialchars($lang->notuse)}" class="buttonSet buttonDisable"><span>{$lang->notuse}</span></a>
|
||||
<!--@end-->
|
||||
</td>
|
||||
<td>
|
||||
<!--@if($val->mactivated)-->
|
||||
<a href="#" onclick="doToggleAddon('{$val->addon}','mobile');return false;" title="{htmlspecialchars($lang->use)}" class="buttonSet buttonActive"><span>{$lang->use}</span></a>
|
||||
<!--@else-->
|
||||
<a href="#" onclick="doToggleAddon('{$val->addon}','mobile');return false;" title="{htmlspecialchars($lang->notuse)}" class="buttonSet buttonDisable"><span>{$lang->notuse}</span></a>
|
||||
<!--@end-->
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
{nl2br($val->description)}
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
<h1 class="h1">{$lang->installed_addon}</h1>
|
||||
<p>{$lang->about_installed_addon}</p>
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<div class="table even easyList">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<caption>All({$addon_count})</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->favorite}</th>
|
||||
<th scope="col" class="title">{$lang->addon_name}</th>
|
||||
<th scope="col">{$lang->version}</th>
|
||||
<th scope="col">{$lang->author}</th>
|
||||
<th scope="col">{$lang->installed_path}</th>
|
||||
<th scope="col">{$lang->cmd_setup}</th>
|
||||
<th scope="col">PC</th>
|
||||
<th scope="col">Mobile</th>
|
||||
<th scope="col">
|
||||
{$lang->fixed}[<a href="#fixed" class="tgAnchor">?</a>]
|
||||
<div id="fixed" class="tgContent layer" style="right:0;">
|
||||
<p>{$lang->about_fixed}</p>
|
||||
</div>
|
||||
</th>
|
||||
<th scope="col">{$lang->cmd_delete}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$addon_list => $addon">
|
||||
<td>
|
||||
<input type="checkbox" name="favorite[]" value="{$addon->addon_name}" checked="checked"|cond="$favoriteList[$addon->addon_name]" />
|
||||
</td>
|
||||
<td class="title">
|
||||
<p><strong>{$addon->title}</strong></p>
|
||||
<p>{cut_str($addon->description, 200)}</p>
|
||||
<p cond="$addon->need_update == 'Y'" class="update">
|
||||
{$lang->msg_avail_update} <a href="{$addon->update_url}&return_url={urlencode(getRequestUriByServerEnviroment())}">{$lang->msg_do_you_like_update}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td>{$addon->version}</td>
|
||||
<td>
|
||||
<block loop="$addon->author => $author">
|
||||
<a cond="$author->homepage" href="{$author->homepage}" target="_blank">{$author->name}</a>
|
||||
<block cond="!$author->homepage">{$author->name}</block>
|
||||
</block>
|
||||
</td>
|
||||
<td>{$addon->path}</td>
|
||||
<td><a href="{getUrl('act', 'dispAddonAdminSetup', 'selected_addon', $addon->addon_name)}">{$lang->cmd_setup}</a></td>
|
||||
<td><input type="checkbox" name="pc[]" title="PC" value="{htmlspecialchars($addon->addon_name)}" checked="checked"|cond="$addon->activated" /></td>
|
||||
<td><input type="checkbox" name="mobile[]" title="Mobile" value="{htmlspecialchars($addon->addon_name)}" checked="checked"|cond="$addon->mactivated" /></td>
|
||||
<td><input type="checkbox" name="fixed[]" title="{$lang->fixed}" value="{htmlspecialchars($addon->addon_name)}" checked="checked"|cond="$addon->fixed" /></td>
|
||||
<td><a cond="$addon->remove_url" href="{$addon->remove_url}&return_url={urlencode(getRequestUriByServerEnviroment())}">{$lang->cmd_delete}</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -1,105 +1,51 @@
|
|||
<!--%import("filter/setup_addon.xml")-->
|
||||
<!--%import("css/addon.css")-->
|
||||
<!--%import("js/addon.js")-->
|
||||
|
||||
<div id="popHeader" class="wide">
|
||||
<h3 class="xeAdmin">{$lang->cmd_setup}</h3>
|
||||
<h1 class="h1">{$lang->installed_addon}</h1>
|
||||
<h2 class="h2">{$addon_info->title}</h2>
|
||||
<ul>
|
||||
<li>{$lang->version}: {$addon_info->version} ({zdate($addon_info->date, 'Y-m-d')})</li>
|
||||
<li>
|
||||
{$lang->author}:
|
||||
<block loop="$addon_info->author => $author">
|
||||
{$author->name} (<a cond="$author->homepage" href="{$author->homepage}" target="_blank">{$author->homepage}</a>, <a cond="$author->email_address" href="mailto:{$author->email_address}">{$author->email_address}</a>) <br />
|
||||
</block>
|
||||
</li>
|
||||
<li cond="$addon_info->homepage">{$lang->homepage}: <a href="{$addon_info->homepage}" target="_blank">{$addon_info->homepage}</a></li>
|
||||
</ul>
|
||||
<block cond="count($addon_info->extra_vars)">
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<form action="./" method="post" class="form">
|
||||
<input type="hidden" name="module" value="addon" />
|
||||
<input type="hidden" name="act" value="procAddonAdminSetupAddon" />
|
||||
<input type="hidden" name="addon_name" value="{$addon_info->addon_name}" />
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, setup_addon);">
|
||||
<input type="hidden" name="addon_name" value="{$addon_info->addon_name}" />
|
||||
|
||||
<div id="popBody">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<th scope="row"><div><label for="textfield1">{$lang->title}</label></div></th>
|
||||
<td>{$addon_info->title} ver. {$addon_info->version} ({zdate($addon_info->date, 'Y-m-d')})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->author}</div></th>
|
||||
<td>
|
||||
<!--@foreach($addon_info->author as $author)-->
|
||||
{$author->name} (<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a>, <a href="mailto:{$author->email_address}">{$author->email_address}</a>)<br />
|
||||
<!--@endforeach-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div><label for="textfield2">{$lang->homepage}</label></div></th>
|
||||
<td class="blue"><a href="{$addon_info->homepage}" onclick="window.open(this.href);return false;">{$addon_info->homepage}</a> </td>
|
||||
</tr>
|
||||
|
||||
<!--@foreach($addon_info->extra_vars as $id => $var)-->
|
||||
|
||||
<!--@if($var->group && ((!$group) || $group != $var->group))-->
|
||||
{@$group = $var->group}
|
||||
</table>
|
||||
|
||||
<h4 class="xeAdmin">{$group}</h4>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="100" />
|
||||
<col width="*" />
|
||||
<!--@end-->
|
||||
|
||||
<tr class="row{$cycle_idx}">
|
||||
<th scope="row"><div>{$var->title}</div></th>
|
||||
<td>
|
||||
<!--@if($var->type == 'text')-->
|
||||
<input type="text" name="{$var->name}" id="{$var->name}" value="{htmlspecialchars($var->value)}" class="inputTypeText w400 lang_code" />
|
||||
|
||||
<!--@elseif($var->type == 'textarea')-->
|
||||
<textarea name="{$var->name}" id="{$var->name}" class="inputTypeTextArea lang_code">{htmlspecialchars($var->value)}</textarea>
|
||||
|
||||
<!--@elseif($var->type == 'select')-->
|
||||
<select name="{$var->name}">
|
||||
<!--@foreach($var->options as $val)-->
|
||||
<option value="{$val->value}"<!--@if($var->value == $val->value)--> selected="selected"<!--@end-->>{$val->title}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<!--@end-->
|
||||
<p class="clear">{nl2br($var->description)}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($group)-->
|
||||
</table>
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($mid_list)-->
|
||||
<tr>
|
||||
<th scope="row"><div>
|
||||
{$lang->module}
|
||||
<input type="checkbox" onclick="XE.checkboxToggleAll('mid_list'); return false;" />
|
||||
</div></th>
|
||||
<td>
|
||||
<p>{$lang->about_addon_mid}</p>
|
||||
<!--@foreach($mid_list as $module_category_srl => $modules)-->
|
||||
<div class="module_category_title">
|
||||
<input type="checkbox" onclick="XE.checkboxToggleAll('mid_list', { wrap:'section_{$module_category_srl}' });" />
|
||||
<!--@if($modules->title)-->
|
||||
{$modules->title}
|
||||
<!--@else-->
|
||||
{$lang->none_category}
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
||||
<div id="section_{$module_category_srl}">
|
||||
<!--@foreach($modules->list as $key => $val)-->
|
||||
<div class="module_list">
|
||||
<input type="checkbox" value="{$key}" name="mid_list" id="chk_mid_list_{$key}" <!--@if(in_array($key, $addon_info->mid_list))-->checked="checked"<!--@end--> />
|
||||
<label for="chk_mid_list_{$key}">{$key} ({$val->browser_title})</label>
|
||||
</div>
|
||||
<!--@end-->
|
||||
</div>
|
||||
<!--@end-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@endif-->
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="popFooter">
|
||||
<span class="button black strong"><input type="submit" value="{$lang->cmd_apply}" /></span>
|
||||
</div>
|
||||
<block loop="$addon_info->extra_vars => $id, $var">
|
||||
<block cond="!$not_first && !$var->group"><ul></block>
|
||||
<block cond="$group != $var->group">
|
||||
<block cond="$not_first"></ul></block>
|
||||
<h3 class="h3">{$var->group}</h3>
|
||||
<ul>
|
||||
{@$group = $var->group}
|
||||
</block>
|
||||
{@$not_first = true}
|
||||
<li>
|
||||
<p class="q"><label for="{$var->name}">{$var->title}</label></p>
|
||||
<p class="a">
|
||||
<input cond="$var->type == 'text'" type="text" name="{$var->name}" id="{$var->name}" value="{htmlspecialchars($var->value)}" class="lang_code">
|
||||
<textarea cond="$var->type == 'textarea'" name="{$var->name}" id="{$var->name}" class="lang_code">{htmlspecialchars($var->value)}</textarea>
|
||||
<select cond="$var->type == 'select'" name="{$var->name}" id="{$var->name}">
|
||||
<option loop="$var->options => $option" value="{$option->value}" selected="selected"|cond="$var->value == $option->value">{$option->title}</option>
|
||||
</select>
|
||||
<span class="desc">{nl2br($var->description)}</span>
|
||||
</p>
|
||||
</li>
|
||||
</block>
|
||||
</ul>
|
||||
<div class="btnArea">
|
||||
<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
</div>
|
||||
</form>
|
||||
</block>
|
||||
<div cond="!count($addon_info->extra_vars)" class="message info">
|
||||
<p>{$lang->msg_not_exist_option}</p>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue