@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | * {@inhericDoc} |
| 27 | 27 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
| 28 | 28 | */ |
| 29 | - protected function renderContent() { |
|
| 29 | + protected function renderContent() { |
|
| 30 | 30 | |
| 31 | - /** @var AbstractModule $module */ |
|
| 32 | - $module = $this->data->get('module'); |
|
| 33 | - ?> |
|
| 31 | + /** @var AbstractModule $module */ |
|
| 32 | + $module = $this->data->get('module'); |
|
| 33 | + ?> |
|
| 34 | 34 | <ol class="breadcrumb small"> |
| 35 | 35 | <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li> |
| 36 | 36 | <li><a href="admin_modules.php"><?php echo I18N::translate('Module administration'); ?></a></li> |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | </form> |
| 187 | 187 | |
| 188 | 188 | <?php |
| 189 | - } |
|
| 189 | + } |
|
| 190 | 190 | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | \ No newline at end of file |
@@ -22,20 +22,20 @@ |
||
| 22 | 22 | * {@inhericDoc} |
| 23 | 23 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
| 24 | 24 | */ |
| 25 | - protected function renderContent() { |
|
| 26 | - if($this->data->get('has_stats', false)) { |
|
| 27 | - $html = I18N::translate('%1$s visits since the beginning of %2$s<br>(%3$s today)' , |
|
| 28 | - '<span class="odometer">' . I18N::number($this->data->get('visits_year')) . '</span>', |
|
| 29 | - date('Y'), |
|
| 30 | - '<span class="odometer">' . I18N::number($this->data->get('visits_today')) . '</span>' |
|
| 31 | - ); |
|
| 32 | - } |
|
| 33 | - else { |
|
| 34 | - $html = I18N::translate('No statistics could be retrieved from Piwik.'); |
|
| 35 | - } |
|
| 25 | + protected function renderContent() { |
|
| 26 | + if($this->data->get('has_stats', false)) { |
|
| 27 | + $html = I18N::translate('%1$s visits since the beginning of %2$s<br>(%3$s today)' , |
|
| 28 | + '<span class="odometer">' . I18N::number($this->data->get('visits_year')) . '</span>', |
|
| 29 | + date('Y'), |
|
| 30 | + '<span class="odometer">' . I18N::number($this->data->get('visits_today')) . '</span>' |
|
| 31 | + ); |
|
| 32 | + } |
|
| 33 | + else { |
|
| 34 | + $html = I18N::translate('No statistics could be retrieved from Piwik.'); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - return $html; |
|
| 38 | - } |
|
| 37 | + return $html; |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | } |
@@ -23,51 +23,51 @@ |
||
| 23 | 23 | * {@inhericDoc} |
| 24 | 24 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
| 25 | 25 | */ |
| 26 | - protected function renderContent() { |
|
| 26 | + protected function renderContent() { |
|
| 27 | 27 | |
| 28 | - return ' |
|
| 28 | + return ' |
|
| 29 | 29 | <tr> |
| 30 | 30 | <td class="descriptionbox wrap width33">' . |
| 31 | - I18N::translate('Enable Piwik Statistics') . |
|
| 32 | - // Ideally, would like to add helpLink, but this does not work for modules... |
|
| 33 | - // FunctionsPrint::helpLink('piwik_enabled', $this->getName()); |
|
| 34 | - '</td> |
|
| 31 | + I18N::translate('Enable Piwik Statistics') . |
|
| 32 | + // Ideally, would like to add helpLink, but this does not work for modules... |
|
| 33 | + // FunctionsPrint::helpLink('piwik_enabled', $this->getName()); |
|
| 34 | + '</td> |
|
| 35 | 35 | <td class="optionbox">' . |
| 36 | - FunctionsEdit::editFieldYesNo('piwik_enabled', $this->data->get('piwik_enabled', '0')) . |
|
| 37 | - '</td> |
|
| 36 | + FunctionsEdit::editFieldYesNo('piwik_enabled', $this->data->get('piwik_enabled', '0')) . |
|
| 37 | + '</td> |
|
| 38 | 38 | </tr>' . |
| 39 | 39 | |
| 40 | - '<tr> |
|
| 40 | + '<tr> |
|
| 41 | 41 | <td class="descriptionbox wrap width33">' . |
| 42 | - I18N::translate('Piwik URL') . |
|
| 43 | - '</td> |
|
| 42 | + I18N::translate('Piwik URL') . |
|
| 43 | + '</td> |
|
| 44 | 44 | <td class="optionbox"> |
| 45 | 45 | <input type="text" name="piwik_url" size="45" value="' . |
| 46 | - $this->data->get('piwik_url', '') . '" /> |
|
| 46 | + $this->data->get('piwik_url', '') . '" /> |
|
| 47 | 47 | </td> |
| 48 | 48 | </tr>' . |
| 49 | 49 | |
| 50 | - '<tr> |
|
| 50 | + '<tr> |
|
| 51 | 51 | <td class="descriptionbox wrap width33">' . |
| 52 | - I18N::translate('Piwik Token') . |
|
| 53 | - '</td> |
|
| 52 | + I18N::translate('Piwik Token') . |
|
| 53 | + '</td> |
|
| 54 | 54 | <td class="optionbox"> |
| 55 | 55 | <input type="text" name="piwik_token" size="45" value="' . |
| 56 | - $this->data->get('piwik_token', '') . '" /> |
|
| 56 | + $this->data->get('piwik_token', '') . '" /> |
|
| 57 | 57 | </td> |
| 58 | 58 | </tr>' . |
| 59 | 59 | |
| 60 | - '<tr> |
|
| 60 | + '<tr> |
|
| 61 | 61 | <td class="descriptionbox wrap width33">' . |
| 62 | - I18N::translate('Piwik Site ID') . |
|
| 63 | - '</td> |
|
| 62 | + I18N::translate('Piwik Site ID') . |
|
| 63 | + '</td> |
|
| 64 | 64 | <td class="optionbox"> |
| 65 | 65 | <input type="text" name="piwik_siteid" size="4" value="' . |
| 66 | - $this->data->get('piwik_siteid', '') . '" /> |
|
| 66 | + $this->data->get('piwik_siteid', '') . '" /> |
|
| 67 | 67 | </td> |
| 68 | 68 | </tr>' ; |
| 69 | 69 | |
| 70 | - } |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | } |
@@ -15,12 +15,12 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | interface MvcControllerInterface { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Return the module attached to this controller. |
|
| 20 | - * |
|
| 21 | - * @return \Fisharebest\Webtrees\Module\AbstractModule |
|
| 22 | - */ |
|
| 23 | - function getModule(); |
|
| 18 | + /** |
|
| 19 | + * Return the module attached to this controller. |
|
| 20 | + * |
|
| 21 | + * @return \Fisharebest\Webtrees\Module\AbstractModule |
|
| 22 | + */ |
|
| 23 | + function getModule(); |
|
| 24 | 24 | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | \ No newline at end of file |
@@ -17,28 +17,28 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class MvcController implements MvcControllerInterface |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * Reference module |
|
| 22 | - * @var Fisharebest\Webtrees\Module\AbstractModule $module |
|
| 23 | - */ |
|
| 24 | - protected $module; |
|
| 20 | + /** |
|
| 21 | + * Reference module |
|
| 22 | + * @var Fisharebest\Webtrees\Module\AbstractModule $module |
|
| 23 | + */ |
|
| 24 | + protected $module; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Constructor for MvcController |
|
| 28 | - * |
|
| 29 | - * @param AbstractModule $module |
|
| 30 | - */ |
|
| 31 | - public function __construct(AbstractModule $module) { |
|
| 32 | - $this->module = $module; |
|
| 33 | - } |
|
| 26 | + /** |
|
| 27 | + * Constructor for MvcController |
|
| 28 | + * |
|
| 29 | + * @param AbstractModule $module |
|
| 30 | + */ |
|
| 31 | + public function __construct(AbstractModule $module) { |
|
| 32 | + $this->module = $module; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * {@inheritDoc} |
|
| 37 | - * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface::getModule() |
|
| 38 | - */ |
|
| 39 | - public function getModule() { |
|
| 40 | - return $this->module; |
|
| 41 | - } |
|
| 35 | + /** |
|
| 36 | + * {@inheritDoc} |
|
| 37 | + * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface::getModule() |
|
| 38 | + */ |
|
| 39 | + public function getModule() { |
|
| 40 | + return $this->module; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | \ No newline at end of file |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * @param \Fisharebest\Webtrees\Module\AbstractModule $module |
| 22 | 22 | * @param string $request |
| 23 | 23 | */ |
| 24 | - public function handle(\Fisharebest\Webtrees\Module\AbstractModule $module, $request); |
|
| 24 | + public function handle(\Fisharebest\Webtrees\Module\AbstractModule $module, $request); |
|
| 25 | 25 | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | \ No newline at end of file |
@@ -17,87 +17,87 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class ViewFactory { |
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * @var ViewFactory $instance Singleton pattern instance |
|
| 22 | - */ |
|
| 23 | - private static $instance = null; |
|
| 20 | + /** |
|
| 21 | + * @var ViewFactory $instance Singleton pattern instance |
|
| 22 | + */ |
|
| 23 | + private static $instance = null; |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Returns the *ViewFactory* instance of this class. |
|
| 27 | - * |
|
| 28 | - * @return ViewFactory The *Singleton* instance. |
|
| 29 | - */ |
|
| 30 | - public static function getInstance() |
|
| 31 | - { |
|
| 32 | - if (null === static::$instance) { |
|
| 33 | - static::$instance = new static(); |
|
| 34 | - } |
|
| 25 | + /** |
|
| 26 | + * Returns the *ViewFactory* instance of this class. |
|
| 27 | + * |
|
| 28 | + * @return ViewFactory The *Singleton* instance. |
|
| 29 | + */ |
|
| 30 | + public static function getInstance() |
|
| 31 | + { |
|
| 32 | + if (null === static::$instance) { |
|
| 33 | + static::$instance = new static(); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - return static::$instance; |
|
| 37 | - } |
|
| 36 | + return static::$instance; |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Protected constructor |
|
| 41 | - */ |
|
| 42 | - protected function __construct() {} |
|
| 39 | + /** |
|
| 40 | + * Protected constructor |
|
| 41 | + */ |
|
| 42 | + protected function __construct() {} |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * Return the view specified by the controller and view name, using data from the ViewBag |
|
| 46 | - * |
|
| 47 | - * @param string $view_name |
|
| 48 | - * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl |
|
| 49 | - * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl |
|
| 50 | - * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data |
|
| 51 | - * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View |
|
| 52 | - * @throws \Exception |
|
| 53 | - */ |
|
| 54 | - public function makeView($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) |
|
| 55 | - { |
|
| 56 | - if(!$mvc_ctrl) throw new \Exception('Mvc Controller not defined'); |
|
| 57 | - if(!$ctrl) throw new \Exception('Base Controller not defined'); |
|
| 58 | - if(!$view_name) throw new \Exception('View not defined'); |
|
| 44 | + /** |
|
| 45 | + * Return the view specified by the controller and view name, using data from the ViewBag |
|
| 46 | + * |
|
| 47 | + * @param string $view_name |
|
| 48 | + * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl |
|
| 49 | + * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl |
|
| 50 | + * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data |
|
| 51 | + * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View |
|
| 52 | + * @throws \Exception |
|
| 53 | + */ |
|
| 54 | + public function makeView($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) |
|
| 55 | + { |
|
| 56 | + if(!$mvc_ctrl) throw new \Exception('Mvc Controller not defined'); |
|
| 57 | + if(!$ctrl) throw new \Exception('Base Controller not defined'); |
|
| 58 | + if(!$view_name) throw new \Exception('View not defined'); |
|
| 59 | 59 | |
| 60 | - $mvc_ctrl_refl = new \ReflectionObject($mvc_ctrl); |
|
| 61 | - $view_class = $mvc_ctrl_refl->getNamespaceName() . '\\Views\\' . $view_name . 'View'; |
|
| 62 | - if(!class_exists($view_class)) throw new \Exception('View does not exist'); |
|
| 60 | + $mvc_ctrl_refl = new \ReflectionObject($mvc_ctrl); |
|
| 61 | + $view_class = $mvc_ctrl_refl->getNamespaceName() . '\\Views\\' . $view_name . 'View'; |
|
| 62 | + if(!class_exists($view_class)) throw new \Exception('View does not exist'); |
|
| 63 | 63 | |
| 64 | - return new $view_class($ctrl, $data); |
|
| 65 | - } |
|
| 64 | + return new $view_class($ctrl, $data); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * Static invocation of the makeView method |
|
| 69 | - * |
|
| 70 | - * @param string $view_name |
|
| 71 | - * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl |
|
| 72 | - * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl |
|
| 73 | - * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data |
|
| 74 | - * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View |
|
| 75 | - * @see \MyArtJaub\Webtrees\Mvc\View\ViewFactory::handle() |
|
| 76 | - */ |
|
| 77 | - public static function make($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) |
|
| 78 | - { |
|
| 79 | - return self::getInstance()->makeView($view_name, $mvc_ctrl, $ctrl, $data); |
|
| 80 | - } |
|
| 67 | + /** |
|
| 68 | + * Static invocation of the makeView method |
|
| 69 | + * |
|
| 70 | + * @param string $view_name |
|
| 71 | + * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl |
|
| 72 | + * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl |
|
| 73 | + * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data |
|
| 74 | + * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View |
|
| 75 | + * @see \MyArtJaub\Webtrees\Mvc\View\ViewFactory::handle() |
|
| 76 | + */ |
|
| 77 | + public static function make($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) |
|
| 78 | + { |
|
| 79 | + return self::getInstance()->makeView($view_name, $mvc_ctrl, $ctrl, $data); |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * Private clone method to prevent cloning of the instance of the |
|
| 84 | - * *Dispatcher* instance. |
|
| 85 | - * |
|
| 86 | - * @return void |
|
| 87 | - */ |
|
| 88 | - private function __clone() |
|
| 89 | - { |
|
| 90 | - } |
|
| 82 | + /** |
|
| 83 | + * Private clone method to prevent cloning of the instance of the |
|
| 84 | + * *Dispatcher* instance. |
|
| 85 | + * |
|
| 86 | + * @return void |
|
| 87 | + */ |
|
| 88 | + private function __clone() |
|
| 89 | + { |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * Private unserialize method to prevent unserializing of the *Dispatcher* |
|
| 94 | - * instance. |
|
| 95 | - * |
|
| 96 | - * @return void |
|
| 97 | - */ |
|
| 98 | - private function __wakeup() |
|
| 99 | - { |
|
| 100 | - } |
|
| 92 | + /** |
|
| 93 | + * Private unserialize method to prevent unserializing of the *Dispatcher* |
|
| 94 | + * instance. |
|
| 95 | + * |
|
| 96 | + * @return void |
|
| 97 | + */ |
|
| 98 | + private function __wakeup() |
|
| 99 | + { |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | \ No newline at end of file |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * webtrees-lib: MyArtJaub library for webtrees |
|
| 4 | - * |
|
| 5 | - * @package MyArtJaub\Webtrees |
|
| 6 | - * @subpackage Hook |
|
| 7 | - * @author Jonathan Jaubart <[email protected]> |
|
| 8 | - * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
| 9 | - * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
| 10 | - */ |
|
| 3 | + * webtrees-lib: MyArtJaub library for webtrees |
|
| 4 | + * |
|
| 5 | + * @package MyArtJaub\Webtrees |
|
| 6 | + * @subpackage Hook |
|
| 7 | + * @author Jonathan Jaubart <[email protected]> |
|
| 8 | + * @copyright Copyright (c) 2011-2016, Jonathan Jaubart |
|
| 9 | + * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 |
|
| 10 | + */ |
|
| 11 | 11 | namespace MyArtJaub\Webtrees\Hook; |
| 12 | 12 | |
| 13 | 13 | use \Fisharebest\Webtrees as fw; |
@@ -15,13 +15,13 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | interface HookSubscriberInterface { |
| 17 | 17 | |
| 18 | - /** |
|
| 18 | + /** |
|
| 19 | 19 | * Return the list of functions implementented in the class which needs to be registered as hooks. |
| 20 | 20 | * The format is either { function1, function 2,...} in which case the priority is the default one |
| 21 | 21 | * or { function1 => priority1, function2 => priority2, ...} |
| 22 | 22 | * |
| 23 | 23 | * @return array Array of hooks |
| 24 | 24 | */ |
| 25 | - public function getSubscribedHooks(); |
|
| 25 | + public function getSubscribedHooks(); |
|
| 26 | 26 | |
| 27 | 27 | } |
| 28 | 28 | \ No newline at end of file |