Пример #1
0
 /**
  * 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);
 }
Пример #3
0
 /**
  * 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);
 }
Пример #4
0
 /**
  * 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);
 }
Пример #5
0
 /**
  * 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()));
 }
Пример #6
0
 protected function CreateFormUrl()
 {
     $args = array('page' => $this->page->GetID(), 'area' => $this->area->GetID());
     return BackendRouter::ModuleUrl(new ModuleForm(), $args);
 }
Пример #7
0
 /**
  * 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);
 }