/** * The edit/create url base parameters */ protected function EditParams() { $params = array(); $params['page'] = $this->page->GetID(); $params['area'] = $this->area->GetID(); return $params; }
/** * Gets the top most content of the layout area * @param Area $area The area * @return LayoutContent The first and root layout content */ function TopMost() { $sql = Access::SqlBuilder(); $tbl = LayoutContent::Schema()->Table(); $where = $sql->Equals($tbl->Field('Area'), $sql->Value($this->area->GetID()))->And_($sql->IsNull($tbl->Field('Parent')))->And_($sql->IsNull($tbl->Field('Previous'))); return LayoutContent::Schema()->First($where); }
/** * The edit form url * @param Area $area * @return string */ protected function EditUrl(Area $area) { $args = array('layout' => $this->layout->GetID()); $args['area'] = $area->GetID(); return BackendRouter::ModuleUrl(new AreaForm(), $args); }
/** * Gets the content tree url * @param Area $area * @return string Returns the page content tree url */ protected function AreaUrl(Area $area) { $params = array(); $params['page'] = $this->page->GetID(); $params['area'] = $area->GetID(); return BackendRouter::ModuleUrl(new PageContentTree(), $params); }
/** * The link to the area contents * @param Area $area The area * @return string Returns the url of the area content tree */ protected function AreaUrl(Area $area) { return BackendRouter::ModuleUrl(new LayoutContentTree(), array('area' => $area->GetID())); }
protected function CreateFormUrl() { $args = array('page' => $this->page->GetID(), 'area' => $this->area->GetID()); return BackendRouter::ModuleUrl(new ModuleForm(), $args); }
/** * The last log item that is directly related to the area * @param Area $area The area * @return LogItem Returns the log item */ static function LastAreaLog(Area $area) { $tblLogArea = LogArea::Schema()->Table(); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed'))); $joinCond = $sql->Equals($tblLogArea->Field('LogItem'), $tblLogItem->Field('ID')); $where = $sql->Equals($tblLogArea->Field('Area'), $sql->Value($area->GetID())); return LogItem::Schema()->First($where, $orderBy, null, $sql->Join($tblLogArea), JoinType::Inner(), $joinCond); }