public function getInstance() { if ($this->instance == null) { $this->instance = new $this->class(); $this->instance->setClub(\Club\Club::getInstance()); $this->instance->init(); } return $this->instance; }
public function getDateFormat($type = "php") { $module = \Club\Club::getInstance()->getModules()->getModule("calendar"); $default = "de"; if ($module != NULL) { foreach ($module->getSettings() as $setting) { if ($setting["key"] == "calender_time_format") { $default = $setting["default"]; } } } $formatString = get_option("calender_time_format", $default); return self::$FORMATS[$formatString][$type]; }
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $modules = \Club\Club::getInstance()->getModules(); ?> <div class="wrap"> <h2>Club Plugin Einstellugne</h2> <form method="post" action="options.php"> <?php settings_fields('club-settings'); ?> <?php do_settings_sections('club-settings'); ?> <table class="form-table"> <?php foreach ($modules->getSettings() as $setting) { $default = false; if (array_key_exists("default", $setting)) { $default = $setting["default"]; } ?> <tr valign="top"> <th scope="row"><?php echo $setting["displayName"]; ?>
use Ramsey\Uuid\Uuid; use Club\Admin\Calendar\Event; $uuid = filter_input(INPUT_GET, "uuid"); $edit = false; $event = null; if (!Uuid::isValid($uuid)) { $uuid = null; $event = new Event(); } else { $event = Event::findById($uuid); $edit = true; } $defaultFormat = ""; $momentFormat = ""; $module = \Club\Club::getInstance()->getModules()->getModuleInstance("calendar"); if ($module != NULL) { $defaultFormat = $module->getDateFormat(); $momentFormat = $module->getDateFormat("moment"); } ?> <div class="bootstrap-wrapper"> <div class="container"> <h1>Club Termine</h1> <form class="form-horizontal"> <div class="form-group" id="divTitle" class="can-have-error"> <label for="txtTitle" class="col-sm-2 control-label">Title</label> <div class="col-sm-10"> <input type="text" class="form-control can-have-error" value="<?php echo $event->getTitle();
public function registerMenus() { $club = \Club\Club::getInstance(); $baseDir = $club->plugin_base; foreach ($this->activated as $name) { $menus = $this->getModule($name)->getMenu(); $this->registerJsonMenu($menus, $baseDir, $club, $name); } }
/** * * @param \Club\Modules\Page $page */ protected function registerPage($page) { $club = \Club\Club::getInstance(); $club->registerPage($page); }
<?php $club = \Club\Club::getInstance(); $module = $club->getModules()->getModules(); $activ = $club->getModules()->getActivated(); ?> <div class="bootstrap-wrapper"> <div class="container"> <h1>Club Module</h1> <table class="table table-hover table-striped"> <thead> <tr> <th>Modul</th> <th>Beschreibung</th> <th> </th> </tr> </thead> <tbody> <?php foreach ($module as $mod) { ?> <tr> <td><?php echo $mod->getName(); ?> </td> <td><?php echo $mod->getDescription(); ?> </td>