Extends Module
This commit is contained in:
parent
2400564a79
commit
68068969cb
@ -8,10 +8,9 @@
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
class Album {
|
||||
class Album extends Module {
|
||||
|
||||
private $database = null;
|
||||
private $plugins = null;
|
||||
private $settings = null;
|
||||
private $albumIDs = null;
|
||||
|
||||
@ -27,20 +26,6 @@ class Album {
|
||||
|
||||
}
|
||||
|
||||
private function plugins($name, $location, $args) {
|
||||
|
||||
if (!isset($this->plugins, $name, $location, $args)) return false;
|
||||
|
||||
# Parse
|
||||
$location = ($location===0 ? 'before' : 'after');
|
||||
|
||||
# Call plugins
|
||||
$this->plugins->activate($name . ":" . $location, $args);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public function add($title = 'Untitled', $public = 0, $visible = 1) {
|
||||
|
||||
if (!isset($this->database)) return false;
|
||||
|
29
php/modules/Module.php
Normal file
29
php/modules/Module.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
###
|
||||
# @name Module
|
||||
# @author Tobias Reich
|
||||
# @copyright 2014 by Tobias Reich
|
||||
###
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
class Module {
|
||||
|
||||
protected $plugins = null;
|
||||
|
||||
protected function plugins($name, $location, $args) {
|
||||
|
||||
if (!isset($this->plugins, $name, $location, $args)) return false;
|
||||
|
||||
# Parse
|
||||
$location = ($location===0 ? 'before' : 'after');
|
||||
|
||||
# Call plugins
|
||||
$this->plugins->activate($name . ":" . $location, $args);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -8,9 +8,8 @@
|
||||
|
||||
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
|
||||
|
||||
class Session {
|
||||
class Session extends Module {
|
||||
|
||||
private $plugins = null;
|
||||
private $settings = null;
|
||||
|
||||
public function __construct($plugins, $settings) {
|
||||
@ -23,20 +22,6 @@ class Session {
|
||||
|
||||
}
|
||||
|
||||
private function plugins($name, $location, $args) {
|
||||
|
||||
if (!isset($this->plugins, $name, $location, $args)) return false;
|
||||
|
||||
# Parse
|
||||
$location = ($location===0 ? 'before' : 'after');
|
||||
|
||||
# Call plugins
|
||||
$this->plugins->activate($name . ":" . $location, $args);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public function init($public, $version) {
|
||||
|
||||
if (!isset($this->settings, $public, $version)) return false;
|
||||
|
Loading…
Reference in New Issue
Block a user