本文整理汇总了PHP中Flash::queue方法的典型用法代码示例。如果您正苦于以下问题:PHP Flash::queue方法的具体用法?PHP Flash::queue怎么用?PHP Flash::queue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flash
的用法示例。
在下文中一共展示了Flash::queue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveChanges
function saveChanges()
{
$_POST->setType('etitle', 'string');
$_POST->setType('eimg', 'string');
$_POST->setType('etxt', 'string');
$_POST->setType('active', 'string');
$_POST->setType('regstop', 'string');
$_POST->setType('attendance', 'string');
$_POST->setType('reminder', 'bool');
$_POST->setType('contact', 'numeric');
$_POST->setType('attending_groups', 'numeric', true);
$_POST->setType('visibility', 'numeric', true);
if ($_POST['etitle']) {
$this->that->Name = $_POST['etitle'];
$this->that->start = Short::parseDateAndTime('estart', false);
$this->that->end = Short::parseDateAndTime('eend', false);
$this->that->Image = $_POST['eimg'];
$this->that->registration_ends = strtotime($_POST['regstop']);
$this->that->setActive(Short::parseDateAndTime('active'), $this->that->end);
$this->that->contact = $_POST['contact'];
$this->that->attendance = isset($_POST['attendance']);
$this->that->attending_groups = $_POST['attending_groups'];
$this->that->reminder = $_REQUEST['reminder'];
$this->updateVisibility($_POST['visibility']);
Flash::queue(__('Event updated'), 'confirmation');
}
}
示例2: run
function run()
{
global $Templates, $CONFIG;
if ($this->saveChanges()) {
Flash::queue(__('Your changes were saved'), 'confirmation');
redirect($this->that);
}
$this->setContent('main', Form::quick(false, __('Save'), new Input(__('Page name'), 'name', $this->Name), new Select(__('Group'), 'interesting_groups', $this->that->groups(), $CONFIG->matrikel->interesting_groups, true)));
$Templates->render();
}
示例3: saveChanges
function saveChanges()
{
global $CONFIG;
$_REQUEST->setType('uncompress', 'any');
if (isset($_FILES['uFiles']) && $this->may($USER, EDIT)) {
$u = false;
$ue = false;
$extensions = $CONFIG->Files->filter;
foreach ($_FILES['uFiles']['error'] as $i => $e) {
$parts = explode('.', $_FILES['uFiles']['name'][$i]);
$extension = array_pop($parts);
if ($e == UPLOAD_ERR_NO_FILE) {
continue;
}
$newPath = $this->that->path . '/' . $_FILES['uFiles']['name'][$i];
if ($e == UPLOAD_ERR_OK) {
if ($_REQUEST['uncompress'] && in_array(strtolower(strrchr($_FILES['uFiles']['name'][$i], '.')), array('.tar', '.gz', '.tgz', '.bz2', '.tbz', '.zip', '.ar', '.deb'))) {
$tmpfile = $_FILES['uFiles']['tmp_name'][$i] . $_FILES['uFiles']['name'][$i];
rename($_FILES['uFiles']['tmp_name'][$i], $tmpfile);
$u = true;
require_once "File/Archive.php";
error_reporting(E_ALL);
$curdir = getcwd();
chdir($this->path);
//FIXME: FIXME!
if (@File_Archive::extract(File_Archive::filter(File_Archive::predExtension($extensions), File_Archive::read($tmpfile . '/*')), File_Archive::toFiles()) == null) {
$ue = true;
} else {
Flash::queue(__('Extraction failed'));
}
chdir($curdir);
} elseif (!in_array(strtolower($extension), $extensions)) {
Flash::queue(__('Invalid format:') . ' ' . $_FILES['uFiles']['name'][$i], 'warning');
continue;
} else {
$u = (bool) @move_uploaded_file($_FILES['uFiles']['tmp_name'][$i], $newPath);
}
}
if (!$u) {
Flash::queue(__('Upload of file') . ' "' . $_FILES['uFiles']['name'][$i] . '" ' . __('failed') . ' (' . ($e ? $e : __('Check permissions')) . ')', 'warning');
}
}
if ($u) {
$this->loadStructure(true);
Flash::queue(__('Your file(s) were uploaded'));
return true;
}
if ($ue) {
$this->loadStructure(true);
Flash::queue(__('Your file(s) were uploaded and extracted'));
return true;
}
return false;
}
}
示例4: saveChanges
function saveChanges()
{
$_REQUEST->setType('fname', 'string');
if ($_REQUEST['fname'] && strposa($_REQUEST['fname'], array('..', '/', '\\')) === false && $this->that->mayI(EDIT)) {
if (@mkdir($this->path . '/' . $_REQUEST['fname'], 0700)) {
Flash::queue(__('The folder was created successfully'));
} else {
Flash::queue(__('There was a problem creating the directory. Check permissions and the name'));
}
}
}
示例5: saveChanges
function saveChanges()
{
$_REQUEST->setType('flows', 'numeric', true);
$_REQUEST->setType('items', 'numeric');
if ($_REQUEST['items'] && $_REQUEST['flows']) {
$this->that->flows = $_REQUEST['flows'];
$this->that->items_per_page = $_REQUEST['items'];
Flash::queue(__('Your changes were saved'), 'confirmation');
return true;
}
return false;
}
示例6: saveChanges
function saveChanges()
{
$_REQUEST->setType('to', 'numeric');
if ($_REQUEST['action'] == 'move' && $_REQUEST['to'] && $this->that->mayI(EDIT)) {
if ($this->moveFile($_REQUEST['to'])) {
Flash::queue(__('The object was successfully moved'), 'confirmation');
redirect();
} else {
Flash::queue(__('There was an error moving the file.'), 'warning');
}
}
}
示例7: saveChanges
function saveChanges()
{
$_POST->setType('calendarname', 'string');
if (!$_POST['calendarname']) {
return false;
}
global $Controller;
$new = $Controller->newObj('Calendar');
$new->Name = $_POST['calendarname'];
Flash::queue(__('The new calendar') . ' `' . $_POST['calendarname'] . '`' . __('was created'), 'confirmation');
return true;
}
示例8: saveChanges
function saveChanges()
{
global $Controller;
$_POST->setType('oname', 'string');
$_POST->setType('oparent', 'numeric');
if ($_POST['oname']) {
$Obj = $Controller->newObj('Booking_Object');
Flash::queue(__('New object created'));
$Obj->Name = $_POST['oname'];
$Obj->sortBooking('last', $_POST['oparent']);
$Controller->forceReload($Obj);
}
}
示例9: doDelete
function doDelete()
{
$_POST->setType('confirm', 'any');
if (!$_POST['confirm']) {
return false;
}
if ($this->that->mayI(DELETE) && $this->that->delete()) {
Flash::queue(__('The object was deleted'), 'confirmation');
} else {
Flash::queue(__('The object could not be deleted'), 'warning');
}
return true;
}
示例10: saveChanges
function saveChanges()
{
$_POST->setType('calendars', 'string', true);
$_POST->setType('itemsPerPage', 'numeric');
if (!$_POST['calendars']) {
return false;
}
$this->that->calendars = $_POST['calendars'];
if ($_POST['itemsPerPage']) {
$this->that->itemsPerPage = $_POST['itemsPerPage'];
}
Flash::queue(__('Your changes were saved'), 'confirmation');
return true;
}
示例11: saveChanges
function saveChanges()
{
$_POST->setType('filename', 'string');
$_POST->setType('cropimgx', 'numeric');
$_POST->setType('cropimgy', 'numeric');
$_POST->setType('cropimgw', 'numeric');
$_POST->setType('cropimgh', 'numeric');
$_REQUEST->setType('mkcopy', 'string');
if ($_REQUEST['filename']) {
if ($_REQUEST['mkcopy']) {
if ($_POST['filename'] != $this->basename && $_POST['filename']) {
if (!file_exists($this->dirname . '/' . $_POST['filename'])) {
$p = $this->dirname . '/' . $_POST['filename'];
} else {
Flash::queue(__('File exists. Please give another name or delete the conflicting file. Your changes were not saved.'), 'warning');
break;
}
} else {
$nrofcopies = count(glob(substr($this->path, 0, -(strlen($this->extension) + 1)) . '_copy*'));
if ($nrofcopies == 0) {
$nrofcopies = '';
}
$p = substr($this->path, 0, -(strlen($this->extension) + 1)) . '_copy' . ($nrofcopies + 1) . substr($this->path, -(strlen($this->extension) + 1));
}
touch($p);
$copy = File::open($p);
} else {
if ($_POST['filename'] != $this->basename) {
$this->rename($_POST['filename']);
}
$p = $this->path;
$img = new Image($this->path);
if ($_POST['cropimgw'] && $_POST['cropimgh']) {
$width = $img->width();
$s = $width / min($width, 400);
$img->crop(round($s * $_POST['cropimgx']), round($s * $_POST['cropimgy']), round($s * $_POST['cropimgw']), round($s * $_POST['cropimgh']));
}
if ($_REQUEST['imgrot']) {
$img->rotate($_REQUEST['imgrot']);
}
$img->save($p);
Flash::queue(__('Your changes were saved'));
}
}
}
示例12: saveChanges
function saveChanges()
{
$_POST->setType('title', 'string');
$_POST->setType('template', 'string');
$_POST->setType('alias', 'string');
$_POST->setType('commentsEnabled', 'bool');
if (!$_POST['title']) {
return false;
}
$this->that->Name = $_POST['title'];
$this->that->resetAlias(explode(',', $_POST['alias']));
$this->that->setActive(Short::parseDateAndTime('activate'), Short::parseDateAndTime('deactivate'));
$this->that->settings['comments'] = isset($_POST['commentsEnabled']);
if ($_POST['template']) {
$this->that->template = $_POST['template'];
}
Flash::queue(__('Your changes were saved'), 'confirmation');
return true;
}
示例13: run
/**
* Display the page for managing installations
* @see lib/Page#run()
*/
function run()
{
global $USER, $CONFIG, $Templates, $SITE, $Controller;
if (!$this->may($USER, READ)) {
return;
}
$_REQUEST->setType('place', 'numeric');
$_REQUEST->setType('parent', 'numeric');
$_REQUEST->setType('reinstall', 'string');
$_REQUEST->setType('new', 'string');
if ($this->mayI(EDIT)) {
if ($_REQUEST['reinstall']) {
$this->reinstall($_REQUEST['reinstall']);
Flash::create($_REQUEST['reinstall'] . ' ' . __('was reinstalled'));
} elseif ($_REQUEST['new']) {
$class = $_REQUEST['new'];
if (validInclude($class) && ($class == 'MenuItem' || @is_subclass_of($class, 'MenuItem')) && $Controller->menuEditor->mayI(EDIT)) {
$obj = $Controller->newObj($class);
$obj->move($_REQUEST['place'] ? $_REQUEST['place'] : 'last', $_REQUEST['parent']);
Flash::queue(__('New') . ' ' . $class . ' ' . __('installed'));
redirect(url(array('id' => 'menuEditor')));
}
unset($class);
}
}
$installed = $CONFIG->base->installed;
$dir = 'plugins';
$fullpath = ROOTDIR . DIRECTORY_SEPARATOR . $dir;
$entries = readDirFilesRecursive($fullpath, true);
natcasesort($entries);
$i = 0;
$c = array();
foreach ($entries as $entry) {
if (substr($entry, -4) == '.php') {
$class = substr($entry, false, -4);
$methods = class_exists($class) ? get_class_methods($class) : array();
$c[] = '<span class="fixed-width">' . $class . '</span><div class="tools">' . ($this->may($USER, EDIT) && (@in_array('installable', $methods) && @in_array('install', $methods) && call_user_func(array($class, 'installable')) == $class) ? icon('small/arrow_refresh_small', __('Reinstall'), url(array('reinstall' => $class), array('id'))) : '') . (($class == 'MenuItem' || @is_subclass_of($class, 'MenuItem')) && $Controller->menuEditor->may($USER, EDIT) ? icon('small/add', __('Add new instance to menu'), url(array('new' => $class), array('id'))) : '') . '</div>';
}
}
$this->setContent('header', __('Installer'));
$this->setContent('main', listify($c));
$Templates->admin->render();
}
示例14: saveChanges
function saveChanges()
{
if (!is_a($this->that, 'User')) {
return null;
}
/**
* Delete user
*/
if ($_REQUEST->numeric('del') && $this->that->mayI(DELETE)) {
$Controller->{$_REQUEST['del']}(OVERRIDE)->delete();
Flash::queue(__('User was deleted'));
redirect(url());
}
global $Controller, $DB;
$_POST->setType('username', 'string');
$_POST->setType('password1', 'string');
$_POST->setType('password2', 'string');
$_POST->setType('volgroups', 'numeric', true);
$changes = false;
/**
* Save the user
*/
if ($_POST['username'] && $_POST['username'] != $this->that->username) {
if ($DB->users->exists(array('username' => $_POST['username'], 'id!' => $this->that->ID))) {
Flash::create(__('Username is already in use'), 'warning');
return false;
} else {
$user->username = $_POST['username'];
$changes = true;
}
}
if ($_POST['password1']) {
if ($_POST['password1'] === $_POST['password2']) {
$user->password = $_POST['password1'];
$changes = true;
} else {
Flash::create(__("The passwords don't match. Try again"), 'warning');
return false;
}
}
$vgs = (array) $_POST['volgroups'];
$volkeys = $DB->{'spine,metadata'}->asList(array('spine.class' => 'Group', 'metadata.field' => 'GroupType', 'metadata.value' => array('vol', 'volpre')), 'spine.id');
$volgroups = $Controller->get($volkeys, OVERRIDE);
asort($volgroups);
/**
* Save group data
*/
foreach ($volgroups as $vg) {
if (in_array($vg->ID, $vgs)) {
if ($vg->addMember($this->that)) {
$changes = true;
}
} else {
if ($vg->removeMember($this->that)) {
$changes = true;
}
}
}
$changes = UInfoFields::save($this->that->ID) || $changes;
$Controller->forceReload($this->that);
if ($changes) {
Flash::create(__('Your changes were saved'));
}
return $changes;
}
示例15: saveAttendance
function saveAttendance()
{
$_REQUEST->setType('attending', '/yes|no/');
$_REQUEST->setType('user', 'numeric');
$_REQUEST->setType('comment', 'string');
if ($_REQUEST['attending']) {
if ($_REQUEST['user'] && $this->mayI(EDIT)) {
$user = $_REQUEST['user'];
} else {
global $USER;
$user = $USER->ID;
}
global $DB;
$DB->attendance->update(array('attending' => $_REQUEST['attending'], 'comment' => $_REQUEST['comment']), array('event' => $this->ID, 'attendee' => $user), true);
Flash::queue(__('Saved'));
return true;
}
return false;
}