public function testGetAllTemplates() { $templates = site_templates(); $this->assertTrue(!empty($templates), true); $this->assertTrue(!empty($templates[0]), true); $this->assertTrue(isset($templates[0]['name']), true); $this->assertTrue(isset($templates[0]['dir_name']), true); }
private function collect_local_data() { $data = array(); $data['php_version'] = phpversion(); $data['mw_version'] = MW_VERSION; $data['mw_update_check_site'] = $this->app->url_manager->site(); $t = site_templates(); $data['templates'] = $t; $t = $this->app->modules->get("ui=any&no_limit=true"); $modules = array(); $data['module_templates'] = array(); if (is_array($t)) { foreach ($t as $value) { if (isset($value['module']) and isset($value['version'])) { $mod = array('module' => $value['module'], 'version' => $value['version']); $modules[] = $mod; $module_templates = $this->app->modules->templates($value['module']); $mod_tpls = array(); if (is_array($module_templates)) { foreach ($module_templates as $key1 => $value1) { if (isset($value1['filename'])) { $options = array(); if ($this->skip_cache) { $options['no_cache'] = 1; } $options['for_modules'] = 1; $options['filename'] = $value1['filename']; $module_templates_for_this = $this->app->layouts_manager->scan($options); if (isset($module_templates_for_this[0]) and is_array($module_templates_for_this[0])) { $mod_tpls[$key1] = $module_templates_for_this[0]; } } } if (!empty($mod_tpls)) { $data['module_templates'][$value['module']] = $mod_tpls; } } } } } $data['modules'] = $modules; if ($this->skip_cache) { $t = $this->app->modules->scan_for_elements("skip_cache=1"); } else { $t = $this->app->modules->scan_for_elements(); } $elements = array(); if (is_array($t)) { foreach ($t as $value) { if (isset($value['module']) and isset($value['version'])) { $mod = array('module' => $value['module'], 'version' => $value['version']); $elements[] = $mod; } } } $data['elements'] = $elements; return $data; }
if (isset($data['table_prefix']) == true and isset($data['table_prefix']) != '' and trim($data['table_prefix']) != '{table_prefix}') { ?> value="<?php print $data['table_prefix']; ?> " <?php } ?> onblur="prefix_add(this)"/> </div> <?php $templates = site_templates(); ?> <?php if (is_array($templates) and !empty($templates)) { ?> <div class="mw-ui-field-holder"> <label class="mw-ui-label"> <?php print "Template"; ?> <span data-help="<?php print "Choose default site template"; ?> "><span class="mw-icon-help-outline mwahi tip"></span></span></label>