Advertisement
Guest User

Abstract Plugin Class

a guest
Nov 21st, 2013
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.28 KB | None | 0 0
  1. <?php
  2. /*********************************************\
  3. |****************** OPENCMS ******************|
  4. |*********************************************|
  5. |* @author Yannici                           *|
  6. |* @copyright Yannici                        *|
  7. |*********************************************|
  8. |* @since 04.11.2013                         *|
  9. \*********************************************/
  10.  
  11.  
  12. abstract class Abstract_plugin {
  13.    
  14.     public abstract function action();
  15.    
  16.     public function view($data) {
  17.         $data['PATH'] = $this->config->item('path');
  18.        
  19.         if(!file_exists(APPPATH . '/views/plugins/' . strtolower($this->_get_plugin_name()) . '/' . strtolower($this->_get_plugin_name()) . '.php')) {
  20.             show_404();
  21.         }
  22.        
  23.         $data['title'] = ucfirst($this->_get_plugin_name());
  24.        
  25.         $this->load->view('templates/header', $data);
  26.         $this->load->view('plugins/' . strtolower($this->_get_plugin_name()) . '/' . strtolower($this->_get_plugin_name()), $data);
  27.         $this->load->view('templates/footer');
  28.     }
  29.    
  30.     public function __get($key) {
  31.         if(property_exists($this, $key)) {
  32.             return $this->$key;
  33.         }
  34.        
  35.         $CI =& get_instance();
  36.         return $CI->$key;
  37.     }
  38. }
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement