FOF30\View\DataView\Raw::onBeforeEdit PHP Méthode

onBeforeEdit() protected méthode

Executes before rendering the page for the Edit task.
protected onBeforeEdit ( )
    protected function onBeforeEdit()
    {
        /** @var DataModel $model */
        $model = $this->getModel();
        // It seems that I can't edit records, maybe I can edit only this one due asset tracking?
        if (!$this->permissions->edit || !$this->permissions->editown) {
            if ($model) {
                // Ok, record is tracked, let's see if I can this record
                if ($model->isAssetsTracked()) {
                    $platform = $this->container->platform;
                    if (!$this->permissions->edit) {
                        $this->permissions->edit = $platform->authorise('core.edit', $model->getAssetName());
                    }
                    if (!$this->permissions->editown) {
                        $this->permissions->editown = $platform->authorise('core.edit.own', $model->getAssetName());
                    }
                }
            }
        }
        $this->item = $model->findOrFail();
    }

Usage Example

Exemple #1
0
 /**
  * Executes before rendering the page for the Edit task.
  */
 protected function onBeforeEdit()
 {
     // Hide main menu
     \JFactory::getApplication()->input->set('hidemainmenu', true);
     parent::onBeforeEdit();
 }