コード例 #1
0
 public function execute(Batch $batch)
 {
     $types = $batch->getObjectCollection('thumbnail_type');
     if (!$types) {
         return;
     }
     foreach ($types->getTypes() as $type) {
         if (!$type->getPublisherValidator()->skipItem()) {
             $t = new \Concrete\Core\File\Image\Thumbnail\Type\Type();
             $t->setName($type->getName());
             $t->setHandle($type->getHandle());
             $t->setWidth($type->getWidth());
             $t->setHeight($type->getHeight());
             if ($type->getIsRequired()) {
                 $t->requireType();
             }
             $t->save();
         }
     }
 }
コード例 #2
0
 protected function setUp()
 {
     parent::setUp();
     $thumbnailType = new \Concrete\Core\File\Image\Thumbnail\Type\Type();
     $thumbnailType->requireType();
     $thumbnailType->setName(t('File Manager Thumbnails'));
     $thumbnailType->setHandle(Config::get('concrete.icons.file_manager_listing.handle'));
     $thumbnailType->setWidth(Config::get('concrete.icons.file_manager_listing.width'));
     $thumbnailType->setHeight(Config::get('concrete.icons.file_manager_listing.height'));
     $thumbnailType->save();
     $thumbnailType = new \Concrete\Core\File\Image\Thumbnail\Type\Type();
     $thumbnailType->requireType();
     $thumbnailType->setName(t('File Manager Detail Thumbnails'));
     $thumbnailType->setHandle(Config::get('concrete.icons.file_manager_detail.handle'));
     $thumbnailType->setWidth(Config::get('concrete.icons.file_manager_detail.width'));
     $thumbnailType->save();
     $this->cleanup();
 }
コード例 #3
0
 protected function importFileImportantThumbnailTypes(\SimpleXMLElement $sx)
 {
     if (isset($sx->thumbnailtypes)) {
         foreach ($sx->thumbnailtypes->thumbnailtype as $l) {
             $type = new \Concrete\Core\File\Image\Thumbnail\Type\Type();
             $type->setName((string) $l['name']);
             $type->setHandle((string) $l['handle']);
             $type->setWidth((string) $l['width']);
             $type->setHeight((string) $l['height']);
             $required = (string) $l['required'];
             if ($required) {
                 $type->requireType();
             }
             $type->save();
         }
     }
 }
コード例 #4
0
ファイル: controller.php プロジェクト: jhartman86/jhmrfc
 /**
  * @return Controller
  */
 private function setupThumbnailTypes()
 {
     $largeThumbnail = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle('large');
     if (!is_object($largeThumbnail)) {
         $type = new \Concrete\Core\File\Image\Thumbnail\Type\Type();
         $type->setName('Large');
         $type->setHandle('large');
         $type->setWidth(1440);
         $type->save();
     }
     return $this;
 }
