public function testPageStyles() { $ps = new \Concrete\Core\StyleCustomizer\Inline\StyleSet(); $ps->setBackgroundColor('#ffffff'); $ps->save(); $psx = \Concrete\Core\StyleCustomizer\Inline\StyleSet::getByID(1); $this->assertInstanceOf('\\Concrete\\Core\\StyleCustomizer\\Inline\\StyleSet', $psx); $this->assertEquals(1, $psx->getID()); $this->assertEquals('#ffffff', $psx->getBackgroundColor()); }
public function getAreaCustomStyle($area, $force = false) { $areac = $area->getAreaCollectionObject(); if ($areac instanceof Stack) { // this fixes the problem of users applying design to the main area on the page, and then that trickling into any // stacks that have been added to other areas of the page. return null; } $result = null; $styles = $this->vObj->getCustomAreaStyles(); $areaHandle = $area->getAreaHandle(); if ($force || isset($styles[$areaHandle])) { $pss = isset($styles[$areaHandle]) ? StyleSet::getByID($styles[$areaHandle]) : null; $result = new AreaCustomStyle($pss, $area, $this->getCollectionThemeObject()); } return $result; }
public function getCustomStyle($force = false) { if ($this->getCustomStyleSetID() > 0 || $force) { $csr = StyleSet::getByID($this->getCustomStyleSetID()); $theme = $this->c->getCollectionThemeObject(); switch ($this->getBlockTypeHandle()) { case BLOCK_HANDLE_LAYOUT_PROXY: $bs = new CoreAreaLayoutCustomStyle($csr, $this, $theme); break; default: $bs = new CustomStyle($csr, $this, $theme); break; } return $bs; } }
public function getCustomStyle($force = false) { if ($this->getCustomStyleSetID() > 0 || $force) { $csr = StyleSet::getByID($this->getCustomStyleSetID()); $bs = new CustomStyle($csr, $this->getBlockID(), $this->getAreaHandle()); return $bs; } }
public function getAreaCustomStyle($area, $force = false) { $db = Loader::db(); $areac = $area->getAreaCollectionObject(); if ($areac instanceof Stack) { // this fixes the problem of users applying design to the main area on the page, and then that trickling into any // stacks that have been added to other areas of the page. return false; } $styles = $this->vObj->getCustomAreaStyles(); $issID = $styles[$area->getAreaHandle()]; if ($issID > 0 || $force) { if ($issID) { $pss = StyleSet::getByID($issID); } $pss = new AreaCustomStyle($pss, $area->getAreaHandle()); return $pss; } }