public function publishToPage(Page $c, $data, $controls) { array_push(self::$ptComposerRequestControlsProcessed, $this); // now we check to see if we have any more core controls to process in this request $coreControls = array(); foreach ($controls as $cnt) { if ($cnt->getPageTypeComposerControlTypeHandle() == $this->ptComposerControlTypeHandle) { $coreControls[] = $controls; } } if (count(self::$ptComposerRequestControlsProcessed) == count($coreControls)) { // this was the last one. so we're going to loop through our saved request // and do the page update once, rather than four times. $c->update(self::$ptComposerSaveRequest); } }
public static function refresh(CorePage $c) { // takes a generated collection and refreshes it - updates its path, it's cDateModified // it's name, it's permissions if (!$c->isGeneratedCollection()) { return false; } $pkg = Package::getByID($c->getPackageID()); $currentPath = $c->getCollectionPath(); $pathToFile = static::getPathToNode($currentPath, $pkg); $txt = Loader::helper('text'); $data = array(); $data['cName'] = $txt->unhandle($c->getCollectionHandle()); $data['cFilename'] = $pathToFile; $c->update($data); $env = Environment::get(); $env->clearOverrideCache(); }
/** * @param $data * * @return bool */ public function update($data) { if (isset($data['stackName'])) { $txt = Core::make('helper/text'); $data['cName'] = $data['stackName']; $data['cHandle'] = str_replace('-', Config::get('concrete.seo.page_path_separator'), $txt->urlify($data['stackName'])); } $worked = parent::update($data); if (isset($data['stackName'])) { // Make sure the stack path is always up-to-date after a name change $this->rescanCollectionPath(); $db = Database::connection(); $stackName = $data['stackName']; $db->Execute('update Stacks set stName = ? WHERE cID = ?', array($stackName, $this->getCollectionID())); } return $worked; }
public function update($data) { return parent::update($data); }