public function __construct(File $file) { $this->loadPictureSettingsFromTheme(); if ($this->isResponsive) { $sources = array(); foreach ($this->theme->getThemeResponsiveImageMap() as $thumbnail => $width) { $type = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle($thumbnail); if ($type !== null) { $src = $file->getThumbnailURL($type->getBaseVersion()); if ($width) { $sources[] = $src . ' ' . str_replace('px', '', $width) . 'w'; } } } $this->srcset(implode(', ', $sources)); $this->layout('responsive'); } $path = $file->getRelativePath(); if (!$path) { $path = $file->getURL(); } $this->src($path); $this->width($file->getAttribute('width')); $this->height($file->getAttribute('height')); }
public function view() { $types = \Concrete\Core\File\Image\Thumbnail\Type\Type::getVersionList(); $this->set('types', $types); $version = $this->file->getVersion($this->request->request->get('fvID')); $this->set('version', $version); }
public function importFiles($fromPath, $computeThumbnails = true) { $fh = new Importer(); if (!$computeThumbnails) { $fh->setRescanThumbnailsOnImport(false); $helper = Core::make('helper/file'); } $contents = Core::make('helper/file')->getDirectoryContents($fromPath); foreach ($contents as $filename) { if (!is_dir($filename)) { $fv = $fh->import($fromPath . '/' . $filename, $filename); if (!$computeThumbnails) { $types = \Concrete\Core\File\Image\Thumbnail\Type\Type::getVersionList(); foreach ($types as $type) { // since we provide the thumbnails, we're going to get a list of thumbnail types // and loop through them, assigning them to all the files. $thumbnailPath = $fromPath . '/' . $type->getHandle() . '/' . $filename; if (file_exists($thumbnailPath)) { $fv->importThumbnail($type, $thumbnailPath); } } } } } }
/** * @param \File $f * @param null $usePictureTag */ public function __construct(\File $f = null, $usePictureTag = null) { if (!is_object($f)) { return false; } if (isset($usePictureTag)) { $this->usePictureTag = $usePictureTag; } else { $this->loadPictureSettingsFromTheme(); } if ($this->usePictureTag) { if (!isset($this->theme)) { $c = \Page::getCurrentPage(); $this->theme = $c->getCollectionThemeObject(); } $sources = array(); $fallbackSrc = $f->getRelativePath(); foreach ($this->theme->getThemeResponsiveImageMap() as $thumbnail => $width) { $type = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle($thumbnail); if ($type != NULL) { $src = $f->getThumbnailURL($type->getBaseVersion()); $sources[] = array('src' => $src, 'width' => $width); if ($width == 0) { $fallbackSrc = $src; } } } $this->tag = \Concrete\Core\Html\Object\Picture::create($sources, $fallbackSrc); } else { // Return a simple image tag. $this->tag = \HtmlObject\Image::create($f->getRelativePath()); $this->tag->width($f->getAttribute('width')); $this->tag->height($f->getAttribute('height')); } }
function outputThumbnail($image, $thumbName) { $type = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle($thumbName); if (is_object($type) && is_object($image)) { return $image->getThumbnailURL($type->getBaseVersion()); } return ""; }
public function install_thumbnail_types() { $thumbnail_types = array('product_full' => array('name' => 'Product Full', 'width' => 600), 'product_full_thumbnail' => array('name' => 'Product Full Thumbnail', 'width' => 600, 'height' => 600), 'product_medium' => array('name' => 'Product Medium', 'width' => 300), 'product_medium_thumbnail' => array('name' => 'Product Medium Thumbnail', 'width' => 300, 'height' => 300), 'product_small' => array('name' => 'Product Small', 'width' => 150), 'product_small_thumbnail' => array('name' => 'Product Small Thumbnail', 'width' => 150, 'height' => 150)); foreach ($thumbnail_types as $handle => $type) { $thumbnailType = new ThumbnailType(); $thumbnailType->requireType(); $thumbnailType->setHandle($handle); $thumbnailType->setName($type['name']); $thumbnailType->setWidth($type['width']); if (isset($type['height'])) { $thumbnailType->setHeight($type['height']); } $thumbnailType->save(); } }
/** * $file_objが指定の$thumbnail_type_nameを持つ際にサムネイルURLを返す。 * サムネイルタイプが存在しない場合はフルサイズ画像を返す * * @param object $file_obj * @param str $thumbnail_type_name * @return str file url */ public function thumb_src($file_obj, $thumbnail_type_name = 'full') { $file_src = ""; if ($file_obj) { $handles = array(); foreach ($file_obj->getThumbnails() as $ff) { $handles[] = $ff->getThumbnailTypeVersionObject()->getHandle(); } if (in_array($thumbnail_type_name, $handles)) { $type = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle($thumbnail_type_name); $file_src = $file_obj->getThumbnailURL($type->getBaseVersion()); return $file_src; } else { $path = $file_obj->getRelativePath(); if (!$path) { $path = $file_obj->getURL(); } return $path; } } return false; }
public static function outputThumbnail($image, $thumbName, $args = array(), $output = true) { $type = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle($thumbName); if (is_object($type) && is_object($image)) { $src = $image->getThumbnailURL($type->getBaseVersion()); $alt = $image->getDescription(); $attribs = ""; foreach ($args as $key => $attrValue) { if ($attrValue == null) { $attribs .= "{$key} "; } else { $attribs .= "{$key} = \"{$attrValue}\" "; } } $img = "<img src=\"{$src}\" alt=\"{$alt}\" {$attribs} >"; if ($output) { print $img; } else { return $img; } } }
public function run() { $this->x = new SimpleXMLElement("<concrete5-cif></concrete5-cif>"); $this->x->addAttribute('version', '1.0'); // First, attribute categories AttributeKeyCategory::exportList($this->x); // Features Feature::exportList($this->x); FeatureCategory::exportList($this->x); ConversationEditor::exportList($this->x); ConversationRatingType::exportList($this->x); // composer PageTypePublishTargetType::exportList($this->x); PageTypeComposerControlType::exportList($this->x); PageType::exportList($this->x); // attribute types AttributeType::exportList($this->x); // then block types BlockTypeList::exportList($this->x); // now block type sets (including user) BlockTypeSet::exportList($this->x); // gathering GatheringDataSource::exportList($this->x); GatheringItemTemplate::exportList($this->x); // now attribute keys (including user) AttributeKey::exportList($this->x); // now attribute keys (including user) AttributeSet::exportList($this->x); PageTemplate::exportList($this->x); // now theme PageTheme::exportList($this->x); // now packages PackageList::export($this->x); // permission access entity types PermissionAccessEntityType::exportList($this->x); // now task permissions PermissionKey::exportList($this->x); // workflow types WorkflowType::exportList($this->x); // now jobs Job::exportList($this->x); // now single pages $singlepages = $this->x->addChild("singlepages"); $db = Loader::db(); $r = $db->Execute('select cID from Pages where cFilename is not null and cFilename <> "" and cID not in (select cID from Stacks) order by cID asc'); while ($row = $r->FetchRow()) { $pc = Page::getByID($row['cID'], 'RECENT'); $pc->export($singlepages); } // now stacks/global areas StackList::export($this->x); // now content pages $pages = $this->x->addChild("pages"); $db = Loader::db(); $r = $db->Execute('select Pages.cID from Pages where cIsTemplate = 0 and cFilename is null or cFilename = "" order by cID asc'); while ($row = $r->FetchRow()) { $pc = Page::getByID($row['cID'], 'RECENT'); if ($pc->getPageTypeHandle() == STACKS_PAGE_TYPE) { continue; } $pc->export($pages); } SystemCaptchaLibrary::exportList($this->x); \Concrete\Core\Sharing\SocialNetwork\Link::exportList($this->x); \Concrete\Core\Page\Feed::exportList($this->x); \Concrete\Core\File\Image\Thumbnail\Type\Type::exportList($this->x); Config::exportList($this->x); Tree::exportList($this->x); }
/** * Returns a thumbnail for this type of file */ public function getThumbnail($fullImageTag = true) { $type = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle(\Config::get('concrete.icons.file_manager_listing.handle')); if (file_exists(DIR_AL_ICONS . '/' . $this->extension . '.png')) { $url = REL_DIR_AL_ICONS . '/' . $this->extension . '.png'; } else { $url = AL_ICON_DEFAULT; } if ($fullImageTag == true) { return sprintf('<img src="%s" width="%s" height="%s" class="img-responsive ccm-generic-thumbnail">', $url, $type->getWidth(), $type->getHeight()); } else { return $url; } }
/** * {@inheritDoc} */ public function getDoubledVersion() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDoubledVersion', array()); return parent::getDoubledVersion(); }
public function getListingThumbnailImage() { if ($this->fvHasListingThumbnail) { $type = Type::getByHandle(\Config::get('concrete.icons.file_manager_listing.handle')); $baseSrc = $this->getThumbnailURL($type->getBaseVersion()); $doubledSrc = $this->getThumbnailURL($type->getDoubledVersion()); $width = $type->getWidth(); $height = $type->getHeight(); return sprintf('<img width="%s" height="%s" src="%s" data-at2x="%s">', $width, $height, $baseSrc, $doubledSrc); } else { return $this->getTypeObject()->getThumbnail(); } }
/** * Returns a thumbnail for this type of file. * * @param bool $fullImageTag Set to true to retrieve the full HTML image tag, false to just retrieve the image URL * * @return string */ public function getThumbnail($fullImageTag = true) { $app = Application::getFacadeApplication(); $config = $app->make('config'); $type = ThumbnailType::getByHandle($config->get('concrete.icons.file_manager_listing.handle')); if (file_exists(DIR_AL_ICONS . '/' . $this->getExtension() . '.svg')) { $url = REL_DIR_AL_ICONS . '/' . $this->getExtension() . '.svg'; } else { $url = AL_ICON_DEFAULT; } if ($fullImageTag == true) { return sprintf('<img src="%s" width="%s" height="%s" class="img-responsive ccm-generic-thumbnail">', $url, $type->getWidth(), $type->getHeight()); } else { return $url; } }
public function getListingThumbnailImage() { if ($this->fvHasListingThumbnail) { $type = Type::getByHandle(\Config::get('concrete.icons.file_manager_listing.handle')); $baseSrc = $this->getThumbnailURL($type->getBaseVersion()); $doubledSrc = $this->getThumbnailURL($type->getDoubledVersion()); return '<img src="' . $baseSrc . '" data-at2x="' . $doubledSrc . '" />'; } else { return $this->getTypeObject()->getThumbnail(); } }
public function import_files() { $type = \Concrete\Core\File\StorageLocation\Type\Type::add('default', t('Default')); \Concrete\Core\File\StorageLocation\Type\Type::add('local', t('Local')); $configuration = $type->getConfigurationObject(); $fsl = \Concrete\Core\File\StorageLocation\StorageLocation::add($configuration, t('Default'), true); $thumbnailType = new Type(); $thumbnailType->requireType(); $thumbnailType->setName(tc('ThumbnailTypeName', '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 Type(); $thumbnailType->requireType(); $thumbnailType->setName(tc('ThumbnailTypeName', '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(); if (is_dir($this->getPackagePath() . '/files')) { $fh = new FileImporter(); $contents = Loader::helper('file')->getDirectoryContents($this->getPackagePath() . '/files'); foreach ($contents as $filename) { $f = $fh->import($this->getPackagePath() . '/files/' . $filename, $filename); } } }
public static function getByHandle($handle) { $list = Type::getVersionList(); foreach ($list as $version) { if ($version->getHandle() == $handle) { return $version; } } }
public function skipItem() { $type = Type::getByHandle($this->object->getHandle()); return is_object($type); }
public function do_add() { $request = $this->validateThumbnailRequest(); if (!Loader::helper('validation/token')->validate('do_add')) { $this->error->add(Loader::helper('validation/token')->getErrorMessage()); } if (!$this->error->has()) { $type = new Type(); $height = intval($request->request->get('ftTypeHeight')); if ($height > 0) { $type->setHeight($request->request->get('ftTypeHeight')); } $type->setWidth($request->request->get('ftTypeWidth')); $type->setName($request->request->get('ftTypeName')); $type->setHandle($request->request->get('ftTypeHandle')); $type->save(); $this->redirect('/dashboard/system/files/thumbnails', 'thumbnail_type_added'); } $this->set('type', $type); }
/** * @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; }
$team_slogan = $page->getAttribute('team_slogan'); $captain = $page->getAttribute('captain'); $team_name = $page->getAttribute('team_name'); $team_type = $page->getAttribute('team_type'); $team_trophy = $page->getAttribute('team_trophy'); $team_fairplay = $page->getAttribute('team_fairplay'); $image = $page->getAttribute("team_image"); $defaultImageID = 9; if (is_object($image)) { $img = Core::make('html/image', array($image)); $type = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle("team_image_thumb"); $Cimage = $image->getThumbnailURL($type->getBaseVersion()); } else { $image = \File::getByID($defaultImageID); $img = Core::make('html/image', array($image)); $type = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle("team_image_thumb"); $Cimage = $image->getThumbnailURL($type->getBaseVersion()); } ?> <div class="col-sm-4 team-item"> <div class="team-item-inside"> <div class="team-item-image"> <div class="team-item-logo"><a class="fancybox fancybox.ajax" href="<?php echo $url; ?> "><img data-expand="-110" class="lazyload" src="<?php echo BASE_URL; ?> /application/themes/afdbba/dist/img/default.gif" data-src="<?php echo $Cimage;
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); } }
</section> <div class="container-fluid galleries"> <div class="row"> <?php $fs = FileSet::getByName('featured_image'); $fl = new FileList(); $fl->filterBySet($fs); $fl->sortBy('fsDisplayOrder', 'asc'); $files = $fl->getResults(); $i = 0; $totalImage = count($files); foreach ($files as $f) { $i++; $img = Core::make('html/image', array($f)); $type = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle("file_manager_listing"); if (is_object($f)) { $src = $f->getThumbnailURL($type->getDoubledVersion()); if ($i == 1) { echo "<div class=\"col-sm-4 pull-left nopadding img-wrapper hidden-xs\">"; } echo '<div class="col-xs-4 nopadding gallery-item "><a class="fancybox" data-fancybox-group="fancybox-thumb" href="' . $f->getURL() . '"><img class="lazyload" src="' . $this->getThemePath() . '/dist/img/default.gif" data-src="' . $src . '" alt="' . $f->getTitle() . '" width="' . $type->getWidth() . '" height="' . $type->getHeight() . '"></a></div>'; if ($i == 9) { echo '</div><div class="col-sm-4 nopadding social-call"><div class="content"><div class="social-wrapper">Pour voir l\' intégralité des photos:<br><a target="_blank" href="https://www.facebook.com/dodgeballbeachtournament/?ref=hl"><img src="' . $this->getThemePath() . '/dist/img/facebook_logo.png" alt="Logo Facebook"></a><a target="_blank" href="https://www.instagram.com/afdbba/"><img src="' . $this->getThemePath() . '/dist/img/instagram_logo.png" alt="Logo Instagram"></a></div></div></div><div class="col-sm-4 pull-right nopadding img-wrapper">'; } if ($i == 18) { echo "</div>"; break; } } }
public function import_files() { $type = \Concrete\Core\File\StorageLocation\Type\Type::add('default', t('Default')); \Concrete\Core\File\StorageLocation\Type\Type::add('local', t('Local')); $configuration = $type->getConfigurationObject(); $fsl = \Concrete\Core\File\StorageLocation\StorageLocation::add($configuration, t('Default'), true); $thumbnailType = new Type(); $thumbnailType->requireType(); $thumbnailType->setName(tc('ThumbnailTypeName', '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 Type(); $thumbnailType->requireType(); $thumbnailType->setName(tc('ThumbnailTypeName', '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(); if (is_dir($this->getPackagePath() . '/files')) { $ch = new ContentImporter(); $computeThumbnails = true; if ($this->contentProvidesFileThumbnails()) { $computeThumbnails = false; } $ch->importFiles($this->getPackagePath() . '/files', $computeThumbnails); } }
public function do_add() { $request = $this->validateThumbnailRequest(); if (!Loader::helper('validation/token')->validate('do_add')) { $this->error->add(Loader::helper('validation/token')->getErrorMessage()); } $thumbtype = Type::getByHandle($request->request->get('ftTypeHandle')); if (is_object($thumbtype)) { $this->error->add(t('That handle is in use.')); } if (!$this->error->has()) { $type = new \Concrete\Core\Entity\File\Image\Thumbnail\Type\Type(); $height = intval($request->request->get('ftTypeHeight')); if ($height > 0) { $type->setHeight($request->request->get('ftTypeHeight')); } $type->setWidth($request->request->get('ftTypeWidth')); $type->setName($request->request->get('ftTypeName')); $type->setHandle($request->request->get('ftTypeHandle')); $type->save(); $this->redirect('/dashboard/system/files/thumbnails', 'thumbnail_type_added'); } $this->set('type', $type); }