本文整理匯總了PHP中type::super方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::super方法的具體用法?PHP type::super怎麽用?PHP type::super使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::super方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: formBlock
public static function formBlock($module)
{
$form = form::factory('module', 'id=' . $module->getModulId(), 'index.php');
$form->setSave(false);
$form->addFormAttribute('class', '');
$form->setSuccessMessage(null);
$input = $module->OutputFilter($form->get('input'), $module->getSql());
$form->addRawField($input);
$form->addHiddenField('structure_id', $module->getStructureId());
if ($module->getId()) {
$form->setMode('edit');
$online = $module->get('online');
} else {
$form->setMode('add');
$online = 1;
$form->delButton('save-back');
}
$form->addHiddenField('modul', $module->getModulId());
$form->addHiddenField('sort', $module->getSort());
$field = $form->addRadioField('online', $online);
$field->fieldName(lang::get('block_status'));
$field->add(1, lang::get('online'));
$field->add(0, lang::get('offline'));
$form->addHiddenField('id', $module->getId());
$form->addParam('structure_id', type::super('structure_id', 'int'));
return $form;
}
示例2: saveFile
public static function saveFile($file, $form)
{
if (!is_uploaded_file($file['tmp_name'])) {
return $form;
}
$fileName = mediaUtils::fixFileName($file['name']);
$fileDir = dir::media($fileName);
$extension = substr(strrchr($fileName, '.'), 1);
// z.B. jpg
$badExtensions = dyn::get('addons')['badExtensions'];
// Wenn die Datei eine "verbotene" Datei ist
if (in_array($extension, $badExtensions)) {
$form->setSave(false);
$form->setErrorMessage(sprintf(lang::get('media_error_bad_extension'), $file['name']));
return $form;
}
if ($form->isEditMode()) {
$media = new media(type::super('id', 'int', 0));
}
// Wenn Datei nicht Existiert
// Oder man möchte sie überspeichern
if ($form->isEditMode() && $media->get('filename') != $fileName || !$form->isEditMode() && file_exists($fileDir)) {
$form->setSave(false);
$form->setErrorMessage(sprintf(lang::get('media_error_already_exist'), $file['name']));
return $form;
}
if (!move_uploaded_file($file['tmp_name'], $fileDir)) {
$form->setSave(false);
$form->setErrorMessage(sprintf(lang::get('media_error_move'), $file['name']));
return $form;
}
$form->addPost('filename', $fileName);
$form->addPost('size', filesize($fileDir));
return $form;
}
示例3: getStructureId
public function getStructureId()
{
if ($this->isNew) {
return type::super('structure_id', 'int');
} else {
return $this->get('structure_id');
}
}
示例4: getSaveValue
public function getSaveValue()
{
$name = $this->getName();
$value = type::super($name);
if (is_array($value)) {
$value = '|' . implode('|', $value) . '|';
}
return $value;
}
示例5: getSaveValue
public function getSaveValue()
{
$name = $this->getName();
$value = type::super($name);
if (is_null($value)) {
return '';
}
return implode(',', $value);
}
示例6: fe
public static function fe($id = '', $params = [])
{
if ($id == '') {
type::super('page_id', 'int', dyn::get('start_page'));
}
$url = extension::get('URL_REWRITE', ['id' => $id, 'params' => $params]);
if (!extension::has('URL_REWRITE')) {
$url = 'index.php?page_id=' . $id;
foreach ($params as $name => $value) {
$url .= '&' . $name . '=' . $value;
}
}
return $url;
}
示例7: getButtons
public static function getButtons()
{
$page = type::super('page', 'string', 'dashboard');
$action = type::super('action', 'string');
$activeA = $action == 'add' ? 'class="active"' : '';
$activeG = $action == 'games' ? 'class="active"' : '';
$activeR = '';
$activeS = $action == 'settings' ? 'class="active"' : '';
$buttons = ['add' => '<li ' . $activeA . '><a href="?page=' . $page . '&action=add">' . self::svg('add') . '</a></li>', 'games' => '<li ' . $activeG . '><a href="?page=' . $page . '&action=games">' . self::svg('game') . '</a></li>', 'refresh' => '<li ' . $activeR . '><a>' . self::svg('refresh') . '</a></li>', 'settings' => '<li ' . $activeS . '><a href="?page=' . $page . '&action=settings">' . self::svg('settings') . '</a></li>'];
$return = '';
if (isset(self::$nav[$page])) {
$btn = self::$nav[$page]['buttons'];
if (is_array($btn) && count($btn) >= 1) {
$return .= '<nav>';
$return .= '<ul>';
foreach ($btn as $var) {
$return .= $buttons[$var];
}
$return .= '</ul>';
$return .= '</nav>';
}
}
return $return;
}
示例8: foreach
<?php
$pid = type::super('pid', 'int', 0);
$while_id = $pid;
if (ajax::is()) {
$sort = type::post('array', 'array');
$sql = sql::factory();
$sql->setTable('media_cat');
foreach ($sort as $s => $id) {
$sql->setWhere('id=' . $id);
$sql->addPost('sort', $s + 1);
$sql->update();
}
ajax::addReturn(message::success(lang::get('save_sorting'), true));
}
while ($while_id) {
$sql = sql::factory();
$sql->query('SELECT name, pid FROM ' . sql::table('media_cat') . ' WHERE id=' . $while_id)->result();
if ($pid != $while_id) {
$breadcrumb[] = '<li><a href="' . url::backend('media', ['pid' => $while_id, 'subpage' => 'category']) . '">' . $sql->get('name') . '</a></li>';
} else {
$breadcrumb[] = '<li class="active">' . $sql->get('name') . '</li>';
}
$while_id = $sql->get('pid');
}
$breadcrumb[] = '<li><a href="' . url::backend('media', ['subpage' => 'category']) . '">' . lang::get('start') . '</a></li>';
echo '<ul class="breadcrumb">' . implode('', array_reverse($breadcrumb)) . '</ul>';
if ($action == 'delete' && dyn::get('user')->hasPerm('media[category][delete]')) {
$error = [];
$sql = sql::factory();
$sql->query('SELECT id FROM ' . sql::table('media_cat') . ' WHERE `pid` = ' . $id)->result();
示例9: function
userPerm::add('media[category][edit]', lang::get('media[category][edit]'));
userPerm::add('media[category][delete]', lang::get('media[category][delete]'));
if (dyn::get('user')->hasPerm('media[edit]') || dyn::get('user')->hasPerm('media[delete]') || dyn::get('user')->hasPerm('media[category][edit]') || dyn::get('user')->hasPerm('media[category][delete]')) {
backend::addNavi(lang::get('media'), url::backend('media'), 'picture-o', 2, function () {
return dir::addon('mediamanager', 'page' . DIRECTORY_SEPARATOR . 'media.php');
});
}
form::addClassMethod('addMediaField', function ($name, $value) {
return $this->addField($name, $value, 'formMedia');
});
form::addClassMethod('addMediaListField', function ($name, $value) {
return $this->addField($name, $value, 'formMediaList');
});
$page = type::super('page', 'string');
$subpage = type::super('subpage', 'string');
$action = type::super('action', 'string');
pageArea::addType('varsMedia');
pageArea::addType('varsMedialist');
if (addonConfig::isActive('metainfos')) {
metainfosPage::addType('DYN_MEDIA');
metainfosPage::addType('DYN_MEDIA_LIST');
if ($page == 'meta') {
backend::addSubNavi(lang::get('media'), url::backend('meta', ['subpage' => 'media']), 'circle', -1, function () {
return dir::addon('mediamanager', 'page' . DIRECTORY_SEPARATOR . 'meta.media.php');
});
}
if ($page == 'media' && $subpage == 'files' && in_array($action, ['add', 'edit'])) {
extension::add('FORM_BEFORE_ACTION', function ($form) {
$form = metainfos::getMetaInfos($form, 'media');
});
}
示例10:
</a>
</div>
<?php
}
?>
<div class="clearfix"></div>
</div>
<div class="panel-body">
<select class="form-control" id="media-select-category-ajax" name="catId">
<option value="0"><?php
echo lang::get('no_category');
?>
</option>
<?php
echo mediaUtils::getTreeStructure(0, 0, ' ', $catId);
?>
</select>
<div id="load">
<?php
echo $table->show();
?>
</div>
</div>
</div>
</div>
</div>
<?php
if (!type::super('layout', 'string', false)) {
exit;
}
示例11:
echo pageAreaHtml::formOut($form);
} else {
echo pageAreaHtml::selectBlock($structure_id, $sql->num() + 1);
}
?>
</div>
</div>
</div>
</div>
<?php
//Wenn action
} else {
if (ajax::is() && dyn::get('user')->hasPerm('page[edit]')) {
$post = type::super('array');
$sort = json_decode($post, true);
pageMisc::sortStructure($sort, 0);
echo message::success(lang::get('save_sorting'), true);
}
if (in_array($action, ['edit', 'add']) && dyn::get('user')->hasPerm('page[edit]')) {
$form = form::factory('structure', 'id=' . $id, 'index.php');
$field = $form->addTextField('name', $form->get('name'));
$field->fieldName(lang::get('name'));
$field->autofocus();
$template = template::factory(dyn::get('template'));
$field = $form->addElement('template', $template->getTemplates('template', $form->get('template')));
$field->fieldName(lang::get('template'));
$field = $form->addRadioField('online', $form->get('online'));
$field->fieldName(lang::get('status'));
$field->add(1, lang::get('online'));
示例12: unset
include dir::functions('convert.php');
lang::setDefault();
lang::setLang(rp::get('lang'));
$DB = rp::get('DB');
sql::connect($DB['host'], $DB['user'], $DB['password'], $DB['database']);
unset($DB);
date_default_timezone_set(rp::get('timezone', 'Europe/Berlin'));
new userLogin();
rp::add('user', new user(userLogin::getUser()));
cache::setCache(rp::get('cache'));
addonConfig::loadAllConfig();
addonConfig::includeAllLangFiles();
addonConfig::includeAllLibs();
$page = type::super('page', 'string', 'dashboard');
$action = type::super('action', 'string');
$id = type::super('id', 'int');
$success = type::get('success', 'string');
$error = type::get('error', 'string');
if (!is_null($error)) {
echo message::danger($error);
} elseif (!is_null($success)) {
echo message::success($success);
}
layout::addNav(lang::get('dashboard'), 'dashboard', 'home', ['refresh'], true);
layout::addNav(lang::get('settings'), 'settings', 'settings', [], false);
layout::addNav(lang::get('server'), 'server', 'list', ['add'], true);
layout::addNav(lang::get('addons'), 'addons', 'alt', [], true);
layout::addNav(lang::get('user'), 'user', 'users', ['add'], true);
foreach (addonConfig::includeAllConfig() as $file) {
include $file;
}
示例13:
$field->fieldName(lang::get('category'));
$field = $form->addRawField('<input type="file" name="file" />');
$field->fieldName(lang::get('select_file'));
if ($action == 'edit') {
$form->addHiddenField('id', $id);
}
if ($form->isSubmit()) {
type::addSession('media_cat', $form->get('category'));
$file = type::files('file');
if (!is_uploaded_file($file['tmp_name']) && !$form->isEditMode()) {
$form->setErrorMessage(lang::get('please_load_file'));
$form->setSave(false);
} else {
$form = mediaUtils::saveFile($file, $form);
}
$category = type::super('category', 'int');
$form->addPost('category', $category);
}
?>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><?php
echo lang::get('media_edit');
?>
</h3>
</div>
<div class="panel-body">
<?php
echo $form->show();
示例14: getSaveValue
public function getSaveValue()
{
$name = $this->getName();
$value = type::super($name . '_id');
return $value;
}
示例15: error_reporting
<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
include '..' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'dir.php';
new dir();
include_once dir::classes('autoload.php');
autoload::register();
autoload::addDir(dir::classes('utils'));
autoload::addDir('lib' . DIRECTORY_SEPARATOR . 'classes');
include dir::functions('html_stuff.php');
include dir::functions('url_stuff.php');
new dyn();
lang::setDefault();
lang::setLang(dyn::get('lang'));
lang::loadLang('lib' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR . lang::getLang() . '.json');
$page = type::super('page', 'string', 'licence');
ob_start();
include "layout/index.php";
$out = ob_get_contents();
ob_get_clean();
echo $out;