mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-17 10:19:55 +09:00
merge from 1.7.3.5(r13153:r13167)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc47d2b247
commit
2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions
|
|
@ -1,216 +1,300 @@
|
|||
<?php
|
||||
require_once(_XE_PATH_.'modules/addon/addon.controller.php');
|
||||
|
||||
/**
|
||||
* Admin controller class of addon modules
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
class addonAdminController extends addonController {
|
||||
require_once(_XE_PATH_ . 'modules/addon/addon.controller.php');
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
/**
|
||||
* Admin controller class of addon modules
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
*/
|
||||
class addonAdminController extends addonController
|
||||
{
|
||||
|
||||
/**
|
||||
* Set addon activate
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function procAddonAdminSaveActivate()
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Set addon activate
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function procAddonAdminSaveActivate()
|
||||
{
|
||||
$pcOnList = Context::get('pc_on');
|
||||
$mobileOnList = Context::get('mobile_on');
|
||||
$fixed = Context::get('fixed');
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
if($site_module_info->site_srl)
|
||||
{
|
||||
$pcOnList = Context::get('pc_on');
|
||||
$mobileOnList = Context::get('mobile_on');
|
||||
$fixed = Context::get('fixed');
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
if($site_module_info->site_srl) $site_srl = $site_module_info->site_srl;
|
||||
else $site_srl = 0;
|
||||
$site_srl = $site_module_info->site_srl;
|
||||
}
|
||||
else
|
||||
{
|
||||
$site_srl = 0;
|
||||
}
|
||||
|
||||
if (!$pcOnList) $pcOnList = array();
|
||||
if (!$mobileOnList) $mobileOnList = array();
|
||||
if (!$fixed) $fixed = array();
|
||||
if(!$pcOnList)
|
||||
{
|
||||
$pcOnList = array();
|
||||
}
|
||||
if(!$mobileOnList)
|
||||
{
|
||||
$mobileOnList = array();
|
||||
}
|
||||
if(!$fixed)
|
||||
{
|
||||
$fixed = array();
|
||||
}
|
||||
|
||||
if (!is_array($pcOnList)) $pcOnList = array($pcOnList);
|
||||
if (!is_array($mobileOnList)) $pcOnList = array($mobileOnList);
|
||||
if (!is_array($fixed)) $pcOnList = array($fixed);
|
||||
if(!is_array($pcOnList))
|
||||
{
|
||||
$pcOnList = array($pcOnList);
|
||||
}
|
||||
if(!is_array($mobileOnList))
|
||||
{
|
||||
$pcOnList = array($mobileOnList);
|
||||
}
|
||||
if(!is_array($fixed))
|
||||
{
|
||||
$pcOnList = array($fixed);
|
||||
}
|
||||
|
||||
// get current addon info
|
||||
$oModel = &getAdminModel('addon');
|
||||
$currentAddonList = $oModel->getAddonList($site_srl, 'site');
|
||||
// get current addon info
|
||||
$oModel = getAdminModel('addon');
|
||||
$currentAddonList = $oModel->getAddonList($site_srl, 'site');
|
||||
|
||||
// get need update addon list
|
||||
$updateList = array();
|
||||
foreach($currentAddonList as $addon)
|
||||
// get need update addon list
|
||||
$updateList = array();
|
||||
foreach($currentAddonList as $addon)
|
||||
{
|
||||
if($addon->activated !== in_array($addon->addon_name, $pcOnList))
|
||||
{
|
||||
if ($addon->activated !== in_array($addon->addon_name, $pcOnList))
|
||||
{
|
||||
$updateList[] = $addon->addon_name;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($addon->mactivated !== in_array($addon->addon_name, $mobileOnList))
|
||||
{
|
||||
$updateList[] = $addon->addon_name;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($addon->fixed !== in_array($addon->addon_name, $fixed))
|
||||
{
|
||||
$updateList[] = $addon->addon_name;
|
||||
continue;
|
||||
}
|
||||
$updateList[] = $addon->addon_name;
|
||||
continue;
|
||||
}
|
||||
|
||||
// update
|
||||
foreach($updateList as $targetAddon)
|
||||
if($addon->mactivated !== in_array($addon->addon_name, $mobileOnList))
|
||||
{
|
||||
unset($args);
|
||||
|
||||
if (in_array($targetAddon, $pcOnList))
|
||||
$args->is_used = 'Y';
|
||||
else
|
||||
$args->is_used = 'N';
|
||||
|
||||
if (in_array($targetAddon, $mobileOnList))
|
||||
$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;
|
||||
$args->site_srl = $site_srl;
|
||||
|
||||
$output = executeQuery('addon.updateSiteAddon', $args);
|
||||
if (!$output->toBool()) return $output;
|
||||
$updateList[] = $addon->addon_name;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (count($updateList))
|
||||
if($addon->fixed !== in_array($addon->addon_name, $fixed))
|
||||
{
|
||||
$this->makeCacheFile($site_srl, 'pc', 'site');
|
||||
$this->makeCacheFile($site_srl, 'mobile', 'site');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated', 'info');
|
||||
if (Context::get('success_return_url'))
|
||||
{
|
||||
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAddonAdminIndex'));
|
||||
$updateList[] = $addon->addon_name;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add active/inactive change
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function procAddonAdminToggleActivate() {
|
||||
$oAddonModel = &getAdminModel('addon');
|
||||
// update
|
||||
foreach($updateList as $targetAddon)
|
||||
{
|
||||
$args = new stdClass();
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
// batahom addon values
|
||||
$addon = Context::get('addon');
|
||||
$type = Context::get('type');
|
||||
if(!$type) $type = "pc";
|
||||
if($addon) {
|
||||
// If enabled Disables
|
||||
if($oAddonModel->isActivatedAddon($addon, $site_module_info->site_srl, $type)) $this->doDeactivate($addon, $site_module_info->site_srl, $type);
|
||||
// If it is disabled Activate
|
||||
else $this->doActivate($addon, $site_module_info->site_srl, $type);
|
||||
if(in_array($targetAddon, $pcOnList))
|
||||
{
|
||||
$args->is_used = 'Y';
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->is_used = 'N';
|
||||
}
|
||||
|
||||
$this->makeCacheFile($site_module_info->site_srl, $type);
|
||||
}
|
||||
if(in_array($targetAddon, $mobileOnList))
|
||||
{
|
||||
$args->is_used_m = 'Y';
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->is_used_m = 'N';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the configuration information input
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function procAddonAdminSetupAddon() {
|
||||
$args = Context::getRequestVars();
|
||||
$module = $args->module;
|
||||
$addon_name = $args->addon_name;
|
||||
unset($args->module);
|
||||
unset($args->act);
|
||||
unset($args->addon_name);
|
||||
unset($args->body);
|
||||
unset($args->error_return_url);
|
||||
if(in_array($targetAddon, $fixed))
|
||||
{
|
||||
$args->fixed = 'Y';
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->fixed = 'N';
|
||||
}
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args->addon = $targetAddon;
|
||||
$args->site_srl = $site_srl;
|
||||
|
||||
$output = $this->doSetup($addon_name, $args, $site_module_info->site_srl, 'site');
|
||||
if (!$output->toBool()) return $output;
|
||||
$output = executeQuery('addon.updateSiteAddon', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
$this->makeCacheFile($site_module_info->site_srl, "pc", 'site');
|
||||
$this->makeCacheFile($site_module_info->site_srl, "mobile", 'site');
|
||||
if(count($updateList))
|
||||
{
|
||||
$this->makeCacheFile($site_srl, 'pc', 'site');
|
||||
$this->makeCacheFile($site_srl, 'mobile', 'site');
|
||||
}
|
||||
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', $module, 'act', 'dispAddonAdminSetup', 'selected_addon', $addon_name), $output);
|
||||
}
|
||||
$this->setMessage('success_updated', 'info');
|
||||
if(Context::get('success_return_url'))
|
||||
{
|
||||
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAddonAdminIndex'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add active/inactive change
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function procAddonAdminToggleActivate()
|
||||
{
|
||||
$oAddonModel = getAdminModel('addon');
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
// batahom addon values
|
||||
$addon = Context::get('addon');
|
||||
$type = Context::get('type');
|
||||
if(!$type)
|
||||
{
|
||||
$type = "pc";
|
||||
}
|
||||
if($addon)
|
||||
{
|
||||
// If enabled Disables
|
||||
if($oAddonModel->isActivatedAddon($addon, $site_module_info->site_srl, $type))
|
||||
{
|
||||
$this->doDeactivate($addon, $site_module_info->site_srl, $type);
|
||||
}
|
||||
// If it is disabled Activate
|
||||
else
|
||||
{
|
||||
$this->doActivate($addon, $site_module_info->site_srl, $type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds addon to DB
|
||||
*
|
||||
* @param string $addon Addon name
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $gtype site or global
|
||||
* @param string $isUsed Whether to use
|
||||
* @return Object
|
||||
**/
|
||||
function doInsert($addon, $site_srl = 0, $gtype = 'site', $isUsed = 'N') {
|
||||
$args->addon = $addon;
|
||||
$args->is_used = $isUsed;
|
||||
if($gtype == 'global') return executeQuery('addon.insertAddon', $args);
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.insertSiteAddon', $args);
|
||||
}
|
||||
$this->makeCacheFile($site_module_info->site_srl, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate addon
|
||||
*
|
||||
* @param string $addon Addon name
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $type pc or modile
|
||||
* @param string $gtype site or global
|
||||
* @return Object
|
||||
**/
|
||||
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($gtype == 'global') return executeQuery('addon.updateAddon', $args);
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
/**
|
||||
* Add the configuration information input
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function procAddonAdminSetupAddon()
|
||||
{
|
||||
$args = Context::getRequestVars();
|
||||
$module = $args->module;
|
||||
$addon_name = $args->addon_name;
|
||||
unset($args->module);
|
||||
unset($args->act);
|
||||
unset($args->addon_name);
|
||||
unset($args->body);
|
||||
unset($args->error_return_url);
|
||||
|
||||
/**
|
||||
* Deactivate Addon
|
||||
*
|
||||
* @param string $addon Addon name
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $type pc or mobile
|
||||
* @param string $gtype site or global
|
||||
**/
|
||||
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($gtype == 'global') return executeQuery('addon.updateAddon', $args);
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
}
|
||||
?>
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
$output = $this->doSetup($addon_name, $args, $site_module_info->site_srl, 'site');
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$this->makeCacheFile($site_module_info->site_srl, "pc", 'site');
|
||||
$this->makeCacheFile($site_module_info->site_srl, "mobile", 'site');
|
||||
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', $module, 'act', 'dispAddonAdminSetup', 'selected_addon', $addon_name), $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds addon to DB
|
||||
*
|
||||
* @param string $addon Addon name
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $gtype site or global
|
||||
* @param string $isUsed Whether to use
|
||||
* @return Object
|
||||
*/
|
||||
function doInsert($addon, $site_srl = 0, $gtype = 'site', $isUsed = 'N')
|
||||
{
|
||||
$args->addon = $addon;
|
||||
$args->is_used = $isUsed;
|
||||
if($gtype == 'global')
|
||||
{
|
||||
return executeQuery('addon.insertAddon', $args);
|
||||
}
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.insertSiteAddon', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate addon
|
||||
*
|
||||
* @param string $addon Addon name
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $type pc or modile
|
||||
* @param string $gtype site or global
|
||||
* @return Object
|
||||
*/
|
||||
function doActivate($addon, $site_srl = 0, $type = "pc", $gtype = 'site')
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->addon = $addon;
|
||||
if($type == "pc")
|
||||
{
|
||||
$args->is_used = 'Y';
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->is_used_m = "Y";
|
||||
}
|
||||
if($gtype == 'global')
|
||||
{
|
||||
return executeQuery('addon.updateAddon', $args);
|
||||
}
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deactivate Addon
|
||||
*
|
||||
* @param string $addon Addon name
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $type pc or mobile
|
||||
* @param string $gtype site or global
|
||||
*/
|
||||
function doDeactivate($addon, $site_srl = 0, $type = "pc", $gtype = 'site')
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->addon = $addon;
|
||||
if($type == "pc")
|
||||
{
|
||||
$args->is_used = 'N';
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->is_used_m = 'N';
|
||||
}
|
||||
if($gtype == 'global')
|
||||
{
|
||||
return executeQuery('addon.updateAddon', $args);
|
||||
}
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file addon.admin.controller.php */
|
||||
/* Location: ./modules/addon/addon.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -1,370 +1,531 @@
|
|||
<?php
|
||||
/**
|
||||
* Admin model class of addon module
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
class addonAdminModel extends addon {
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
/**
|
||||
* Admin model class of addon module
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
*/
|
||||
class addonAdminModel extends addon
|
||||
{
|
||||
|
||||
/**
|
||||
* Returns a path of addon
|
||||
*
|
||||
* @param string $addon_name Name to get path
|
||||
* @return string Returns a path
|
||||
**/
|
||||
function getAddonPath($addon_name) {
|
||||
$class_path = sprintf('./addons/%s/', $addon_name);
|
||||
if(is_dir($class_path)) return $class_path;
|
||||
return "";
|
||||
}
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
|
||||
/**
|
||||
* Get addon list for super admin
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function getAddonListForSuperAdmin()
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a path of addon
|
||||
*
|
||||
* @param string $addon_name Name to get path
|
||||
* @return string Returns a path
|
||||
*/
|
||||
function getAddonPath($addon_name)
|
||||
{
|
||||
$class_path = sprintf('./addons/%s/', $addon_name);
|
||||
if(is_dir($class_path))
|
||||
{
|
||||
$addonList = $this->getAddonList(0, 'site');
|
||||
return $class_path;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
$oAutoinstallModel = &getModel('autoinstall');
|
||||
foreach($addonList as $key => $addon)
|
||||
/**
|
||||
* Get addon list for super admin
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function getAddonListForSuperAdmin()
|
||||
{
|
||||
$addonList = $this->getAddonList(0, 'site');
|
||||
|
||||
$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')
|
||||
{
|
||||
// get easyinstall remove url
|
||||
$packageSrl = $oAutoinstallModel->getPackageSrlByPath($addon->path);
|
||||
$addonList[$key]->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl);
|
||||
$addonList[$key]->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
|
||||
}
|
||||
}
|
||||
|
||||
// get easyinstall need update
|
||||
$package = $oAutoinstallModel->getInstalledPackages($packageSrl);
|
||||
$addonList[$key]->need_update = $package[$packageSrl]->need_update;
|
||||
return $addonList;
|
||||
}
|
||||
|
||||
// get easyinstall update url
|
||||
if ($addonList[$key]->need_update == 'Y')
|
||||
/**
|
||||
* Returns addon list
|
||||
*
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $gtype site or global
|
||||
* @return array Returns addon list
|
||||
*/
|
||||
function getAddonList($site_srl = 0, $gtype = 'site')
|
||||
{
|
||||
// Wanted to add a list of activated
|
||||
$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);
|
||||
if(!$searched_count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sort($searched_list);
|
||||
|
||||
$oAddonAdminController = getAdminController('addon');
|
||||
|
||||
for($i = 0; $i < $searched_count; $i++)
|
||||
{
|
||||
// Add the name of
|
||||
$addon_name = $searched_list[$i];
|
||||
if($addon_name == "smartphone")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// Add the path (files/addons precedence)
|
||||
$path = $this->getAddonPath($addon_name);
|
||||
// Wanted information on the add-on
|
||||
unset($info);
|
||||
$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, $type);
|
||||
// Is activated
|
||||
}
|
||||
else
|
||||
{
|
||||
if($inserted_addons[$addon_name]->is_used == 'Y')
|
||||
{
|
||||
$addonList[$key]->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
return $addonList;
|
||||
$list[] = $info;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a information of addon
|
||||
*
|
||||
* @param string $addon Name to get information
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $gtype site or global
|
||||
* @return object Returns a information
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns addon list
|
||||
*
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $gtype site or global
|
||||
* @return array Returns addon list
|
||||
**/
|
||||
function getAddonList($site_srl = 0, $gtype = 'site') {
|
||||
// Wanted to add a list of activated
|
||||
$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);
|
||||
if(!$searched_count) return;
|
||||
sort($searched_list);
|
||||
// Read the xml file for module skin information
|
||||
$xml_file = sprintf("%sconf/info.xml", $addon_path);
|
||||
if(!file_exists($xml_file))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$oAddonAdminController = &getAdminController('addon');
|
||||
$oXmlParser = new XmlParser();
|
||||
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
|
||||
$xml_obj = $tmp_xml_obj->addon;
|
||||
|
||||
for($i=0;$i<$searched_count;$i++) {
|
||||
// Add the name of
|
||||
$addon_name = $searched_list[$i];
|
||||
if($addon_name == "smartphone") continue;
|
||||
// Add the path (files/addons precedence)
|
||||
$path = $this->getAddonPath($addon_name);
|
||||
// Wanted information on the add-on
|
||||
unset($info);
|
||||
$info = $this->getAddonInfoXml($addon_name, $site_srl, $gtype);
|
||||
if(!$xml_obj)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$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, $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;
|
||||
}
|
||||
// DB is set to bring history
|
||||
$db_args = new stdClass();
|
||||
$db_args->addon = $addon;
|
||||
if($gtype == 'global')
|
||||
{
|
||||
$output = executeQuery('addon.getAddonInfo', $db_args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$db_args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.getSiteAddonInfo', $db_args);
|
||||
}
|
||||
$extra_vals = unserialize($output->data->extra_vars);
|
||||
|
||||
$list[] = $info;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
$addon_info = new stdClass();
|
||||
if($extra_vals->mid_list)
|
||||
{
|
||||
$addon_info->mid_list = $extra_vals->mid_list;
|
||||
}
|
||||
else
|
||||
{
|
||||
$addon_info->mid_list = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a information of addon
|
||||
*
|
||||
* @param string $addon Name to get information
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $gtype site or global
|
||||
* @return object Returns a information
|
||||
**/
|
||||
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;
|
||||
// Read the xml file for module skin information
|
||||
$xml_file = sprintf("%sconf/info.xml", $addon_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
if($extra_vals->xe_run_method)
|
||||
{
|
||||
$addon_info->xe_run_method = $extra_vals->xe_run_method;
|
||||
}
|
||||
|
||||
$oXmlParser = new XmlParser();
|
||||
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
|
||||
$xml_obj = $tmp_xml_obj->addon;
|
||||
// Add information
|
||||
if($xml_obj->version && $xml_obj->attrs->version == '0.2')
|
||||
{
|
||||
// addon format v0.2
|
||||
$date_obj = new stdClass();
|
||||
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
|
||||
if(!$xml_obj) return;
|
||||
$addon_info->addon_name = $addon;
|
||||
$addon_info->title = $xml_obj->title->body;
|
||||
$addon_info->description = trim($xml_obj->description->body);
|
||||
$addon_info->version = $xml_obj->version->body;
|
||||
$addon_info->homepage = $xml_obj->link->body;
|
||||
$addon_info->license = $xml_obj->license->body;
|
||||
$addon_info->license_link = $xml_obj->license->attrs->link;
|
||||
|
||||
|
||||
// DB is set to bring history
|
||||
$db_args->addon = $addon;
|
||||
if($gtype == 'global') $output = executeQuery('addon.getAddonInfo',$db_args);
|
||||
else {
|
||||
$db_args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.getSiteAddonInfo',$db_args);
|
||||
}
|
||||
$extra_vals = unserialize($output->data->extra_vars);
|
||||
|
||||
if($extra_vals->mid_list) {
|
||||
$addon_info->mid_list = $extra_vals->mid_list;
|
||||
} else {
|
||||
$addon_info->mid_list = array();
|
||||
}
|
||||
|
||||
if($extra_vals->xe_run_method)
|
||||
if(!is_array($xml_obj->author))
|
||||
{
|
||||
$addon_info->xe_run_method = $extra_vals->xe_run_method;
|
||||
$author_list = array();
|
||||
$author_list[] = $xml_obj->author;
|
||||
}
|
||||
else
|
||||
{
|
||||
$author_list = $xml_obj->author;
|
||||
}
|
||||
|
||||
|
||||
// Add information
|
||||
if($xml_obj->version && $xml_obj->attrs->version == '0.2') {
|
||||
// addon format v0.2
|
||||
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
|
||||
$addon_info->addon_name = $addon;
|
||||
$addon_info->title = $xml_obj->title->body;
|
||||
$addon_info->description = trim($xml_obj->description->body);
|
||||
$addon_info->version = $xml_obj->version->body;
|
||||
$addon_info->homepage = $xml_obj->link->body;
|
||||
$addon_info->license = $xml_obj->license->body;
|
||||
$addon_info->license_link = $xml_obj->license->attrs->link;
|
||||
|
||||
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
|
||||
else $author_list = $xml_obj->author;
|
||||
|
||||
foreach($author_list as $author) {
|
||||
unset($author_obj);
|
||||
$author_obj->name = $author->name->body;
|
||||
$author_obj->email_address = $author->attrs->email_address;
|
||||
$author_obj->homepage = $author->attrs->link;
|
||||
$addon_info->author[] = $author_obj;
|
||||
}
|
||||
|
||||
// Expand the variable order
|
||||
if($xml_obj->extra_vars) {
|
||||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
|
||||
|
||||
foreach($extra_var_groups as $group) {
|
||||
$extra_vars = $group->var;
|
||||
if(!is_array($group->var)) $extra_vars = array($group->var);
|
||||
|
||||
foreach($extra_vars as $key => $val) {
|
||||
unset($obj);
|
||||
if(!$val->attrs->type) { $val->attrs->type = 'text'; }
|
||||
|
||||
$obj->group = $group->title->body;
|
||||
$obj->name = $val->attrs->name;
|
||||
$obj->title = $val->title->body;
|
||||
$obj->type = $val->attrs->type;
|
||||
$obj->description = $val->description->body;
|
||||
if($obj->name)
|
||||
{
|
||||
$obj->value = $extra_vals->{$obj->name};
|
||||
}
|
||||
if(strpos($obj->value, '|@|') != false) { $obj->value = explode('|@|', $obj->value); }
|
||||
if($obj->type == 'mid_list' && !is_array($obj->value)) { $obj->value = array($obj->value); }
|
||||
|
||||
// 'Select'type obtained from the option list.
|
||||
if($val->options && !is_array($val->options))
|
||||
{
|
||||
$val->options = array($val->options);
|
||||
}
|
||||
|
||||
for($i = 0, $c = count($val->options); $i < $c; $i++) {
|
||||
$obj->options[$i]->title = $val->options[$i]->title->body;
|
||||
$obj->options[$i]->value = $val->options[$i]->attrs->value;
|
||||
}
|
||||
|
||||
$addon_info->extra_vars[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// history
|
||||
if($xml_obj->history) {
|
||||
if(!is_array($xml_obj->history)) $history[] = $xml_obj->history;
|
||||
else $history = $xml_obj->history;
|
||||
|
||||
foreach($history as $item) {
|
||||
unset($obj);
|
||||
|
||||
if($item->author) {
|
||||
(!is_array($item->author)) ? $obj->author_list[] = $item->author : $obj->author_list = $item->author;
|
||||
|
||||
foreach($obj->author_list as $author) {
|
||||
unset($author_obj);
|
||||
$author_obj->name = $author->name->body;
|
||||
$author_obj->email_address = $author->attrs->email_address;
|
||||
$author_obj->homepage = $author->attrs->link;
|
||||
$obj->author[] = $author_obj;
|
||||
}
|
||||
}
|
||||
|
||||
$obj->name = $item->name->body;
|
||||
$obj->email_address = $item->attrs->email_address;
|
||||
$obj->homepage = $item->attrs->link;
|
||||
$obj->version = $item->attrs->version;
|
||||
$obj->date = $item->attrs->date;
|
||||
$obj->description = $item->description->body;
|
||||
|
||||
if($item->log) {
|
||||
(!is_array($item->log)) ? $obj->log[] = $item->log : $obj->log = $item->log;
|
||||
|
||||
foreach($obj->log as $log) {
|
||||
unset($log_obj);
|
||||
$log_obj->text = $log->body;
|
||||
$log_obj->link = $log->attrs->link;
|
||||
$obj->logs[] = $log_obj;
|
||||
}
|
||||
}
|
||||
|
||||
$addon_info->history[] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// addon format 0.1
|
||||
$addon_info->addon_name = $addon;
|
||||
$addon_info->title = $xml_obj->title->body;
|
||||
$addon_info->description = trim($xml_obj->author->description->body);
|
||||
$addon_info->version = $xml_obj->attrs->version;
|
||||
sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$author_obj->name = $xml_obj->author->name->body;
|
||||
$author_obj->email_address = $xml_obj->author->attrs->email_address;
|
||||
$author_obj->homepage = $xml_obj->author->attrs->link;
|
||||
$addon_info->author[] = $author_obj;
|
||||
|
||||
if($xml_obj->extra_vars) {
|
||||
// Expand the variable order
|
||||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
|
||||
foreach($extra_var_groups as $group) {
|
||||
$extra_vars = $group->var;
|
||||
if(!is_array($group->var)) $extra_vars = array($group->var);
|
||||
|
||||
foreach($extra_vars as $key => $val) {
|
||||
unset($obj);
|
||||
|
||||
$obj->group = $group->title->body;
|
||||
$obj->name = $val->attrs->name;
|
||||
$obj->title = $val->title->body;
|
||||
$obj->type = $val->type->body ? $val->type->body : 'text';
|
||||
$obj->description = $val->description->body;
|
||||
if($obj->name)
|
||||
{
|
||||
$obj->value = $extra_vals->{$obj->name};
|
||||
}
|
||||
if(strpos($obj->value, '|@|') != false) { $obj->value = explode('|@|', $obj->value); }
|
||||
if($obj->type == 'mid_list' && !is_array($obj->value)) { $obj->value = array($obj->value); }
|
||||
// 'Select'type obtained from the option list.
|
||||
if($val->options && !is_array($val->options))
|
||||
{
|
||||
$val->options = array($val->options);
|
||||
}
|
||||
|
||||
for($i = 0, $c = count($val->options); $i < $c; $i++) {
|
||||
$obj->options[$i]->title = $val->options[$i]->title->body;
|
||||
$obj->options[$i]->value = $val->options[$i]->value->body;
|
||||
}
|
||||
|
||||
$addon_info->extra_vars[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $addon_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns activated addon list
|
||||
*
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $gtype site or global
|
||||
* @return array Returns list
|
||||
**/
|
||||
function getInsertedAddons($site_srl = 0, $gtype = 'site') {
|
||||
$args->list_order = 'addon';
|
||||
if($gtype == 'global') $output = executeQuery('addon.getAddons', $args);
|
||||
else {
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('addon.getSiteAddons', $args);
|
||||
}
|
||||
if(!$output->data) return array();
|
||||
if(!is_array($output->data)) $output->data = array($output->data);
|
||||
|
||||
$activated_count = count($output->data);
|
||||
for($i=0;$i<$activated_count;$i++) {
|
||||
$addon = $output->data[$i];
|
||||
$addon_list[$addon->addon] = $addon;
|
||||
}
|
||||
return $addon_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether to activate
|
||||
*
|
||||
* @param string $addon Name to check
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $type pc or mobile
|
||||
* @param string $gtype site or global
|
||||
* @return bool If addon is activated returns true. Otherwise returns false.
|
||||
**/
|
||||
function isActivatedAddon($addon, $site_srl = 0, $type = "pc", $gtype = 'site') {
|
||||
$args->addon = $addon;
|
||||
if($gtype == 'global') {
|
||||
if($type == "pc") $output = executeQuery('addon.getAddonIsActivated', $args);
|
||||
else $output = executeQuery('addon.getMAddonIsActivated', $args);
|
||||
$addon_info->author = array();
|
||||
foreach($author_list as $author)
|
||||
{
|
||||
$author_obj = new stdClass();
|
||||
$author_obj->name = $author->name->body;
|
||||
$author_obj->email_address = $author->attrs->email_address;
|
||||
$author_obj->homepage = $author->attrs->link;
|
||||
$addon_info->author[] = $author_obj;
|
||||
}
|
||||
else {
|
||||
$args->site_srl = $site_srl;
|
||||
if($type == "pc") $output = executeQuery('addon.getSiteAddonIsActivated', $args);
|
||||
else $output = executeQuery('addon.getSiteMAddonIsActivated', $args);
|
||||
}
|
||||
if($output->data->count>0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
// Expand the variable order
|
||||
if($xml_obj->extra_vars)
|
||||
{
|
||||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups)
|
||||
{
|
||||
$extra_var_groups = $xml_obj->extra_vars;
|
||||
}
|
||||
if(!is_array($extra_var_groups))
|
||||
{
|
||||
$extra_var_groups = array($extra_var_groups);
|
||||
}
|
||||
|
||||
foreach($extra_var_groups as $group)
|
||||
{
|
||||
$extra_vars = $group->var;
|
||||
if(!is_array($group->var))
|
||||
{
|
||||
$extra_vars = array($group->var);
|
||||
}
|
||||
|
||||
foreach($extra_vars as $key => $val)
|
||||
{
|
||||
$obj = new stdClass();
|
||||
if(!$val->attrs->type)
|
||||
{
|
||||
$val->attrs->type = 'text';
|
||||
}
|
||||
|
||||
$obj->group = $group->title->body;
|
||||
$obj->name = $val->attrs->name;
|
||||
$obj->title = $val->title->body;
|
||||
$obj->type = $val->attrs->type;
|
||||
$obj->description = $val->description->body;
|
||||
if($obj->name)
|
||||
{
|
||||
$obj->value = $extra_vals->{$obj->name};
|
||||
}
|
||||
if(strpos($obj->value, '|@|') != FALSE)
|
||||
{
|
||||
$obj->value = explode('|@|', $obj->value);
|
||||
}
|
||||
if($obj->type == 'mid_list' && !is_array($obj->value))
|
||||
{
|
||||
$obj->value = array($obj->value);
|
||||
}
|
||||
|
||||
// 'Select'type obtained from the option list.
|
||||
if($val->options && !is_array($val->options))
|
||||
{
|
||||
$val->options = array($val->options);
|
||||
}
|
||||
|
||||
for($i = 0, $c = count($val->options); $i < $c; $i++)
|
||||
{
|
||||
$obj->options[$i] = new stdClass();
|
||||
$obj->options[$i]->title = $val->options[$i]->title->body;
|
||||
$obj->options[$i]->value = $val->options[$i]->attrs->value;
|
||||
}
|
||||
|
||||
$addon_info->extra_vars[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// history
|
||||
if($xml_obj->history)
|
||||
{
|
||||
if(!is_array($xml_obj->history))
|
||||
{
|
||||
$history = array();
|
||||
$history[] = $xml_obj->history;
|
||||
}
|
||||
else
|
||||
{
|
||||
$history = $xml_obj->history;
|
||||
}
|
||||
|
||||
$addon_info->history = array();
|
||||
foreach($history as $item)
|
||||
{
|
||||
$obj = new stdClass();
|
||||
|
||||
if($item->author)
|
||||
{
|
||||
if(!is_array($item->author))
|
||||
{
|
||||
$obj->author_list = array();
|
||||
$obj->author_list[] = $item->author;
|
||||
}
|
||||
else
|
||||
{
|
||||
$obj->author_list = $item->author;
|
||||
}
|
||||
|
||||
$obj->author = array();
|
||||
foreach($obj->author_list as $author)
|
||||
{
|
||||
$author_obj = new stdClass();
|
||||
$author_obj->name = $author->name->body;
|
||||
$author_obj->email_address = $author->attrs->email_address;
|
||||
$author_obj->homepage = $author->attrs->link;
|
||||
$obj->author[] = $author_obj;
|
||||
}
|
||||
}
|
||||
|
||||
$obj->name = $item->name->body;
|
||||
$obj->email_address = $item->attrs->email_address;
|
||||
$obj->homepage = $item->attrs->link;
|
||||
$obj->version = $item->attrs->version;
|
||||
$obj->date = $item->attrs->date;
|
||||
$obj->description = $item->description->body;
|
||||
|
||||
if($item->log)
|
||||
{
|
||||
if(!is_array($item->log))
|
||||
{
|
||||
$obj->log = array();
|
||||
$obj->log[] = $item->log;
|
||||
}
|
||||
else
|
||||
{
|
||||
$obj->log = $item->log;
|
||||
}
|
||||
|
||||
$obj->logs = array();
|
||||
foreach($obj->log as $log)
|
||||
{
|
||||
$log_obj = new stdClass();
|
||||
$log_obj->text = $log->body;
|
||||
$log_obj->link = $log->attrs->link;
|
||||
$obj->logs[] = $log_obj;
|
||||
}
|
||||
}
|
||||
$addon_info->history[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// addon format 0.1
|
||||
$addon_info = new stdClass();
|
||||
$addon_info->addon_name = $addon;
|
||||
$addon_info->title = $xml_obj->title->body;
|
||||
$addon_info->description = trim($xml_obj->author->description->body);
|
||||
$addon_info->version = $xml_obj->attrs->version;
|
||||
$date_obj = new stdClass();
|
||||
sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$author_obj->name = $xml_obj->author->name->body;
|
||||
$author_obj->email_address = $xml_obj->author->attrs->email_address;
|
||||
$author_obj->homepage = $xml_obj->author->attrs->link;
|
||||
$addon_info->author = array();
|
||||
$addon_info->author[] = $author_obj;
|
||||
|
||||
if($xml_obj->extra_vars)
|
||||
{
|
||||
// Expand the variable order
|
||||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups)
|
||||
{
|
||||
$extra_var_groups = $xml_obj->extra_vars;
|
||||
}
|
||||
if(!is_array($extra_var_groups))
|
||||
{
|
||||
$extra_var_groups = array($extra_var_groups);
|
||||
}
|
||||
foreach($extra_var_groups as $group)
|
||||
{
|
||||
$extra_vars = $group->var;
|
||||
if(!is_array($group->var))
|
||||
{
|
||||
$extra_vars = array($group->var);
|
||||
}
|
||||
|
||||
$addon_info->extra_vars = array();
|
||||
foreach($extra_vars as $key => $val)
|
||||
{
|
||||
$obj = new stdClass();
|
||||
|
||||
$obj->group = $group->title->body;
|
||||
$obj->name = $val->attrs->name;
|
||||
$obj->title = $val->title->body;
|
||||
$obj->type = $val->type->body ? $val->type->body : 'text';
|
||||
$obj->description = $val->description->body;
|
||||
if($obj->name)
|
||||
{
|
||||
$obj->value = $extra_vals->{$obj->name};
|
||||
}
|
||||
if(strpos($obj->value, '|@|') != false)
|
||||
{
|
||||
$obj->value = explode('|@|', $obj->value);
|
||||
}
|
||||
if($obj->type == 'mid_list' && !is_array($obj->value))
|
||||
{
|
||||
$obj->value = array($obj->value);
|
||||
}
|
||||
// 'Select'type obtained from the option list.
|
||||
if($val->options && !is_array($val->options))
|
||||
{
|
||||
$val->options = array($val->options);
|
||||
}
|
||||
|
||||
$obj->options = array();
|
||||
for($i = 0, $c = count($val->options); $i < $c; $i++)
|
||||
{
|
||||
$obj->options[$i]->title = $val->options[$i]->title->body;
|
||||
$obj->options[$i]->value = $val->options[$i]->value->body;
|
||||
}
|
||||
$addon_info->extra_vars[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $addon_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns activated addon list
|
||||
*
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $gtype site or global
|
||||
* @return array Returns list
|
||||
*/
|
||||
function getInsertedAddons($site_srl = 0, $gtype = 'site')
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->list_order = 'addon';
|
||||
if($gtype == 'global')
|
||||
{
|
||||
$output = executeQueryArray('addon.getAddons', $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQueryArray('addon.getSiteAddons', $args);
|
||||
}
|
||||
if(!$output->data)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$activated_count = count($output->data);
|
||||
$addon_list = array();
|
||||
for($i = 0; $i < $activated_count; $i++)
|
||||
{
|
||||
$addon = $output->data[$i];
|
||||
$addon_list[$addon->addon] = $addon;
|
||||
}
|
||||
return $addon_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether to activate
|
||||
*
|
||||
* @param string $addon Name to check
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $type pc or mobile
|
||||
* @param string $gtype site or global
|
||||
* @return bool If addon is activated returns true. Otherwise returns false.
|
||||
*/
|
||||
function isActivatedAddon($addon, $site_srl = 0, $type = "pc", $gtype = 'site')
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->addon = $addon;
|
||||
if($gtype == 'global')
|
||||
{
|
||||
if($type == "pc")
|
||||
{
|
||||
$output = executeQuery('addon.getAddonIsActivated', $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = executeQuery('addon.getMAddonIsActivated', $args);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->site_srl = $site_srl;
|
||||
if($type == "pc")
|
||||
{
|
||||
$output = executeQuery('addon.getSiteAddonIsActivated', $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = executeQuery('addon.getSiteMAddonIsActivated', $args);
|
||||
}
|
||||
}
|
||||
if($output->data->count > 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file addon.admin.model.php */
|
||||
/* Location: ./modules/addon/addon.admin.model.php */
|
||||
|
|
|
|||
|
|
@ -1,115 +1,133 @@
|
|||
<?php
|
||||
/**
|
||||
* Admin view class of addon modules
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
class addonAdminView extends addon {
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
/**
|
||||
* Admin view class of addon modules
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
*/
|
||||
class addonAdminView extends addon
|
||||
{
|
||||
|
||||
/**
|
||||
* Add Management main page (showing the list)
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function dispAddonAdminIndex() {
|
||||
$oAdminModel = &getAdminModel('admin');
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
$this->setTemplatePath($this->module_path . 'tpl');
|
||||
}
|
||||
|
||||
// Add to the list settings
|
||||
$oAddonModel = &getAdminModel('addon');
|
||||
$addon_list = $oAddonModel->getAddonListForSuperAdmin();
|
||||
/**
|
||||
* Add Management main page (showing the list)
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function dispAddonAdminIndex()
|
||||
{
|
||||
$oAdminModel = getAdminModel('admin');
|
||||
|
||||
$security = new Security($addon_list);
|
||||
$addon_list = $security->encodeHTML('..', '..author..');
|
||||
// Add to the list settings
|
||||
$oAddonModel = getAdminModel('addon');
|
||||
$addon_list = $oAddonModel->getAddonListForSuperAdmin();
|
||||
|
||||
foreach($addon_list as $no => $addon_info)
|
||||
$security = new Security($addon_list);
|
||||
$addon_list = $security->encodeHTML('..', '..author..');
|
||||
|
||||
foreach($addon_list as $no => $addon_info)
|
||||
{
|
||||
$addon_list[$no]->description = nl2br(trim($addon_info->description));
|
||||
}
|
||||
|
||||
Context::set('addon_list', $addon_list);
|
||||
Context::set('addon_count', count($addon_list));
|
||||
// Template specifies the path and file
|
||||
$this->setTemplateFile('addon_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display setup page
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function dispAddonAdminSetup()
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
// Wanted to add the requested
|
||||
$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, 'site');
|
||||
Context::set('addon_info', $addon_info);
|
||||
// Get a mid list
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleAdminModel = getAdminModel('module');
|
||||
|
||||
$args = new stdClass();
|
||||
if($site_module_info->site_srl)
|
||||
{
|
||||
$args->site_srl = $site_module_info->site_srl;
|
||||
}
|
||||
$columnList = array('module_srl', 'module_category_srl', 'mid', 'browser_title');
|
||||
$mid_list = $oModuleModel->getMidList($args, $columnList);
|
||||
// module_category and module combination
|
||||
if(!$site_module_info->site_srl)
|
||||
{
|
||||
// Get a list of module categories
|
||||
$module_categories = $oModuleModel->getModuleCategories();
|
||||
|
||||
if(is_array($mid_list))
|
||||
{
|
||||
$addon_list[$no]->description = nl2br(trim($addon_info->description));
|
||||
foreach($mid_list as $module_srl => $module)
|
||||
{
|
||||
$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$module_categories = array();
|
||||
$module_categories[0] = new stdClass();
|
||||
$module_categories[0]->list = $mid_list;
|
||||
}
|
||||
|
||||
Context::set('addon_list', $addon_list);
|
||||
Context::set('addon_count', count($addon_list));
|
||||
// Template specifies the path and file
|
||||
$this->setTemplateFile('addon_list');
|
||||
}
|
||||
Context::set('mid_list', $module_categories);
|
||||
|
||||
/**
|
||||
* Display setup page
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function dispAddonAdminSetup() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
// Wanted to add the requested
|
||||
$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, 'site');
|
||||
Context::set('addon_info', $addon_info);
|
||||
// Get a mid list
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleAdminModel = &getAdminModel('module');
|
||||
// Template specifies the path and file
|
||||
$this->setTemplateFile('setup_addon');
|
||||
|
||||
if($site_module_info->site_srl) $args->site_srl = $site_module_info->site_srl;
|
||||
$columnList = array('module_srl', 'module_category_srl', 'mid', 'browser_title');
|
||||
$mid_list = $oModuleModel->getMidList($args, $columnList);
|
||||
// module_category and module combination
|
||||
if(!$site_module_info->site_srl) {
|
||||
// Get a list of module categories
|
||||
$module_categories = $oModuleModel->getModuleCategories();
|
||||
if(Context::get('module') != 'admin')
|
||||
{
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('popup_layout');
|
||||
}
|
||||
|
||||
if(is_array($mid_list)) {
|
||||
foreach($mid_list as $module_srl => $module) {
|
||||
$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$module_categories[0]->list = $mid_list;
|
||||
}
|
||||
$security = new Security();
|
||||
$security->encodeHTML('addon_info.', 'addon_info.author..', 'mid_list....');
|
||||
}
|
||||
|
||||
Context::set('mid_list',$module_categories);
|
||||
/**
|
||||
* Display information
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function dispAddonAdminInfo()
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
// Wanted to add the requested
|
||||
$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);
|
||||
Context::set('addon_info', $addon_info);
|
||||
// Set the layout to be pop-up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
// Template specifies the path and file
|
||||
$this->setTemplateFile('addon_info');
|
||||
|
||||
// Template specifies the path and file
|
||||
$this->setTemplateFile('setup_addon');
|
||||
$security = new Security();
|
||||
$security->encodeHTML('addon_info.', 'addon_info.author..');
|
||||
}
|
||||
|
||||
if(Context::get('module') != 'admin')
|
||||
{
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('popup_layout');
|
||||
}
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('addon_info.', 'addon_info.author..', 'mid_list....');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display information
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function dispAddonAdminInfo() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
// Wanted to add the requested
|
||||
$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);
|
||||
Context::set('addon_info', $addon_info);
|
||||
// Set the layout to be pop-up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
// Template specifies the path and file
|
||||
$this->setTemplateFile('addon_info');
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('addon_info.', 'addon_info.author..');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
}
|
||||
/* End of file addon.admin.view.php */
|
||||
/* Location: ./modules/addon/addon.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -1,93 +1,113 @@
|
|||
<?php
|
||||
/**
|
||||
* High class of addon modules
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
class addon extends ModuleObject {
|
||||
|
||||
/**
|
||||
* Implement if additional tasks are necessary when installing
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// Register to add a few
|
||||
$oAddonController = &getAdminController('addon');
|
||||
$oAddonController->doInsert('autolink', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('blogapi');
|
||||
$oAddonController->doInsert('counter', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('member_communication', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('member_extra_info', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('mobile', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('resize_image', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('openid_delegation_id');
|
||||
$oAddonController->doInsert('point_level_icon');
|
||||
/**
|
||||
* High class of addon modules
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
*/
|
||||
class addon extends ModuleObject
|
||||
{
|
||||
|
||||
$oAddonController->makeCacheFile(0);
|
||||
return new Object();
|
||||
}
|
||||
/**
|
||||
* Implement if additional tasks are necessary when installing
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
// Register to add a few
|
||||
$oAddonController = getAdminController('addon');
|
||||
$oAddonController->doInsert('autolink', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('blogapi');
|
||||
$oAddonController->doInsert('counter', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('member_communication', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('member_extra_info', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('mobile', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('resize_image', 0, 'site', 'Y');
|
||||
$oAddonController->doInsert('openid_delegation_id');
|
||||
$oAddonController->doInsert('point_level_icon');
|
||||
|
||||
/**
|
||||
* A method to check if successfully installed
|
||||
*
|
||||
* @return bool
|
||||
**/
|
||||
function checkUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isColumnExists("addons", "is_used_m")) return true;
|
||||
if(!$oDB->isColumnExists("addons_site", "is_used_m")) return true;
|
||||
$oAddonController->makeCacheFile(0);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
// 2011. 7. 29. add is_fixed column
|
||||
if (!$oDB->isColumnExists('addons', 'is_fixed')) return true;
|
||||
/**
|
||||
* A method to check if successfully installed
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
if(!$oDB->isColumnExists("addons", "is_used_m"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if(!$oDB->isColumnExists("addons_site", "is_used_m"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
// 2011. 7. 29. add is_fixed column
|
||||
if(!$oDB->isColumnExists('addons', 'is_fixed'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute update
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
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")) {
|
||||
$oDB->addColumn("addons_site", "is_used_m", "char", 1, "N", true);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// 2011. 7. 29. add is_fixed column
|
||||
if (!$oDB->isColumnExists('addons', 'is_fixed'))
|
||||
/**
|
||||
* Execute update
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
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"))
|
||||
{
|
||||
$oDB->addColumn("addons_site", "is_used_m", "char", 1, "N", TRUE);
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
$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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
$args = new stdClass();
|
||||
$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');
|
||||
}
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-generate the cache file
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function recompileCache() {
|
||||
}
|
||||
/**
|
||||
* Re-generate the cache file
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file addon.class.php */
|
||||
/* Location: ./modules/addon/addon.class.php */
|
||||
|
|
|
|||
|
|
@ -1,244 +1,208 @@
|
|||
<?php
|
||||
/**
|
||||
* Addon module's controller class
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
class addonController extends addon {
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
/**
|
||||
* Addon module's controller class
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
*/
|
||||
class addonController extends addon
|
||||
{
|
||||
|
||||
/**
|
||||
* Returns a cache file path
|
||||
*
|
||||
* @param $type pc or mobile
|
||||
* @return string Returns a path
|
||||
**/
|
||||
function getCacheFilePath($type = "pc") {
|
||||
static $addon_file;
|
||||
if(isset($addon_file)) return $addon_file;
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = $site_module_info->site_srl;
|
||||
}
|
||||
|
||||
$addon_path = _XE_PATH_.'files/cache/addons/';
|
||||
/**
|
||||
* Returns a cache file path
|
||||
*
|
||||
* @param $type pc or mobile
|
||||
* @return string Returns a path
|
||||
*/
|
||||
function getCacheFilePath($type = "pc")
|
||||
{
|
||||
static $addon_file;
|
||||
if(isset($addon_file))
|
||||
{
|
||||
return $addon_file;
|
||||
}
|
||||
|
||||
$addon_file = $addon_path.$site_srl.$type.'.acivated_addons.cache.php';
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = $site_module_info->site_srl;
|
||||
|
||||
if($this->addon_file_called) return $addon_file;
|
||||
$this->addon_file_called = true;
|
||||
$addon_path = _XE_PATH_ . 'files/cache/addons/';
|
||||
|
||||
if(!is_dir($addon_path)) FileHandler::makeDir($addon_path);
|
||||
if(!file_exists($addon_file)) $this->makeCacheFile($site_srl, $type);
|
||||
return $addon_file;
|
||||
}
|
||||
$addon_file = $addon_path . $site_srl . $type . '.acivated_addons.cache.php';
|
||||
|
||||
if($this->addon_file_called)
|
||||
{
|
||||
return $addon_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns mid list that addons is run
|
||||
*
|
||||
* @param string $selected_addon Name to get list
|
||||
* @param int $site_srl Site srl
|
||||
* @return string[] Returns list that contain mid
|
||||
**/
|
||||
function _getMidList($selected_addon, $site_srl = 0) {
|
||||
$this->addon_file_called = TRUE;
|
||||
|
||||
$oAddonAdminModel = &getAdminModel('addon');
|
||||
$addon_info = $oAddonAdminModel->getAddonInfoXml($selected_addon, $site_srl);
|
||||
return $addon_info->mid_list;
|
||||
}
|
||||
if(!is_dir($addon_path))
|
||||
{
|
||||
FileHandler::makeDir($addon_path);
|
||||
}
|
||||
if(!file_exists($addon_file))
|
||||
{
|
||||
$this->makeCacheFile($site_srl, $type);
|
||||
}
|
||||
|
||||
return $addon_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns mid list that addons is run
|
||||
*
|
||||
* @param string $selected_addon Name to get list
|
||||
* @param int $site_srl Site srl
|
||||
* @return string[] Returns list that contain mid
|
||||
*/
|
||||
function _getMidList($selected_addon, $site_srl = 0)
|
||||
{
|
||||
$oAddonAdminModel = getAdminModel('addon');
|
||||
$addon_info = $oAddonAdminModel->getAddonInfoXml($selected_addon, $site_srl);
|
||||
return $addon_info->mid_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds mid into running mid list
|
||||
*
|
||||
* @param string $selected_addon Addon name to add mid
|
||||
* @param string $mid Module id to add
|
||||
* @param int $site_srl Site srl
|
||||
* @return void
|
||||
**/
|
||||
function _setAddMid($selected_addon,$mid, $site_srl=0) {
|
||||
// Wanted to add the requested information
|
||||
$mid_list = $this->_getMidList($selected_addon, $site_srl);
|
||||
/**
|
||||
* Re-generate the cache file
|
||||
*
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $type pc or mobile
|
||||
* @param string $gtype site or global
|
||||
* @return void
|
||||
*/
|
||||
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, $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') || ($gtype == 'global' && $val->is_fixed != 'Y'))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$mid_list[] = $mid;
|
||||
$new_mid_list = array_unique($mid_list);
|
||||
$this->_setMid($selected_addon,$new_mid_list, $site_srl);
|
||||
}
|
||||
$extra_vars = unserialize($val->extra_vars);
|
||||
$mid_list = $extra_vars->mid_list;
|
||||
if(!is_array($mid_list) || !count($mid_list))
|
||||
{
|
||||
$mid_list = NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes mid from running mid list
|
||||
*
|
||||
* @param string $selected_addon Addon name to delete mid
|
||||
* @param string $mid Module id to delete
|
||||
* @param int $site_srl Site srl
|
||||
* @return void
|
||||
**/
|
||||
function _setDelMid($selected_addon,$mid,$site_srl=0) {
|
||||
// Wanted to add the requested information
|
||||
$mid_list = $this->_getMidList($selected_addon,$site_srl);
|
||||
|
||||
$new_mid_list = array();
|
||||
if(is_array($mid_list)){
|
||||
for($i=0,$c=count($mid_list);$i<$c;$i++){
|
||||
if($mid_list[$i] != $mid) $new_mid_list[] = $mid_list[$i];
|
||||
}
|
||||
}else{
|
||||
$new_mid_list[] = $mid;
|
||||
}
|
||||
|
||||
|
||||
$this->_setMid($selected_addon,$new_mid_list,$site_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set running mid list
|
||||
*
|
||||
* @param string $selected_addon Addon name to set
|
||||
* @param string[] $mid_list List to set
|
||||
* @param int $site_srl Site srl
|
||||
* @return void
|
||||
**/
|
||||
function _setMid($selected_addon,$mid_list,$site_srl=0) {
|
||||
$args->mid_list = join('|@|',$mid_list);
|
||||
$this->doSetup($selected_addon, $args,$site_srl);
|
||||
$this->makeCacheFile($site_srl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds mid into running mid list
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function procAddonSetupAddonAddMid() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
$args = Context::getRequestVars();
|
||||
$addon_name = $args->addon_name;
|
||||
$mid = $args->mid;
|
||||
$this->_setAddMid($addon_name,$mid,$site_module_info->site_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes mid from running mid list
|
||||
*
|
||||
* @return Object
|
||||
**/
|
||||
function procAddonSetupAddonDelMid() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
$args = Context::getRequestVars();
|
||||
$addon_name = $args->addon_name;
|
||||
$mid = $args->mid;
|
||||
|
||||
$this->_setDelMid($addon_name,$mid,$site_module_info->site_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-generate the cache file
|
||||
*
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $type pc or mobile
|
||||
* @param string $gtype site or global
|
||||
* @return void
|
||||
**/
|
||||
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, $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') || ($gtype == 'global' && $val->is_fixed != 'Y')) continue;
|
||||
|
||||
$extra_vars = unserialize($val->extra_vars);
|
||||
$mid_list = $extra_vars->mid_list;
|
||||
if(!is_array($mid_list)||!count($mid_list)) $mid_list = null;
|
||||
|
||||
$buff .= '$rm = \'' . $extra_vars->xe_run_method . "';";
|
||||
$buff .= '$ml = array(';
|
||||
if($mid_list)
|
||||
$buff .= '$rm = \'' . $extra_vars->xe_run_method . "';";
|
||||
$buff .= '$ml = array(';
|
||||
if($mid_list)
|
||||
{
|
||||
foreach($mid_list as $mid)
|
||||
{
|
||||
foreach($mid_list as $mid)
|
||||
{
|
||||
$buff .= "'$mid' => 1,";
|
||||
}
|
||||
$buff .= "'$mid' => 1,";
|
||||
}
|
||||
$buff .= ');';
|
||||
$buff .= sprintf('$addon_file = \'./addons/%s/%s.addon.php\';', $addon, $addon);
|
||||
}
|
||||
$buff .= ');';
|
||||
$buff .= sprintf('$addon_file = \'./addons/%s/%s.addon.php\';', $addon, $addon);
|
||||
|
||||
if($val->extra_vars) {
|
||||
unset($extra_vars);
|
||||
$extra_vars = base64_encode($val->extra_vars);
|
||||
}
|
||||
$addon_include = sprintf('unset($addon_info); $addon_info = unserialize(base64_decode(\'%s\')); @include($addon_file);', $extra_vars);
|
||||
if($val->extra_vars)
|
||||
{
|
||||
unset($extra_vars);
|
||||
$extra_vars = base64_encode($val->extra_vars);
|
||||
}
|
||||
$addon_include = sprintf('unset($addon_info); $addon_info = unserialize(base64_decode(\'%s\')); @include($addon_file);', $extra_vars);
|
||||
|
||||
$buff .= 'if(file_exists($addon_file)){';
|
||||
$buff .= 'if($rm === \'no_run_selected\'){';
|
||||
$buff .= 'if(!isset($ml[$_m])){';
|
||||
$buff .= $addon_include;
|
||||
$buff .= '}}else{';
|
||||
$buff .= 'if(isset($ml[$_m]) || count($ml) === 0){';
|
||||
$buff .= $addon_include;
|
||||
$buff .= '}}}';
|
||||
}
|
||||
$buff .= 'if(file_exists($addon_file)){';
|
||||
$buff .= 'if($rm === \'no_run_selected\'){';
|
||||
$buff .= 'if(!isset($ml[$_m])){';
|
||||
$buff .= $addon_include;
|
||||
$buff .= '}}else{';
|
||||
$buff .= 'if(isset($ml[$_m]) || count($ml) === 0){';
|
||||
$buff .= $addon_include;
|
||||
$buff .= '}}}';
|
||||
}
|
||||
|
||||
$buff = sprintf('<?php if(!defined("__XE__")) exit(); $_m = Context::get(\'mid\'); %s ?>', $buff);
|
||||
$buff = sprintf('<?php if(!defined("__XE__")) exit(); $_m = Context::get(\'mid\'); %s ?>', $buff);
|
||||
|
||||
$addon_path = _XE_PATH_.'files/cache/addons/';
|
||||
if(!is_dir($addon_path)) FileHandler::makeDir($addon_path);
|
||||
$addon_path = _XE_PATH_ . 'files/cache/addons/';
|
||||
if(!is_dir($addon_path))
|
||||
{
|
||||
FileHandler::makeDir($addon_path);
|
||||
}
|
||||
|
||||
if($gtype == 'site') $addon_file = $addon_path.$site_srl.$type.'.acivated_addons.cache.php';
|
||||
else $addon_file = $addon_path.$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);
|
||||
}
|
||||
FileHandler::writeFile($addon_file, $buff);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save setup
|
||||
*
|
||||
* @param string $addon Addon name
|
||||
* @param object $extra_vars Extra variables
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $gtype site or global
|
||||
* @return Object
|
||||
**/
|
||||
function doSetup($addon, $extra_vars,$site_srl=0, $gtype = 'site') {
|
||||
if(!is_array($extra_vars->mid_list)) unset($extra_vars->mid_list);
|
||||
/**
|
||||
* Save setup
|
||||
*
|
||||
* @param string $addon Addon name
|
||||
* @param object $extra_vars Extra variables
|
||||
* @param int $site_srl Site srl
|
||||
* @param string $gtype site or global
|
||||
* @return Object
|
||||
*/
|
||||
function doSetup($addon, $extra_vars, $site_srl = 0, $gtype = 'site')
|
||||
{
|
||||
if(!is_array($extra_vars->mid_list))
|
||||
{
|
||||
unset($extra_vars->mid_list);
|
||||
}
|
||||
|
||||
$args->addon = $addon;
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
if($gtype == 'global') return executeQuery('addon.updateAddon', $args);
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
$args = new stdClass();
|
||||
$args->addon = $addon;
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
if($gtype == 'global')
|
||||
{
|
||||
return executeQuery('addon.updateAddon', $args);
|
||||
}
|
||||
$args->site_srl = $site_srl;
|
||||
return executeQuery('addon.updateSiteAddon', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove add-on information in the virtual site
|
||||
*
|
||||
* @param int $site_srl Site srl
|
||||
* @return void
|
||||
**/
|
||||
function removeAddonConfig($site_srl) {
|
||||
$addon_path = _XE_PATH_.'files/cache/addons/';
|
||||
$addon_file = $addon_path.$site_srl.'.acivated_addons.cache.php';
|
||||
if(file_exists($addon_file)) FileHandler::removeFile($addon_file);
|
||||
/**
|
||||
* Remove add-on information in the virtual site
|
||||
*
|
||||
* @param int $site_srl Site srl
|
||||
* @return void
|
||||
*/
|
||||
function removeAddonConfig($site_srl)
|
||||
{
|
||||
$addon_path = _XE_PATH_ . 'files/cache/addons/';
|
||||
$addon_file = $addon_path . $site_srl . '.acivated_addons.cache.php';
|
||||
if(file_exists($addon_file))
|
||||
{
|
||||
FileHandler::removeFile($addon_file);
|
||||
}
|
||||
|
||||
$args->site_srl = $site_srl;
|
||||
executeQuery('addon.deleteSiteAddons', $args);
|
||||
$args = new stdClass();
|
||||
$args->site_srl = $site_srl;
|
||||
executeQuery('addon.deleteSiteAddons', $args);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
}
|
||||
/* End of file addon.controller.php */
|
||||
/* Location: ./modules/addon/addon.controller.php */
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
<title xml:lang="ru">Аддон</title>
|
||||
<title xml:lang="zh-TW">附加元件</title>
|
||||
<title xml:lang="tr">Eklenti</title>
|
||||
<description xml:lang="ko">애드온을 등록하거나 사용/미사용을 설정하는 애드온 관리 모듈입니다.</description>
|
||||
<description xml:lang="en">This module is for maintaining addons which can toggle between two states when use and not used.</description>
|
||||
<description xml:lang="ko">애드온을 등록하거나 사용/미사용을 설정합니다.</description>
|
||||
<description xml:lang="en">This is for maintaining addons which can toggle between two states when use and not used.</description>
|
||||
<description xml:lang="vi">Module này dành cho việc bảo trì những Addon đang sử dụng và không sử dụng.</description>
|
||||
<description xml:lang="es">Este Módulo es para agregar Addons, como también el manejo de ellos.</description>
|
||||
<description xml:lang="zh-CN">登录插件或设置启用/禁用插件的管理模块。</description>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
<action name="dispAddonAdminSetup" type="view" standalone="true" menu_name="installedAddon" />
|
||||
<action name="procAddonAdminToggleActivate" 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>
|
||||
|
|
|
|||
|
|
@ -57,19 +57,19 @@
|
|||
<value xml:lang="vi"><![CDATA[Lịch sử]]></value>
|
||||
</item>
|
||||
<item name="about_addon_mid">
|
||||
<value xml:lang="ko"><![CDATA[애드온이 사용될 대상을 지정할 수 있습니다.<br />(모두 해제 시 모든 대상에서 사용 가능합니다.)]]></value>
|
||||
<value xml:lang="en"><![CDATA[Select a target where the added is used.<br />(If you select none, the addon will be used on all targets.)]]></value>
|
||||
<value xml:lang="jp"><![CDATA[アドオンを使用する対象を指定します。<br />(選択しない場合、すべてのモジュールが利用可能対象となります]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[可以指定使用插件的对象。<br />(全部解除表示可用在所有对象。)]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[可以指定使用附加元件的目標。<br />(全部不選取表示可用於所有目標。)]]></value>
|
||||
<value xml:lang="ko"><![CDATA[애드온이 사용될 대상을 지정할 수 있습니다. (모두 해제 시 모든 대상에서 사용 가능합니다.)]]></value>
|
||||
<value xml:lang="en"><![CDATA[Select a target where the added is used. (If you select none, the addon will be used on all targets.)]]></value>
|
||||
<value xml:lang="jp"><![CDATA[アドオンを使用する対象を指定します。(選択しない場合、すべてのモジュールが利用可能対象となります]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[可以指定使用插件的对象。(全部解除表示可用在所有对象。)]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[可以指定使用附加元件的目標。(全部不選取表示可用於所有目標。)]]></value>
|
||||
<value xml:lang="fr"><![CDATA[On peut choisir des objets dans lesquels la Compagnon soit utilisé.<br />(Tout sera choisi quand rien n'est choisi.)]]></value>
|
||||
<value xml:lang="ru"><![CDATA[애드온이 사용될 대상을 지정할 수 있습니다.<br />(모두 해제시 모든 대상에서 사용 가능합니다)]]></value>
|
||||
<value xml:lang="es"><![CDATA[Add-ons se puede utilizar para especificar el destino. <br /> (Todo gratis, están disponibles en todos los destinos)]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Eklentiler, hedef seçebilirler.<br />(Herhangi bir seçim yapılmadığında, tüm hedefler seçilecektir.)]]></value>
|
||||
<value xml:lang="vi"><![CDATA[Addon có thể chọn những vị trí.<br />(Tất cả những vị trí mà chưa Addon nào sử dụng.)]]></value>
|
||||
<value xml:lang="ru"><![CDATA[애드온이 사용될 대상을 지정할 수 있습니다.(모두 해제시 모든 대상에서 사용 가능합니다)]]></value>
|
||||
<value xml:lang="es"><![CDATA[Add-ons se puede utilizar para especificar el destino. (Todo gratis, están disponibles en todos los destinos)]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Eklentiler, hedef seçebilirler.(Herhangi bir seçim yapılmadığında, tüm hedefler seçilecektir.)]]></value>
|
||||
<value xml:lang="vi"><![CDATA[Addon có thể chọn những vị trí.(Tất cả những vị trí mà chưa Addon nào sử dụng.)]]></value>
|
||||
</item>
|
||||
<item name="about_addon">
|
||||
<value xml:lang="ko"><![CDATA[애드온은 HTML결과물을 출력하기보다는 동작을 제어하는 역할을 합니다.<br />원하시는 애드온을 ON/OFF 하시는 것만으로도 사이트 운영에 유용한 기능을 연동할 수 있습니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[애드온은 HTML결과물을 출력하기보다는 동작을 제어하는 역할을 합니다.<br />원하는 애드온을 ON/OFF 하는 것만으로도 사이트 운영에 유용한 기능을 연동할 수 있습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Addons control many actions performed in your site rather than display HTML results.<br />You can control useful functions simply by switching ON/OFF of addons.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[アドオンは、HTMLの出力をコントロールするというより、動作を制御する役割をします。アドオンを「使用/未使用」に設定するだけで、サイトの運営に有用な機能を利用できます。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[插件就是对动作(Action)的有效控制来给核心程序提供扩展功能的一种组件。<br />只需启用/禁用操作,即可为网站提供强大的扩展功能。]]></value>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<h1 class="h1">{$lang->addon_maker}</h1>
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<h1>{$lang->addon_maker}</h1>
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
<tr>
|
||||
<th scope="row">{$lang->title}</th>
|
||||
<td>{$addon_info->title} ver. {$addon_info->version}</td>
|
||||
|
|
@ -13,7 +12,7 @@
|
|||
<!--@endforeach-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@if($addon_info->homepage)-->
|
||||
<!--@if($addon_info->homepage)-->
|
||||
<tr>
|
||||
<th scope="row">{$lang->homepage}</th>
|
||||
<td><a href="{$addon_info->homepage}" onclick="window.open(this.href);return false;">{$addon_info->homepage}</a></td>
|
||||
|
|
@ -22,7 +21,7 @@
|
|||
<th scope="row">{$lang->regdate}</th>
|
||||
<td>{zdate($addon_info->date, 'Y-m-d')}</td>
|
||||
</tr>
|
||||
<!--@if($addon_info->license || $addon_info->license_link)-->
|
||||
<!--@if($addon_info->license || $addon_info->license_link)-->
|
||||
<tr>
|
||||
<th scope="row">{$lang->addon_license}</th>
|
||||
<td>
|
||||
|
|
@ -32,47 +31,41 @@
|
|||
<!--@end-->
|
||||
</td>
|
||||
</tr><!--@end-->
|
||||
<!--@if($addon_info->description)-->
|
||||
<!--@if($addon_info->description)-->
|
||||
<tr>
|
||||
<th scope="row">{$lang->description}</th>
|
||||
<td>{nl2br(trim($addon_info->description))}</td>
|
||||
</tr><!--@end-->
|
||||
</table>
|
||||
</div>
|
||||
</table>
|
||||
|
||||
<!--@if($addon_info->history)-->
|
||||
<h1 class="h1">{$lang->addon_history}</h1>
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<col width="100" />
|
||||
<col />
|
||||
|
||||
<!--@foreach($addon_info->history as $history)-->
|
||||
<tr>
|
||||
<th scope="row">
|
||||
{$history->version}<br />
|
||||
{$history->date} </th>
|
||||
<td>
|
||||
<!--@foreach($history->author as $author)-->
|
||||
<p>{$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>)</p>
|
||||
<h1>{$lang->addon_history}</h1>
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
<!--@foreach($addon_info->history as $history)-->
|
||||
<tr>
|
||||
<th scope="row">
|
||||
{$history->version}<br />
|
||||
{$history->date} </th>
|
||||
<td>
|
||||
<!--@foreach($history->author as $author)-->
|
||||
<p>{$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>)</p>
|
||||
<!--@endforeach-->
|
||||
<!--@if($history->description)-->
|
||||
<p>{nl2br(trim($history->description))}</p>
|
||||
<!--@endif-->
|
||||
<!--@if($history->logs)-->
|
||||
<ul>
|
||||
<!--@foreach($history->logs as $log)-->
|
||||
<!--@if($log->link)-->
|
||||
<li><a href="{$log->link}">{$log->text}</a></li>
|
||||
<!--@else-->
|
||||
<li>{$log->text}</li>
|
||||
<!--@endif-->
|
||||
<!--@endforeach-->
|
||||
<!--@if($history->description)-->
|
||||
<p>{nl2br(trim($history->description))}</p>
|
||||
<!--@endif-->
|
||||
<!--@if($history->logs)-->
|
||||
<ul>
|
||||
<!--@foreach($history->logs as $log)-->
|
||||
<!--@if($log->link)-->
|
||||
<li><a href="{$log->link}">{$log->text}</a></li>
|
||||
<!--@else-->
|
||||
<li>{$log->text}</li>
|
||||
<!--@endif-->
|
||||
<!--@endforeach-->
|
||||
</ul>
|
||||
<!--@endif-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@endforeach-->
|
||||
</table>
|
||||
</div>
|
||||
</ul>
|
||||
<!--@endif-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@endforeach-->
|
||||
</table>
|
||||
<!--@endif-->
|
||||
|
|
|
|||
|
|
@ -1,57 +1,63 @@
|
|||
<div class="x_page-header">
|
||||
<h1>{$lang->installed_addons} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_advanced_installed_addon" target="_blank">{$lang->help}</a></h1>
|
||||
</div>
|
||||
<p>{$lang->about_installed_addon}</p>
|
||||
<form action="./" method="post">
|
||||
<input type="hidden" name="module" value="addon" />
|
||||
<input type="hidden" name="act" value="procAddonAdminSaveActivate" />
|
||||
<input type="hidden" name="sccess_return_url" value="{getRequestUriByServerEnviroment()}" />
|
||||
<input type="hidden" name="xe_validator_id" value="modules/addon/tpl/addon_list/1" />
|
||||
|
||||
<h1 class="h1">{$lang->installed_addons}</h1>
|
||||
<p>{$lang->about_installed_addon}</p>
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/addon/tpl/addon_list/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<div class="table even easyList dsTg">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<caption>
|
||||
All({$addon_count})
|
||||
<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="title">{$lang->addon_name}</th>
|
||||
<th scope="col" class="nowr">{$lang->version}</th>
|
||||
<th scope="col" class="nowr">{$lang->author}</th>
|
||||
<th scope="col" class="nowr">{$lang->installed_path}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_setup}</th>
|
||||
<th scope="col" class="nowr">PC</th>
|
||||
<th scope="col" class="nowr">Mobile</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_delete}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$addon_list => $addon">
|
||||
<td class="title">
|
||||
<p><strong>{$addon->title}</strong></p>
|
||||
<p>{$addon->description}</p>
|
||||
<p cond="$addon->need_update == 'Y'" class="update">
|
||||
{$lang->msg_avail_easy_update} <a href="{$addon->update_url}&return_url={urlencode(getRequestUriByServerEnviroment())}">{$lang->msg_do_you_like_update}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td class="nowr">{$addon->version}</td>
|
||||
<td class="nowr">
|
||||
<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 class="nowr">{$addon->path}</td>
|
||||
<td class="nowr"><a href="{getUrl('act', 'dispAddonAdminSetup', 'selected_addon', $addon->addon_name)}">{$lang->cmd_setup}</a></td>
|
||||
<td class="nowr"><input type="checkbox" name="pc_on[]" title="PC" value="{htmlspecialchars($addon->addon_name)}" checked="checked"|cond="$addon->activated" /></td>
|
||||
<td class="nowr"><input type="checkbox" name="mobile_on[]" title="Mobile" value="{htmlspecialchars($addon->addon_name)}" checked="checked"|cond="$addon->mactivated" /></td>
|
||||
<td class="nowr"><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>
|
||||
<table class="x_table x_table-striped x_table-hover dsTg">
|
||||
<caption>
|
||||
<strong>All({$addon_count})</strong>
|
||||
<div class="x_pull-right x_btn-group">
|
||||
<button type="button" class="x_btn x_active __simple">{$lang->simple_view}</button>
|
||||
<button type="button" class="x_btn __detail">{$lang->detail_view}</button>
|
||||
</div>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title">{$lang->addon_name}</th>
|
||||
<th class="nowr">{$lang->version}</th>
|
||||
<th class="nowr">{$lang->author}</th>
|
||||
<th class="nowr">{$lang->installed_path}</th>
|
||||
<th class="nowr">{$lang->cmd_setup}</th>
|
||||
<th class="nowr">PC</th>
|
||||
<th class="nowr">Mobile</th>
|
||||
<th class="nowr">{$lang->cmd_delete}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$addon_list => $addon">
|
||||
<td class="title">
|
||||
<p><strong>{$addon->title}</strong></p>
|
||||
<p>{$addon->description}</p>
|
||||
<p cond="$addon->need_update == 'Y'" class="update">
|
||||
{$lang->msg_avail_easy_update} <a href="{$addon->update_url}&return_url={urlencode(getRequestUriByServerEnviroment())}">{$lang->msg_do_you_like_update}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td>{$addon->version}</td>
|
||||
<td class="nowr">
|
||||
<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_on[]" title="PC" value="{htmlspecialchars($addon->addon_name)}" checked="checked"|cond="$addon->activated" /></td>
|
||||
<td><input type="checkbox" name="mobile_on[]" title="Mobile" value="{htmlspecialchars($addon->addon_name)}" checked="checked"|cond="$addon->mactivated" /></td>
|
||||
<td><a cond="$addon->remove_url" href="{$addon->remove_url}&return_url={urlencode(getRequestUriByServerEnviroment())}">{$lang->cmd_delete}</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="x_clearfix">
|
||||
<div class="x_pull-right">
|
||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,77 +1,114 @@
|
|||
<h1 class="h1">{$lang->installed_addons}</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>
|
||||
<li cond="$addon_info->license">{$lang->addon_license}: <a href="{$addon_info->license_link}"|cond="$addon_info->license_link" target="_blank">{$addon_info->license}</a></li>
|
||||
</ul>
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<div class="x_page-header">
|
||||
<h1>{$lang->installed_addons}</h1>
|
||||
</div>
|
||||
<h2>{$addon_info->title}</h2>
|
||||
<table class="x_table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="nowr">{$lang->version}</th>
|
||||
<td>{$addon_info->version} ({zdate($addon_info->date, 'Y-m-d')})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="nowr">{$lang->author}</th>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
<tr cond="$addon_info->homepage">
|
||||
<th class="nowr">{$lang->homepage}</th>
|
||||
<td><a href="{$addon_info->homepage}" target="_blank">{$addon_info->homepage}</a></td>
|
||||
</tr>
|
||||
<tr cond="$addon_info->license">
|
||||
<th class="nowr">{$lang->addon_license}</th>
|
||||
<td><a href="{$addon_info->license_link}"|cond="$addon_info->license_link" target="_blank">{$addon_info->license}</a></td>
|
||||
</tr>
|
||||
<tr cond="$addon_info->description">
|
||||
<th class="nowr">{$lang->description}</th>
|
||||
<td>{$addon_info->description}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/addon/tpl/setup_addon/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<form action="./" method="post" class="form">
|
||||
<form action="./" method="post" class="x_form-horizontal">
|
||||
<section class="section">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="procAddonAdminSetupAddon" />
|
||||
<input type="hidden" name="addon_name" value="{$addon_info->addon_name}" />
|
||||
<input type="hidden" name="xe_validator_id" value="modules/addon/tpl/setup_addon/1" />
|
||||
|
||||
<block cond="count($addon_info->extra_vars)">
|
||||
<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>
|
||||
<h2>{$var->group}</h2>
|
||||
{@$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">
|
||||
<div class="x_control-group" cond="!$not_first && $group != $var->group"></div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="{$var->name}"|cond="$var->type != 'textarea'" for="lang_{$var->name}"|cond="$var->type == 'textarea'">{$var->title}</label>
|
||||
<div class="x_controls">
|
||||
<input cond="$var->type == 'text'" type="text" name="{$var->name}" id="{$var->name}" value="{htmlspecialchars($var->value)}">
|
||||
<textarea cond="$var->type == 'textarea'" name="{$var->name}" id="{$var->name}" class="lang_code" rows="8" cols="42">{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>
|
||||
</p>
|
||||
<p class="desc">{nl2br($var->description)}</p>
|
||||
</li>
|
||||
<span class="x_help-inline">{nl2br($var->description)}</span>
|
||||
</div>
|
||||
</div>
|
||||
</block>
|
||||
</ul>
|
||||
</block>
|
||||
<div cond="!count($addon_info->extra_vars)" class="message info">
|
||||
<p>{$lang->msg_not_exist_option}</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<block cond="$mid_list">
|
||||
<h3 class="h3">{$lang->module}</h3>
|
||||
<p>{$lang->about_addon_mid}</p>
|
||||
<p class="q">{$lang->run_method}</p>
|
||||
<p class="a">
|
||||
<select name="xe_run_method">
|
||||
<option value="run_selected" selected="selected"|cond="$addon_info->xe_run_method === 'run_selected'">{$lang->run_selected_module}</option>
|
||||
<option value="no_run_selected" selected="selected"|cond="$addon_info->xe_run_method === 'no_run_selected'">{$lang->no_run_selected_module}</option>
|
||||
</select>
|
||||
</p>
|
||||
<p><input type="checkbox" id="check_all" /> <label for="check_all">Check all</label></p>
|
||||
<fieldset loop="$mid_list => $module_category_srl, $modules" style="border: 1px solid #ccc; margin:1em 0; padding:.5em 1em">
|
||||
<legend cond="$modules->title">{$modules->title}</legend>
|
||||
<legend cond="!$modules->title">{$lang->none_category}</legend>
|
||||
<div loop="$modules->list => $key, $val">
|
||||
<input type="checkbox" value="{$key}" name="mid_list[]" id="chk_mid_list_{$key}" checked="checked"|cond="in_array($key, $addon_info->mid_list)"/>
|
||||
<label for="chk_mid_list_{$key}">{$key} ({$val->browser_title})</label>
|
||||
<h1>{$lang->target}</h1>
|
||||
<div class="x_control-group">{$lang->about_addon_mid}</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->run_method}</label>
|
||||
<div class="x_controls">
|
||||
<select name="xe_run_method">
|
||||
<option value="run_selected" selected="selected"|cond="$addon_info->xe_run_method === 'run_selected'">{$lang->run_selected_module}</option>
|
||||
<option value="no_run_selected" selected="selected"|cond="$addon_info->xe_run_method === 'no_run_selected'">{$lang->no_run_selected_module}</option>
|
||||
</select>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->target}</label>
|
||||
<div class="x_controls">
|
||||
<label for="check_all"><input type="checkbox" id="check_all" /> Check all</label>
|
||||
<block loop="$mid_list => $module_category_srl, $modules">
|
||||
<!--@if(count($mid_list) > 1)-->
|
||||
<fieldset>
|
||||
<legend><!--@if($modules->title)-->{$modules->title}<!--@else-->{$lang->none_category}<!--@end--></legend>
|
||||
<!--@end-->
|
||||
<label loop="$modules->list => $key, $val">
|
||||
<input type="checkbox" value="{$key}" name="mid_list[]" id="chk_mid_list_{$key}" checked="checked"|cond="in_array($key, $addon_info->mid_list)"/>
|
||||
{$key} ({$val->browser_title})
|
||||
</label>
|
||||
<!--@if(count($mid_list) > 1)-->
|
||||
</fieldset>
|
||||
<!--@end-->
|
||||
</block>
|
||||
</div>
|
||||
</div>
|
||||
</block>
|
||||
<div class="btnArea">
|
||||
<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
<div class="x_clearfix btnArea">
|
||||
<div class="x_pull-right">
|
||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</block>
|
||||
<script type="text/javascript">
|
||||
</section>
|
||||
</form>
|
||||
<script>
|
||||
(function($){
|
||||
$('#check_all')
|
||||
.bind('click', function(e){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue