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"]; ?>
/** * Программа управления клубом * * @package Club * @version 1.0 * @author Anton Kucherov <*****@*****.**> * @link http://idexter.ru/ */ require_once "Autoloader.php"; use Club\Club; use Club\Song; use Club\Playlist; use Club\Visitor; $playlist = new Playlist("Новый плейлист"); $playlist[] = new Song("Arash feat. Helena - One Day", "Pop"); $playlist[] = new Song("Бьянка - Ногами Руками", "Rnb"); $playlist[] = new Song("Inna feat. J Balvin - Cola Song", "House"); $visitor = new Visitor("Дима"); $visitor->addDanceSkill(new \Club\Dance\Rnb()); $visitor->addDanceSkill(new \Club\Dance\Pop()); $visitor2 = new Visitor("Петя"); $visitor2->addDanceSkill(new \Club\Dance\House()); $visitor3 = new Visitor("Вася"); $club = new Club("Fix Club", 2); $club->open(); $club->addVisitor($visitor); $club->addVisitor($visitor2); $club->addVisitor($visitor3); $club->setPlaylist($playlist); $club->playMusic(); $club->close();
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>