mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
issue 2662 coding convention in modules/addon
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12233 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7928ad163b
commit
da0146a8ae
5 changed files with 982 additions and 926 deletions
|
|
@ -1,93 +1,100 @@
|
|||
<?php
|
||||
/**
|
||||
* High class of addon modules
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
class addon extends ModuleObject {
|
||||
/**
|
||||
* 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');
|
||||
|
||||
/**
|
||||
* 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');
|
||||
$oAddonController->makeCacheFile(0);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
$oAddonController->makeCacheFile(0);
|
||||
return new Object();
|
||||
}
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
// 2011. 7. 29. add is_fixed column
|
||||
if(!$oDB->isColumnExists('addons', 'is_fixed')) return true;
|
||||
|
||||
// 2011. 7. 29. add is_fixed column
|
||||
if (!$oDB->isColumnExists('addons', 'is_fixed')) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
// 2011. 7. 29. add is_fixed column
|
||||
if (!$oDB->isColumnExists('addons', 'is_fixed'))
|
||||
// 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->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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue