示例#1
0
 /**
  * @ignore
  */
 public static function init()
 {
     self::gatherConsoleData();
     self::gatherFileData();
     self::gatherMemoryData();
     self::gatherQueryData();
     self::gatherTimeData();
     Views::viewFile('{core}views/pqp/display.php', self::$output);
 }
示例#2
0
?>
" class="prev" />
						<input type="text" class="pagedisplay" readonly="readonly" />
						<img src="<?php 
echo Http::url('scabbia-assets/jquery.tablesorter/images/next.png');
?>
" class="next" />
						<img src="<?php 
echo Http::url('scabbia-assets/jquery.tablesorter/images/last.png');
?>
" class="last" />
						<select class="pagesize">
							<option value="10">10</option>
							<option selected="selected" value="25">25</option>
							<option value="50">50</option>
							<option value="100">100</option>
						</select>
					</form>
				</div>

			</div>
			<div class="bottomLine"></div>
			<div class="clear"></div>
		</td>
		<td id="pageMiddleExtra">
		</td>
	</tr>
</table>
<?php 
Views::viewFile('{core}views/panel/footer.php');
示例#3
0
 /**
  * @ignore
  *
  * @throws \Exception
  */
 public static function getDirectory($uSelectedDirectory, $uSubPath)
 {
     $tPath = rtrim(Io::translatePath($uSelectedDirectory['path']), '/');
     foreach (explode('/', ltrim($uSubPath, '/')) as $tSubDirectory) {
         if (strlen($tSubDirectory) === 0 || $tSubDirectory[0] === '.') {
             break;
         }
         $tPath .= '/' . $tSubDirectory;
     }
     if (!file_exists($tPath)) {
         throw new \Exception('asset not found.');
     }
     if (isset($uSelectedDirectory['autoViewer/defaultPage'])) {
         if (is_dir($tPath)) {
             $tPath = rtrim($tPath, '/') . '/' . $uSelectedDirectory['autoViewer/defaultPage'];
         }
         if (isset($uSelectedDirectory['autoViewer/header'])) {
             Views::viewFile($uSelectedDirectory['autoViewer/header']);
         }
         Views::viewFile($tPath);
         if (isset($uSelectedDirectory['autoViewer/footer'])) {
             Views::viewFile($uSelectedDirectory['autoViewer/footer']);
         }
         return true;
     }
     if (is_dir($tPath)) {
         return false;
     }
     header('Content-Type: ' . Mime::getType(pathinfo($tPath, PATHINFO_EXTENSION)), true);
     header('Content-Transfer-Encoding: binary', true);
     // header('ETag: "' . md5_file($tPath) . '"', true);
     readfile($tPath);
     return true;
 }
示例#4
0
 /**
  * @ignore
  */
 public static function index()
 {
     Auth::checkRedirect('user');
     $tVariables = array('message' => 'test');
     Views::viewFile('{app}views/admin/test/index.cshtml', $tVariables);
 }
示例#5
0
            <div class="block_head">
                <h2><?php 
echo I18n::_(Config::get('panel/loginTitle', 'Scabbia: Panel Login'));
?>
</h2>
            </div>

            <div class="block_content">
                <form method="POST" action="<?php 
echo Http::url('panel/' . Panel::LOGIN_MODULE_INDEX);
?>
">
                    <fieldset>
                        <div class="indent">
                            <?php 
Views::viewFile('{core}views/panel/sectionError.php');
?>

                            <label for="username"><?php 
echo I18n::_('Username:'******'Password:');
?>
</label>
示例#6
0
 /**
  * @ignore
  */
 public static function edit($uAction, $uSlug)
 {
     Auth::checkRedirect('editor');
     $tModule = AutoModels::get(Panel::$module);
     $tViewbag = array('module' => $tModule, 'fields' => array());
     if (Request::$method === 'post') {
         //! todo: validations
         Validation::addRule('name')->isRequired()->errorMessage('Name shouldn\'t be blank.');
         // Validation::addRule('slug')->isRequired()->errorMessage('Slug shouldn\'t be blank.');
         if (Validation::validate($_POST)) {
             $tSlug = Request::post('slug', "");
             if (strlen(rtrim($tSlug)) === 0) {
                 $tSlug = Request::post('name', "");
             }
             $tInput = array('type' => Request::post('type'), 'name' => Request::post('name'), 'slug' => String::slug(String::removeAccent($tSlug)));
             $tAutoModel = new AutoModel('categories');
             $tAutoModel->update($uSlug, $tInput);
             Session::set('notification', array('info', 'ok-sign', 'Record modified.'));
             Http::redirect('panel/categories');
             return;
         }
         Session::set('notification', array('error', 'remove-sign', Validation::getErrorMessages(true)));
         foreach ($tModule['fieldList'] as $tField) {
             $tIsView = array_key_exists('view', $tField['methods']);
             $tIsEdit = array_key_exists('edit', $tField['methods']);
             if ($tIsView || $tIsEdit) {
                 if ($tField['type'] === 'enum') {
                     $tTypes = array();
                     foreach ($tField['valueList'] as $tValue) {
                         $tTypes[$tValue['name']] = $tValue['title'];
                     }
                     $tAttributes = array('name' => $tField['name'], 'class' => 'input-block-level input_' . $tField['type']);
                     if (!$tIsEdit) {
                         $tAttributes['readonly'] = 'readonly';
                     }
                     $tTag = '<p>' . I18n::_($tField['title']) . ': ' . Html::tag('select', $tAttributes, Html::selectOptions($tTypes, Request::post($tField['name'], null))) . '</p>';
                 } else {
                     $tAttributes = array('type' => 'text', 'name' => $tField['name'], 'value' => Request::post($tField['name'], ""), 'class' => 'input-block-level input_' . $tField['type']);
                     if (!$tIsEdit) {
                         $tAttributes['readonly'] = 'readonly';
                     }
                     $tTag = '<p>' . I18n::_($tField['title']) . ': ' . Html::tag('input', $tAttributes) . '</p>';
                 }
             }
             $tViewbag['fields'][] = array('data' => $tField, 'html' => $tTag);
         }
         Views::viewFile('{core}views/panel/models/form.php', $tViewbag);
         return;
     }
     $tAutoModel = new AutoModel('categories');
     $tCategory = $tAutoModel->getBySlug($tModule['name'], $uSlug);
     foreach ($tModule['fieldList'] as $tField) {
         $tIsView = array_key_exists('view', $tField['methods']);
         $tIsEdit = array_key_exists('edit', $tField['methods']);
         if ($tIsView || $tIsEdit) {
             if ($tField['type'] === 'enum') {
                 $tTypes = array();
                 foreach ($tField['valueList'] as $tValue) {
                     $tTypes[$tValue['name']] = $tValue['title'];
                 }
                 $tAttributes = array('name' => $tField['name'], 'class' => 'input-block-level input_' . $tField['type']);
                 if (!$tIsEdit) {
                     $tAttributes['readonly'] = 'readonly';
                 }
                 $tTag = '<p>' . I18n::_($tField['title']) . ': ' . Html::tag('select', $tAttributes, Html::selectOptions($tTypes, $tCategory[$tField['name']])) . '</p>';
             } else {
                 $tAttributes = array('type' => 'text', 'name' => $tField['name'], 'value' => $tCategory[$tField['name']], 'class' => 'input-block-level input_' . $tField['type']);
                 if (!$tIsEdit) {
                     $tAttributes['readonly'] = 'readonly';
                 }
                 $tTag = '<p>' . I18n::_($tField['title']) . ': ' . Html::tag('input', $tAttributes) . '</p>';
             }
         }
         $tViewbag['fields'][] = array('data' => $tField, 'html' => $tTag);
     }
     Views::viewFile('{core}views/panel/models/form.php', $tViewbag);
 }
示例#7
0
 /**
  * @ignore
  */
 public function xml($uModel = null)
 {
     Views::xml($uModel !== null ? $uModel : $this->vars);
 }
示例#8
0
 /**
  * @ignore
  */
 public static function error($uErrorType, $uTitle = null, $uMessage = null)
 {
     if (!isset(self::$errorPages[$uErrorType])) {
         self::$errorPages[$uErrorType] = Config::get('http/errorPages/' . $uErrorType, '{core}views/shared/error.php');
     }
     //! todo internalization.
     // maybe just include?
     Views::viewFile(self::$errorPages[$uErrorType], array('title' => $uTitle, 'message' => $uMessage));
     Framework::end(1);
 }
示例#9
0
 /**
  * @ignore
  */
 public static function debug()
 {
     Auth::checkRedirect('admin');
     Views::viewFile('{core}views/panel/scabbia/debug.php');
 }