Paperyard
Public Member Functions | Protected Attributes | Private Attributes | List of all members
Paperyard\Controllers\BasicController Class Reference
Inheritance diagram for Paperyard\Controllers\BasicController:
Paperyard\Controllers\Archive\Archive Paperyard\Controllers\Archive\Confirm Paperyard\Controllers\Archive\ConfirmDetails Paperyard\Controllers\Archive\Details Paperyard\Controllers\Misc\Index Paperyard\Controllers\Misc\Shell Paperyard\Controllers\Rule\ArchiveDetails Paperyard\Controllers\Rule\Archives Paperyard\Controllers\Rule\RecipientDetails Paperyard\Controllers\Rule\Recipients Paperyard\Controllers\Rule\SenderDetails Paperyard\Controllers\Rule\Senders Paperyard\Controllers\Rule\SubjectDetails Paperyard\Controllers\Rule\Subjects

Public Member Functions

 getPlugins ()
 
 registerPlugin ($name, $type=PluginType::NORMAL)
 
 getLanguageFlag ()
 

Protected Attributes

 $view
 
 $logger
 
 $flash
 

Private Attributes

 $plugins_js
 
 $plugins_css
 

Detailed Description

Definition at line 7 of file BasicController.php.

Member Function Documentation

Paperyard\Controllers\BasicController::getLanguageFlag ( )

maps current set language to html class

Returns
string

Definition at line 74 of file BasicController.php.

74  {
75  $codes = array(
76  "de_DE" => "flag-icon-de",
77  "en_US" => "flag-icon-gb");
78  return $codes[$_SESSION['lang-code']];
79  }
Paperyard\Controllers\BasicController::getPlugins ( )

return successfully registered plugins

Returns
array plugins which exist

Definition at line 29 of file BasicController.php.

30  {
31  return array(
32  'css' => $this->plugins_css,
33  'js' => $this->plugins_js
34  );
35  }
Paperyard\Controllers\BasicController::registerPlugin (   $name,
  $type = PluginType::NORMAL 
)

checks if plugin exist and adds it to the plugin list

Parameters
$namestring plugin to search for in plugin directory
$typeint flag to toggle plugin type

Definition at line 43 of file BasicController.php.

44  {
45  $js_path = $_SERVER["DOCUMENT_ROOT"] . '/frontend/public/static/js/plugins/' . $name . '.js';
46  $css_path = $_SERVER["DOCUMENT_ROOT"] . '/frontend/public/static/js/plugins/' . $name . '.js';
47 
48  switch ($type) {
49  case PluginType::NORMAL:
50  if (file_exists($js_path) &&
51  file_exists($css_path)) {
52  $this->plugins_js[] = $name;
53  $this->plugins_css[] = $name;
54  }
55  break;
57  if (file_exists($css_path)) {
58  $this->plugins_css[] = $name;
59  }
60  break;
62  if (file_exists($js_path)) {
63  $this->plugins_js[] = $name;
64  }
65  break;
66  }
67  }

Member Data Documentation

Paperyard\Controllers\BasicController::$flash
protected

Definition at line 16 of file BasicController.php.

Paperyard\Controllers\BasicController::$logger
protected

Definition at line 13 of file BasicController.php.

Paperyard\Controllers\BasicController::$plugins_css
private

Definition at line 22 of file BasicController.php.

Paperyard\Controllers\BasicController::$plugins_js
private

Definition at line 19 of file BasicController.php.

Paperyard\Controllers\BasicController::$view
protected

Definition at line 10 of file BasicController.php.


The documentation for this class was generated from the following file: