Example #1
0
 public function on_page_view()
 {
     $html = Loader::helper('html');
     $bv = new BlockView();
     $bv->setBlockObject($this->getBlockObject());
     $this->addFooterItem($html->javascript($bv->getBlockURL() . '/magnific/magnific-combined-1.0.0.min.js', array('minify' => true)));
 }
Example #2
0
 public function view()
 {
     Loader::model('sortable_fancybox_gallery', 'sortable_fancybox_gallery');
     $sg = new SortableFancyboxGallery($this->bID);
     $files = $sg->getPermittedImages();
     $ih = Loader::helper('image');
     $images = array();
     $max_row_height = 0;
     foreach ($files as $file) {
         $image = array();
         //$image['src'] = $file->getRelativePath();
         // $size = @getimagesize($file->getPath());
         // $image['width'] = $size[0];
         // $image['height'] = $size[1];
         $fv = $file->getRecentVersion();
         $image['title'] = htmlspecialchars($fv->getTitle(), ENT_QUOTES, 'UTF-8');
         $image['description'] = htmlspecialchars($fv->getDescription(), ENT_QUOTES, 'UTF-8');
         $full = $ih->getThumbnail($file, $this->fullWidth, $this->fullHeight);
         $image['full_src'] = $full->src;
         $image['full_width'] = $full->width;
         $image['full_height'] = $full->height;
         if ($this->enableLightbox) {
             $thumb = $ih->getThumbnail($file, $this->thumbWidth, $this->thumbHeight, true);
             $image['thumb_src'] = $thumb->src;
             $image['thumb_width'] = $thumb->width;
             $image['thumb_height'] = $thumb->height;
             $max_row_height = $thumb->height > $max_row_height ? $thumb->height : $max_row_height;
         } else {
             $image['thumb_src'] = '';
             $image['thumb_width'] = 0;
             $image['thumb_height'] = 0;
             $max_row_height = $full->height > $max_row_height ? $full->height : $max_row_height;
         }
         $images[] = $image;
     }
     $this->set('images', $images);
     $this->set('max_row_height', $max_row_height);
     //For "initial block add" css workaround:
     $html = Loader::helper('html');
     $bv = new BlockView();
     $bv->setBlockObject($this->getBlockObject());
     $css_output_object = $html->css($bv->getBlockURL() . '/view.css');
     //Pick up theme overrides
     $this->set('inline_view_css_url', $css_output_object->file);
 }
 function testCoreImageBlockWithNoOverridesHasCorrectTemplates()
 {
     // Test a.
     $p = Page::getByID(1);
     $blocks = $p->getBlocks('Header');
     $b = $blocks[0];
     $bvt = new BlockViewTemplate($b);
     $this->assertEqual($bvt->getTemplate(), DIR_BASE_CORE . '/blocks/image/view.php', 'Test A');
     // Test b.
     $bt = BlockType::getByHandle('image');
     global $a, $ap, $c, $cp;
     if (is_object($bt)) {
         ob_start();
         $bv = new BlockView();
         $bv->render($bt, 'add', array('a' => $a, 'ap' => $ap, 'c' => $c, 'cp' => $cp));
         ob_end_clean();
     }
     $this->assertEqual($bv->getTemplate(), DIR_BASE_CORE . '/blocks/image/add.php', 'Test B');
 }
    $rcID = intval($_REQUEST['cID']);
    $isGlobal = 1;
    $rarHandle = $_REQUEST['arHandle'];
} else {
    $c = Page::getByID($_REQUEST['cID']);
    $a = Area::get($c, $_REQUEST['arHandle']);
    $b = Block::getByID($_REQUEST['bID'], $c, $a);
}
$bp = new Permissions($b);
if (!$bp->canWrite()) {
    die(t("Access Denied."));
}
if ($_REQUEST['btask'] != 'view' && $_REQUEST['btask'] != 'view_edit_mode') {
    include DIR_FILES_ELEMENTS_CORE . '/dialog_header.php';
}
$bv = new BlockView();
if (($isGlobal || $c->isMasterCollection()) && !in_array($_REQUEST['btask'], array('child_pages', 'composer', 'view_edit_mode'))) {
    echo '<div class="ccm-notification">';
    echo t('This is a global block.  Editing it here will change all instances of this block throughout the site.');
    //echo t('This is a global block.  Edit it from the <a href="%s">Global Scrapbook</a> in your dashboard.<br /><br /><br />', View::url('/dashboard/scrapbook/') );
    //echo '[<a class="ccm-dialog-close">'.t('Close Window').'</a>]';
    echo '</div>';
}
if ($b->isAliasOfMasterCollection() && $_REQUEST['btask'] != 'view_edit_mode') {
    echo '<div class="ccm-notification">';
    echo t('This block is an alias of Page Defaults. Editing it here will "disconnect" it so changes to Page Defaults will no longer affect this block.');
    echo '</div>';
}
if (is_object($b)) {
    switch ($_REQUEST['btask']) {
        case 'block_css':
Example #5
0
 /**
  * displays the Area in the page
  * ex: $a = new Area('Main'); $a->display($c);
  * @param Page|Collection $c
  * @param Block[] $alternateBlockArray optional array of blocks to render instead of default behavior
  * @return void
  */
 function display(&$c, $alternateBlockArray = null)
 {
     if (!intval($c->cID)) {
         //Invalid Collection
         return false;
     }
     if ($this->arIsGlobal) {
         $stack = Stack::getByName($this->arHandle);
     }
     $currentPage = Page::getCurrentPage();
     $ourArea = self::getOrCreate($c, $this->arHandle, $this->arIsGlobal);
     if (count($this->customTemplateArray) > 0) {
         $ourArea->customTemplateArray = $this->customTemplateArray;
     }
     if (count($this->attributes) > 0) {
         $ourArea->attributes = $this->attributes;
     }
     if ($this->maximumBlocks > -1) {
         $ourArea->maximumBlocks = $this->maximumBlocks;
     }
     $ap = new Permissions($ourArea);
     if (!$ap->canViewArea()) {
         return false;
     }
     $blocksToDisplay = $alternateBlockArray ? $alternateBlockArray : $ourArea->getAreaBlocksArray($c, $ap);
     $this->totalBlocks = $ourArea->getTotalBlocksInArea();
     $u = new User();
     $bv = new BlockView();
     // now, we iterate through these block groups (which are actually arrays of block objects), and display them on the page
     if ($this->showControls && $c->isEditMode() && $ap->canViewAreaControls()) {
         $bv->renderElement('block_area_header', array('a' => $ourArea));
     }
     $bv->renderElement('block_area_header_view', array('a' => $ourArea));
     //display layouts tied to this area
     //Might need to move this to a better position
     $areaLayouts = $this->getAreaLayouts($c);
     if (is_array($areaLayouts) && count($areaLayouts)) {
         foreach ($areaLayouts as $layout) {
             $layout->display($c, $this);
         }
         if ($this->showControls && ($c->isArrangeMode() || $c->isEditMode())) {
             echo '<div class="ccm-layouts-block-arrange-placeholder ccm-block-arrange"></div>';
         }
     }
     $blockPositionInArea = 1;
     //for blockWrapper output
     foreach ($blocksToDisplay as $b) {
         $includeEditStrip = false;
         $bv = new BlockView();
         $bv->setAreaObject($ourArea);
         // this is useful for rendering areas from one page
         // onto the next and including interactive elements
         if ($currentPage->getCollectionID() != $c->getCollectionID()) {
             $b->setBlockActionCollectionID($c->getCollectionID());
         }
         if ($this->arIsGlobal && is_object($stack)) {
             $b->setBlockActionCollectionID($stack->getCollectionID());
         }
         $p = new Permissions($b);
         if ($c->isEditMode() && $this->showControls && $p->canViewEditInterface()) {
             $includeEditStrip = true;
         }
         if ($p->canViewBlock()) {
             if (!$c->isEditMode()) {
                 $this->outputBlockWrapper(true, $b, $blockPositionInArea);
             }
             if ($includeEditStrip) {
                 $bv->renderElement('block_controls', array('a' => $ourArea, 'b' => $b, 'p' => $p));
                 $bv->renderElement('block_header', array('a' => $ourArea, 'b' => $b, 'p' => $p));
             }
             $bv->render($b);
             if ($includeEditStrip) {
                 $bv->renderElement('block_footer');
             }
             if (!$c->isEditMode()) {
                 $this->outputBlockWrapper(false, $b, $blockPositionInArea);
             }
         }
         $blockPositionInArea++;
     }
     $bv->renderElement('block_area_footer_view', array('a' => $ourArea));
     if ($this->showControls && $c->isEditMode() && $ap->canViewAreaControls()) {
         $bv->renderElement('block_area_footer', array('a' => $ourArea));
     }
 }
Example #6
0
echo $c->getCollectionID();
?>
&arHandle=<?php 
echo $a->getAreaHandle();
?>
&btask=alias_existing_block&<?php 
echo $token;
?>
', function(r) { ccm_parseBlockResponse(r, false, 'add'); })"><?php 
echo $bt->getBlockTypeName();
?>
</a>
					<div class="ccm-scrapbook-list-item-detail">	
						<?	
						try {
							$bv = new BlockView();
							$bv->render($item, 'scrapbook');
						} catch(Exception $e) {
							print BLOCK_NOT_AVAILABLE_TEXT;
						}	
						?>
					</div>
				</div>
			</div>	
			<?
			$i++;
		} else { ?>
		
		
			<div class="ccm-scrapbook-list-item" id="ccm-pc-<?php 
echo $obj->getPileContentID();
Example #7
0
<?php

defined('C5_EXECUTE') or die("Access Denied.");
$bo = Block::getByID($bOriginalID);
$bp = new Permissions($bo);
$bo->setProxyBlock($b);
if ($bp->canWrite()) {
    $bv = new BlockView();
    ?>
	
		<div class="ccm-ui">
			<div class="alert alert-info"><?php 
    echo t("This block was copied from another location. Editing it will create a new instance of it.");
    ?>
</div>
		</div>
		
	<?php 
    $bv->render($bo, 'edit', array('c' => $c, 'a' => $a));
}
 /**
  * Renders a view in the block's folder.
  * <code>
  * public function view() { // The view() method is automatically run when a block is viewed
  *     $this->render("other_special_view"); // don't use .php
  * }
  * </code>
  * @param string $view
  * @return void
  */
 function render($view)
 {
     $bv = new BlockView();
     $bv->setController($this);
     // sometimes we need the block type available in here
     if (is_object($this->getBlockObject())) {
         $bt = BlockType::getByID($this->getBlockObject()->getBlockTypeID());
         $a = $this->getBlockObject()->getBlockAreaObject();
     }
     $this->renderOverride = $view;
 }
Example #9
0
 public function hasComposerBlockTemplate()
 {
     $bv = new BlockView();
     $bv->setBlockObject($this);
     $cpFilename = $this->getBlockComposerFilename();
     if ($cpFilename) {
         $cmpbase = $bv->getBlockPath(DIRNAME_BLOCK_TEMPLATES_COMPOSER . '/' . $cpFilename);
         if (file_exists($cmpbase . '/' . DIRNAME_BLOCK_TEMPLATES_COMPOSER . '/' . $cpFilename)) {
             return true;
         }
     }
     $cmpbase = $bv->getBlockPath(FILENAME_BLOCK_COMPOSER);
     if (file_exists($cmpbase . '/' . FILENAME_BLOCK_COMPOSER)) {
         return true;
     }
     return false;
 }
	private function computeView() {
		$bFilename = $this->bFilename;
		$obj = $this->obj;
		
		// if we've passed in "templates/" as the first part, we strip that off.
		if (strpos($bFilename, 'templates/') === 0) {
			$bFilename = substr($bFilename, 10);
		}

		if ($bFilename) {
			if (is_file(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
				$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
				$bv = new BlockView();
				$bv->setBlockObject($obj);
				$this->baseURL = $bv->getBlockURL();
				$this->basePath = $bv->getBlockPath($this->render);
			} else if (is_file(DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
				$template = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
				$this->baseURL = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
				$this->basePath = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle();
			} else if (is_dir(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
				$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename . '/' . $this->render;
				$this->baseURL = DIR_REL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
			} else if (is_dir(DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
				$template = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename . '/'  . $this->render;
				$this->baseURL = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
			}

			// we check all installed packages
			if (!isset($template)) {
				$pl = PackageList::get();
				$packages = $pl->getPackages();
				foreach($packages as $pkg) {
					$d = '';
					if (is_dir(DIR_PACKAGES . '/' . $pkg->getPackageHandle())) {
						$d = DIR_PACKAGES . '/'. $pkg->getPackageHandle();
					} else if (is_dir(DIR_PACKAGES_CORE . '/'. $pkg->getPackageHandle())) {
						$d = DIR_PACKAGES_CORE . '/'. $pkg->getPackageHandle();
					}
					
					if ($d != '') {
						$baseStub = (is_dir(DIR_PACKAGES . '/' . $pkg->getPackageHandle())) ? DIR_REL . '/' . DIRNAME_PACKAGES . '/'. $pkg->getPackageHandle() : ASSETS_URL . '/'. DIRNAME_PACKAGES . '/' . $pkg->getPackageHandle();
						
						if (is_file($d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . $bFilename)) {
							$template = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . $bFilename;
							$this->baseURL = ASSETS_URL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
							$this->basePath = DIR_FILES_BLOCK_TYPES_CORE . '/' . $obj->getBlockTypeHandle();
						} else if (is_file($d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
							$template = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
							$this->baseURL = $baseStub . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
							$this->basePath = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
						} else if (is_dir($d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename)) {
							$template = $d . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename . '/' . $this->render;
							$this->baseURL = $baseStub . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle() . '/' . DIRNAME_BLOCK_TEMPLATES . '/' . $bFilename;
						}
					}
					
					if ($this->baseURL != '') {
						continue;
					}
					
				}
			}
			
		} else if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '.php')) {
			$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '.php';
			$bv = new BlockView();
			$bv->setBlockObject($obj);
			$this->baseURL = $bv->getBlockURL();
			$this->basePath = $bv->getBlockPath($this->render);
		} else if (file_exists(DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . $this->render)) {
			$template = DIR_FILES_BLOCK_TYPES . '/' . $obj->getBlockTypeHandle() . '/' . $this->render;
			$this->baseURL = DIR_REL . '/' . DIRNAME_BLOCKS . '/' . $obj->getBlockTypeHandle();
		}
		
		if (!isset($template)) {
			$bv = new BlockView();
			$bv->setBlockObject($obj);
			$template = $bv->getBlockPath($this->render) . '/' . $this->render;
			$this->baseURL = $bv->getBlockURL();
		}
		
		if ($this->basePath == '') {
			$this->basePath = dirname($template);
		}
		$this->template = $template;
	}
Example #11
0
 public function view()
 {
     Loader::model('deluxe_image_gallery', 'deluxe_image_gallery');
     $sg = new DeluxeImageGallery($this->bID);
     $files = $sg->getPermittedImages();
     $ch = Loader::helper('deluxe_image_gallery', 'deluxe_image_gallery');
     $ih = Loader::helper('image');
     $images = array();
     $max_img_height = 0;
     foreach ($files as $file) {
         $image = array();
         $image['fID'] = $file['fID'];
         $image['title'] = htmlentities($file['title'], ENT_QUOTES, APP_CHARSET);
         if (defined('DELUXE_IMAGE_GALLERY_HTML_CAPTIONS') && (bool) DELUXE_IMAGE_GALLERY_HTML_CAPTIONS) {
             $image['caption'] = $file['caption'];
         } else {
             $image['caption'] = htmlentities($file['caption'], ENT_QUOTES, APP_CHARSET);
         }
         if ($this->lightboxTitlePosition == 'inside' || $this->lightboxTitlePosition == 'over') {
             $image['caption'] = nl2br($image['caption']);
             //Don't insert linebreaks if title position is 'float'/'outside',
             // because that style doesn't expand down to fit more than one line.
         }
         $f = $file['file'];
         if ($this->enableCropping) {
             $thumb = $ch->getThumbnail($f, $this->thumbWidth, $this->thumbHeight);
         } else {
             $thumb = $ih->getThumbnail($f, $this->thumbWidth, $this->thumbHeight);
         }
         $image['thumb_src'] = $thumb->src;
         $image['thumb_width'] = $thumb->width;
         $image['thumb_height'] = $thumb->height;
         $max_img_height = $thumb->height > $max_img_height ? $thumb->height : $max_img_height;
         if ($this->enableLightbox && empty($this->fullWidth) && empty($this->fullHeight)) {
             $image['full_src'] = $f->getRelativePath();
             $image['full_width'] = $f->getAttribute('width');
             $image['full_height'] = $f->getAttribute('height');
         } else {
             if ($this->enableLightbox) {
                 $maxWidth = empty($this->fullWidth) ? 9999 : $this->fullWidth;
                 $maxHeight = empty($this->fullHeight) ? 9999 : $this->fullHeight;
                 $full = $ih->getThumbnail($f, $maxWidth, $maxHeight);
                 $image['full_src'] = $full->src;
                 $image['full_width'] = $full->width;
                 $image['full_height'] = $full->height;
             } else {
                 $image['full_src'] = '';
                 $image['full_width'] = 0;
                 $image['full_height'] = 0;
             }
         }
         $images[] = $image;
     }
     $this->set('images', $images);
     $this->set('max_img_height', $max_img_height);
     //For "initial block add" css workaround:
     // (Note that this is only needed if the site is under a sub-directory)
     $inline_view_css_url = '';
     $dir_rel = DIR_REL;
     //uhh... php is weird -- won't let us put a constant inside the empty() function?!
     if (!empty($dir_rel)) {
         $html = Loader::helper('html');
         $bv = new BlockView();
         $bv->setBlockObject($this->getBlockObject());
         $css_output_object = $html->css($bv->getBlockURL() . '/view.css');
         //Pick up theme overrides
         $inline_view_css_url = $css_output_object->file;
     }
     $this->set('inline_view_css_url', $inline_view_css_url);
 }
Example #12
0
	function isEditable() {
		$bv = new BlockView();
		$bv->setBlockObject($this);
		$path = $bv->getBlockPath(FILENAME_BLOCK_EDIT);
		if (file_exists($path . '/' . FILENAME_BLOCK_EDIT)) {
			return true;
		}
		return false;
	}
Example #13
0
					<?php 
            echo $ak->render('composer', $value, true);
            ?>
				</div>
			</div>
		
		<?php 
        } else {
            $b = $ci;
            $b = $entry->getComposerBlockInstance($b);
            ?>
		
		<div class="control-group">
		<?php 
            if (is_object($b)) {
                $bv = new BlockView();
                $bv->render($b, 'composer');
            } else {
                print t('Block not found. Unable to edit in composer.');
            }
            ?>
		
		</div>
		
		<?php 
        }
        ?>
	<?php 
    }
    ?>
	</fieldset>
Example #14
0
		/** 
		 * Renders a particular view of a block type, using the public $controller variable as the block type's controller
		 * @param string template 'view' for the default
		 * @return void
		 */
		public function render($view = 'view') {
			$bv = new BlockView();
			$bv->setController($this->controller);
			$bv->render($this, $view);
		}			
Example #15
0
if (!is_object($a)) {
	exit;
}
$ap = new Permissions($a);
$canContinue = ($_REQUEST['btask'] == 'alias') ? $ap->canAddBlocks() : $ap->canAddBlock($bt);

if (!$canContinue) {
	exit;
}
	
$c->loadVersionObject('RECENT');
require_once(DIR_FILES_ELEMENTS_CORE . '/dialog_header.php');

if ($ap->canAddBlock($bt)) {
	$cnt = $bt->getController();
	if (!is_a($cnt, 'BlockController')) {
		$jsh = Loader::helper('concrete/interface');
		print '<div class="ccm-error">' . t('Unable to load the controller for this block type. Perhaps it has been moved or removed.') . '</div>';
		print '<br><br>';
		print $jsh->button_js(t('Close'), 'jQuery.fn.dialog.closeTop()', 'left');
	} else {
		$bv = new BlockView();
		$bv->render($bt, 'add', array(
			'a' => $a,
			'cp' => $cp,
			'ap' => $ap
		));
	}
}

require_once(DIR_FILES_ELEMENTS_CORE . '/dialog_footer.php'); ?>
$cp = new Permissions($c);
if (!$cp->canWrite()) {
    throw new Exception(_('Access Denied.'));
}
//$previewVersion=$previewCollection->getVersionObject();
$previewVersionID = $c->getVersionID();
$db = Loader::db();
$previewBlocksData = $db->getAll('SELECT bID, arHandle FROM CollectionVersionBlocks AS cvb WHERE cvID=? AND cID=?', array($previewVersionID, $previewCID));
$areasBlocksHTML = array();
//get collection areas / blocks HTML
foreach ($previewBlocksData as $previewBlockData) {
    if (!intval($previewBlockData['bID']) || !strlen($previewBlockData['arHandle'])) {
        continue;
    }
    $b = Block::getByID(intval($previewBlockData['bID']));
    $bv = new BlockView();
    ob_start();
    $bv->render($b);
    $blockHTML = ob_get_contents();
    ob_end_clean();
    $areasBlocksHTML[$previewBlockData['arHandle']][] = $blockHTML;
}
$areasBlocksSerialized = serialize($areasBlocksHTML);
$postStr = 'content=' . urlencode($areasBlocksSerialized) . '&themeHandle=' . $themeHandle . '&ctID=' . $ctID . '&ctHandle=' . $ctHandle;
if (!function_exists('curl_init')) {
    ?>
	<div><?php 
    echo t('curl must be enabled to preview external themes.');
    ?>
</div>
<?php 
Example #17
0
		
		<div class="sillyIE7"><?php 
    echo $ih->button_js(t('Add Block to Scrapbook'), 'GlobalScrapbook.addBlock(event)', 'left');
    ?>
</div>
		
		<div class="ccm-spacer"></div>	
		
		<div id="ccm-scrapbook-list" class="ui-sortable">			
			<?php 
    if (!count($globalScrapbookBlocks)) {
        echo t('You have no items in this scrapbook.');
    } else {
        foreach ($globalScrapbookBlocks as $b) {
            $b->setBlockAreaObject($globalScrapbookArea);
            $bv = new BlockView();
            $bt = BlockType::getByID($b->getBlockTypeID());
            $bp = new Permissions($b);
            $btIcon = $ci->getBlockTypeIconURL($bt);
            //give this block a name if it doesn't have one
            if (!strlen($b->getBlockName())) {
                $b->updateBlockName($scrapbookName . ' ' . intval($b->bID));
            }
            ?>
				 <div class="ccm-scrapbook-list-item" id="ccm-scrapbook-list-item-<?php 
            echo intval($b->bID);
            ?>
"> 
					 <div class="ccm-block-type">  
						<div class="options"> 
							<?php 
Example #18
0
	public function display( $view = 'view', $args = array()){
		if ($this->getBlockTypeID() < 1) {
			return ;
		}
		
		$bv = new BlockView();
		$bt = BlockType::getByID( $this->getBlockTypeID() );  
		$bv->render($this, $view, $args);
	}
Example #19
0
	
	<div class="ccm-dashboard-inner"> 

		<a style="float: right" href="<?=View::url($cPath) ?>"><?= t("&laquo; Return to Scrapbook List") ?></a>		
		
		<div class="sillyIE7"><?= $ih->button_js( t('Add Block to Scrapbook'), 'GlobalScrapbook.addBlock(event)','left'); ?></div>
		
		<div class="ccm-spacer"></div>	
		
		<div id="ccm-scrapbook-list" class="ui-sortable">			
			<? 		 			
			if( !count($globalScrapbookBlocks) ){
				echo t('You have no items in this scrapbook.');
			}else foreach($globalScrapbookBlocks as $b) {
				 $b->setBlockAreaObject($globalScrapbookArea);
				 $bv = new BlockView();
				 $bt = BlockType::getByID( $b->getBlockTypeID() ); 
				 $bp = new Permissions($b);
				 $btIcon = $ci->getBlockTypeIconURL($bt); 			 
				 
				 //give this block a name if it doesn't have one
				 if( !strlen($b->getBlockName()) ){ 
					$b->updateBlockName( $scrapbookName.' '.intval($b->bID) );
				 }
				 ?>
				 <div class="ccm-scrapbook-list-item" id="ccm-scrapbook-list-item-<?=intval($b->bID)?>"> 
					 <div class="ccm-block-type">  
						<div class="options"> 
							<? if ($bp->canWrite()) { ?>
							<a href="javascript:void(0)" onclick="GlobalScrapbook.toggleRename(<?=intval($b->bID) ?>)"><?=t('Rename')?></a>
							&nbsp;|&nbsp; 
Example #20
0
<?
	defined('C5_EXECUTE') or die("Access Denied.");
?>
<div class="ccm-ui">
<?
$bo = Block::getByID($bOriginalID);
$bp = new Permissions($bo);
if ($bp->canWrite()) {
	$bv = new BlockView(); ?>
	
		<div class="alert-message block-message info" style="margin-bottom: 10px" ><p><?php 
echo t("This block was copied from another location. Editing it will create a new instance of it.");
?>
</p></div>

	<?
	
	$bv->render($bo, 'edit', array(
		'c' => $c,
		'a' => $a,
		'proxyBlock' => $b
	));
} else { ?>
	<div class="alert-message error"><?php 
echo t("You don't have access to edit the original instance of this block.");
?>
</div>
<? } ?>
</div>
'" class="btn small ccm-main-nav-edit-option ccm-button-v2-right"><?php 
        echo t('Approve Changes');
        ?>
</a>
		<?php 
    }
    ?>
	</div>
	<div class="ccm-pane-body ccm-pane-body-footer clearfix" id="ccm-stack-container">
	<?php 
    $a = Area::get($stack, 'Main');
    $bv = new BlockView();
    $bv->renderElement('block_area_header', array('a' => $a));
    $bv->renderElement('block_area_header_view', array('a' => $a));
    foreach ($blocks as $b) {
        $bv = new BlockView();
        $bv->setAreaObject($a);
        $p = new Permissions($b);
        if ($p->canViewBlock()) {
            $bv->renderElement('block_controls', array('a' => $a, 'b' => $b, 'p' => $p));
            $bv->renderElement('block_header', array('a' => $a, 'b' => $b, 'p' => $p));
            $bv->render($b);
            $bv->renderElement('block_footer');
        }
    }
    $bv->renderElement('block_area_footer_view', array('a' => $a));
    print '</div>';
    // instead  of loading block area footer view
    ?>
	
	</div>
}
if (!is_object($b)) {
    echo '<div class="ccm-ui"><div class="alert alert-error">';
    echo t("Unable to retrieve block object. If this block has been moved please reload the page.");
    echo '</div></div';
    exit;
}
$bp = new Permissions($b);
$ap = new Permissions($a);
if (!$bp->canViewEditInterface()) {
    die(t("Access Denied."));
}
if ($_REQUEST['btask'] != 'view' && $_REQUEST['btask'] != 'view_edit_mode') {
    include DIR_FILES_ELEMENTS_CORE . '/dialog_header.php';
}
$bv = new BlockView();
if ($isGlobalArea && $_REQUEST['btask'] != 'view_edit_mode') {
    echo '<div class="ccm-ui"><div class="alert-message block-message warning">';
    echo t('This block is contained within a global area. Changing its content will change it everywhere that global area is referenced.');
    echo '</div></div>';
}
if ($c->isMasterCollection() && !in_array($_REQUEST['btask'], array('child_pages', 'composer', 'view_edit_mode'))) {
    echo '<div class="ccm-ui"><div class="alert alert-warning">';
    echo t('This is a global block.  Editing it here will change all instances of this block throughout the site.');
    //echo t('This is a global block.  Edit it from the <a href="%s">Global Scrapbook</a> in your dashboard.<br /><br /><br />', View::url('/dashboard/scrapbook/') );
    //echo '[<a class="ccm-dialog-close">'.t('Close Window').'</a>]';
    echo '</div></div>';
}
if ($b->isAliasOfMasterCollection() && $_REQUEST['btask'] != 'view_edit_mode') {
    echo '<div class="ccm-ui"><div class="alert-message block-message warning">';
    echo t('This block is an alias of Page Defaults. Editing it here will "disconnect" it so changes to Page Defaults will no longer affect this block.');