本文整理汇总了PHP中Backend\Core\Engine\Base\ActionEdit::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP ActionEdit::execute方法的具体用法?PHP ActionEdit::execute怎么用?PHP ActionEdit::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Backend\Core\Engine\Base\ActionEdit
的用法示例。
在下文中一共展示了ActionEdit::execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Execute the action
*/
public function execute()
{
$this->id = $this->getParameter('id', 'int');
$error = $this->getParameter('error', 'string');
$this->loadAuthenticatedUser();
// If id and error parameters are not set we'll assume the user logged in
// and has been redirected to this action by the authentication index action.
// When this is the case the user will be redirected to the index action of this module.
// An action to which he may not have any user rights.
// Redirect to the user's own profile instead to avoid unnessary words.
if ($this->id === null && $error === null && $this->authenticatedUser->getUserId()) {
$this->redirect(BackendModel::createURLForAction('Edit') . '&id=' . $this->authenticatedUser->getUserId());
}
// does the user exists
if ($this->id !== null && BackendUsersModel::exists($this->id)) {
parent::execute();
$this->record = (array) BackendUsersModel::get($this->id);
$this->loadForm();
$this->validateForm();
$this->parse();
$this->display();
} else {
$this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
}
}
示例2: execute
public function execute()
{
parent::execute();
try {
$id = Uuid::fromString($this->getParameter('id', 'string'));
$teamMember = $this->get('team_repository')->find($id);
} catch (\Exception $e) {
return $this->redirect(Model::createURLForAction('Index') . '&error=non-existing');
}
$form = new TeamType('edit', $teamMember);
if ($form->handle()) {
$teamMember = $form->getData();
$this->get('team_repository')->save($teamMember);
return $this->redirect(Model::createURLForAction('Index') . '&report=edited' . '&highlight=row-' . $teamMember->getId());
}
// assign the detail url to the template if available
$url = Model::getURLForBlock($this->URL->getModule(), 'Detail');
if (Model::getURL(404) != $url) {
$this->tpl->assign('detailURL', SITE_URL . $url);
}
$form->parse($this->tpl);
$this->tpl->assign('teamMember', $teamMember->toArray());
$this->parse();
$this->display();
}
示例3: execute
/**
* Execute the action
*/
public function execute()
{
$this->id = $this->getParameter('id', 'int');
// does the item exists
if ($this->id !== null && BackendLocationModel::exists($this->id)) {
$this->header->addJS(FrontendLocationModel::getPathToMapStyles());
parent::execute();
// define Google Maps API key
$apikey = $this->get('fork.settings')->get('Core', 'google_maps_key');
// check Google Maps API key, otherwise redirect to settings
if ($apikey === null) {
$this->redirect(BackendModel::createURLForAction('Index', 'Settings'));
}
// add js
$this->header->addJS('https://maps.googleapis.com/maps/api/js?key=' . $apikey, null, false, true, false);
$this->loadData();
$this->loadForm();
$this->validateForm();
$this->loadSettingsForm();
$this->parse();
$this->display();
} else {
$this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
}
}
示例4: execute
/**
* Execute the action
*/
public function execute()
{
parent::execute();
$this->getCompressionParameters();
$this->parse();
$this->display();
}
示例5: execute
/**
* Execute the action
*/
public function execute()
{
parent::execute();
$this->loadData();
$this->parse();
$this->display();
}
示例6: execute
/**
* Execute the action
*
* @return void
*/
public function execute()
{
// get parameters
$this->id = $this->getParameter('id', 'int');
// does the item exists
if ($this->id !== null && BackendSlideshowModel::existsGallery($this->id)) {
// call parent, this will probably add some general CSS/JS or other required files
parent::execute();
// get all data for the item we want to edit
$this->getData();
// load the form
$this->loadForm();
// load datagrids
$this->loadDataGrid();
// validate the form
$this->validateForm();
// parse
$this->parse();
// display the page
$this->display();
} else {
// no item found, throw an exception, because somebody is fucking with our URL
$this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
}
}
示例7: execute
public function execute()
{
// get parameters
$this->id = $this->getParameter('id', 'int');
// does the item exists?
if ($this->id !== null && BackendGalleriaModel::existsAlbum($this->id)) {
// call parent, this will probably add some general CSS/JS or other required files
parent::execute();
// get all data for the item we want to edit
$this->getData();
// load the form
$this->loadForm();
$this->loadFormAddImage();
$this->loadFormDeleteImage();
// validate the form
$this->validateForm();
$this->validateFormAddImage();
$this->validateFormDeleteImage();
// parse the form
$this->parse();
// display the page
$this->display();
} else {
$this->redirect(BackendModel::createURLForAction('albums') . '&error=non-existing');
}
}
示例8: execute
/**
* Execute the action
*/
public function execute()
{
parent::execute();
// load record
$this->loadData();
// add js
$this->header->addJS('jstree/jquery.tree.js', null, false);
$this->header->addJS('jstree/lib/jquery.cookie.js', null, false);
$this->header->addJS('jstree/plugins/jquery.tree.cookie.js', null, false);
// add css
$this->header->addCSS('/src/Backend/Modules/Pages/Js/jstree/themes/fork/style.css', null, true);
// get the templates
$this->templates = BackendExtensionsModel::getTemplates();
// set the default template as checked
$this->templates[$this->record['template_id']]['checked'] = true;
// homepage?
if ($this->id == 1) {
// loop and set disabled state
foreach ($this->templates as &$row) {
$row['disabled'] = $row['has_block'];
}
}
// get the extras
$this->extras = BackendExtensionsModel::getExtras();
$this->loadForm();
$this->loadDrafts();
$this->loadRevisions();
$this->validateForm();
$this->parse();
$this->display();
}
示例9: execute
/**
* Execute the action
*/
public function execute()
{
parent::execute();
$this->loadForm();
$this->validateForm();
$this->parse();
$this->display();
}
示例10: execute
/**
* Execute the action
*/
public function execute()
{
parent::execute();
set_time_limit(0);
$this->fs = new Filesystem();
$this->loadForm();
$this->validateForm();
$this->parse();
$this->display();
}
示例11: execute
/**
* Execute the action
*/
public function execute()
{
parent::execute();
$this->header->addJS('ThemeTemplate.js');
$this->loadData();
$this->loadForm();
$this->validateForm();
$this->parse();
$this->display();
}
示例12: execute
/**
* Execute the action
*/
public function execute()
{
parent::execute();
$this->groupId = \SpoonFilter::getGetValue('group_id', null, 0, 'int');
$this->downloadExampleFile();
$this->loadForm();
$this->validateForm();
$this->parse();
$this->display();
}
示例13: execute
/**
* Execute the action
*/
public function execute()
{
parent::execute();
$this->loadData();
$this->loadForm();
$this->validateForm();
$this->header->addJsData("Media", "mediaModule", (string) $this->getModule());
$this->header->addJsData("Media", "mediaAction", (string) $this->getAction());
$this->header->addJsData("Media", "mediaId", (int) $this->id);
$this->header->addJsData("Media", "mediaType", (string) 'Agenda');
$this->parse();
$this->display();
}
示例14: execute
/**
* Execute the action
*/
public function execute()
{
$this->id = $this->getParameter('id', 'int');
// does the item exist
if (BackendMailmotorModel::existsMailing($this->id)) {
parent::execute();
$this->getData();
$this->parse();
$this->display(BACKEND_MODULES_PATH . '/Mailmotor/Layout/Templates/EditMailingIframe.tpl');
} else {
$this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
}
}
示例15: execute
/**
* Execute the action
*/
public function execute()
{
$this->id = $this->getParameter('id', 'int');
if ($this->id !== null && BackendCatalogModel::existsFile($this->id)) {
parent::execute();
$this->getData();
$this->loadForm();
$this->validateForm();
$this->parse();
$this->display();
} else {
$this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
}
}