parent
							
								
									d89857b44c
								
							
						
					
					
						commit
						9cda41b962
					
				@ -0,0 +1,24 @@ | 
				
			|||||||
 | 
					<?php | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$plugin = StaticPlugin::create(); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$content = $plugin->get_content(); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$title = $plugin->get_block_title(); | 
				
			||||||
 | 
					$title = $title ? "<h4>$title</h4>" : ''; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$css = $plugin->get_css(); | 
				
			||||||
 | 
					$css = $css ? "<style type=\"text/css\">$css</style>" : ''; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if (empty($content)) | 
				
			||||||
 | 
					{ | 
				
			||||||
 | 
					    echo ''; | 
				
			||||||
 | 
					} | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo <<<EOT | 
				
			||||||
 | 
					<div class="well sidebar-nav static"> | 
				
			||||||
 | 
					    $css | 
				
			||||||
 | 
					    $title | 
				
			||||||
 | 
					    $content | 
				
			||||||
 | 
					</div> | 
				
			||||||
 | 
					EOT; | 
				
			||||||
@ -0,0 +1,38 @@ | 
				
			|||||||
 | 
					<?php | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * Description of static_plugin | 
				
			||||||
 | 
					 * | 
				
			||||||
 | 
					 * @copyright (c) 2012 University of Geneva | 
				
			||||||
 | 
					 * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html | 
				
			||||||
 | 
					 * @author Laurent Opprecht <laurent@opprecht.info> | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					class StaticPlugin extends Plugin | 
				
			||||||
 | 
					{ | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /** | 
				
			||||||
 | 
					     * | 
				
			||||||
 | 
					     * @return StaticPlugin  | 
				
			||||||
 | 
					     */ | 
				
			||||||
 | 
					    static function create() | 
				
			||||||
 | 
					    { | 
				
			||||||
 | 
					        static $result = null; | 
				
			||||||
 | 
					        return $result ? $result : $result = new self(); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    function get_block_title() | 
				
			||||||
 | 
					    { | 
				
			||||||
 | 
					        return $this->get('block_title'); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    function get_content() | 
				
			||||||
 | 
					    { | 
				
			||||||
 | 
					        return $this->get('content'); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    protected function __construct() | 
				
			||||||
 | 
					    { | 
				
			||||||
 | 
					        parent::__construct('1.1', 'Laurent Opprecht', array('block_title' => 'text', 'content' => 'wysiwyg')); | 
				
			||||||
 | 
					    } | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					} | 
				
			||||||
@ -0,0 +1,12 @@ | 
				
			|||||||
 | 
					<?php | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** | 
				
			||||||
 | 
					 * @copyright (c) 2011 University of Geneva | 
				
			||||||
 | 
					 * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html | 
				
			||||||
 | 
					 * @author Laurent Opprecht | 
				
			||||||
 | 
					 */ | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					require_once api_get_path(LIBRARY_PATH) . '/plugin.class.php'; | 
				
			||||||
 | 
					require_once dirname(__FILE__) . '/lib/static_plugin.class.php'; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$plugin_info = StaticPlugin::create()->get_info(); | 
				
			||||||
@ -0,0 +1,4 @@ | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					.well.sidebar-nav.rss | 
				
			||||||
 | 
					{ | 
				
			||||||
 | 
					} | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue