public function on_start() { parent::on_start(); Loader::model('stack/list'); $stm = new StackList(); $stm->filterByGlobalAreas(); $this->set('globalareas', $stm->get()); $stm = new StackList(); $stm->filterByUserAdded(); $this->set('useradded', $stm->get()); }
public function swapContent($options) { if ($this->validateClearSiteContents($options)) { Loader::model("page_list"); Loader::model("file_list"); Loader::model("stack/list"); $pl = new PageList(); $pages = $pl->get(); foreach ($pages as $c) { $c->delete(); } $fl = new FileList(); $files = $fl->get(); foreach ($files as $f) { $f->delete(); } // clear stacks $sl = new StackList(); foreach ($sl->get() as $c) { $c->delete(); } $home = Page::getByID(HOME_CID); $blocks = $home->getBlocks(); foreach ($blocks as $b) { $b->deleteBlock(); } $pageTypes = CollectionType::getList(); foreach ($pageTypes as $ct) { $ct->delete(); } // now we add in any files that this package has if (is_dir($this->getPackagePath() . '/content_files')) { Loader::library('file/importer'); $fh = new FileImporter(); $contents = Loader::helper('file')->getDirectoryContents($this->getPackagePath() . '/content_files'); foreach ($contents as $filename) { $f = $fh->import($this->getPackagePath() . '/content_files/' . $filename, $filename); } } // now we parse the content.xml if it exists. Loader::library('content/importer'); $ci = new ContentImporter(); $ci->importContentFile($this->getPackagePath() . '/content.xml'); } }
<?php defined('C5_EXECUTE') or die("Access Denied."); Loader::model('stack/list'); $sl = new StackList(); $sl->filterByUserAdded(); $stacks = $sl->get(); //$btl = $a->getAddBlockTypes($c, $ap ); $ci = Loader::helper('concrete/urls'); $ch = Loader::helper('concrete/interface'); $form = Loader::helper('form'); ?> <script type="text/javascript"> $('input[name=ccmStackSearch]').focus(function() { if ($(this).val() == '<?php echo t("Search"); ?> ') { $(this).val(''); } $(this).css('color', '#000'); if (!ccmLiveSearchActive) { $('#ccmStackSearch').liveUpdate('ccm-stack-list', 'stacks'); ccmLiveSearchActive = true; // $("#ccm-block-type-clear-search").show(); } });