Esempio n. 1
0
function home()
{
    $out = "there is actually no content. enable content module to manage this page";
    if (module_manager::is_enabled("content")) {
        $out = "";
        $nodes = content_database::node_load_all();
        $b = false;
        if (count($nodes) > 0) {
            page::title("Home");
            foreach ($nodes as $node) {
                if (content::node_access_read($node->nid)) {
                    $b = true;
                    $out .= "<div class='post'>";
                    if ($node->title != null) {
                        $out .= "<div class='title'>";
                        $out .= page::link("node/" . $node->nid, $node->title);
                        $out .= "</div>";
                    }
                    if ($node->description != null) {
                        $out .= "<div class='content'>";
                        $node->description = utf8_decode($node->description);
                        if (strlen($node->description) > 200) {
                            $out .= substr($node->description, 0, 200) . "... " . page::link("node/" . $node->nid, t("+ read more"));
                        } else {
                            $out .= $node->description;
                        }
                        $out .= "</div>";
                    }
                    $out .= "<div class='author'>";
                    $out .= "<hr/>";
                    $out .= content_page::post_author_date($node->uid, $node->author, $node->date);
                    $out .= "<hr/>";
                    $out .= "</div>";
                    $out .= "</div>";
                }
            }
        } else {
            $out .= "there is no content, please add a content first.";
        }
    }
    return $b ? $out : "there is no content.";
}
<?php

/**
 * Module Manager
 * @Version: 
 * @Authour: yellow1912
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */
require 'includes/application_top.php';
require_once DIR_WS_CLASSES . 'module_manager.php';
$module_manager = new module_manager();
$yclass = new yclass();
$yclass->init_template();
$yclass->init_validation();
$ytemplate = new ytemplate();
$ytemplate->admin_set_base();
$ytemplate->build_name();
$ytemplate->zen_admin_set_path();
switch ($_GET['action']) {
    case 'list_modules':
        $modules = $module_manager->list_modules();
        $ytemplate->set('modules', $modules);
        break;
    case 'update_module':
        $module_manager->update_module($_GET['ID']);
        $ytemplate->set_name('tpl_index.php');
        break;
    case 'install_modules':
        $modules = $module_manager->list_modules();
        $installed_modules = array();
        if (is_array($modules)) {
Esempio n. 3
0
 public static function theme_blocks($position)
 {
     if (module_manager::is_enabled("blocks")) {
         $path = page::clean_path();
         $blocks = blocks::get_blocks_by_path($path, $position);
         $out = "";
         foreach ($blocks as $b) {
             $out .= blocks::invoke_block($b);
         }
         return $out;
     } else {
         return " ";
     }
 }
Esempio n. 4
0
function system_update_cache()
{
    permission::update_list();
    module_manager::scan_and_update_list();
    theme::scan_theme_folder();
}
Esempio n. 5
0
 public static function page_list_modules()
 {
     page::title("Modules");
     $res = array();
     $head = array("module", "action");
     $modules = module_manager::list_of_declared_modules();
     foreach ($modules as $module) {
         $b = array();
         $b[0] = $module->module_name;
         $b[1] = "";
         if ($module->module_installed && !$module->module_enabled) {
             $b[1] .= page::link("admin/modules/" . $module->module_name . "/enable", "Enable");
             $b[1] .= " / ";
             $b[1] .= page::link("admin/modules/" . $module->module_name . "/uninstall", "Uninstall");
         }
         if ($module->module_installed && $module->module_enabled) {
             $b[1] .= page::link("admin/modules/" . $module->module_name . "/disable", "disable");
         }
         if (!$module->module_installed) {
             $b[1] .= page::link("admin/modules/" . $module->module_name . "/install", "install");
         }
         $res[] = $b;
     }
     $str = '  <a href="' . page::url("admin/modules/scan") . '">Scan for more modules</a><br/>';
     $str .= theme::t_table($res, $head);
     return $str;
 }