Exemplo n.º 1
0
 function on_start()
 {
     $cts = array();
     Loader::model('collection_types');
     $list = CollectionType::getList();
     //this just lists out the page_types in concrete5, nothing hard
     foreach ($list as $ct) {
         $cts[$ct->getCollectionTypeID()] = $ct->getCollectionTypeName();
     }
     $this->set('collectiontypes', $cts);
 }
Exemplo n.º 2
0
 protected function setupForm()
 {
     $this->loadNewsSections();
     Loader::model("collection_types");
     $ctArray = CollectionType::getList('');
     $pageTypes = array();
     foreach ($ctArray as $ct) {
         $pageTypes[$ct->getCollectionTypeID()] = $ct->getCollectionTypeName();
     }
     $this->set('pageTypes', $pageTypes);
     $this->addHeaderItem(Loader::helper('html')->javascript('tiny_mce/tiny_mce.js'));
 }
Exemplo n.º 3
0
 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');
     }
 }
Exemplo n.º 4
0
?>
		<div class="controls">
			<?php 
echo $form->text('cvName', $searchRequest['cvName'], array('style' => 'width: 120px'));
?>
		</div>
		</div>

		<div class="span3">
		<?php 
echo $form->label('ctID', t('Page Type'));
?>
		<div class="controls">
			<? 
			Loader::model('collection_types');
			$ctl = CollectionType::getList();
			$ctypes = array('' => t('** All'));
			foreach($ctl as $ct) {
				$ctypes[$ct->getCollectionTypeID()] = $ct->getCollectionTypeName();
			}
			
			print $form->select('ctID', $ctypes, $searchRequest['ctID'], array('style' => 'width:120px'))?>

		</div>
		</div>

		<div class="span3">
		<?php 
echo $form->label('numResults', t('# Per Page'));
?>
		<div class="controls">
Exemplo n.º 5
0
<?php  defined('C5_EXECUTE') or die("Access Denied."); ?> 
<?php  $c = Page::getCurrentPage(); ?>
<ul id="ccm-pagelist-tabs" class="ccm-dialog-tabs">
	<li class="ccm-nav-active"><a id="ccm-pagelist-tab-add" href="javascript:void(0);"><?php echo ($bID>0)? t('Edit') : t('Add') ?></a></li>
	<li class=""><a id="ccm-pagelist-tab-preview"  href="javascript:void(0);"><?php echo t('Preview')?></a></li>
</ul>

<input type="hidden" name="pageListToolsDir" value="<?php echo $uh->getBlockTypeToolsURL($bt)?>/" />
<div id="ccm-pagelistPane-add" class="ccm-pagelistPane">
	<div class="ccm-block-field-group">
	  <h2><?php echo t('Number and Type of Pages')?></h2>
	  <?php echo t('Display')?>
	  <input type="text" name="num" value="<?php echo $num?>" style="width: 30px">
	  <?php echo t('pages of type')?>
	  <?php 
			$ctArray = CollectionType::getList();
	
			if (is_array($ctArray)) { ?>
	  <select name="ctID" id="selectCTID">
		<option value="0">** <?php  echo t('All')?> **</option>
		<?php  foreach ($ctArray as $ct) { ?>
		<option value="<?php echo $ct->getCollectionTypeID()?>" <?php  if ($ctID == $ct->getCollectionTypeID()) { ?> selected <?php  } ?>>
		<?php echo $ct->getCollectionTypeName()?>
		</option>
		<?php  } ?>
	  </select>
	  <?php  } ?>
	  
	  <h2><?php echo t('Filter')?></h2>
	  
	  <?php 
Exemplo n.º 6
0
	public function getFilesInTheme() {
		Loader::model('collection_types');
		Loader::model('single_page');
		
		$dh = Loader::helper('file');
		$ctlist = CollectionType::getList();
		$cts = array();
		foreach($ctlist as $ct) {
			$cts[] = $ct->getCollectionTypeHandle();
		}
		
		$filesTmp = $dh->getDirectoryContents($this->ptDirectory);
		foreach($filesTmp as $f) {
			if (strrchr($f, '.') == PageTheme::THEME_EXTENSION) {
				$fHandle = substr($f, 0, strpos($f, '.'));
				
				if ($f == FILENAME_THEMES_VIEW) {
					$type = PageThemeFile::TFTYPE_VIEW;
				} else if ($f == FILENAME_THEMES_DEFAULT) {
					$type = PageThemeFile::TFTYPE_DEFAULT;
				} else if (in_array($f, SinglePage::getThemeableCorePages())) {
					$type = PageThemeFile::TFTYPE_SINGLE_PAGE;
				} else if (in_array($fHandle, $cts)) {
					$type = PageThemeFile::TFTYPE_PAGE_TYPE_EXISTING;
				} else {
					$type = PageThemeFile::TFTYPE_PAGE_TYPE_NEW;
				}
				
				$pf = new PageThemeFile();
				$pf->setFilename($f);
				$pf->setType($type);
				$files[] = $pf;
			}
		}
		
		return $files;
	}
Exemplo n.º 7
0
<?
defined('C5_EXECUTE') or die("Access Denied.");

Loader::model('collection_types');
$stringHelper=Loader::helper('text');
$tArray = PageTheme::getGlobalList();
$tArray2 = PageTheme::getLocalList();
$tArray = array_merge($tArray, $tArray2);
$ctArray = CollectionType::getList($c->getAllowedSubCollections());

$cp = new Permissions($c);
if ($c->getCollectionID() > 1) {
	$parent = Page::getByID($c->getCollectionParentID());
	$parentCP = new Permissions($parent);
}
if (!$cp->canAdminPage()) {
	die(t('Access Denied'));
}

$cnt = 0;
for ($i = 0; $i < count($ctArray); $i++) {
	$ct = $ctArray[$i];
	if ($c->getCollectionID() == 1 || $parentCP->canAddSubCollection($ct)) { 
		$cnt++;
	}
}

$plID = $c->getCollectionThemeID();
$ctID = $c->getCollectionTypeID();
if ($plID == 0) {
	$pl = PageTheme::getSiteTheme();
<?php

defined('C5_EXECUTE') or die("Access Denied.");
?>

<?php 
$included = $permissionAccess->getAccessListItems();
$excluded = $permissionAccess->getAccessListItems(PermissionKey::ACCESS_TYPE_EXCLUDE);
$pageTypes = CollectionType::getList();
$form = Loader::helper('form');
?>

<?php 
if (count($included) > 0 || count($excluded) > 0) {
    ?>

<?php 
    if (count($included) > 0) {
        ?>

<h3><?php 
        echo t('Who can add what?');
        ?>
</h3>

<?php 
        foreach ($included as $assignment) {
            $entity = $assignment->getAccessEntityObject();
            ?>