Skip to content

Instantly share code, notes, and snippets.

@steelydylan
Last active November 18, 2017 02:28
Show Gist options
  • Save steelydylan/32fa60e6d4d5cd9101182823cc38be25 to your computer and use it in GitHub Desktop.
Save steelydylan/32fa60e6d4d5cd9101182823cc38be25 to your computer and use it in GitHub Desktop.
拡張アプリサンプル
<?php
/**
* Class AAPP_Sample_GET_Sample
*
* /php/AC
*/
class AAPP_Sample_GET_Sample extends ACMS_GET
{
public function get()
{
}
}
/**
<!-- BEGIN_MODULE Sample -->
<!-- END_MODULE Sample -->
で呼び出せます。
**/
<?php
class AAPP_Sample_POST_Sample extends ACMS_POST
{
public function post()
{
}
}
<header class="acms-admin-grid-r">
<div class="acms-admin-col-md-6">
<h1 class="acms-admin-admin-title">
<i class="acms-admin-icon acms-admin-icon-app"></i><!--T-->アプリ名<!--/T-->
</h1>
</div>
<div class="acms-admin-col-md-6"></div>
</header>
<!-- BEGIN_MODULE Touch_SessionWithAdministration -->
<!-- BEGIN_MODULE Admin_Config -->
<!-- BEGIN_IF [{notice_mess}/nem/] -->
<p class="acms-admin-alert acms-admin-alert-info">
<button class="js-acms-alert-close">X</button>
設定を保存しました
</p><!-- END_IF -->
<form action="" method="post" class="js-adminSave acms-admin-form">
<div class="js-acms_fix_marker js-acms_fix_target acms_fix_bg">
<div class="acms-admin-form-group acms_fix_bg_index">
<input type="submit" name="ACMS_POST_Config" value="保存" class="acms-admin-btn-admin acms-admin-btn-admin-primary acms-admin-btn-admin-save"
/>
</div>
</div>
<!-- ここにfieldをconfigに置換したものを設置  -->
</form>
<!-- END_MODULE Admin_Config -->
<!-- END_MODULE Touch_SessionWithAdministration -->
use Acms\Services\Facades\Storage;
class AAPP_Sample extends ACMS_APP
{
public $version = '1.0.0';
public $name = 'Sample';
public $author = 'com.appleple';
public $module = false;
public $menu = 'sample_index';
public $desc = 'Sample';
/**
* Hook処理など
*/
public function serviceProvider()
{
$Hook = ACMS_Hook::singleton();
if ( HOOK_ENABLE && class_exists('AAPP_Sample_Hook') ) {
$Hook->attach('Sample', new AAPP_Sample_Hook());
}
}
/**
* インストールするときの処理
* データベーステーブルの初期化など
*
* @return void
*/
public function install()
{
$theme = config('theme');
$path = '/admin/app/sample/index.html';
$to = THEMES_DIR . $theme . $path;
$from = AAPP_LIB_DIR . 'Sample/theme' . $path;
Storage::makeDirectory(THEMES_DIR . $theme . '/admin/app/sample');
if ( !Storage::exists($to) ) {
Storage::copy($from, $to);
}
}
/**
* アンインストールするときの処理
* データベーステーブルの始末など
*
* @return void
*/
public function uninstall()
{
}
/**
* アップデートするときの処理
*
* @return bool
*/
public function update()
{
return true;
}
/**
* 有効化するときの処理
*
* @return bool
*/
public function activate()
{
return true;
}
/**
* 無効化するときの処理
*
* @return bool
*/
public function deactivate()
{
return true;
}
}
<option value="Sample"{name:selected#Sample}>サンプル(Sample)</option>
<!-- モジュールIDの選択画面で選択できるようにする
/admin/module/select.user.html
-->
@steelydylan
Copy link
Author

@ohtsuki2843
@kadoyan

お願いします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment