Close Connection when there is no connection value.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13161 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2013-09-25 15:29:32 +00:00
parent 034a5c0288
commit f70ce644ce
1410 changed files with 7188 additions and 53541 deletions

View file

@ -71,102 +71,6 @@ class addonController extends addon
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);
$mid_list[] = $mid;
$new_mid_list = array_unique($mid_list);
$this->_setMid($selected_addon, $new_mid_list, $site_srl);
}
/**
* 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
*

View file

@ -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>

View file

@ -1,13 +1,14 @@
<div class="x_page-header">
<h1>{$lang->installed_addons} <a class="x_icon-question-sign" href="./help/index.html#UMAN_advanced_installed_addon" target="_blank">{$lang->help}</a></h1>
<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" />
<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>
<table class="x_table x_table-striped x_table-hover dsTg">

View file

@ -30,7 +30,7 @@
</tr>
</tbody>
</table>
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<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="x_form-horizontal">
@ -38,6 +38,7 @@
<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">
@ -48,7 +49,7 @@
{@$not_first = true}
<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}">{$var->title}</label>
<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>