GNU.php
* LICENSE: The plugin developed for * Hotaru CMS is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * is distributed in the hope that * it will be useful, but WITHOUTANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with Hotaru CMS. If not, see http://www.gnu.org/licenses/.
None.php
Other.php
* LICENSE: Insert your own license here. * *
MIT.php
* Copyright (c) <> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * You can review a copy of the MIT License details at * http://www.opensource.org/licenses/mit-license.php
admin_sidebar_plugin_settings.php



theme_index_top.php
/** * Determine page and get user details */ public function theme_index_top($h) { /** * * e.g. if retrieving option settings and using value * $_settings = $h->getSerializedSettings(); * $h->vars['setting_var_to_use'] = $_settings['setting_var_to_retrieve']; * */ $_proceed = false; $user = $h->cage->get->testUsername('user'); if (!$user) { $user = $h->currentUser->name; } /** * Establish that this function can run if the $pageName matches one for this plugin * switch ($h->pageName) { case '_pagename1': $_proceed = true; $h->pageTitle = $h->lang['_pagename1'] . "[delimiter]" . $user; break; case '_pagename2': $_proceed = true; $h->pageTitle = $h->lang['_pagename2'] . "[delimiter]" . $user; break; case '_pagename3': $_proceed = true; $h->pageTitle = $h->lang['_pagename3'] . "[delimiter]" . $user; } if ($messaging) { /** * Set any deafults that are required before html is shown * } switch ($h->pageName) { case '_pagename1': /** * Insert relevant code here for page display * * break; case '_pagename2': // break; case '_pagename3': // } }


header_include_raw.php
/** * To directly paste html into the header of all pages displayed to the users */ public function header_include_raw($h) { /** * Common Usages * Pass CSS or JS code directs * include_oncc() calls * inlcude CSS, JS reference * * }


theme_index_main.php
/** * Display pages */ public function theme_index_main($h) { /** * Apply any permission checks if required * e.g. Disallow anyone except the current logged in user to see their own data * * if (isset($h->vars['user']->id) && ($h->currentUser->id != $h->vars['user']->id)) { return false; } */ switch ($h->pageName) { case 'pagename1': $h->displayTemplate('_pagename1'); return true; break; case 'pagename2': $h->displayTemplate('_pagename1'); return true; break; case 'pagename3': $h->displayTemplate('_pagename1'); return true; break; } }


install_plugin.php
/** * Add settings fields to the db. */ public function install_plugin($h) { // Default settings $_settings = $h->getSerializedSettings(); $settings = array( '_setting1' => 'checked', '_setting2' => 0 ); foreach ($settings as $setting => $value) { if (!isset($_settings[$setting])) { $_settings[$setting] = $value; } } $h->updateSetting('_settings', serialize($_settings)); }


table_main.php
// Create a new empty table called "" $exists = $h->db->table_exists(''); if (!$exists) { //echo "table doesn't exist. Stopping before creation."; exit; $sql = "CREATE TABLE `" . DB_PREFIX . "` ( `_id` int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, `_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `_name` varchar(255) NOT NULL DEFAULT '', `_content` text NULL, `_user_id` tinyint(1) NOT NULL DEFAULT '1', `_updateby` int(20) NOT NULL DEFAULT 0 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='';"; $h->db->query($sql); }
table_meta.php
// Create a meta table for "" $exists = $h->db->table_exists('_meta'); if (!$exists) { //echo "table doesn't exist. Stopping before creation."; exit; $sql = "CREATE TABLE `" . DB_PREFIX . "_meta` ( `meta_id` int(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, `meta_archived` enum('Y','N') NOT NULL DEFAULT 'N', `meta_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `meta_id` int(20) NOT NULL DEFAULT 0, `meta_key` varchar(255) NULL, `meta_value` text NULL, `meta_updateby` int(20) NOT NULL DEFAULT 0, INDEX (`meta_id`) ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT=' Meta';"; $h->db->query($sql); }
breadcrumbs.php
/** * Breadcrumbs for pages */ public function breadcrumbs($h) { $user = $h->cage->get->testUsername('user'); if (!$user) { $user = $h->currentUser->name; } switch ($h->pageName) { case '_pagename1': return "<a href='" . $h->url(array('user'=>$user)) . "'>" . $user . "</a> » " . $h->lang['_pagename1']; break; case '_pagename2': return "<a href='" . $h->url(array('user'=>$user)) . "'>" . $user . "</a> » " . $h->lang['_pagename1']; break; case '_pagename3': return "<a href='" . $h->url(array('user'=>$user)) . "'>" . $user . "</a> » " . $h->lang['_pagename1']; break; } }
create_db_table.php
/** Creata a new Database Table for plugin * */ public function create_db_table($h) {