本文整理汇总了PHP中MessageBox::success方法的典型用法代码示例。如果您正苦于以下问题:PHP MessageBox::success方法的具体用法?PHP MessageBox::success怎么用?PHP MessageBox::success使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageBox
的用法示例。
在下文中一共展示了MessageBox::success方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index_action
function index_action()
{
$form_fields['comment'] = array('caption' => _("Kommentar"), 'type' => 'textarea', 'attributes' => array('rows' => 4, 'style' => 'width:100%'));
$form_fields['snd_message'] = array('caption' => _("Benachrichtigung über ausfallende Termine an alle Teilnehmer verschicken"), 'type' => 'checkbox', 'attributes' => array('style' => 'vertical-align:middle'));
$form_buttons['save_close'] = array('caption' => _('OK'), 'info' => _("Termine absagen und Dialog schließen"));
$form = new StudipForm($form_fields, $form_buttons, 'cancel_dates', false);
if ($form->isClicked('save_close')) {
$sem = Seminar::getInstance($this->course_id);
$comment = $form->getFormFieldValue('comment');
foreach ($this->dates as $date) {
$sem->cancelSingleDate($date->getTerminId(), $date->getMetadateId());
$date->setComment($comment);
$date->setExTermin(true);
$date->store();
}
if ($form->getFormFieldValue('snd_message') && count($this->dates)) {
$snd_messages = raumzeit_send_cancel_message($comment, $this->dates);
if ($snd_messages) {
$msg = sprintf(_("Es wurden %s Benachrichtigungen gesendet."), $snd_messages);
}
}
PageLayout::postMessage(MessageBox::success(_("Folgende Termine wurden abgesagt") . ($msg ? ' (' . $msg . '):' : ':'), array_map(function ($d) {
return $d->toString();
}, $this->dates)));
$this->redirect($this->url_for('course/dates'));
}
$this->form = $form;
}
示例2: index_action
public function index_action()
{
if (Request::isPost() && Request::option("termin_id") && Request::get("topic_title")) {
$date = new CourseDate(Request::option("termin_id"));
$seminar_id = $date['range_id'];
$title = Request::get("topic_title");
$topic = CourseTopic::findByTitle($seminar_id, $title);
if (!$topic) {
$topic = new CourseTopic();
$topic['title'] = $title;
$topic['seminar_id'] = $seminar_id;
$topic['author_id'] = $GLOBALS['user']->id;
$topic['description'] = "";
$topic->store();
}
$success = $date->addTopic($topic);
if ($success) {
PageLayout::postMessage(MessageBox::success(_("Thema wurde hinzugefügt.")));
} else {
PageLayout::postMessage(MessageBox::info(_("Thema war schon mit dem Termin verknüpft.")));
}
}
Navigation::activateItem('/course/schedule/dates');
object_set_visit_module("schedule");
$this->last_visitdate = object_get_visit(Course::findCurrent()->id, 'schedule');
$this->dates = Course::findCurrent()->getDatesWithExdates();
$this->lecturer_count = Course::findCurrent()->countMembersWithStatus('dozent');
}
示例3: tabularasa_action
public function tabularasa_action($timestamp = null)
{
$institutes = MyRealmModel::getMyInstitutes();
foreach ($institutes as $index => $institut) {
MyRealmModel::setObjectVisits($institutes[$index], $institut['institut_id'], $GLOBALS['user']->id, $timestamp);
}
PageLayout::postMessage(MessageBox::success(_('Alles als gelesen markiert!')));
$this->redirect('my_institutes/index');
}
示例4: delete_action
/**
* This method is called to remove an avatar for a course.
*
* @return void
*/
function delete_action()
{
CourseAvatar::getAvatar($this->course_id)->reset();
PageLayout::postMessage(MessageBox::success(_("Veranstaltungsbild gelöscht.")));
if ($this->studygroup_mode) {
$this->redirect(URLHelper::getUrl('dispatch.php/course/studygroup/edit/' . $this->course_id));
} else {
$this->redirect(URLHelper::getUrl('dispatch.php/course/avatar/update/' . $this->course_id));
}
}
示例5: ask_for_hosts_action
public function ask_for_hosts_action($host_id)
{
$host = new LernmarktplatzHost($host_id);
$added = $this->askForHosts($host);
if ($added > 0) {
PageLayout::postMessage(MessageBox::success(sprintf(_("%s neue Server hinzugefügt."), $added)));
} else {
PageLayout::postMessage(MessageBox::info(_("Keine neuen Server gefunden.")));
}
$this->redirect("admin/hosts");
}
示例6: edit_action
public function edit_action($material_id = null)
{
$this->material = new LernmarktplatzMaterial($material_id);
Pagelayout::setTitle($this->material->isNew() ? _("Neues Material hochladen") : _("Material bearbeiten"));
if ($this->material['user_id'] && $this->material['user_id'] !== $GLOBALS['user']->id) {
throw new AccessDeniedException();
}
if (Request::submitted("delete") && Request::isPost()) {
$this->material->pushDataToIndexServers("delete");
$this->material->delete();
PageLayout::postMessage(MessageBox::success(_("Ihr Material wurde gelöscht.")));
$this->redirect("market/overview");
} elseif (Request::isPost()) {
$was_new = $this->material->setData(Request::getArray("data"));
$this->material['user_id'] = $GLOBALS['user']->id;
$this->material['host_id'] = null;
$this->material['license'] = "CC BY 4.0";
if ($_FILES['file']['tmp_name']) {
$this->material['content_type'] = $_FILES['file']['type'];
if (in_array($this->material['content_type'], array("application/x-zip-compressed", "application/zip", "application/x-zip"))) {
$tmp_folder = $GLOBALS['TMP_PATH'] . "/temp_folder_" . md5(uniqid());
mkdir($tmp_folder);
unzip_file($_FILES['file']['tmp_name'], $tmp_folder);
$this->material['structure'] = $this->getFolderStructure($tmp_folder);
rmdirr($tmp_folder);
} else {
$this->material['structure'] = null;
}
$this->material['filename'] = $_FILES['file']['name'];
move_uploaded_file($_FILES['file']['tmp_name'], $this->material->getFilePath());
}
if ($_FILES['image']['tmp_name']) {
$this->material['front_image_content_type'] = $_FILES['image']['type'];
move_uploaded_file($_FILES['image']['tmp_name'], $this->material->getFrontImageFilePath());
}
if (Request::get("delete_front_image")) {
$this->material['front_image_content_type'] = null;
}
$this->material->store();
//Topics:
$topics = Request::getArray("tags");
foreach ($topics as $key => $topic) {
if (!trim($topic)) {
unset($topics[$key]);
}
}
$this->material->setTopics($topics);
$this->material->pushDataToIndexServers();
PageLayout::postMessage(MessageBox::success(_("Lernmaterial erfolgreich gespeichert.")));
$this->redirect("market/details/" . $this->material->getId());
}
}
示例7: edit_action
public function edit_action($process_id = null)
{
$this->process = new FleximportProcess($process_id);
if (Request::isPost()) {
if (Request::submitted("delete_process")) {
$this->process->delete();
PageLayout::postMessage(MessageBox::success(_("Prozess wurde gelöscht.")));
$processes = FleximportProcess::findBySQL("1=1 ORDER BY name ASC");
$this->redirect("import/overview" . (count($processes) ? "/" . $processes[0]['process_id'] : ""));
} else {
$this->process->setData(Request::getArray("data"));
$this->process->store();
PageLayout::postMessage(MessageBox::success(_("Prozess wurde gespeichert")));
$this->redirect("import/overview/" . $this->process->getId());
}
}
}
示例8: perform
public function perform($unconsumed)
{
if ($unconsumed !== 'read_all') {
return;
}
$global_news = StudipNews::GetNewsByRange('studip', true);
foreach ($global_news as $news) {
object_add_view($news['news_id']);
object_set_visit($news['news_id'], 'news');
}
if (Request::isXhr()) {
echo json_encode(true);
} else {
PageLayout::postMessage(MessageBox::success(_('Alle Ankündigungen wurden als gelesen markiert.')));
header('Location: ' . URLHelper::getLink('dispatch.php/start'));
}
}
示例9: createEvaluationHeader
/**
* createEvaluationHeader: generate the head of an evaluation (title and base text)
* @param the evaluation
* @returns a table row
*/
function createEvaluationHeader($eval, $votedNow, $votedEarlier)
{
$br = new HTMpty("br");
$tr = new HTM("tr");
$td = new HTM("td");
$td->attr("class", "table_row_even");
$table2 = new HTM("table");
$table2->attr("width", "100%");
$tr2 = new HTM("tr");
$td2 = new HTM("td");
$td2->attr("width", "90%");
$td2->attr("valign", "top");
if ($eval->isError()) {
$td2->html(EvalCommon::createErrorReport($eval, _("Fehler")));
$td2->html($br);
}
$span = new HTM("span");
$span->attr("class", "eval_title");
$span->html(htmlReady($eval->getTitle()));
$td2->cont($span);
$td2->cont($br);
$td2->cont($br);
if ($votedNow) {
$message = new HTML('div');
$message->_content = array((string) MessageBox::success(_("Vielen Dank für Ihre Teilnahme.")));
$td2->cont($message);
} elseif ($votedEarlier) {
$message = new HTML('div');
$message->_content = array((string) MessageBox::info(_("Sie haben an dieser Evaluation bereits teilgenommen.")));
$td2->cont($message);
} else {
$td2->html(formatReady($eval->getText()));
$td2->cont($br);
}
$tr2->cont($td2);
$td2 = new HTM("td");
$td2->attr("width", "250");
$td2->attr("valign", "top");
$td2->html(EvalShow::createInfoBox($eval, $votedNow || $votedEarlier));
$tr2->cont($td2);
$table2->cont($tr2);
$td->cont($table2);
$tr->cont($td);
return $tr;
}
示例10: approve_action
public function approve_action($plugin_id)
{
$this->marketplugin = new MarketPlugin($plugin_id);
if ($this->marketplugin['approved']) {
throw new Exception("Plugin ist schon reviewt.");
}
$this->marketplugin['approved'] = (int) Request::int("approved");
if (!$this->marketplugin['approved']) {
$this->marketplugin['publiclyvisible'] = 0;
}
if ($this->marketplugin['approved'] && $this->marketplugin['publiclyvisible']) {
$this->marketplugin['published'] = time();
}
$this->marketplugin->store();
$messaging = new messaging();
$messaging->insert_message(sprintf(_("Ihr Plugin %s wurde reviewt:"), $this->marketplugin['name']) . "\n\n" . ($this->marketplugin['approved'] ? _("Es ist in den Marktplatz aufgenommen worden!") : _("Es ist leider noch nicht in den Marktplatz aufgenommen.")) . "\n\n" . (Request::get("review") ? _("Begründung:") . "\n\n" . Request::get("review") : _("Ein ausführliches Review wurde nicht angegeben und muss bei Bedarf direkt angefragt werden.")), get_username($this->marketplugin['user_id']), '', '', '', '', '', _("Pluginreview"), true, 'normal', "pluginreview");
PageLayout::postMessage(MessageBox::success(_("Review wurde gespeichert.")));
$this->redirect('approving/overview');
}
示例11: favor_action
/**
* Toggles whether a certain smiley is favored for the current user
*
* @param int $id Id of the smiley to favor/disfavor
* @param String $view View to return to
*/
function favor_action($id, $view)
{
try {
$state = $this->favorites->toggle($id);
$message = $state ? _('Der Smiley wurde zu Ihren Favoriten hinzugefügt.') : _('Der Smiley gehört nicht mehr zu Ihren Favoriten.');
$msg_box = MessageBox::success($message);
} catch (OutOfBoundsException $e) {
$state = $this->favorites->contain($id);
$message = _('Maximale Favoritenzahl erreicht. Vielleicht sollten Sie mal ausmisten? :)');
$msg_box = MessageBox::error($message);
}
if (Request::isXhr()) {
$this->response->add_header('Content-Type', 'application/json');
$this->render_text(json_encode(array('state' => $state, 'message' => studip_utf8encode($msg_box))));
} else {
PageLayout::postMessage($msg_box);
$this->redirect('smileys/index/' . $view . '#smiley' . $id);
}
}
示例12: tablemapping_action
public function tablemapping_action($table_id)
{
PageLayout::setTitle(_("Datenmapping einstellen"));
$this->table = new FleximportTable($table_id);
Navigation::activateItem("/fleximport/process_" . $this->table['process_id']);
if (Request::isPost()) {
$tabledata = Request::getArray("tabledata");
$tabledata = array_merge($this->table['tabledata'], $tabledata);
$this->table['tabledata'] = $tabledata;
$this->table->store();
PageLayout::postMessage(MessageBox::success(_("Daten wurden gespeichert.")));
}
$datafield_object_types = array('User' => "user", 'Course' => "sem", 'CourseMember' => "usersemdata");
$this->datafields = Datafield::findBySQL("object_type = :object_type", array('object_type' => $datafield_object_types[$this->table['import_type']]));
if (Request::isAjax() && Request::isPost()) {
$output = array('func' => "STUDIP.Fleximport.updateTable", 'payload' => array('table_id' => $table_id, 'name' => $this->table['name'], 'html' => $this->render_template_as_string("import/_table.php")));
$this->response->add_header("X-Dialog-Execute", json_encode(studip_utf8encode($output)));
}
}
示例13: authorize_action
/**
*
**/
public function authorize_action()
{
global $user, $auth;
$auth_plugin = Config::get()->API_OAUTH_AUTH_PLUGIN;
if ($GLOBALS['user']->id === 'nobody' && $auth_plugin !== 'Standard' && !Request::option('sso')) {
$params = $_GET;
$params['sso'] = $auth_plugin;
$this->redirect($this->url_for('api/oauth/authorize?' . http_build_query($params)));
return;
} else {
$auth->login_if($user->id === 'nobody');
}
$user_id = RESTAPI\Consumer\OAuth::getOAuthId($GLOBALS['user']->id);
try {
$consumer = RESTAPI\Consumer\Base::detectConsumer('oauth', 'request');
if (Request::submitted('allow')) {
$result = $consumer->grantAccess($GLOBALS['user']->id);
$redirect_uri = Request::get('oauth_callback', $consumer->callback);
if ($redirect_uri) {
$this->redirect($redirect_uri);
} else {
// No oauth_callback, show the user the result of the authorization
// ** your code here **
PageLayout::postMessage(MessageBox::success(_('Sie haben der Applikation Zugriff auf Ihre Daten gewährt.')));
$this->redirect('api/authorizations#' . $consumer->auth_key);
}
return;
}
} catch (OAuthException $e) {
// No token to be verified in the request, show a page where the user can enter the token to be verified
// **your code here**
die('invalid');
}
PageLayout::disableHeader();
PageLayout::setTitle(sprintf(_('"%s" bittet um Zugriff'), $consumer->title));
$this->set_layout($GLOBALS['template_factory']->open('layouts/base.php'));
$this->consumer = $consumer;
$this->token = Request::option('oauth_token');
$this->oauth_callback = Request::get('oauth_callback');
}
示例14: process_action
public function process_action($process_id)
{
if (Request::isPost()) {
if (Request::submitted("start")) {
$protocol = array();
$starttime = time();
$this->process = FleximportProcess::find($process_id);
$this->tables = $this->process->tables;
foreach ($this->tables as $table) {
$table->fetchData();
}
foreach ($this->tables as $table) {
$table->doImport();
}
$duration = time() - $starttime;
if ($duration >= 60) {
PageLayout::postMessage(MessageBox::success(sprintf(_("Import wurde durchgeführt und dauerte %s Minuten"), floor($duration / 60)), $protocol));
} else {
PageLayout::postMessage(MessageBox::success(_("Import wurde durchgeführt"), $protocol));
}
} elseif ($_FILES['tableupload']) {
foreach ($_FILES['tableupload']['tmp_name'] as $table_id => $tmp_name) {
if ($tmp_name) {
$table = new FleximportTable($table_id);
$output = $this->plugin->getCSVDataFromFile($tmp_name);
if ($table['tabledata']['source_encoding'] === "utf8") {
$output = studip_utf8decode($output);
}
$headline = array_shift($output);
$table->createTable($headline, $output);
}
}
PageLayout::postMessage(MessageBox::success(_("CSV-Datei hochgeladen")));
}
}
$this->redirect("import/overview/" . $process_id);
}
示例15: remove_action
function remove_action($group = null)
{
$contact = Contact::find(array(User::findCurrent()->id, User::findByUsername(Request::username('user'))->id));
if ($contact) {
if ($group) {
$contact->group_assignments->unsetBy('statusgruppe_id', $group);
if ($contact->store()) {
PageLayout::postMessage(MessageBox::success(_("Der Kontakt wurde aus der Gruppe entfernt.")));
}
} else {
if ($contact->delete()) {
PageLayout::postMessage(MessageBox::success(_("Der Kontakt wurde entfernt.")));
}
}
}
$this->redirect('contact/index/' . $group);
}