Exemplo n.º 1
0
 function view()
 {
     $array = files::listDir(SYS_ROOT . 'tmpls/' . ADMIN_SITE);
     $i = 0;
     if ($array) {
         foreach ($array as $k => $v) {
             if ($v && is_array($v)) {
                 s::roll('templates', array('app' => $k));
                 $z = 0;
                 foreach ($v as $f) {
                     $z++;
                     $i++;
                     s::roll('templates' . $k, array('sindex' => $i, 'iclass' => string::stroke($z), 'file' => $f));
                 }
             }
         }
     }
     if ($i == 0) {
         s::section('no_data');
     } else {
         s::section('yes_data');
     }
 }
Exemplo n.º 2
0
 function view()
 {
     events::observe('clear_pages_versions', 'system', 'base', 'clear_pages_versions');
     events::observe('clear_templates_versions', 'system', 'base', 'clear_templates_versions');
     events::observe('delete_dump', 'system', 'base', 'delete_dump');
     events::observe('restore', 'system', 'base', 'restore');
     events::observe('reserve', 'system', 'base', 'reserve');
     events::observe('optimize', 'system', 'base', 'optimize');
     events::observe('repair', 'system', 'base', 'repair');
     events::observer();
     $sql = "SHOW TABLE STATUS";
     $res = db::query($sql);
     $data_length = 0;
     while ($row = mysql_fetch_array($res)) {
         $vol = $row['Data_length'] + $row['Index_length'];
         $data_length += $vol;
     }
     if ($data_length > 1000000) {
         s::set('base_volume', round($data_length / 1000000, 2) . ' MB');
     } else {
         s::set('base_volume', round($data_length / 1024, 2) . ' KB');
     }
     if ($data_length > 1000000) {
         s::set('base_damp_need', round($data_length / 1000000 / 4.6) . ' MB');
     } else {
         s::set('base_damp_need', round($data_length / 1024 / 4.6) . ' KB');
     }
     $files = files::listDir(SYS_ROOT . 'var/backup/');
     if (count($files)) {
         foreach ($files as $v) {
             s::roll('restore_files', array('value' => $v, 'file' => $v));
         }
     } else {
         s::roll('restore_files', array('value' => 0, 'file' => 'нет файла'), 0);
     }
 }