public function testCanAppendHtmlToAdminUsersAddForm()
 {
     add_plugin_hook('users_form', array($this, 'appendExtraFormInput'));
     $this->dispatch('/users/add');
     $this->assertNotRedirect();
     $this->assertQueryContentContains("label", "TEST HOOK CONTENT");
 }
Example #2
0
 public function testHookStorageViaAddPluginHookFunction()
 {
     $this->broker->register();
     $this->broker->setCurrentPluginDirName('fake-plugin-name');
     add_plugin_hook('initialize', 'fake_plugin_initialize');
     // Using the registry should not interfere with the other unit tests.
     Zend_Registry::_unsetInstance();
     $callback = $this->broker->getHook('fake-plugin-name', 'initialize');
     $this->assertEquals('fake_plugin_initialize', $callback[0]);
 }
 /**
  * Iterate over hooks and filters, define callbacks.
  *
  * @return void
  */
 public function addHooksAndFilters()
 {
     foreach (self::$_hooks as $hookName) {
         $functionName = Inflector::variablize($hookName);
         add_plugin_hook($hookName, array($this, $functionName));
     }
     foreach (self::$_filters as $filterName) {
         $functionName = Inflector::variablize($filterName);
         add_filter($filterName, array($this, $functionName));
     }
 }
 public function _addPluginHooksAndFilters($pluginBroker, $pluginName)
 {
     // Set the current plugin so the add_plugin_hook function works
     $pluginBroker->setCurrentPluginDirName($pluginName);
     // Add plugin hooks.
     add_plugin_hook('install', 'simple_contact_form_install');
     add_plugin_hook('uninstall', 'simple_contact_form_uninstall');
     add_plugin_hook('define_routes', 'simple_contact_form_define_routes');
     add_plugin_hook('config_form', 'simple_contact_form_config_form');
     add_plugin_hook('config', 'simple_contact_form_config');
     // Add filters.
     add_filter('public_navigation_main', 'simple_contact_form_public_navigation_main');
 }
 public function _addPluginHooksAndFilters($pluginBroker, $pluginName)
 {
     // Set the current plugin so the add_plugin_hook function works
     $pluginBroker->setCurrentPluginDirName($pluginName);
     // Add plugin hooks
     add_plugin_hook('install', 'geolocation_install');
     add_plugin_hook('uninstall', 'geolocation_uninstall');
     add_plugin_hook('config_form', 'geolocation_config_form');
     add_plugin_hook('config', 'geolocation_config');
     add_plugin_hook('define_acl', 'geolocation_define_acl');
     add_plugin_hook('define_routes', 'geolocation_add_routes');
     add_plugin_hook('after_save_form_item', 'geolocation_save_location');
     add_plugin_hook('admin_append_to_items_show_secondary', 'geolocation_admin_show_item_map');
     add_plugin_hook('admin_append_to_advanced_search', 'geolocation_admin_append_to_advanced_search');
     add_plugin_hook('public_append_to_advanced_search', 'geolocation_public_append_to_advanced_search');
     add_plugin_hook('item_browse_sql', 'geolocation_item_browse_sql');
     add_plugin_hook('contribution_append_to_type_form', 'geolocation_append_contribution_form');
     add_plugin_hook('contribution_save_form', 'geolocation_save_contribution_form');
     // Add plugin filters
     add_filter('admin_navigation_main', 'geolocation_admin_nav');
     add_filter('define_response_contexts', 'geolocation_kml_response_context');
     add_filter('define_action_contexts', 'geolocation_kml_action_context');
     add_filter('admin_items_form_tabs', 'geolocation_item_form_tabs');
 }
Example #6
0
 * @copyright  Center for History and New Media, 2011
 * @license    http://www.gnu.org/licenses/gpl-3.0.txt
 * @version    $Id:$
 * @package Nested
 * @author CHNM
 **/
/**
 * Hooks necesary to accomplish this task.
 */
add_plugin_hook('install', 'nested_install');
add_plugin_hook('uninstall', 'nested_uninstall');
add_plugin_hook('admin_append_to_collections_form', 'nest_form');
add_plugin_hook('after_save_form_record', 'nest_save');
add_plugin_hook('admin_append_to_collections_show_primary', 'nested_show');
add_plugin_hook('collection_browse_sql', 'nested_collection_browse_sql');
add_plugin_hook('public_append_to_collections_show', 'nested_collections_show');
/**
 * nested_install() creates the table neede to
 *                 associate the parent with the child.
 */
