29 $class_path = sprintf(
'./addons/%s/', $addon_name);
30 if(is_dir($class_path))
46 $oAutoinstallModel =
getModel(
'autoinstall');
47 foreach($addonList as $key => $addon)
50 $packageSrl = $oAutoinstallModel->getPackageSrlByPath($addon->path);
51 $addonList[$key]->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl);
54 $package = $oAutoinstallModel->getInstalledPackages($packageSrl);
55 $addonList[$key]->need_update = $package[$packageSrl]->need_update;
58 if($addonList[$key]->need_update ==
'Y')
60 $addonList[$key]->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
80 $searched_count = count($searched_list);
90 for($i = 0; $i < $searched_count; $i++)
93 $addon_name = $searched_list[$i];
94 if($addon_name ==
"smartphone")
103 if(!$info) $info =
new stdClass();
105 $info->addon = $addon_name;
107 $info->activated = FALSE;
108 $info->mactivated = FALSE;
109 $info->fixed = FALSE;
111 if(!in_array($addon_name, array_keys($inserted_addons)))
114 $oAddonAdminController->doInsert($addon_name, $site_srl, $type);
119 if($inserted_addons[$addon_name]->is_used ==
'Y')
121 $info->activated = TRUE;
123 if($inserted_addons[$addon_name]->is_used_m ==
'Y')
125 $info->mactivated = TRUE;
127 if($gtype ==
'global' && $inserted_addons[$addon_name]->is_fixed ==
'Y')
156 $xml_file = sprintf(
"%sconf/info.xml", FileHandler::getRealpath($addon_path));
157 if(!file_exists($xml_file))
163 $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
164 $xml_obj = $tmp_xml_obj->addon;
172 $db_args =
new stdClass();
173 $db_args->addon = $addon;
174 if($gtype ==
'global')
180 $db_args->site_srl = $site_srl;
183 $extra_vals = unserialize(
$output->data->extra_vars);
185 $addon_info =
new stdClass();
186 if($extra_vals->mid_list)
188 $addon_info->mid_list = $extra_vals->mid_list;
192 $addon_info->mid_list = array();
195 if($extra_vals->xe_run_method)
197 $addon_info->xe_run_method = $extra_vals->xe_run_method;
201 if($xml_obj->version && $xml_obj->attrs->version ==
'0.2')
204 $date_obj =
new stdClass();
205 sscanf($xml_obj->date->body,
'%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
206 $addon_info->date = sprintf(
'%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
208 $addon_info->addon_name = $addon;
209 $addon_info->title = $xml_obj->title->body;
210 $addon_info->description = trim($xml_obj->description->body);
211 $addon_info->version = $xml_obj->version->body;
212 $addon_info->homepage = $xml_obj->link->body;
213 $addon_info->license = $xml_obj->license->body;
214 $addon_info->license_link = $xml_obj->license->attrs->link;
216 if(!is_array($xml_obj->author))
218 $author_list = array();
219 $author_list[] = $xml_obj->author;
223 $author_list = $xml_obj->author;
226 $addon_info->author = array();
227 foreach($author_list as $author)
229 $author_obj =
new stdClass();
230 $author_obj->name = $author->name->body;
231 $author_obj->email_address = $author->attrs->email_address;
232 $author_obj->homepage = $author->attrs->link;
233 $addon_info->author[] = $author_obj;
237 if($xml_obj->extra_vars)
239 $extra_var_groups = $xml_obj->extra_vars->group;
240 if(!$extra_var_groups)
242 $extra_var_groups = $xml_obj->extra_vars;
244 if(!is_array($extra_var_groups))
246 $extra_var_groups = array($extra_var_groups);
249 foreach($extra_var_groups as $group)
252 if(!is_array($group->var))
264 $obj =
new stdClass();
267 $val->attrs =
new stdClass();
269 if(!$val->attrs->type)
271 $val->attrs->type =
'text';
274 $obj->group = $group->title->body;
275 $obj->name = $val->attrs->name;
276 $obj->title = $val->title->body;
277 $obj->type = $val->attrs->type;
278 $obj->description = $val->description->body;
281 $obj->value = $extra_vals->{
$obj->name};
283 if(strpos(
$obj->value,
'|@|') != FALSE)
285 $obj->value = explode(
'|@|',
$obj->value);
287 if(
$obj->type ==
'mid_list' && !is_array(
$obj->value))
293 if($val->options && !is_array($val->options))
295 $val->options = array($val->options);
298 for($i = 0, $c = count($val->options); $i < $c; $i++)
300 $obj->options[$i] =
new stdClass();
301 $obj->options[$i]->title = $val->options[$i]->title->body;
302 $obj->options[$i]->value = $val->options[$i]->attrs->value;
305 $addon_info->extra_vars[] =
$obj;
313 $addon_info =
new stdClass();
314 $addon_info->addon_name = $addon;
315 $addon_info->title = $xml_obj->title->body;
316 $addon_info->description = trim($xml_obj->author->description->body);
317 $addon_info->version = $xml_obj->attrs->version;
319 $date_obj =
new stdClass();
320 sscanf($xml_obj->author->attrs->date,
'%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
321 $addon_info->date = sprintf(
'%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
323 $author_obj =
new stdClass();
324 $author_obj->name = $xml_obj->author->name->body;
325 $author_obj->email_address = $xml_obj->author->attrs->email_address;
326 $author_obj->homepage = $xml_obj->author->attrs->link;
328 $addon_info->author = array();
329 $addon_info->author[] = $author_obj;
331 if($xml_obj->extra_vars)
334 $extra_var_groups = $xml_obj->extra_vars->group;
335 if(!$extra_var_groups)
337 $extra_var_groups = $xml_obj->extra_vars;
339 if(!is_array($extra_var_groups))
341 $extra_var_groups = array($extra_var_groups);
343 foreach($extra_var_groups as $group)
346 if(!is_array($group->var))
351 $addon_info->extra_vars = array();
359 $obj =
new stdClass();
361 $obj->group = $group->title->body;
362 $obj->name = $val->attrs->name;
363 $obj->title = $val->title->body;
364 $obj->type = $val->type->body ? $val->type->body :
'text';
365 $obj->description = $val->description->body;
368 $obj->value = $extra_vals->{
$obj->name};
370 if(strpos(
$obj->value,
'|@|') !=
false)
372 $obj->value = explode(
'|@|',
$obj->value);
374 if(
$obj->type ==
'mid_list' && !is_array(
$obj->value))
379 if($val->options && !is_array($val->options))
381 $val->options = array($val->options);
384 $obj->options = array();
385 for($i = 0, $c = count($val->options); $i < $c; $i++)
387 $obj->options[$i]->title = $val->options[$i]->title->body;
388 $obj->options[$i]->value = $val->options[$i]->value->body;
390 $addon_info->extra_vars[] =
$obj;
407 $args =
new stdClass();
408 $args->list_order =
'addon';
409 if($gtype ==
'global')
415 $args->site_srl = $site_srl;
423 $activated_count = count(
$output->data);
424 $addon_list = array();
425 for($i = 0; $i < $activated_count; $i++)
428 $addon_list[$addon->addon] = $addon;
444 $args =
new stdClass();
445 $args->addon = $addon;
446 if($gtype ==
'global')
459 $args->site_srl = $site_srl;
foreach($sitemap as $id=> &$val) $extra_vars
getAddonListForSuperAdmin()
getAddonList($site_srl=0, $gtype= 'site')
getAddonInfoXml($addon, $site_srl=0, $gtype= 'site')
getAddonPath($addon_name)
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
getAdminController($module_name)
readDir($path, $filter= '', $to_lower=FALSE, $concat_prefix=FALSE)
getInsertedAddons($site_srl=0, $gtype= 'site')
isActivatedAddon($addon, $site_srl=0, $type="pc", $gtype= 'site')
executeQuery($query_id, $args=NULL, $arg_columns=NULL)