Skip to content

Instantly share code, notes, and snippets.

View kanetei's full-sized avatar

Takayuki Kaneko kanetei

  • Osaka
  • 23:35 (UTC +09:00)
View GitHub Profile
@kanetei
kanetei / view.php
Created December 10, 2019 22:58
【concrete5】日付ナビで日付毎の件数を表示するサンプルコード
<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<aside class="blog-sidenav__list">
<h5 class="list-title"><?=h($title)?></h5>
<p class="view-all"><a href="<?=URL::to('/store/blog/archive')?>">一覧を見る</a></p>
<?php if (count($dates)) { ?>
<ul class="list-archive row">
<?php foreach ($dates as $date) { ?>
<li class="medium-6 columns<?php
if($date === end($dates)) {
echo ' end';
@kanetei
kanetei / .gitignore
Created January 25, 2018 08:31
concrete5 gitignore sample
application/bootstrap/autoload.php
application/bootstrap/start.php
application/config/doctrine/
application/config/generated_overrides/
application/config/concrete.php
application/config/update.php
application/config/database.php
application/files/
application/languages/cs_CZ/
application/languages/da_DK/
@kanetei
kanetei / form_setup_html.php
Last active November 22, 2017 02:14
Advanced HTML Block:強制ダウンロードするリンクを挿入出来るようにする
<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<p>
<button id="ccm-block-advanced-html-page-selector" type="button" class="btn btn-primary btn-xs"><?php echo t('Insert Page Link'); ?></button>
<button id="ccm-block-advanced-html-inline-file-selector" type="button" class="btn btn-primary btn-xs"><?php echo t('Insert File Inline Link'); ?></button>
<button id="ccm-block-advanced-html-download-file-selector" type="button" class="btn btn-primary btn-xs"><?php echo t('Insert File Download Link'); ?></button>
<button id="ccm-block-advanced-html-base-url" type="button" class="btn btn-primary btn-xs"><?php echo t('Insert Base URL'); ?></button>
<button id="ccm-block-advanced-html-force-download-file-selector" type="button" class="btn btn-primary btn-xs"><?php echo t('Insert Force File Download Link'); ?></button>
</p>
<div id="ccm-block-advanced-html-value"><?php echo htmlspecialchars($content,ENT_QUOTES,APP_CHARSET)?></div>
@kanetei
kanetei / api.php
Last active August 24, 2017 03:01
【concrete5】特定のページタイプ(例:'news')の内容をJSONPで出力する
<?php
// application/controllers/api.php
namespace Application\Controller;
use PageList;
use Core;
use Page;
use URL;
<?php
namespace Application\Src\Workflow;
use Concrete\Core\Workflow\HistoryEntry\BasicHistoryEntry as BasicWorkflowHistoryEntry;
use Concrete\Core\Workflow\Progress\Progress as WorkflowProgress;
use Concrete\Core\Workflow\Progress\BasicData as BasicWorkflowProgressData;
use Loader;
use Core;
use PermissionKey;
use User;
@kanetei
kanetei / controller.php
Created April 11, 2017 03:30
【concrete5】特定のエクスプレスオブジェクトで、属性(チェックボックス)にチェックがない時に項目を表示するカスタマイズ
<?php
namespace Application\Block\ExpressEntryList;
use Concrete\Core\Express\Entry\Search\Result\Result;
use Concrete\Core\Express\EntryList;
class Controller extends \Concrete\Block\ExpressEntryList\Controller
{
public function view()
<?php
namespace Application\Src\Workflow;
use Concrete\Core\Workflow\Progress\Progress as WorkflowProgress;
use Core;
use PermissionKey;
class BasicWorkflow extends \Concrete\Core\Workflow\BasicWorkflow
{
protected function notify(
@kanetei
kanetei / view.php
Created April 5, 2016 05:30
[concrete5] Google マップブロックのカスタムテンプレート-モバイルデバイスの時に指でスクロールしないようにする
<?php defined('C5_EXECUTE') or die("Access Denied.");
Loader::library('3rdparty/mobile_detect');
$md = new Mobile_Detect();
$c = Page::getCurrentPage();
if ($c->isEditMode()) { ?>
<div class="ccm-edit-mode-disabled-item" style="width: <?php echo $width; ?>; height: <?php echo $height; ?>">
<div style="padding: 80px 0px 0px 0px"><?php echo t('Google Map disabled in edit mode.')?></div>
</div>
@kanetei
kanetei / .htaccess
Last active March 4, 2016 07:42
concrete5のプリティURLとさくらのレンタルサーバのwww付きURL設定の両立
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(tagworks\.jp)$ [NC]
RewriteRule (.*) http://www.tagworks.jp%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
@kanetei
kanetei / view.php
Last active April 5, 2016 05:28
[concrete5] オートナビの出力をページ属性の値でグルーピングする
<?php defined('C5_EXECUTE') or die("Access Denied.");
// application/blocks/autonav/templates/grouping_autonav/view.php
$navItems = $controller->getNavItems();
$c = Page::getCurrentPage();
function cmp($a, $b)
{
$cmp = strcmp($a->cObj->getAttribute('attribute'), $b->cObj->getAttribute('attribute'));