21 $order_target_array = array(
'newest' => 1,
'download' => 1,
'popular' => 1);
22 if(!isset($order_target_array[$order_target]))
24 $order_target =
'newest';
27 $order_type_array = array(
'asc' => 1,
'desc' => 1);
28 if(!isset($order_type_array[$order_type]))
51 $this->
getPackageList(
'menu', $order_target, $order_type, $page, $search_keyword);
64 $type_array = array(
'M' => 1,
'P' => 1);
66 if(!isset($type_array[$type]))
81 $this->
getPackageList(
'layout', $order_target, $order_type, $page, $search_keyword, $category_srl);
96 $type_array = array(
'M' => 1,
'P' => 1);
98 if(!isset($type_array[$type]))
113 $this->
getPackageList(
'skin', $order_target, $order_type, $page, $search_keyword, $category_srl, $parent_program);
119 function getPackageList($type, $order_target =
'newest', $order_type =
'desc', $page =
'1', $search_keyword = NULL, $category_srl = NULL, $parent_program = NULL)
123 $params[
"act"] =
"getResourceapiMenuPackageList";
125 elseif($type ==
'skin')
127 $params[
"act"] =
"getResourceapiSkinPackageList";
128 $params[
'parent_program'] = $parent_program;
132 $params[
"act"] =
"getResourceapiPackagelist";
136 $params[
"order_target"] = $order_target;
137 $params[
"order_type"] = $order_type;
138 $params[
"page"] = $page;
142 $params[
"category_srl"] = $category_srl;
147 $params[
"search_keyword"] = $search_keyword;
151 if($xmlDoc && $xmlDoc->response->packagelist->item)
153 $item_list = $oAdminView->rearranges($xmlDoc->response->packagelist->item);
154 $this->
add(
'item_list', $item_list);
155 $array = array(
'total_count',
'total_page',
'cur_page',
'page_count',
'first_page',
'last_page');
156 $page_nav = $oAdminView->rearrange($xmlDoc->response->page_navigation, $array);
157 $page_navigation =
new PageHandler($page_nav->total_count, $page_nav->total_page, $page_nav->cur_page, 5);
158 $this->
add(
'page_navigation', $page_navigation);
168 $package = $oAdminModel->getInstallInfo(
Context::get(
'package_srl'));
171 $output = $oAdminModel->checkUseDirectModuleInstall($package);
179 if(!$ftp_info->ftp_root_path)
185 $is_authed = (int) isset($_SESSION[
'ftp_password']);
189 $this->
add(
'is_authed', $is_authed);
206 foreach(
$output->data as $package)
208 $packageSrl = $package->package_srl;
210 $packageInfo =
new stdClass();
211 $packageInfo->currentVersion = $package->current_version;
212 $packageInfo->version = $package->version;
213 $packageInfo->type = $oModel->getTypeFromPath($package->path);
214 $packageInfo->url = $oModel->getUpdateUrlByPackageSrl($package->package_srl);
216 if($packageInfo->type ==
'core')
218 $title =
'XpressEngine';
222 $configFile = $oModel->getConfigFilePath($packageInfo->type);
227 $type = $packageInfo->type;
228 if($type ==
"drcomponent")
232 if($type ==
"style" || $type ==
"m.skin")
236 if($type ==
"m.layout")
240 $title = $xmlDoc->{$type}->title->body;
244 $pathInfo = explode(
'/', $package->path);
245 $title = $pathInfo[count($pathInfo) - 1];
248 $packageInfo->title = $title;
250 $result[] = $packageInfo;
264 $params[
"act"] =
"getResourceapiInstallInfo";
265 $params[
"package_srl"] = $packageSrl;
269 $targetpackages = array();
272 $xmlPackage = $xmlDoc->response->package;
273 $package =
new stdClass();
274 $package->package_srl = $xmlPackage->package_srl->body;
275 $package->title = $xmlPackage->title->body;
276 $package->package_description = $xmlPackage->package_description->body;
277 $package->version = $xmlPackage->version->body;
278 $package->path = $xmlPackage->path->body;
279 if($xmlPackage->depends)
281 if(!is_array($xmlPackage->depends->item))
283 $xmlPackage->depends->item = array($xmlPackage->depends->item);
286 $package->depends = array();
287 foreach($xmlPackage->depends->item as $item)
289 $dep_item =
new stdClass();
290 $dep_item->package_srl = $item->package_srl->body;
291 $dep_item->title = $item->title->body;
292 $dep_item->version = $item->version->body;
293 $dep_item->path = $item->path->body;
294 $package->depends[] = $dep_item;
295 $targetpackages[$dep_item->package_srl] = 1;
298 $packages = $oModel->getInstalledPackages(array_keys($targetpackages));
299 $package->deplist =
"";
300 foreach($package->depends as $key => $dep)
302 if(!$packages[$dep->package_srl])
304 $package->depends[$key]->installed = FALSE;
305 $package->package_srl .=
"," . $dep->package_srl;
309 $package->depends[$key]->installed = TRUE;
310 $package->depends[$key]->cur_version = $packages[$dep->package_srl]->current_version;
311 if(version_compare($dep->version, $packages[$dep->package_srl]->current_version,
">"))
313 $package->depends[$key]->need_update = TRUE;
314 $package->package_srl .=
"," . $dep->package_srl;
316 if($dep->path ===
'.')
318 $package->contain_core = TRUE;
319 $package->contain_core_version = $dep->version;
324 $package->need_update = FALSE;
330 $installedPackage = $oModel->getInstalledPackage($packageSrl);
331 if($installedPackage)
333 $package->installed = TRUE;
334 $package->cur_version = $installedPackage->current_version;
335 $package->need_update = version_compare($package->version, $installedPackage->current_version,
">");
350 return new BaseObject(-1,
'msg_invalid_request');
353 $package = $this->getInstallInfo($packageSrl);
354 $this->add(
'package', $package);
359 $directModuleInstall = TRUE;
360 $arrUnwritableDir = array();
361 $output = $this->isWritableDir($package->path);
364 $directModuleInstall = FALSE;
365 $arrUnwritableDir[] =
$output->get(
'path');
368 foreach($package->depends as $dep)
370 $output = $this->isWritableDir($dep->path);
373 $directModuleInstall = FALSE;
374 $arrUnwritableDir[] =
$output->get(
'path');
378 if($directModuleInstall==FALSE)
381 $output->add(
'path', $arrUnwritableDir);
390 $path_list = explode(
'/', dirname($path));
395 $check_path = realpath($real_path . implode(
'/', $path_list));
400 array_pop($path_list);
$mobile_layout_category_srl
getPackageList($type, $order_target= 'newest', $order_type= 'desc', $page= '1', $search_keyword=NULL, $category_srl=NULL, $parent_program=NULL)
setRequestMethod($type= '')
getAutoInstallAdminInstallInfo()
$module_skin_category_srl
getAutoinstallAdminLayoutPackageList()
preProcParam(&$order_target, &$order_type, &$page)
checkUseDirectModuleInstall($package)
getInstallInfo($packageSrl)
getAutoinstallAdminIsAuthed()
getAdminModel($module_name)
getAutoinstallAdminMenuPackageList()
$module_mobile_skin_category_srl
getAutoinstallAdminSkinPackageList()
getAdminView($module_name)
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)