public function getParent($id = 0) { $page = new Pagdivspage(); if ($parent = $page->getParent($id)) { return $parent; } else { $news = new Pagdivsnews(); if ($parent = $news->getParent($id)) { return $parent; } } return null; }
public function duplicateAction() { $dbId = $this->_getParam('id', null); $request = $this->getRequest(); $status = 0; if (null == $dbId) { $msg = 'A problem occur.'; } else { if ('pages' == $this->eModule) { // Soucis : il faudrait récuperer l'ordre du type de contenu $result = Pagdivspage::duplicate($dbId, $request->pagstructureid); $traceMsg = 'trace.event.duplicate_content_pages'; } else { $result = Pagdivsnews::duplicate($dbId, $request->pagstructureid); $traceMsg = 'trace.event.duplicate_content_news'; } if (false == $result) { $msg = 'Unknow status'; } else { $msg = 'Element ' . $result; $status = 1; Sydney_Db_Trace::add($traceMsg, $request->getModuleName(), 'pagdivs', $request->getActionName(), $result, $request->pagstructureid); } } $this->view->ResultSet = array('message' => $msg, 'status' => $status, 'dbid' => $result, 'modal' => false); }