ConcreteCMS TIPS のサンプルコードです。
動画はこちらからご覧いただけます。 https://youtu.be/bIPE_50tjpE
| <?php | |
| // Logging setting based on Concrete CMS 8.5.12 | |
| return [ | |
| /* | |
| * ------------------------------------------------------------------------ | |
| * Logging settings | |
| * ------------------------------------------------------------------------ | |
| */ | |
| 'log' => [ | |
| /* |
ConcreteCMS TIPS のサンプルコードです。
動画はこちらからご覧いただけます。 https://youtu.be/bIPE_50tjpE
| <?php | |
| // appliction/config/concrete.php | |
| return [ | |
| 'sitemap_xml' => [ | |
| 'file' => 'sitemap2.xml', | |
| ], | |
| ]; |
| <?php | |
| class Controller extends BlockController | |
| { | |
| // 省略 | |
| public function on_start() | |
| { | |
| // https://documentation.concrete5.org/developers/assets/registering-an-asset | |
| $al = AssetList::getInstance(); | |
| $al->register('javascript', 'jquery', 'js/jquery.js'); |
| <?php | |
| namespace Application\Controller\SinglePage; | |
| use Concrete\Controller\SinglePage\Login as CoreLogin; | |
| class Login extends CoreLogin | |
| { | |
| public function view($type = null, $element = 'form') | |
| { | |
| $key=$this->request->query->get('key'); |
| <?php | |
| /** | |
| * Usage: | |
| * concrete/bin/concrete5 c5:exec bulk_change_page_template.php old_page_template_handle /parent-page-path new_page_template_handle | |
| */ | |
| $filterPageTemplateHandle = $args[0]; | |
| $filterPagePath = $args[1]; | |
| $changePageTemplateHandle = $args[2]; |
| # Set the bucket name and date limit that you want to scan for... | |
| # | |
| # For example, if you deleted everything at 9'ish, set the DATE_LIMIT for a | |
| # few minutes before to ensure you find only the stuff you deleted by error | |
| # | |
| BUCKET_NAME="..." | |
| DATE_LIMIT="0000-00-00T00:00:00.000Z" | |
| aws s3api list-object-versions --bucket "${BUCKET_NAME}" > objects.json | |
| cat objects.json | jq --arg DATE_LIMIT "${DATE_LIMIT}" '[ .DeleteMarkers[] | select(.LastModified > $DATE_LIMIT and .IsLatest) | { file: .Key, version: .VersionId } ]' > markers-to-delete.json |
| <?php | |
| // /application/bootstrap/app.php | |
| Route::register('/ccm/request_test', function() { | |
| header("Pragma: no-cache"); | |
| echo '<dl>'; | |
| ?><dt>Application environment:</dt><dd><?php echo ($this->app->environment()) ? $this->app->environment() : 'default'; ?></dd><?php | |
| $request = \Concrete\Core\Http\Request::getInstance(); | |
| ?><dt>Client IP:</dt><dd><?php echo $request->getClientIp(); ?></dd><?php | |
| ?><dt>Host:</dt><dd><?php echo $request->getHost(); ?></dd><?php | |
| ?><dt>Port:</dt><dd><?php echo $request->getPort(); ?></dd><?php |
| <?php | |
| namespace Concrete\Core\File\Image; | |
| use Concrete\Core\Application\ApplicationAwareInterface; | |
| use Concrete\Core\Application\ApplicationAwareTrait; | |
| use Concrete\Core\Entity\File\File; | |
| use Concrete\Core\Entity\File\StorageLocation\StorageLocation; | |
| use Concrete\Core\File\Image\Thumbnail\ThumbnailerInterface; | |
| use Concrete\Core\File\Image\Thumbnail\Type\CustomThumbnail; | |
| use Concrete\Core\File\StorageLocation\Configuration\LocalConfiguration; |
| <?php | |
| namespace Application\Block\Form; | |
| use Concrete\Core\Block\BlockController; | |
| use Core; | |
| use Database; | |
| use User; | |
| use Page; | |
| use UserInfo; |