static function uninstall_templates() { $templates = self::get_templates(); if (sizeof($templates) > 0) { foreach ($templates as $key => $value) { $template = self::get_template($key); if ($template) { if (!MExtension::check_extension('template', $template->name)) { $template->delete(); } } } } }
static function uninstall_modules() { $modules = self::get_modules(); if (sizeof($modules) > 0) { foreach ($modules as $key => $value) { $mod = self::get_module($key); if ($mod) { if (!MExtension::check_extension('module', $mod->name)) { $mod->delete(); } } } } }
static function uninstall_widgets() { $widgets = self::get_widgets(); print "Widgets:<br />"; print_r($widgets); if (sizeof($widgets) > 0) { foreach ($widgets as $key => $value) { $wid = self::get_widget($key); if ($wid) { if (!MExtension::check_extension('widget', $wid->name)) { $wid->delete(); } } } } }
$module->text .= '<div>Status: <code>Missing</code></div>'; } elseif (1 == $module->enabled) { $module->text .= '<div>Status: <code class="green">Enabled</code></div>'; } else { $module->text .= '<div>Status: <code>Disabled</code></div>'; } if (isset($module->description)) { $module->text .= '<div><p> </p><p>' . $module->description . '</p></div>'; } } } } $forinstalls = array(); if (is_array($data['forinstall']) && sizeof($data['forinstall']) > 0) { foreach ($data['forinstall'] as $module) { $markdown = MExtension::markdown('module', $module); if ($markdown && isset($markdown['title'])) { $forinstall = new stdClass(); $forinstall->name = $module; $forinstall->title = $markdown['title']; $forinstall->text = ''; if (isset($markdown['version'])) { $forinstall->text .= '<div>Version: <code class="green">' . $markdown['version'] . '</code></div>'; } if (isset($markdown['description'])) { $forinstall->text .= '<div><p> </p><p>' . $markdown['description'] . '</p></div>'; } $forinstalls[] = $forinstall; } } }
$widget->text .= '<div>Status: <code>Missing</code></div>'; } elseif (1 == $widget->enabled) { $widget->text .= '<div>Status: <code class="green">Enabled</code></div>'; } else { $widget->text .= '<div>Status: <code>Disabled</code></div>'; } if (isset($widget->description)) { $widget->text .= '<div><p> </p><p>' . $widget->description . '</p></div>'; } } } } $forinstalls = array(); if (is_array($data['forinstall']) && sizeof($data['forinstall']) > 0) { foreach ($data['forinstall'] as $widget) { $markdown = MExtension::markdown('widget', $widget); if ($markdown && isset($markdown['title'])) { $forinstall = new stdClass(); $forinstall->name = $widget; $forinstall->title = $markdown['title']; $forinstall->text = ''; if (isset($markdown['version'])) { $forinstall->text .= '<div>Version: <code class="green">' . $markdown['version'] . '</code></div>'; } if (isset($markdown['description'])) { $forinstall->text .= '<div><p> </p><p>' . $markdown['description'] . '</p></div>'; } $forinstalls[] = $forinstall; } } }
} $template->text .= '</div>'; $template->text .= '<div style="clear: both;"></div>'; } } } $forinstalls = array(); if (is_array($data['forinstall']) && sizeof($data['forinstall']) > 0) { foreach ($data['forinstall'] as $template) { $markdown = MExtension::markdown('template', $template); if ($markdown && isset($markdown['title'])) { $forinstall = new stdClass(); $forinstall->name = $template; $forinstall->title = $markdown['title']; $forinstall->text = ''; $forinstall->text .= '<div style="float: left; margin-top: 12px; margin-bottom: 12px;"><img class="media-object" style="height: 120px; width: 180px;" src="../' . MExtension::thumbnail($forinstall->name) . '" alt="" /></div>'; $forinstall->text .= '<div style="float: left; margin-top: 12px; margin-left: 12px;">'; if (isset($markdown['version'])) { $forinstall->text .= '<div>Version: <code class="green">' . $markdown['version'] . '</code></div>'; } if (isset($markdown['description'])) { $forinstall->text .= '<div><p> </p><p>' . $markdown['description'] . '</p></div>'; } $forinstall->text .= '</div>'; $forinstall->text .= '<div style="clear: both;"></div>'; $forinstalls[] = $forinstall; } } } ?>