Commit 9284dd29 authored by lindonb's avatar lindonb

[REF] feedback class: no need for second parameter

parent 257dc1ca
......@@ -17,8 +17,8 @@ if (isset($_POST['import']) && $access->checkCsrf()) {
$msgs = [];
$result = $artlib->import_csv($fname, $msgs);
if ($result) {
Feedback::success(tr('File %0 succesfully imported.', $_FILES['csvlist']['name']), 'session');
Feedback::success(tr('File %0 succesfully imported.', $_FILES['csvlist']['name']));
} elseif (! empty($msgs)) {
Feedback::error(['mes' => $msgs], 'session');
Feedback::error(['mes' => $msgs]);
}
}
......@@ -58,10 +58,10 @@ if (! empty($_POST['move']) && $access->checkCsrf()) {
$errors = $filegallib->moveFiles($_REQUEST['move'], $feedbacks);
}
if (! empty($errors)) {
Feedback::error(['mes' => $errors], 'session');
Feedback::error(['mes' => $errors]);
}
if (! empty($feedbacks)) {
Feedback::note(['mes' => $feedbacks], 'session');
Feedback::note(['mes' => $feedbacks]);
}
}
......
......@@ -15,8 +15,8 @@ if (isset($_POST["cleanup"]) && $access->checkCsrf()) {
$freetaglib = TikiLib::lib('freetag');
$result = $freetaglib->cleanup_tags();
if ($result) {
Feedback::success(tr('Tags successfully cleaned up.'), 'session');
Feedback::success(tr('Tags successfully cleaned up.'));
} else {
Feedback::error(tr('Tag cleanup failed.'), 'session');
Feedback::error(tr('Tag cleanup failed.'));
}
}
......@@ -35,7 +35,7 @@ if (isset($_REQUEST['galfeatures'])) {
//*** begin state-changing actions
if (isset($_POST['rmvorphimg']) && $access->checkCsrfForm(tra('Remove orphan images?'))) {
$adminlib->remove_orphan_images();
Feedback::success(tra('Orphan images successfully removed'), 'session');
Feedback::success(tra('Orphan images successfully removed'));
}
if (isset($_POST['mvimg']) && isset($_POST['move_gallery']) && $access->checkCsrf()) {
......@@ -47,7 +47,7 @@ if (isset($_POST['mvimg']) && isset($_POST['move_gallery']) && $access->checkCsr
if ($mvresult['timeout']) {
$mvmsg .= ' ' . tra('a timeout occurred. Hit the reload button to move the rest');
}
Feedback::note($mvmsg, 'session');
Feedback::note($mvmsg);
}
}
//*** end state-changing actions
......
......@@ -23,7 +23,7 @@ if (! empty($_POST['testMail']) && $access->checkCsrf()) {
$mailerrors = print_r($mail->errors, true);
$msg .= '<br>' . $mailerrors;
}
Feedback::warning($msg, 'session');
Feedback::warning($msg);
} else {
add_feedback('testMail', tra('Test mail sent to') . ' ' . $_REQUEST['testMail'], 3);
}
......
......@@ -52,7 +52,7 @@ if (isset($_POST['forget'], $_POST['pp'], $_POST['pd']) && $access->checkCsrf())
foreach ($profilefeedback as $feedback) {
if (strpos($feedback, tra('An error occurred: ')) === 0) {
Feedback::error($feedback, 'session');
Feedback::error($feedback);
}
}
......@@ -102,7 +102,7 @@ if (isset($_POST['install'], $_POST['pd'], $_POST['pp']) && $access->checkCsrf()
$target = $wikilib->sefurl($target);
$profilefeedback = $installer->getFeedback();
if (count($profilefeedback) > 0) {
Feedback::note(['mes' => $profilefeedback, 'title' => tra('The following list of changes has been applied:')], 'session');
Feedback::note(['mes' => $profilefeedback, 'title' => tra('The following list of changes has been applied:')]);
}header('Location: ' . $target);
exit;
} else {
......
......@@ -30,8 +30,7 @@ if (isset($_REQUEST['test']) && $access->is_machine_request()) {
//*** begin state-changing actions
if (isset($_POST['create']) && ! empty($jitPost->name->text()) && $access->checkCsrf()) {
$id = $ratingconfiglib->create_configuration($jitPost->name->text());
Feedback::success(tr('New rating configuration %0 created', '<em>' . $jitPost->name->text() . '</em>'),
'session');
Feedback::success(tr('New rating configuration %0 created', '<em>' . $jitPost->name->text() . '</em>'));
}
if (isset($_POST['edit']) && $access->checkCsrf()) {
......@@ -41,8 +40,7 @@ if (isset($_POST['edit']) && $access->checkCsrf()) {
$jitPost->expiry->digits(),
$jitPost->formula->xss()
);
Feedback::success(tr('Rating configuration updated for %0', '<em>' . $jitPost->name->text() . '</em>'),
'session');
Feedback::success(tr('Rating configuration updated for %0', '<em>' . $jitPost->name->text() . '</em>'));
}
//*** end state-changing actions
......
......@@ -13,7 +13,7 @@ if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
$scorelib = TikiLib::lib('score');
if (isset($_POST['events']) && is_array($_POST['events']) && $access->checkCsrf()) {
$scorelib->update_events($_POST['events']);
Feedback::success(tra('Scoring events replaced with form data.'), 'session');
Feedback::success(tra('Scoring events replaced with form data.'));
}
$smarty->assign('eventTypes', $scorelib->getEventTypes());
......
......@@ -13,7 +13,7 @@ if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
if (! empty($_POST['clearTickets']) && $access->checkCsrf()) {
$_SESSION['tickets'] = [];
Feedback::success(tra('Server security tickets have been deleted'), 'session');
Feedback::success(tra('Server security tickets have been deleted'));
}
TikiLib::lib('smarty')->assign('openssl_available', extension_loaded('openssl'));
......
......@@ -27,7 +27,7 @@ if (! empty($_POST['moveWikiUp']) && $access->checkCsrf()) {
$errorsWikiUp = [];
$info = $filegallib->get_file_gallery_info($prefs['home_file_gallery']);
if (empty($info)) {
Feedback::error(tr('You must set a home file gallery'), 'session');
Feedback::error(tr('You must set a home file gallery'));
} else {
$filegallib->moveAllWikiUpToFgal($prefs['home_file_gallery']);
}
......@@ -37,37 +37,37 @@ if (! empty($_POST['moveWikiUp']) && $access->checkCsrf()) {
if (isset($_POST['createtag']) && $access->checkCsrf()) {
// Check existence
if ($adminlib->tag_exists($_POST['newtagname'])) {
Feedback::error(tra('Tag already exists'), 'session');
Feedback::error(tra('Tag already exists'));
}
$adminlib->create_tag($_POST['newtagname']);
Feedback::success(tr('Tag %0 created.', '<em>' . $_POST['newtagname'] . '</em>'), 'session');
Feedback::success(tr('Tag %0 created.', '<em>' . $_POST['newtagname'] . '</em>'));
}
if (isset($_POST['restoretag'])&& $access->checkCsrf()) {
// Check existance
if (! $adminlib->tag_exists($_POST['tagname'])) {
Feedback::error(tr('Tag %0 not found', '<em>' . $_POST['tagname'] . '</em>'), 'session');
Feedback::error(tr('Tag %0 not found', '<em>' . $_POST['tagname'] . '</em>'));
}
$result = $adminlib->restore_tag($_POST['tagname']);
if ($result) {
Feedback::success(tr('Tag %0 restored.', '<em>' . $_POST['tagname'] . '</em>'), 'session');
Feedback::success(tr('Tag %0 restored.', '<em>' . $_POST['tagname'] . '</em>'));
} else {
Feedback::error(tr('Tag %0 not restored.', '<em>' . $_POST['tagname'] . '</em>'), 'session');
Feedback::error(tr('Tag %0 not restored.', '<em>' . $_POST['tagname'] . '</em>'));
}
}
if (isset($_POST['removetag']) && $access->checkCsrf()) {
$result = $adminlib->remove_tag($_POST['tagname']);
if ($result) {
Feedback::success(tr('Tag %0 removed.', '<em>' . $_POST['tagname'] . '</em>'), 'session');
Feedback::success(tr('Tag %0 removed.', '<em>' . $_POST['tagname'] . '</em>'));
} else {
Feedback::error(tr('Tag %0 not removed.', '<em>' . $_POST['tagname'] . '</em>'), 'session');
Feedback::error(tr('Tag %0 not removed.', '<em>' . $_POST['tagname'] . '</em>'));
}
}
if (isset($_POST['rmvunusedpic']) && $access->checkCsrf()) {
$adminlib->remove_unused_pictures();
Feedback::success(tr('Process to remove pictures has completed.'), 'session');
Feedback::success(tr('Process to remove pictures has completed.'));
}
//*** end state-changing actions
......@@ -76,18 +76,18 @@ if (isset($_REQUEST['createdump'])) {
error_reporting(E_ERROR | E_WARNING);
$adminlib->dump();
if (is_file($path)) {
Feedback::success(tr('Dump created at %0', '<em>' . $path . '</em>'), 'session');
Feedback::success(tr('Dump created at %0', '<em>' . $path . '</em>'));
} else {
Feedback::error(tra('Dump was not created. Please check permissions for the storage/ directory.'), 'session');
Feedback::error(tra('Dump was not created. Please check permissions for the storage/ directory.'));
}
}
if (isset($_REQUEST['removedump'])) {
@unlink($path);
if (! is_file($path)) {
Feedback::success(tr('Dump file %0 removed.', '<em>' . $path . '</em>'), 'session');
Feedback::success(tr('Dump file %0 removed.', '<em>' . $path . '</em>'));
} else {
Feedback::error(tr('Dump file %0 was not removed.', '<em>' . $path . '</em>'), 'session');
Feedback::error(tr('Dump file %0 was not removed.', '<em>' . $path . '</em>'));
}
}
......
......@@ -3101,7 +3101,7 @@ class Comments extends TikiLib
);
if ($approved === false) {
Feedback::error(tr('Your comment was rejected.'), 'session');
Feedback::error(tr('Your comment was rejected.'));
return false;
}
......@@ -3302,7 +3302,7 @@ class Comments extends TikiLib
]
);
} catch (Exception $e) {
Feedback::error(tr('Cannot perform spam check: %0', $e->getMessage()), 'session');
Feedback::error(tr('Cannot perform spam check: %0', $e->getMessage()));
return false;
}
}
......
......@@ -35,7 +35,7 @@ class Controller
if (! empty($type)) {
$className = 'Tiki\\CustomRoute\\Type\\' . $type;
if (! class_exists($className)) {
Feedback::error(tr('An error occurred; please contact the administrator.'), 'session');
Feedback::error(tr('An error occurred; please contact the administrator.'));
$this->redirectToAdmin();
}
......@@ -64,11 +64,11 @@ class Controller
$item->save();
$feedback = $id ? tr('Route was updated.') : tr('Route was created.');
Feedback::success($feedback, 'session');
Feedback::success($feedback);
$this->redirectToAdmin();
}
Feedback::error(['mes' => $errors], 'session');
Feedback::error(['mes' => $errors]);
return $item->toArray();
}
......
......@@ -189,7 +189,7 @@ class H5P_H5PTiki implements H5PFrameworkInterface
{
if (Perms::get()->h5p_edit) {
// needs 'session' as the method param if the error happens asychronously
Feedback::error(tra($message), 'session');
Feedback::error(tra($message));
}
}
......@@ -202,7 +202,7 @@ class H5P_H5PTiki implements H5PFrameworkInterface
public function setInfoMessage($message)
{
if (Perms::get()->h5p_edit) {
Feedback::success(tra($message), 'session');
Feedback::success(tra($message));
}
}
......@@ -1384,7 +1384,7 @@ GROUP BY l.`name`, l.`major_version`, l.`minor_version`');
$exportedFile = H5P_H5PTiki::$h5p_path . '/exports/' . $filename;
if (! file_exists($exportedFile)) {
Feedback::error(tr('Exporting H5P content %0 failed', $content['id']), 'session');
Feedback::error(tr('Exporting H5P content %0 failed', $content['id']));
}
$filegallib = TikiLib::lib('filegal');
......@@ -1410,7 +1410,7 @@ GROUP BY l.`name`, l.`major_version`, l.`minor_version`');
$this->isSaving = false;
if (! $result) {
Feedback::error(tr('Saving H5P content %0 (fileId %1) failed', $content['id'], $content['file_id']), 'session');
Feedback::error(tr('Saving H5P content %0 (fileId %1) failed', $content['id'], $content['file_id']));
}
}
......
......@@ -87,7 +87,7 @@ class Search_Elastic_Connection
// in elastic v2 _status has been replaced by _stats so try that next...
if (strpos($message, '[_status]') === false) { // another error
Feedback::error($message . ' for index ' . $index, 'session');
Feedback::error($message . ' for index ' . $index);
return null;
}
}
......@@ -97,7 +97,7 @@ class Search_Elastic_Connection
$message = $e->getMessage();
if (strpos($message, 'no such index') === false) { // suppress no such index "errors"
Feedback::error($message . ' for index ' . $index, 'session');
Feedback::error($message . ' for index ' . $index);
}
return null;
}
......
......@@ -339,7 +339,7 @@ class Search_Elastic_Index implements Search_Index_Interface, Search_Index_Query
],
]];
} else {
Feedback::error(tr('Federated index %0 not found', $indexName), 'session');
Feedback::error(tr('Federated index %0 not found', $indexName));
}
}
......
......@@ -156,7 +156,7 @@ class Search_Formatter_Builder
} elseif (! file_exists($arguments['template'])) {
$temp = $smarty->get_filename($arguments['template']);
if (empty($temp)) { //if get_filename cannot find template, return error
Feedback::error(tr('Missing template "%0"', $arguments['template']), 'session');
Feedback::error(tr('Missing template "%0"', $arguments['template']));
return '';
}
$arguments['template'] = $temp;
......
......@@ -154,7 +154,7 @@ class Search_Indexer
$objectType,
$e->getMessage()
);
Feedback::error($msg, 'session');
Feedback::error($msg);
$this->log->err($msg);
}
}
......@@ -210,7 +210,7 @@ class Search_Indexer
'Object %0 type %1 returned null from getDocument function',
$objectId,
$objectType
), 'session');
));
$data = [];
}
if (! is_int(key($data))) {
......
......@@ -209,7 +209,7 @@ class Search_Lucene_Index implements Search_Index_Interface
try {
$hits = $this->getLucene()->find($query, $this->getSortField($sortOrder), $this->getSortType($sortOrder), $this->getSortOrder($sortOrder));
} catch (Exception $e) {
Feedback::error($e->getMessage(), 'session');
Feedback::error($e->getMessage());
}
$result = [];
......
......@@ -142,7 +142,7 @@ class Search_Query implements Search_Query_Interface
if ($from2) {
$from = $from2;
} else {
Feedback::error(tra('filterRange: "from" value not parsed'), 'session');
Feedback::error(tra('filterRange: "from" value not parsed'));
}
}
if (! is_numeric($to)) {
......@@ -150,7 +150,7 @@ class Search_Query implements Search_Query_Interface
if ($to2) {
$to = $to2;
} else {
Feedback::error(tra('filterRange: "to" value not parsed'), 'session');
Feedback::error(tra('filterRange: "to" value not parsed'));
}
}
......@@ -321,7 +321,7 @@ class Search_Query implements Search_Query_Interface
$this->sortOrder = null;
$resultset = $index->find($this, $this->start, $this->count);
} catch (Exception $e) {
Feedback::error(tra("Malformed search query"), 'session');
Feedback::error(tra("Malformed search query"));
trigger_error($e->getMessage(), E_USER_WARNING);
return Search_ResultSet::create([]);
}
......
......@@ -180,7 +180,7 @@ class Search_Query_WikiBuilder
function wpquery_filter_relation($query, $value, $arguments)
{
if (! isset($arguments['qualifier'], $arguments['objecttype'])) {
Feedback::error(tr('Missing objectype or qualifier for relation filter.'), 'session');
Feedback::error(tr('Missing objectype or qualifier for relation filter.'));
}
/* custom mani for OR operation in relation filter */
......@@ -237,7 +237,7 @@ class Search_Query_WikiBuilder
$arguments['to'] = $arguments['from'] + $arguments['gap'];
}
if (! isset($arguments['from'], $arguments['to'])) {
Feedback::error(tr('The range filter is missing \"from\" or \"to\".'), 'session');
Feedback::error(tr('The range filter is missing \"from\" or \"to\".'));
}
$query->filterRange($arguments['from'], $arguments['to'], $value);
}
......@@ -245,7 +245,7 @@ class Search_Query_WikiBuilder
function wpquery_filter_textrange($query, $value, array $arguments)
{
if (! isset($arguments['from'], $arguments['to'])) {
Feedback::error(tr('The range filter is missing \"from\" or \"to\".'), 'session');
Feedback::error(tr('The range filter is missing \"from\" or \"to\".'));
}
$query->filterTextRange($arguments['from'], $arguments['to'], $value);
}
......@@ -318,7 +318,7 @@ class Search_Query_WikiBuilder
function wpquery_filter_distance($query, $value, array $arguments)
{
if (! isset($arguments['distance'], $arguments['lat'], $arguments['lon'])) {
Feedback::error(tr('The distance filter is missing \"distance\", \"lat\" or \"lon\".'), 'session');
Feedback::error(tr('The distance filter is missing \"distance\", \"lat\" or \"lon\".'));
}
$query->filterDistance($value, $arguments['lat'], $arguments['lon']);
}
......@@ -353,7 +353,7 @@ class Search_Query_WikiBuilder
$value = new Search_Query_Order('geo_point', 'distance', $arguments['order'], $arguments);
} else {
Feedback::error(tr('Distance sort: Missing lat or lon arguments'), 'session');
Feedback::error(tr('Distance sort: Missing lat or lon arguments'));
return;
}
}
......
......@@ -63,12 +63,12 @@ class Services_ActivityStream_ManageController
$result = $this->lib->deleteRule($id);
if ($result->numRows()) {
if ($result->numRows() == 1) {
Feedback::success(tra('Activity rule deleted'), 'session');
Feedback::success(tra('Activity rule deleted'));
} else {
Feedback::success(tra('%0 activity rules deleted', $result->numRows()));
}
} else {
Feedback::error(tra('No activity rules deleted'), 'session');
Feedback::error(tra('No activity rules deleted'));
}
$removed = true;
}
......
......@@ -314,7 +314,7 @@ class Services_Edit_PluginController
$user,
$tikilib->get_ip_address()
);
Feedback::success($message, 'session');
Feedback::success($message);
return [];
}
}
......@@ -404,7 +404,7 @@ class Services_Edit_PluginController
$tikilib->get_ip_address()
);
Feedback::success(tr('Plugin %0 on page %1 converted.', $plugin, $page), 'session');
Feedback::success(tr('Plugin %0 on page %1 converted.', $plugin, $page));
return [];
}
}
......
......@@ -245,15 +245,15 @@ class Services_File_Controller
$errors
);
} catch (Exception $e) {
Feedback::error($e->getMessage(), 'session');
Feedback::error($e->getMessage());
}
if ($errors) {
Feedback::error(['mes' => $errors], 'session');
Feedback::error(['mes' => $errors]);
} else {
$file['syntax'] = tr('Batch file processed: "%0"', $file['name']); // cheeky?
}
} else {
Feedback::error(tra('You don\'t have permission to upload zipped file packages'), 'session');
Feedback::error(tra('You don\'t have permission to upload zipped file packages'));
}
}
......
......@@ -92,7 +92,7 @@ class Services_File_FinderController
if ($startGallery) {
$gal_info = TikiLib::lib('filegal')->get_file_gallery_info($startGallery);
if (! $gal_info) {
Feedback::error(tr('Gallery ID %0 not found', $startGallery), 'session');
Feedback::error(tr('Gallery ID %0 not found', $startGallery));
$startGallery = $prefs['fgal_root_id'];
}
}
......
......@@ -148,7 +148,7 @@ class Services_Forum_Controller
'mes' => $msg,
'items' => $util->items,
];
Feedback::success($feedback, 'session');
Feedback::success($feedback);
//return to page
return Services_Utilities::refresh($util->extra['referer']);
}
......@@ -231,7 +231,7 @@ class Services_Forum_Controller
'mes' => $msg,
'items' => $util->items,
];
Feedback::success($feedback, 'session');
Feedback::success($feedback);
//return to page
return Services_Utilities::refresh($util->extra['referer']);
}
......@@ -286,7 +286,7 @@ class Services_Forum_Controller
'mes' => $msg,
'items' => $util->items,
];
Feedback::success($feedback, 'session');
Feedback::success($feedback);
//return to page
return Services_Utilities::refresh($util->extra['referer']);
}
......@@ -334,7 +334,7 @@ class Services_Forum_Controller
'mes' => $msg,
'items' => $util->items,
];
Feedback::success($feedback, 'session');
Feedback::success($feedback);
//return to page
return Services_Utilities::refresh($util->extra['referer']);
}
......@@ -408,7 +408,7 @@ class Services_Forum_Controller
'mes' => $msg,
'items' => $util->items,
];
Feedback::success($feedback, 'session');
Feedback::success($feedback);
//return to page
return Services_Utilities::refresh($util->extra['referer']);
}
......@@ -507,7 +507,7 @@ class Services_Forum_Controller
'mes' => $msg,
'items' => $util->items,
];
Feedback::success($feedback, 'session');
Feedback::success($feedback);
//return to page
return Services_Utilities::refresh($util->extra['referer']);
}
......@@ -568,7 +568,7 @@ class Services_Forum_Controller
'mes' => $msg,
'items' => $util->items,
];
Feedback::success($feedback, 'session');
Feedback::success($feedback);
//return to page
return Services_Utilities::refresh($util->extra['referer']);
}
......
......@@ -103,7 +103,7 @@ class Services_Group_Controller
'mes' => $msg1,
'items' => $notDeleted,
];
Feedback::error($feedback1, 'session');
Feedback::error($feedback1);
}
if (count($deleted) > 0) {
if (count($deleted) === 1) {
......@@ -116,7 +116,7 @@ class Services_Group_Controller
'mes' => $msg2,
'items' => $deleted,
];
Feedback::success($feedback2, 'session');
Feedback::success($feedback2);
}
//return to page
return Services_Utilities::refresh($this->extra['referer']);
......@@ -192,13 +192,13 @@ class Services_Group_Controller
'tpl' => 'action',
'mes' => tr('Group %0 (ID %1) successfully created', $util->extra['name'], $newGroupId),
];
Feedback::success($feedback1, 'session');
Feedback::success($feedback1);
} else {
$feedback2 = [
'tpl' => 'action',
'mes' => tr('Group %0 not created', $util->extra['name']),
];
Feedback::error($feedback2, 'session');
Feedback::error($feedback2);
}
//return to page - will go back to group listing tab, which is okay
return Services_Utilities::refresh($util->extra['referer']);
......@@ -279,13 +279,13 @@ class Services_Group_Controller
'tpl' => 'action',
'mes' => tr('Group %0 successfully modified', $params['name']),
];
Feedback::success($feedback1, 'session');
Feedback::success($feedback1);
} else {
$feedback2 = [
'tpl' => 'action',
'mes' => tr('Group %0 not modified', $params['name']),
];
Feedback::error($feedback2, 'session');
Feedback::error($feedback2);
}
//return to page
return Services_Utilities::refresh($util->extra['referer']);
......@@ -343,7 +343,7 @@ class Services_Group_Controller
'mes' => $msg,
'items' => $util->items,
];
Feedback::success($feedback, 'session');
Feedback::success($feedback);
}
//return to page
return Services_Utilities::redirect($_SERVER['HTTP_REFERER'] . '#contenttabs_admingroups-3');
......@@ -398,7 +398,7 @@ class Services_Group_Controller
'mes' => $msg,
'items' => $util->items,
];
Feedback::success($feedback, 'session');
Feedback::success($feedback);
}
//return to page
return Services_Utilities::redirect($_SERVER['HTTP_REFERER'] . $util->extra['anchor']);
......@@ -452,7 +452,7 @@ class Services_Group_Controller
'mes' => $msg,
'items' => $util->items,
];
Feedback::success($feedback, 'session');
Feedback::success($feedback);
}
//return to page
return Services_Utilities::redirect($_SERVER['HTTP_REFERER'] . $util->extra['anchor']);
......
......@@ -68,15 +68,15 @@ class Services_Menu_Controller
$success = $this->menulib->replace_menu($menuId, $name, $description, $type, $icon, $use_items_icons, $parse);
if ($success) {
if ($menuId) {
Feedback::success(tr('The %0 menu has been edited', $name), 'session');
Feedback::success(tr('The %0 menu has been edited', $name));
} else {
Feedback::success(tr('The %0 menu has been created', $name), 'session');
Feedback::success(tr('The %0 menu has been created', $name));
}
} else {
if ($menuId) {
Feedback::error(tr('An error occurred - the %0 menu may not have been edited', $name), 'session');
Feedback::error(tr('An error occurred - the %0 menu may not have been edited', $name));
} else {
Feedback::error(tr('An error occurred - the %0 menu may not have been created', $name), 'session');
Feedback::error(tr('An error occurred - the %0 menu may not have been created', $name));
}
}
}
......@@ -114,8 +114,7 @@ class Services_Menu_Controller
//execute menu cloning
if ($util->isConfirmPost()) {
$this->menulib->clone_menu($menuId, $input->name->text(), $input->description->text());
Feedback::success(tr('Menu %0 cloned as menu %1', $menuDetails['info']['name'], $input->name->text()),
'session');
Feedback::success(tr('Menu %0 cloned as menu %1', $menuDetails['info']['name'], $input->name->text()));
return [];
}
//prepare basic data
......@@ -342,7 +341,7 @@ class Services_Menu_Controller
$menuLib->import_menu_options($menuId);
global $base_url;
$redirect = $base_url . 'tiki-admin_menu_options.php?menuId=' . $menuId;
Feedback::success(tr('Your menu options have been imported'), 'session');
Feedback::success(tr('Your menu options have been imported'));
Services_Utilities::sendFeedback($redirect);
}
......@@ -518,9 +517,9 @@ class Services_Menu_Controller
if ($util->isConfirmPost()) {
$result = $this->menulib->remove_menu($menuId);
if ($result) {
Feedback::success(tr('The %0 menu has been removed', $menuDetails['info']['name']), 'session');
Feedback::success(tr('The %0 menu has been removed', $menuDetails['info']['name']));
} else {
Feedback::error(tr('The %0 menu has not been removed', $menuDetails['info']['name']), 'session');
Feedback::error(tr('The %0 menu has not been removed', $menuDetails['info']['name']));
}
return Services_Utilities::refresh($util->extra['referer']);
} else {
......
......@@ -111,7 +111,7 @@ class Services_Object_Controller
$return = TikiLib::lib('attribute')->set_attribute($type, $object, $attribute, $value);
if (! $return) {
Feedback::error(tr('Invalid attribute name "%0"',