Exemplo n.º 1
0
 public function install($data = array())
 {
     $pkg = parent::install();
     // Set Theme
     // check for active themes
     $active_theme = PageTheme::getSiteTheme();
     // strcmp($active_theme->getThemeHandle(), $themeHandle) == 0
     if (is_object($active_theme) && $active_theme->getThemeHandle() !== 'elemental') {
         // Theme::setThemeHandle($themeHandle);
         // $pt = PageTheme::getByID($pThemeID);
         $pt = PageTheme::getByHandle('elemental');
         $pt->applyToSite();
     }
 }
Exemplo n.º 2
0
 public function view()
 {
     $tArray = array();
     $tArray2 = array();
     $tArray = PageTheme::getList();
     $tArray2 = PageTheme::getAvailableThemes();
     $this->set('tArray', $tArray);
     $this->set('tArray2', $tArray2);
     $siteThemeID = 0;
     $obj = PageTheme::getSiteTheme();
     if (is_object($obj)) {
         $siteThemeID = $obj->getThemeID();
     }
     $this->set('siteThemeID', $siteThemeID);
     $this->set('activate', View::url('/dashboard/pages/themes', 'activate'));
     $this->set('install', View::url('/dashboard/pages/themes', 'install'));
 }
Exemplo n.º 3
0
if (!$cp->canEditPageType() && !$cp->canEditPageTheme()) {
	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();
	$plID = $pl->getThemeID();
}
?>

<div class="ccm-ui">
<form method="post" name="ccmThemeForm" action="<?php 
echo $c->getCollectionAction();
?>
">
	<input type="hidden" name="plID" value="<?php 
echo $c->getCollectionThemeID();
?>
" />
	<input type="hidden" name="ctID" value="<?php 
echo $c->getCollectionTypeID();
Exemplo n.º 4
0
 /**
  * Returns Collection's theme object
  * @return PageTheme
  */
 function getCollectionThemeObject()
 {
     if ($this->vObj->ptID < 1) {
         return PageTheme::getSiteTheme();
     } else {
         $pl = PageTheme::getByID($this->vObj->ptID);
         return $pl;
     }
 }
Exemplo n.º 5
0
}
if (!isset($editor_selector)) {
    $editor_selector = 'ccm-advanced-editor';
}
if (isset($editor_height)) {
    $textEditorHeight = $editor_height;
}
if (isset($editor_width)) {
    $textEditorWidth = $editor_width;
}
if (!isset($editor_mode)) {
    $txtEditorMode = Config::get('CONTENTS_TXT_EDITOR_MODE');
} else {
    $txtEditorMode = $editor_mode;
}
$theme = PageTheme::getSiteTheme();
?>
<script type="text/javascript">
    var validElementsHtml5 =
        "@[accesskey|draggable|style|class|hidden|tabindex" +
        "|contenteditable|id|title|contextmenu|lang|dir<ltr?rtl|spellcheck" +
        "|onabort|onerror|onmousewheel|onblur|onfocus|onpause|oncanplay|onformchange|onplay" +
        "|oncanplaythrough|onforminput|onplaying|onchange|oninput|onprogress|onclick|oninvalid" +
        "|onratechange|oncontextmenu|onkeydown|onreadystatechange|ondblclick|onkeypress|onscroll" +
        "|ondrag|onkeyup|onseeked|ondragend|onload|onseeking|ondragenter|onloadeddata|onselect" +
        "|ondragleave|onloadedmetadata|onshow|ondragover|onloadstart|onstalled|ondragstart" +
        "|onmousedown|onsubmit|ondrop|onmousemove|onsuspend|ondurationmouseout|ontimeupdate" +
        "|onemptied|onmouseover|onvolumechange|onended|onmouseup|onwaiting]," +
        "a[target<_blank?_self?_top?_parent|ping|media|href|hreflang|type" +
        "|rel<alternate?archives?author?bookmark?external?feed?first?help?index?last?license?" +
        "next?nofollow?noreferrer?prev?search?sidebar?tag?up" +
Exemplo n.º 6
0
				ccm_composerLastSaveTime = new Date();
				$("#composer-save-status").html('<div class="alert alert-info"><?php 
echo t("Page saved at ");
?>
' + r.time + '</div>');
				$(".ccm-composer-hide-on-approved").show();
				if (callback) {
					callback();
				}
			}
		});
	}
	
	ccm_composerLaunchPreview = function() {
		jQuery.fn.dialog.showLoader();
		<? $t = PageTheme::getSiteTheme(); ?>
		ccm_composerDoAutoSave(function() {
			ccm_previewInternalTheme(<?php 
echo $entry->getCollectionID();
?>
, <?php 
echo $t->getThemeID();
?>
, '<?php 
echo addslashes(str_replace(array("\r", "\n", "\n"), '', $t->getThemeName()));
?>
');
		});
	}
	
	ccm_composerSelectParentPage = function(cID) {
Exemplo n.º 7
0
			'dataType': 'json',
			'success': function(r) {
				$('input[name=autosave]').val('0');
				ccm_composerLastSaveTime = new Date();
				$("#composer-save-status").html('<?php echo t("Page saved at ")?>' + r.time);
				$(".ccm-composer-hide-on-approved").show();
				if (callback) {
					callback();
				}
			}
		});
	}
	
	ccm_composerLaunchPreview = function() {
		jQuery.fn.dialog.showLoader();
		<?php  $t = PageTheme::getSiteTheme(); ?>
		ccm_composerDoAutoSave(function() {
			ccm_previewInternalTheme(<?php echo $entry->getCollectionID()?>, <?php echo $t->getThemeID()?>, '<?php echo addslashes(str_replace(array("\r","\n","\n"),'',$t->getThemeName()))?>');
		});
	}
	
	ccm_composerSelectParentPage = function(cID) {
		$("input[name=cPublishParentID]").val(cID);
		$(".ccm-composer-hide-on-no-target").show();
		$("#ccm-composer-publish-location").load('<?php echo $this->action("select_publish_target")?>', {'entryID': <?php echo $entry->getCollectionID()?>, 'cPublishParentID': cID});
		jQuery.fn.dialog.closeTop();

	}	

	ccm_composerSelectParentPageAndSubmit = function(cID) {
		$("input[name=cPublishParentID]").val(cID);
Exemplo n.º 8
0
	public static function exportList($xml) {
		$nxml = $xml->addChild('themes');
		$list = PageTheme::getList();
		$pst = PageTheme::getSiteTheme();
		
		foreach($list as $pt) {
			$activated = 0;
			if ($pst->getThemeID() == $pt->getThemeID()) {
				$activated = 1;
			}
			$type = $nxml->addChild('theme');
			$type->addAttribute('handle', $pt->getThemeHandle());
			$type->addAttribute('package', $pt->getPackageHandle());
			$type->addAttribute('activated', $activated);
		}

	}
Exemplo n.º 9
0
 /**
  * @return bool|int[] true on success, array of error codes on failure
  */
 public function testForUninstall()
 {
     $errors = array();
     $items = $this->getPackageItems();
     /** @var PageTheme[] $themes */
     $themes = array_get($items, 'page_themes', array());
     // Step 1, check for active themes
     $active_theme = \PageTheme::getSiteTheme();
     foreach ($themes as $theme) {
         if ($active_theme->getThemeID() == $theme->getThemeID()) {
             $errors[] = self::E_PACKAGE_THEME_ACTIVE;
             break;
         }
     }
     return count($errors) ? $errors : true;
 }