function nested_install()
{
    $db = get_db();
    $sql = "CREATE TABLE IF NOT EXISTS `{$db->Nest}`( " . "`id` int(10) unsigned NOT NULL auto_increment," . "`child` INT NOT NULL, " . "`parent` INT NOT NULL," . " PRIMARY KEY (`id`)," . " UNIQUE KEY `child` (`child`))" . "ENGINE = MyISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;";
    $db->exec($sql);
}
/**
 * nested_uninstall() Deletes the table from the database.
 */
function nested_uninstall()
{
 * CategoryBrowse.php
 * 
 * Test Class to Slugify Omeka Element Values
 * Kevin Reiss
 * 
 * As suggested by Patrick Murray-John on Omeka-dev
 * see http://groups.google.com/group/omeka-dev/browse_thread/thread/80149f3e98c61861
 * To Do:
 * 
 * 1. Incorporate Selected Browsing Element in "Browse" Results display contextual
 * 2. Add pagination to results
 * 3. Add order by alpah to results
 * 4. Improve slug creation routine to handle library punctuation
 * 5. Think about how to automatically build this into the theme using plugin hook
 * 6. Where does the user selection option need to live?
 * 
 */
add_plugin_hook('install', 'category_browse_install');
add_plugin_hook('uninstall', 'category_browse_uninstall');
add_plugin_hook('define_routes', 'category_browse_define_routes');
function category_browse_install()
{
}
function category_browse_uninstall()
{
}
function category_browse_define_routes($router)
{
    $router->addRoute('category_browse_elbrowse_browse', new Zend_Controller_Router_Route('categories/browse/:elset/:elname/:eltext', array('module' => 'category-browse', 'controller' => 'browse', 'action' => 'browse')));
    $router->addRoute('category_browse_elbrowse_list', new Zend_Controller_Router_Route('categories/list/:elset/:elname/:page', array('module' => 'category-browse', 'controller' => 'browse', 'action' => 'list', 'page' => 1), array('page' => '\\d+')));
}
Example #8
0
<?php

require_once dirname(__FILE__) . '/functions.php';
add_plugin_hook('public_head', 'queue_theme_assets');
add_filter('exhibit_builder_display_random_featured_exhibit', 'hijack_exhibit_builder_random_featured_exhibit');
Example #9
0
 * @copyright City Lore, 2009
 * TODO: check licensing options!
 */
define('SPREADSHEET_VERSION', '1.0');
define('SPREADSHEET_STATUS_INIT', 1);
define('SPREADSHEET_STATUS_COMPLETE', 2);
define('SPREADSHEET_STATUS_PURGED', 3);
define('SPREADSHEET_STATUS_ERROR', 4);
define('SPREADSHEET_FILES_DIR', PLUGIN_DIR . '/Spreadsheet/files');
add_plugin_hook('install', 'spreadsheet_install');
add_plugin_hook('config', 'spreadsheet_config');
add_plugin_hook('config_form', 'spreadsheet_config_form');
add_plugin_hook('uninstall', 'spreadsheet_uninstall');
add_plugin_hook('admin_append_to_dashboard_primary', 'spreadsheet_dashboard');
add_plugin_hook('admin_append_to_items_browse_primary', 'spreadsheet_export_link');
add_plugin_hook('define_routes', 'spreadsheet_routes');
function spreadsheet_install()
{
    set_option('spreadsheet_version', SPREADSHEET_VERSION);
    //number of days to keep export files before purging
    set_option('spreadsheet_expiry', '90');
    $db = get_db();
    $db->exec("CREATE TABLE IF NOT EXISTS `{$db->prefix}spreadsheets` (\n\t\t\t`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t`status` INT,\n\t\t\t`user_id` INT,\n\t\t\t`file_name` VARCHAR(255),\n\t\t\t`terms` TEXT,\n\t\t\t`added` DATETIME,\n\t\t\tPRIMARY KEY  (`id`)\n       ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
}
function spreadsheet_config()
{
    set_option('spreadsheet_php_path', $_POST['spreadsheet_php_path']);
}
function spreadsheet_config_form()
{
    if (!($path = get_option('spreadsheet_php_path'))) {
<?php

define('CONTROLLED_VOCAB_PLUGIN_DIR', dirname(__FILE__));
add_plugin_hook('install', 'ControlledVocabPlugin::install');
add_plugin_hook('uninstall', 'ControlledVocabPlugin::uninstall');
add_plugin_hook('admin_theme_header', 'ControlledVocabPlugin::admin_theme_header');
add_plugin_hook('define_routes', 'ControlledVocabPlugin::define_routes');
add_plugin_hook('config', 'ControlledVocabPlugin::config');
add_plugin_hook('config_form', 'ControlledVocabPlugin::config_form');
add_filter('admin_navigation_main', 'ControlledVocabPlugin::admin_navigation_main');
try {
    ControlledVocabPlugin::addFilters();
} catch (Exception $e) {
}
class ControlledVocabPlugin
{
    public static function admin_navigation_main($tabs)
    {
        $tabs['Controlled Vocabs'] = uri('controlled-vocab');
        return $tabs;
    }
    public static function addFilters()
    {
        //TODO:: how do I check if tables have been set up?
        if (class_exists("ControlledVocab_Term")) {
            $termTable = get_db()->getTable('ControlledVocab_Term');
            $filterElements = $termTable->getElementSetsAndElements();
            foreach ($filterElements as $elSet => $elNames) {
                foreach ($elNames as $elName) {
                    add_filter(array('Form', 'Item', $elSet, $elName), 'ControlledVocabPlugin::filterItemForm');
                }
Example #11
0
<?php

require_once dirname(__FILE__) . '/functions.php';
// When displaying item metadata (or anything else that makes use of the
// 'html_escape' filter), make sure we escape entities correctly with UTF-8.
add_filter('html_escape', 'utf8_htmlspecialchars', 1);
// The second thing that needs to happen for all metadata that needs to be escaped
// to HTML is that new lines need to be represented as <br /> tags.
add_filter('html_escape', 'nl2br', 2);
/**
 * If an item has a blank Dublin Core Title, use the string '[Untitled]' instead.
 */
add_filter(array('Display', 'Item', 'Dublin Core', 'Title'), 'show_untitled_items');
add_filter(array('Display', 'Collection', 'Dublin Core', 'Title'), 'show_untitled_items');
add_plugin_hook('public_head', 'theme_header_background');
// If there is a current user, add admin_bar.
if (!is_admin_theme() && apply_filters('public_show_admin_bar', (bool) current_user())) {
    add_plugin_hook('public_head', 'admin_bar_css');
    add_plugin_hook('public_body', 'admin_bar');
    add_filter('body_tag_attributes', 'admin_bar_class');
}
 */
if (!defined('EXHIBIT_PLUGIN_DIR')) {
    define('EXHIBIT_PLUGIN_DIR', dirname(__FILE__));
}
add_plugin_hook('install', 'exhibit_builder_install');
add_plugin_hook('uninstall', 'exhibit_builder_uninstall');
add_plugin_hook('upgrade', 'exhibit_builder_upgrade');
add_plugin_hook('config_form', 'exhibit_builder_config_form');
add_plugin_hook('config', 'exhibit_builder_config');
add_plugin_hook('initialize', 'exhibit_builder_initialize');
add_plugin_hook('define_acl', 'exhibit_builder_define_acl');
add_plugin_hook('define_routes', 'exhibit_builder_define_routes');
add_plugin_hook('public_head', 'exhibit_builder_public_head');
add_plugin_hook('admin_head', 'exhibit_builder_admin_head');
add_plugin_hook('items_browse_sql', 'exhibit_builder_items_browse_sql');
add_plugin_hook('admin_items_search', 'exhibit_builder_items_search');
add_plugin_hook('public_items_search', 'exhibit_builder_items_search');
add_plugin_hook('html_purifier_form_submission', 'exhibit_builder_purify_html');
add_filter('public_navigation_main', 'exhibit_builder_public_main_nav');
add_filter('admin_navigation_main', 'exhibit_builder_admin_nav');
add_filter('public_theme_name', 'exhibit_builder_public_theme_name');
add_filter('admin_dashboard_stats', 'exhibit_builder_dashboard_stats');
add_filter('search_record_types', 'exhibit_builder_search_record_types');
add_filter('api_resources', 'exhibit_builder_api_resources');
add_filter('api_extend_items', 'exhibit_builder_api_extend_items');
add_filter('item_search_filters', 'exhibit_builder_item_search_filters');
add_filter('api_import_omeka_adapters', 'exhibit_builder_api_import_omeka_adapters');
// Helper functions for exhibits and exhibit pages
require_once EXHIBIT_PLUGIN_DIR . '/helpers/ExhibitFunctions.php';
require_once EXHIBIT_PLUGIN_DIR . '/helpers/ExhibitPageFunctions.php';
require_once EXHIBIT_PLUGIN_DIR . '/functions.php';
 *     Advanced search and database query for string production different values.
 *  4. Automatic way to activate browsing by value for active categories in "show" and 
 *     "browse" pages. This now needs to be done manually. See "howtolink.txt" for
 *     more information on how to currently do this.
 */
// Require the record model for the metadata_browser_category table.
require_once 'MetadataBrowserCategory.php';
// add plugin hooks
add_plugin_hook('install', 'metadata_browser_install');
add_plugin_hook('uninstall', 'metadata_browser_uninstall');
/*
add_plugin_hook('config_form', 'metadata_browser_config_form');
add_plugin_hook('config', 'metadata_browser_config');
*/
// add route hook
add_plugin_hook('define_routes', 'metadata_browser_define_routes');
// add filter for admin menu
add_filter('admin_navigation_main', 'metadata_browser_admin_nav');
function metadata_browser_install()
{
    /* Create a Table to hold category information */
    $db = get_db();
    $db->exec("CREATE TABLE IF NOT EXISTS `{$db->MetadataBrowserCategory}` (\n\t \t\t\t`id` int(10) unsigned NOT NULL auto_increment,\n\t \t\t\t`element_id` int(10) unsigned NOT NULL,\n\t \t\t\t`display_name` tinytext collate utf8_unicode_ci NOT NULL,\n\t \t\t\t`slug` tinytext collate utf8_unicode_ci NOT NULL,\n\t \t\t\t`active` tinyint(1) NOT NULL,\n\t \t\t\tPRIMARY KEY  (`id`)\n      \t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;");
    /* Populate table with all existing Elements as possible category choices */
    $setelements = $db->getTable('Element')->findall();
    $num = 1;
    // for ID value
    foreach ($setelements as $element) {
        $element_id = $element->id;
        $display_name = $element->name;
        $slug = metadata_browser_generate_slug($element->name);
Example #14
0
add_plugin_hook('install', 'geolocation_install');
add_plugin_hook('uninstall', 'geolocation_uninstall');
add_plugin_hook('config_form', 'geolocation_config_form');
add_plugin_hook('config', 'geolocation_config');
add_plugin_hook('define_acl', 'geolocation_define_acl');
add_plugin_hook('define_routes', 'geolocation_add_routes');
add_plugin_hook('after_save_form_item', 'geolocation_save_location');
add_plugin_hook('admin_append_to_items_show_secondary', 'geolocation_admin_show_item_map');
add_plugin_hook('public_append_to_items_show', 'geolocation_public_show_item_map');
add_plugin_hook('admin_append_to_advanced_search', 'geolocation_admin_append_to_advanced_search');
add_plugin_hook('public_append_to_advanced_search', 'geolocation_public_append_to_advanced_search');
add_plugin_hook('item_browse_sql', 'geolocation_item_browse_sql');
add_plugin_hook('contribution_append_to_type_form', 'geolocation_append_contribution_form');
add_plugin_hook('contribution_save_form', 'geolocation_save_contribution_form');
add_plugin_hook('public_theme_header', 'geolocation_header');
add_plugin_hook('after_save_item', 'geolocation_get_default_location');
// Plugin Filters
add_filter('admin_navigation_main', 'geolocation_admin_nav');
add_filter('define_response_contexts', 'geolocation_kml_response_context');
add_filter('define_action_contexts', 'geolocation_kml_action_context');
add_filter('admin_items_form_tabs', 'geolocation_item_form_tabs');
add_filter('public_navigation_items', 'geolocation_public_nav');
// Hook Functions
function geolocation_install()
{
    $db = get_db();
    $sql = "\n    CREATE TABLE IF NOT EXISTS {$db->Location} (\n    `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,\n    `item_id` BIGINT UNSIGNED NOT NULL ,\n    `latitude` DOUBLE NOT NULL ,\n    `longitude` DOUBLE NOT NULL ,\n    `zoom_level` INT NOT NULL ,\n    `map_type` VARCHAR( 255 ) NOT NULL ,\n    `address` TEXT NOT NULL ,\n    INDEX (`item_id`)) ENGINE = MYISAM";
    $db->query($sql);
    // If necessary, upgrade the plugin options
    geolocation_upgrade_options();
    set_option('geolocation_default_latitude', '38');
Example #15
0
<?php

add_plugin_hook('install', 'item_show_log_install');
add_plugin_hook('uninstall', 'item_show_log_uninstall');
add_plugin_hook('admin_theme_header', 'item_show_log_admin_theme_header');
add_plugin_hook('admin_append_to_items_show_secondary', 'item_show_log_admin_append_to_items_show_secondary');
add_plugin_hook('public_append_to_items_show', 'item_show_log_public_append_to_items_show');
add_filter('admin_navigation_main', 'adminNavigationMain');
function item_show_log_install()
{
    $db = get_db();
    $sql = "\nCREATE TABLE `{$db->prefix}item_show_log_logs` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `item_id` int(10) unsigned NOT NULL,\n  `ip_address` tinytext COLLATE utf8_unicode_ci NOT NULL,\n  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n  PRIMARY KEY (`id`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;";
    $db->exec($sql);
}
function item_show_log_uninstall()
{
    $db = get_db();
    $sql = "DROP TABLE IF EXISTS `{$db->prefix}item_show_log_logs` ; ";
    $db->exec($sql);
}
function item_show_log_public_append_to_items_show()
{
    $item = get_current_item();
    $newLogRecord = new ItemShowLogLog();
    $newLogRecord->item_id = $item->id;
    $newLogRecord->timestamp = date('Y-m-d H:i:s');
    $newLogRecord->ip_address = $_SERVER['REMOTE_ADDR'];
    $newLogRecord->save();
    #	print_r($newLogRecord);
}
function item_show_log_admin_theme_header()
Example #16
0
<?php

define('JQUERY_VERSION', '1.4.2');
define('JQUERY_PLUGIN_DIR', dirname(__FILE__));
add_plugin_hook('public_theme_header', 'jquery_public_theme_header');
add_plugin_hook('admin_theme_header', 'jquery_admin_theme_header');
require_once JQUERY_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'JqueryFunctions.php';
function jquery_admin_theme_header()
{
    echo '<link rel="stylesheet" type="text/css" href="' . WEB_PLUGIN . '/Jquery/views/admin/css/jquery.css"  ></link>';
}
function jquery_public_theme_header()
{
    echo jquery_add();
}
Example #17
0
 /**
  * Validate and add hooks.
  */
 private function _addHooks()
 {
     if (!is_array($this->_hooks)) {
         return;
     }
     foreach ($this->_hooks as $callback => $hook) {
         if (!is_string($callback)) {
             $callback = 'hook' . Inflector::camelize($hook);
         }
         if (!is_callable(array($this, $callback))) {
             throw new Omeka_Plugin_Exception('Hook callback "' . $callback . '" does not exist.');
         }
         add_plugin_hook($hook, array($this, $callback));
     }
 }
Example #18
0
 * 	  more accurate
 * 2. Identify a way to efficiently update sitemap upon addition of new content
 *    building entire sitemap using the varies "after" hooks that are currently
 *    commented out.
 * 3. Idenitfy a way to schedule sitemap build via daily/weekly chron.
 * 4. Identify a way to automatically register sitemap with various 
 *    search engines after the first time it is built.
 * 5. Think about who should have permission to see the admin options 
 * 6. Proper routine to check and see if MetadataBrowser plugin is installed so 
 *    addition of MetadataBrowingCategory categories only happens when the plugin
 *    confirms it is installed.
 */
add_plugin_hook('config_form', 'xml_sitemap_config_form');
add_plugin_hook('config', 'xml_sitemap_config');
add_plugin_hook('install', 'xml_sitemap_install');
add_plugin_hook('uninstall', 'xml_sitemap_uninstall');
/* add a hook to allow the sitemap to be rebuilt everytime these objects change
 * There should be a more efficient way to handle this.
 * Investigate seeing a chron job can build this on a daily basis.
 * 
 */
/*
add_plugin_hook('after_save_item', 'xml_sitemap_after_save_item');
add_plugin_hook('after_update_item', 'xml_sitemap_after_update_item');
add_plugin_hook('after_delete_item', 'xml_sitemap_after_delete_item');
add_plugin_hook('after_save_collection', 'xml_sitemap_after_save_collection');
add_plugin_hook('after_update_collection', 'xml_sitemap_after_update_collection');
add_plugin_hook('after_delete_collection', 'xml_sitemap_after_delete_collection');
add_plugin_hook('after_save_exhibit', 'xml_sitemap_after_save_exhibit');
add_plugin_hook('after_update_exhibit', 'xml_sitemap_after_update_exhibit');
add_plugin_hook('after_delete_exhibit', 'xml_sitemap_after_delete_exhibit');
Example #19
0
<?php

define('FEED_IMPORTER_PLUGIN_DIR', dirname(__FILE__));
add_plugin_hook('install', 'feed_importer_install');
add_plugin_hook('uninstall', 'feed_importer_uninstall');
add_plugin_hook('define_routes', 'feed_importer_define_routes');
add_plugin_hook('admin_theme_header', 'feed_importer_admin_theme_header');
/*

add_plugin_hook('config', 'feed_importer_config');
add_plugin_hook('config_form', 'feed_importer_config_form');

add_plugin_hook('public_theme_header', 'feed_importer_public_theme_header');
add_plugin_hook('define_acl', 'feed_importer_define_acl');
add_plugin_hook('public_append_to_items_show', 'feed_importer_append_to_items_show');
*/
add_filter('admin_navigation_main', 'feed_importer_admin_navigation_main');
function feed_importer_install()
{
    $db = get_db();
    //Add Feeds table
    $sql = "CREATE TABLE IF NOT EXISTS `{$db->prefix}feed_importer_feeds` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `collection_id` int(10) unsigned NULL,\n  `task_id` int(10) unsigned NULL,\t\t\n  `feed_url` text COLLATE utf8_unicode_ci,\n  `feed_title` text COLLATE utf8_unicode_ci,\n  `feed_description` text COLLATE utf8_unicode_ci,  \t\t\n  `import_start_time` datetime DEFAULT NULL,\n  `import_end_time` datetime DEFAULT NULL,\n  `feed_display_name` text COLLATE utf8_unicode_ci,\n  `feed_display_description` text COLLATE utf8_unicode_ci,\n  `item_type_id` int(10) unsigned DEFAULT NULL,\n  `import_media` tinyint(1) DEFAULT '0',\n  `trim_length` int(10) unsigned DEFAULT '300',\n  `update_frequency` text COLLATE utf8_unicode_ci,\n  `import_content` tinyint(1) DEFAULT NULL,\n  `content_as_description` tinyint(1) DEFAULT NULL,\n  `tags_as_subjects` tinyint(1) DEFAULT NULL,\n  `tags_as_tags` tinyint(1) DEFAULT NULL,\n  `tags_linkback` tinyint(1) DEFAULT NULL,\n  `author_as_creator` tinyint(1) DEFAULT NULL,\n  `map_authors` tinyint(1) DEFAULT NULL,\n  `authors_to_users_map` text COLLATE utf8_unicode_ci,\n  `map_tags` tinyint(1) DEFAULT NULL,\n  `tags_map` text COLLATE utf8_unicode_ci,\n  `items_linkback` tinyint(1) DEFAULT NULL,\n  PRIMARY KEY (`id`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;";
    $db->exec($sql);
    $sql = "CREATE TABLE IF NOT EXISTS `{$db->prefix}feed_importer_imports` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `created`  datetime DEFAULT NULL,\t\t\n  `feed_id` int(10) unsigned NOT NULL,\n  `status` text COLLATE utf8_unicode_ci,\n  `sp_error` text COLLATE utf8_unicode_ci,\n  `collection_id` int(10) unsigned ,\n  PRIMARY KEY (`id`)  \n) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;";
    $db->exec($sql);
    $sql = "CREATE TABLE IF NOT EXISTS `{$db->prefix}feed_importer_imported_items` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `feed_id` int(10) unsigned NOT NULL, \t\t\n  `import_id` int(10) unsigned NOT NULL,\n  `permalink` text COLLATE utf8_unicode_ci ,\n  `sp_id` text COLLATE utf8_unicode_ci,\n  `item_id` int(10) unsigned NOT NULL,\n  PRIMARY KEY (`id`)  \n) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;";
    $db->exec($sql);
    $sql = "CREATE TABLE IF NOT EXISTS `{$db->prefix}feed_importer_tag_configs` (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `original_name` tinytext COLLATE utf8_unicode_ci NOT NULL,\n  `pref_name` tinytext COLLATE utf8_unicode_ci NULL,\n  `scheme` tinytext COLLATE utf8_unicode_ci NULL,\n  `collection_id` int(10) unsigned NULL,\n  `collection_id_priority` int(10) unsigned NULL,\t\t  \t\t\n  `item_type_id` int(10) unsigned NULL,\n  `item_type_id_priority` int(10) unsigned NULL,  \n  `feed_id` int(10) unsigned NULL,\n  `created` date NOT NULL,\n   `skip` int(1) unsigned NULL,\n  `count` int(10) unsigned NULL,\n  `elements_map` mediumtext COLLATE utf8_unicode_ci NULL,\n  `tags_map` mediumtext COLLATE utf8_unicode_ci NULL,\n  PRIMARY KEY (`id`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;";
    $db->exec($sql);
}
function feed_importer_uninstall()
Example #20
0
<?php

add_plugin_hook('admin_footer', 'st_footer');
add_plugin_hook('admin_head', 'st_head');
require_once dirname(__FILE__) . '/functions.php';
Example #21
0
<?php

define('FAKE_CRON_PLUGIN_DIR', dirname(__FILE__));
//require_once(PLUGIN_DIR . DIRECTORY_SEPARATOR . 'Jquery' . DIRECTORY_SEPARATOR . 'plugin.php');
require_once FAKE_CRON_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'FakeCronFunctions.php';
add_plugin_hook('install', 'fake_cron_install');
add_plugin_hook('uninstall', 'fake_cron_uninstall');
add_plugin_hook('public_theme_header', 'fake_cron_public_theme_header');
add_plugin_hook('define_routes', 'fake_cron_define_routes');
add_filter('admin_navigation_main', 'fake_cron_admin_navigation_main');
function fake_cron_install()
{
    $db = get_db();
    $sql = "CREATE TABLE IF NOT EXISTS `{$db->prefix}fake_cron_tasks` (\n\t  `id` int(11) NOT NULL auto_increment,\n\t  `name` text COLLATE utf8_unicode_ci NOT NULL,\n\t  `description` text COLLATE utf8_unicode_ci NULL,\n\t  `interval`  int(11) NOT NULL,\t  \t\t\n\t  `last_run` datetime DEFAULT NULL,\n    `plugin_name` text COLLATE utf8_unicode_ci NOT NULL,\n\t  `plugin_class` text COLLATE utf8_unicode_ci NOT NULL,\n\t  PRIMARY KEY (`id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
    $db->exec($sql);
}
function fake_cron_uninstall()
{
    $db = get_db();
    $sql = "DROP TABLE IF EXISTS `{$db->prefix}fake_cron_tasks`";
    $db->exec($sql);
}
function fake_cron_define_routes($router)
{
    $router->addRoute('fake_cron_fakecron', new Zend_Controller_Router_Route('fake-cron/tasks/fakecron/:taskId', array('module' => 'fake-cron', 'controller' => 'tasks', 'action' => 'fakecron', 'taskId' => '/d+')));
}
function fake_cron_admin_navigation_main($tabs)
{
    $tabs['Fake Cron'] = uri('fake-cron/tasks');
    return $tabs;
}