mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
issue 2368, issue 2372, added new apis on easyinstall
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11213 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4139647b07
commit
ba47c3ea18
2 changed files with 162 additions and 0 deletions
159
modules/autoinstall/autoinstall.admin.model.php
Normal file
159
modules/autoinstall/autoinstall.admin.model.php
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
<?php
|
||||
/**
|
||||
* Model class of the autoinstall module
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
**/
|
||||
class autoinstallAdminModel extends autoinstall {
|
||||
|
||||
var $layout_category_srl = 18322954;
|
||||
var $mobile_layout_category_srl = 18994172;
|
||||
var $module_skin_category_srl = 18322943;
|
||||
var $module_mobile_skin_category_srl = 18994170;
|
||||
|
||||
/**
|
||||
* Pre process parameters
|
||||
*/
|
||||
function preProcParam(&$order_target, &$order_type, &$page)
|
||||
{
|
||||
$order_target_array = array('newest' => 1, 'download' => 1, 'popular' => 1);
|
||||
if(!isset($order_target_array[$order_target]))
|
||||
{
|
||||
$order_target = 'newest';
|
||||
}
|
||||
|
||||
$order_type_array = array('asc' => 1, 'desc' => 1);
|
||||
if(!isset($order_type_array[$order_type]))
|
||||
{
|
||||
$order_type = 'desc';
|
||||
}
|
||||
|
||||
$page = (int)$page;
|
||||
if($page < 1)
|
||||
{
|
||||
$page = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of package that can have instance
|
||||
*/
|
||||
function getAutoinstallAdminMenuPackageList()
|
||||
{
|
||||
$search_keyword = Context::get('search_keyword');
|
||||
$order_target = Context::get('order_target');
|
||||
$order_type = Context::get('order_type');
|
||||
$page = Context::get('page');
|
||||
|
||||
$this->preProcParam($order_target, $order_type, $page);
|
||||
$this->getPackageList('menu', $order_target, $order_type, $page, $search_keyword);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of layout package
|
||||
*/
|
||||
function getAutoinstallAdminLayoutPackageList()
|
||||
{
|
||||
$search_keyword = Context::get('search_keyword');
|
||||
$order_target = Context::get('order_target');
|
||||
$order_type = Context::get('order_type');
|
||||
$page = Context::get('page');
|
||||
|
||||
$type_array = array('M' => 1, 'P' => 1);
|
||||
$type = Context::get('type');
|
||||
if(!isset($type_array[$type]))
|
||||
{
|
||||
$type = 'P';
|
||||
}
|
||||
|
||||
if($type == 'P')
|
||||
{
|
||||
$category_srl = $this->layout_category_srl;
|
||||
}
|
||||
else
|
||||
{
|
||||
$category_srl = $this->mobile_layout_category_srl;
|
||||
}
|
||||
|
||||
$this->preProcParam($order_target, $order_type, $page);
|
||||
$this->getPackageList('layout', $order_target, $order_type, $page, $search_keyword, $category_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of module skin package
|
||||
*/
|
||||
function getAutoinstallAdminSkinPackageList()
|
||||
{
|
||||
Context::setRequestMethod('JSON');
|
||||
$search_keyword = Context::get('search_keyword');
|
||||
$order_target = Context::get('order_target');
|
||||
$order_type = Context::get('order_type');
|
||||
$page = Context::get('page');
|
||||
$parent_program = Context::get('parent_program');
|
||||
|
||||
$type_array = array('M' => 1, 'P' => 1);
|
||||
$type = Context::get('type');
|
||||
if(!isset($type_array[$type]))
|
||||
{
|
||||
$type = 'P';
|
||||
}
|
||||
|
||||
if($type == 'P')
|
||||
{
|
||||
$category_srl = $this->module_skin_category_srl;
|
||||
}
|
||||
else
|
||||
{
|
||||
$category_srl = $this->module_mobile_skin_category_srl;
|
||||
}
|
||||
|
||||
$this->preProcParam($order_target, $order_type, $page);
|
||||
$this->getPackageList('skin', $order_target, $order_type, $page, $search_keyword, $category_srl, $parent_program);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Package List
|
||||
*/
|
||||
function getPackageList($type, $order_target = 'newest', $order_type = 'desc', $page = '1', $search_keyword = NULL, $category_srl = NULL, $parent_program = NULL)
|
||||
{
|
||||
if($type == 'menu')
|
||||
{
|
||||
$params["act"] = "getResourceapiMenuPackageList";
|
||||
}
|
||||
elseif($type == 'skin')
|
||||
{
|
||||
$params["act"] = "getResourceapiSkinPackageList";
|
||||
$params['parent_program'] = $parent_program;
|
||||
}
|
||||
else
|
||||
{
|
||||
$params["act"] = "getResourceapiPackagelist";
|
||||
}
|
||||
|
||||
$oAdminView = getAdminView('autoinstall');
|
||||
$params["order_target"] = $order_target;
|
||||
$params["order_type"] = $order_type;
|
||||
$params["page"] = $page;
|
||||
|
||||
if($category_srl)
|
||||
{
|
||||
$params["category_srl"] = $category_srl;
|
||||
}
|
||||
|
||||
if($search_keyword)
|
||||
{
|
||||
$params["search_keyword"] = $search_keyword;
|
||||
}
|
||||
|
||||
$xmlDoc = XmlGenerater::getXmlDoc($params);
|
||||
if($xmlDoc && $xmlDoc->response->packagelist->item)
|
||||
{
|
||||
$item_list = $oAdminView->rearranges($xmlDoc->response->packagelist->item);
|
||||
$this->add('item_list', $item_list);
|
||||
$array = array('total_count', 'total_page', 'cur_page', 'page_count', 'first_page', 'last_page');
|
||||
$page_nav = $oAdminView->rearrange($xmlDoc->response->page_navigation, $array);
|
||||
$page_navigation = new PageHandler($page_nav->total_count, $page_nav->total_page, $page_nav->cur_page, 5);
|
||||
$this->add('page_navigation', $page_navigation);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -8,6 +8,9 @@
|
|||
<action name="dispAutoinstallAdminIndex" type="view" standalone="true" admin_index="true" menu_name="easyInstall" menu_index="true" />
|
||||
<action name="procAutoinstallAdminUpdateinfo" type="controller" standalone="true" />
|
||||
<action name="procAutoinstallAdminPackageinstall" type="controller" standalone="true" ruleset="ftp" />
|
||||
<action name="getAutoinstallAdminMenuPackageList" type="model" />
|
||||
<action name="getAutoinstallAdminLayoutPackageList" type="model" />
|
||||
<action name="getAutoinstallAdminSkinPackageList" type="model" />
|
||||
</actions>
|
||||
<menus>
|
||||
<menu name="easyInstall">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue