Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  * @return mixed
  */
 public function process()
 {
     if (!$this->checkParentPermissions()) {
         return $this->failure($this->modx->lexicon('permission_denied'));
     }
     $this->newResource = $this->oldResource->duplicate(array('newName' => $this->getProperty('name', ''), 'duplicateChildren' => $this->getProperty('duplicate_children', false), 'prefixDuplicate' => $this->getProperty('prefixDuplicate', false), 'publishedMode' => $this->getProperty('published_mode', 'preserve')));
     if (!$this->newResource instanceof modResource) {
         return $this->failure($this->newResource);
     }
     $this->fireDuplicateEvent();
     $this->logManagerAction();
     return $this->success('', array('id' => $this->newResource->get('id')));
 }