コード例 #5
0
ファイル: controller.php プロジェクト: baardev/lbtb
 public function upgrade()
 {
     parent::upgrade();
     // Install Single Pages
     $sP = Page::getByPath('/dashboard/fundamental');
     if (!is_object($sP) || $sP->isError()) {
         $sP = SinglePage::add('/dashboard/fundamental', $this);
         $sP->update(array('cName' => t("Fundamental Theme Settings")));
         // Set up Default Config Settings
         // Navigation
         Config::save('c5hub.fundamental.navigation.position', 'right');
         Config::save('c5hub.fundamental.navigation.branding', true);
         Config::save('c5hub.fundamental.navigation.branding_position', 'branding-left');
         Config::save('c5hub.fundamental.navigation.contain_to_grid', true);
         Config::save('c5hub.fundamental.navigation.sticky', false);
         Config::save('c5hub.fundamental.navigation.custom_back_text', true);
         Config::save('c5hub.fundamental.navigation.back_text', 'Back');
         Config::save('c5hub.fundamental.navigation.is_hover', true);
         Config::save('c5hub.fundamental.navigation.mobile_show_parent_link', true);
         Config::save('c5hub.fundamental.navigation.scroll_top', false);
         Config::save('c5hub.fundamental.navigation.divider', false);
         // Page Meta
         Config::save('c5hub.fundamental.page_meta_alignment', 'text-left');
         Config::save('c5hub.fundamental.page_meta_title', true);
         Config::save('c5hub.fundamental.page_meta_description', true);
         // Background Images
         Config::save('c5hub.fundamental.body_background_image_repeat', 'repeat');
         Config::save('c5hub.fundamental.body_background_image_size', 'auto');
         Config::save('c5hub.fundamental.body_background_image_attachment', 'scroll');
         Config::save('c5hub.fundamental.top_background_image_repeat', 'repeat');
         Config::save('c5hub.fundamental.top_background_image_size', 'auto');
         Config::save('c5hub.fundamental.top_background_image_attachment', 'scroll');
         Config::save('c5hub.fundamental.branding_background_image_repeat', 'repeat');
         Config::save('c5hub.fundamental.branding_background_image_size', 'auto');
         Config::save('c5hub.fundamental.branding_background_image_attachment', 'scroll');
         Config::save('c5hub.fundamental.navigation_background_image_repeat', 'repeat');
         Config::save('c5hub.fundamental.navigation_background_image_size', 'auto');
         Config::save('c5hub.fundamental.navigation_background_image_attachment', 'scroll');
         Config::save('c5hub.fundamental.header_background_image_repeat', 'repeat');
         Config::save('c5hub.fundamental.header_background_image_size', 'auto');
         Config::save('c5hub.fundamental.header_background_image_attachment', 'scroll');
         Config::save('c5hub.fundamental.banner_background_image_repeat', 'repeat');
         Config::save('c5hub.fundamental.banner_background_image_size', 'auto');
         Config::save('c5hub.fundamental.banner_background_image_attachment', 'scroll');
         Config::save('c5hub.fundamental.page_info_background_image_repeat', 'repeat');
         Config::save('c5hub.fundamental.page_info_background_image_size', 'auto');
         Config::save('c5hub.fundamental.page_info_background_image_attachment', 'scroll');
         Config::save('c5hub.fundamental.main_background_image_repeat', 'repeat');
         Config::save('c5hub.fundamental.main_background_image_size', 'auto');
         Config::save('c5hub.fundamental.main_background_image_attachment', 'scroll');
         Config::save('c5hub.fundamental.footer_top_background_image_repeat', 'repeat');
         Config::save('c5hub.fundamental.footer_top_background_image_size', 'auto');
         Config::save('c5hub.fundamental.footer_top_background_image_attachment', 'scroll');
         Config::save('c5hub.fundamental.footer_bottom_background_image_repeat', 'repeat');
         Config::save('c5hub.fundamental.footer_bottom_background_image_size', 'auto');
         Config::save('c5hub.fundamental.footer_bottom_background_image_attachment', 'scroll');
         // Attribution
         Config::save('c5hub.fundamental.footer_attribution', '/ <a href="http://c5hub.com" target="_blank" title="concrete5 themes & add-ons">Responsive concrete5 Theme by <b>c5Hub</b></a>');
         // White Label
         Config::save('concrete.marketplace.enabled', true);
         Config::save('concrete.marketplace.intelligent_search', true);
         Config::save('concrete.external.news_overlay', true);
         Config::save('concrete.external.news', true);
     }
     $sP = Page::getByPath('/dashboard/fundamental/navigation');
     if (!is_object($sP) || $sP->isError()) {
         $sP = SinglePage::add('/dashboard/fundamental/navigation', $this);
         $sP->update(array('cName' => t("Navigation")));
     }
     $sP = Page::getByPath('/dashboard/fundamental/off_canvas_navigation');
     if (!is_object($sP) || $sP->isError()) {
         $sP = SinglePage::add('/dashboard/fundamental/off_canvas_navigation', $this);
         $sP->update(array('cName' => t("Off Canvas Navigation")));
         // Off Canvas Navigation
         Config::save('c5hub.fundamental.off_canvas.position', 'right');
         Config::save('c5hub.fundamental.off_canvas.open_method', 'move');
         Config::save('c5hub.fundamental.off_canvas.close_on_click', false);
     }
     $sP = Page::getByPath('/dashboard/fundamental/page_meta');
     if (!is_object($sP) || $sP->isError()) {
         $sP = SinglePage::add('/dashboard/fundamental/page_meta', $this);
         $sP->update(array('cName' => t("Page Meta")));
     }
     $sP = Page::getByPath('/dashboard/fundamental/background_images');
     if (!is_object($sP) || $sP->isError()) {
         $sP = SinglePage::add('/dashboard/fundamental/background_images', $this);
         $sP->update(array('cName' => t("Background Images")));
     }
     $sP = Page::getByPath('/dashboard/fundamental/attribution');
     if (!is_object($sP) || $sP->isError()) {
         $sP = SinglePage::add('/dashboard/fundamental/attribution', $this);
         $sP->update(array('cName' => t("Attribution")));
     }
     $sP = Page::getByPath('/dashboard/fundamental/white_label');
     if (!is_object($sP) || $sP->isError()) {
         $sP = SinglePage::add('/dashboard/fundamental/white_label', $this);
         $sP->update(array('cName' => t("White Label")));
     }
     $sP = Page::getByPath('/dashboard/fundamental/general');
     if (!is_object($sP) || $sP->isError()) {
         $sP = SinglePage::add('/dashboard/fundamental/general', $this);
         $sP->update(array('cName' => t("General")));
         // General
         Config::save('c5hub.fundamental.general.boxed', false);
         Config::save('c5hub.fundamental.general.sticky_footer', false);
     }
     $sP = Page::getByPath('/dashboard/fundamental/masonry_grid');
     if (!is_object($sP) || $sP->isError()) {
         $sP = SinglePage::add('/dashboard/fundamental/masonry_grid', $this);
         $sP->update(array('cName' => t("Masonry Grid")));
         // Masonry Grid
         Config::save('c5hub.fundamental.masonry_grid_columns_desktop', 4);
         Config::save('c5hub.fundamental.masonry_grid_columns_tablet', 4);
         Config::save('c5hub.fundamental.masonry_grid_columns_mobile', 12);
     }
     // Install Page Types
     if (!PageTemplate::getByHandle('blog_entry')) {
         PageTemplate::add('blog_entry', 'Blog Entry', 'left_sidebar.png', $pkg);
     }
     if (!PageTemplate::getByHandle('custom')) {
         PageTemplate::add('custom', 'Custom', 'full.png', $pkg);
     }
     if (!PageTemplate::getByHandle('blank')) {
         PageTemplate::add('blank', t('Blank'), 'full.png', $pkg);
     }
     // Install Blocks
     if (!BlockType::getByHandle('fundamental_simple_document')) {
         BlockType::installBlockTypeFromPackage('fundamental_simple_document', $this);
     }
     if (!BlockType::getByHandle('fundamental_section')) {
         BlockType::installBlockTypeFromPackage('fundamental_section', $this);
     }
     if (!BlockType::getByHandle('fundamental_slick_slider')) {
         BlockType::installBlockTypeFromPackage('fundamental_slick_slider', $this);
     }
     // Install Thumbnail Types
     $small = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle('small');
     if (!is_object($small)) {
         $type = new \Concrete\Core\File\Image\Thumbnail\Type\Type();
         $type->setName('Small');
         $type->setHandle('small');
         $type->setWidth(740);
         $type->save();
     }
     $medium = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle('medium');
     if (!is_object($medium)) {
         $type = new \Concrete\Core\File\Image\Thumbnail\Type\Type();
         $type->setName('Medium');
         $type->setHandle('medium');
         $type->setWidth(940);
         $type->save();
     }
     $large = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle('large');
     if (!is_object($large)) {
         $type = new \Concrete\Core\File\Image\Thumbnail\Type\Type();
         $type->setName('Large');
         $type->setHandle('large');
         $type->setWidth(1140);
         $type->save();
     }
     $xlarge = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle('xlarge');
     if (!is_object($xlarge)) {
         $type = new \Concrete\Core\File\Image\Thumbnail\Type\Type();
         $type->setName('XLarge');
         $type->setHandle('xlarge');
         $type->setWidth(9999);
         $type->save();
     }
     // Attributes
     $navIconKey = CollectionAttributeKey::getByHandle('nav_icon');
     if (!$navIconKey || !intval($navIconKey->getAttributeKeyID())) {
         $navIconType = AttributeType::getByHandle('select');
         $navIconKey = CollectionAttributeKey::add($navIconType, array('akHandle' => 'nav_icon', 'akName' => t('Nav Icon'), 'akIsSearchable' => false), $pkg);
         ## Add Options
         $options = $this->getIconClasses();
         foreach ($options as $opt) {
             $navIconKeyOption = SelectAttributeTypeOption::add($navIconKey, $opt, 0);
         }
     }
     $thumbnailKey = CollectionAttributeKey::getByHandle('thumbnail');
     if (!$thumbnailKey || !intval($thumbnailKey->getAttributeKeyID())) {
         $thumbnailType = AttributeType::getByHandle('image_file');
         $thumbnailKey = CollectionAttributeKey::add($thumbnailType, array('akHandle' => 'thumbnail', 'akName' => t('Thumbnail'), 'akIsSearchable' => false), $pkg);
     }
     $disableTitleKey = CollectionAttributeKey::getByHandle('disable_page_info_title');
     if (!$disableTitleKey || !intval($disableTitleKey->getAttributeKeyID())) {
         $disableTitleType = AttributeType::getByHandle('boolean');
         $disableTitleKey = CollectionAttributeKey::add($disableTitleType, array('akHandle' => 'disable_page_info_title', 'akName' => t('Disable Page Info Title'), 'akIsSearchable' => false), $pkg);
     }
     $disableDescriptionKey = CollectionAttributeKey::getByHandle('disable_page_info_description');
     if (!$disableDescriptionKey || !intval($disableDescriptionKey->getAttributeKeyID())) {
         $disableDescriptionType = AttributeType::getByHandle('boolean');
         $disableDescriptionKey = CollectionAttributeKey::add($disableDescriptionType, array('akHandle' => 'disable_page_info_description', 'akName' => t('Disable Page Info Description'), 'akIsSearchable' => false), $pkg);
     }
     $areaCountKey = CollectionAttributeKey::getByHandle('area_count');
     if (!$areaCountKey || !intval($areaCountKey->getAttributeKeyID())) {
         $areaCountType = AttributeType::getByHandle('number');
         $areaCountKey = CollectionAttributeKey::add($areaCountType, array('akHandle' => 'area_count', 'akName' => t('Area Count'), 'akIsSearchable' => false), $pkg);
     }
 }