File: /var/www/html/wp-content/plugins/ganryu_shop/boot/boot.php
<?php
class ganryu_shop_boot_Boot{
public $uniqSession = null;
function initialize(){
add_action('admin_menu', array($this, 'initializeMenu'));
add_action('wp_ajax_admin_ganryu_shop_ajax_config', array($this, 'ajaxConfig'));
add_action('wp_ajax_admin_ganryu_shop_ajax_delete', array($this, 'ajaxDelete'));
add_action('wp_ajax_admin_ganryu_shop_ajax_open', array($this, 'ajaxOpen'));
add_action('wp_ajax_admin_ganryu_shop_ajax_edit', array($this, 'ajaxEdit'));
add_action('wp_ajax_admin_ganryu_shop_ajax_add', array($this, 'ajaxAdd'));
add_action('wp_ajax_admin_ganryu_shop_ajax_item_image_upload', array($this, 'ajaxItemImageUpload'));
add_action('wp_ajax_admin_ganryu_shop_ajax_subitem_image_upload', array($this, 'ajaxSubitemImageUpload'));
add_action('wp_ajax_admin_ganryu_shop_ajax_subitem_setup', array($this, 'ajaxSubitemSetup'));
add_action('wp_ajax_admin_ganryu_shop_ajax_subitem_entry', array($this, 'ajaxSubitemEntry'));
add_action('wp_ajax_admin_ganryu_shop_ajax_itemtype', array($this, 'ajaxItemtype'));
add_action('wp_ajax_admin_ganryu_shop_ajax_deliverylist', array($this, 'ajaxDeliverylist'));
add_action('wp_ajax_admin_ganryu_shop_ajax_taxlist', array($this, 'ajaxTaxlist'));
add_action('wp_ajax_admin_ganryu_shop_ajax_mailtemplate', array($this, 'ajaxMailTemplate'));
add_action('wp_ajax_admin_ganryu_shop_ajax_purchase_itemcalc', array($this, 'ajaxPurchaseItemcalc'));
add_action('wp_ajax_admin_ganryu_shop_ajax_purchase_itemsearch', array($this, 'ajaxPurchaseItemsearch'));
add_action('wp_ajax_admin_ganryu_shop_ajax_purchase_statuschange', array($this, 'ajaxPurchaseStatuschange'));
add_action('wp_ajax_admin_ganryu_shop_ajax_purchase_update', array($this, 'ajaxPurchaseUpdate'));
add_action('wp_ajax_ganryu_shop_cartin', array($this, 'ajaxFrontCartin'));
add_action('wp_ajax_nopriv_ganryu_shop_cartin', array($this, 'ajaxFrontCartin'));
add_action('wp_ajax_ganryu_shop_cartlist', array($this, 'ajaxFrontCartlist'));
add_action('wp_ajax_nopriv_ganryu_shop_cartlist', array($this, 'ajaxFrontCartlist'));
add_action('wp_ajax_ganryu_shop_cartstart', array($this, 'ajaxFrontCartstart'));
add_action('wp_ajax_nopriv_ganryu_shop_cartstart', array($this, 'ajaxFrontCartstart'));
add_action('wp_ajax_ganryu_shop_cartpay', array($this, 'ajaxFrontCartpay'));
add_action('wp_ajax_nopriv_ganryu_shop_cartpay', array($this, 'ajaxFrontCartpay'));
add_action('wp_ajax_ganryu_shop_address', array($this, 'ajaxFrontAddress'));
add_action('wp_ajax_nopriv_ganryu_shop_logincheck', array($this, 'ajaxFrontLogincheck'));
add_action('wp_ajax_ganryu_shop_fav', array($this, 'ajaxFrontFav'));
add_action('wp_ajax_ganryu_shop_fanclubpay', array($this, 'ajaxFrontFanclubpay'));
add_action('wp_ajax_nopriv_ganryu_shop_fanclubpay', array($this, 'ajaxFrontFanclubpay'));
add_action('wp_ajax_ganryu_shop_fanclubcancel', array($this, 'ajaxFrontFanclubcancel'));
add_action('wp_ajax_nopriv_ganryu_shop_fanclubcancel', array($this, 'ajaxFrontFanclubcancel'));
add_action('init', array($this, "initialFilter"));
add_action('admin_init', array($this, "initialFilterAdmin"));
add_shortcode('ganryu_shop', array($this, 'attachTag'));
add_shortcode('ganryu_shop_global_cart', array($this, 'tagGlobalCart'));
}
function initialFilterAdmin(){
$action = grys_getvalue('grys_admin_action');
if ($action == "receipt"){
$this->doAction('Image', "receipt");
}
}
function initialFilter(){
$uss = null;
$generated = false;
if (array_key_exists('grys_ss', $_COOKIE)){
$uss = $_COOKIE['grys_ss'];
}
if (!$uss){
$uss = grys_generate_session(16);
grys_set_cookie('grys_ss', $uss, time()+60*60*24*365*100);
$generated = true;
}
$this->uniqSession = array(
'session'=>$uss,
'generated'=>$generated
);
$this->doAction('Shopping', 'rd_set');
$path = grys_request_path();
if ($path == "/"){
$action = grys_getvalue('grys_action');
if ($action == "item_image"){
$this->doAction('Image', "item_image");
}
if ($action == "subitem_image"){
$this->doAction('Image', "subitem_image");
}
if ($action == "rd"){
$this->doAction('Shopping', "rd");
}
}
else if ($path == "/eps"){
$this->doAction('Shopping', "eps");
}
}
function initializeMenu(){
add_menu_page('巌流島ショップ', '巌流島ショップ', 'read', "ganryu_shop", array($this, 'actionDashboard'), null, '1.05');
add_submenu_page("ganryu_shop", "ダッシュボード", "ダッシュボード", "read", "ganryu_shop", array($this, 'actionDashboard'));
add_submenu_page("ganryu_shop", "商品一覧", "商品一覧", "read", "ganryu_shop_list", array($this, 'actionList'));
add_submenu_page("ganryu_shop", "商品追加", "商品追加", "read", "ganryu_shop_add", array($this, 'actionAdd'));
add_submenu_page("ganryu_shop", "設定", "設定", "read", "ganryu_shop_config", array($this, 'actionConfig'));
add_submenu_page("ganryu_shop", "受注管理", "受注管理", "read", "ganryu_shop_purchase", array($this, 'actionPurchase'));
add_submenu_page("ganryu_shop", "ポイント管理", "ポイント管理", "read", "ganryu_shop_point", array($this, 'actionPoint'));
}
function ajaxConfig(){
grys_admin_only();
$this->doAction('Ajax', 'config');
}
function ajaxAdd(){
grys_admin_only();
$this->doAction('Ajax', 'add');
}
function ajaxEdit(){
grys_admin_only();
$this->doAction('Ajax', 'edit');
}
function ajaxDelete(){
grys_admin_only();
$this->doAction('Ajax', 'delete');
}
function ajaxOpen(){
grys_admin_only();
$this->doAction('Ajax', 'open');
}
function ajaxItemImageUpload(){
grys_admin_only();
$this->doAction('Ajax', 'itemImageUpload');
}
function ajaxSubitemImageUpload(){
grys_admin_only();
$this->doAction('Ajax', 'subitemImageUpload');
}
function ajaxSubitemSetup(){
grys_admin_only();
$this->doAction('Ajax', 'subitemSetup');
}
function ajaxSubitemEntry(){
grys_admin_only();
$this->doAction('Ajax', 'subitemEntry');
}
function ajaxItemtype(){
grys_admin_only();
$this->doAction('Ajax', 'itemtype');
}
function ajaxDeliverylist(){
grys_admin_only();
$this->doAction('Ajax', 'deliverylist');
}
function ajaxTaxlist(){
grys_admin_only();
$this->doAction('Ajax', 'taxlist');
}
function ajaxMailTemplate(){
grys_admin_only();
$this->doAction('Ajax', 'mailTemplate');
}
function ajaxPurchaseItemcalc(){
grys_admin_only();
$this->doAction('Ajax', 'purchaseItemcalc');
}
function ajaxPurchaseItemsearch(){
grys_admin_only();
$this->doAction('Ajax', 'purchaseItemsearch');
}
function ajaxPurchaseStatuschange(){
grys_admin_only();
$this->doAction('Ajax', 'purchaseStatuschange');
}
function ajaxPurchaseUpdate(){
grys_admin_only();
$this->doAction('Ajax', 'purchaseUpdate');
}
function ajaxFrontLogincheck(){
$this->doAction('Ajax', 'frontLogincheck');
}
function ajaxFrontCartin(){
$this->doAction('Ajax', 'frontCartin');
}
function ajaxFrontCartlist(){
$this->doAction('Ajax', 'frontCartlist');
}
function ajaxFrontCartpay(){
$this->doAction('Ajax', 'frontCartpay');
}
function ajaxFrontCartstart(){
$this->doAction('Ajax', 'frontCartstart');
}
function ajaxFrontAddress(){
$this->doAction('Ajax', 'frontAddress');
}
function ajaxFrontFav(){
$this->doAction('Ajax', 'frontFav');
}
function ajaxFrontFanclubpay(){
$this->doAction('Ajax', 'frontFanclubpay');
}
function ajaxFrontFanclubcancel(){
$this->doAction('Ajax', 'frontFanclubcancel');
}
function attachTag($attr){
if ($attr && is_array($attr) && count($attr)){
$action = $attr[0];
}
else{
$action = $this->pageAction();
}
if ($action == "itemdetail"){
$this->tagItemDetail();
}
elseif ($action == "cartlist"){
$this->tagCartlist();
}
elseif ($action == "cartpay"){
$this->tagCartpay();
}
elseif ($action == "cartconfirm"){
$this->tagCartconfirm();
}
elseif ($action == "cartcomplete"){
$this->tagCartcomplete();
}
elseif ($action == "purchaselog"){
$this->tagPurchaselog();
}
elseif ($action == "purchasedetail"){
$this->tagPurchaseDetail();
}
elseif ($action == "pointlog"){
$this->tagPointlog();
}
elseif ($action == "address_list"){
$this->tagAddressList();
}
elseif ($action == "address_add"){
$this->tagAddressAdd();
}
elseif ($action == "address_edit"){
$this->tagAddressEdit();
}
elseif ($action == "favlist"){
$this->tagFavlist();
}
else{
$this->tagItemList();
}
}
function tagItemlist(){
$this->doAction('Shopping', 'itemlist');
}
function tagItemDetail(){
$this->doAction('Shopping', 'itemdetail');
}
function tagCartlist(){
$this->doAction('Shopping', 'cartlist');
}
function tagCartpay(){
$this->doAction('Shopping', 'cartpay');
}
function tagCartconfirm(){
$this->doAction('Shopping', 'cartconfirm');
}
function tagCartcomplete(){
$this->doAction('Shopping', 'cartcomplete');
}
function tagPurchaseLog(){
$this->doAction('Shopping', 'purchaselog');
}
function tagPurchaseDetail(){
$this->doAction('Shopping', 'purchasedetail');
}
function tagPointlog(){
$this->doAction('Shopping', 'pointlog');
}
function tagAddressList(){
$this->doAction('Shopping', 'address');
}
function tagAddressAdd(){
$this->doAction('Shopping', 'address_add');
}
function tagAddressEdit(){
$this->doAction('Shopping', 'address_edit');
}
function tagFavlist(){
$this->doAction('Shopping', 'favlist');
}
function tagGlobalCart(){
$this->doAction('Shopping', 'globalCart');
}
function pageAction(){
if (array_key_exists('page_action', $_GET)){
return $_GET['page_action'];
}
return null;
}
function actionDashboard(){
echo "d";
}
function actionList(){
$pact = $this->pageAction();
$this->doAction("List", $pact);
}
function actionAdd(){
$this->doAction("Add");
}
function actionConfig(){
$pact = $this->pageAction();
$this->doAction("Config", $pact);
}
function actionPurchase(){
$pact = $this->pageAction();
$this->doAction("Purchase", $pact);
}
function actionPoint(){
$pact = $this->pageAction();
$this->doAction("Point", $pact);
}
function doAction($action, $func=null, $attr=array()){
if (!$func) $func = "action";
$file = GANRYU_SHOP_ROOT."/action/".$action.".php";
require_once $file;
$cls = "ganryu_shop_action_".$action;
$obj = new $cls();
$obj->initialize();
return call_user_func_array(array($obj, $func), $attr);
}
}