Last active
November 18, 2017 02:28
-
-
Save steelydylan/32fa60e6d4d5cd9101182823cc38be25 to your computer and use it in GitHub Desktop.
拡張アプリサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 --> | |
で呼び出せます。 | |
**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AAPP_Sample_POST_Sample extends ACMS_POST | |
{ | |
public function post() | |
{ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<option value="Sample"{name:selected#Sample}>サンプル(Sample)</option> | |
<!-- モジュールIDの選択画面で選択できるようにする | |
/admin/module/select.user.html | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ohtsuki2843
@kadoyan
お願いします。