예제 #1
0
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Post::add_new_type('revision');
 }
 /**
  * When Plugin is activated insert default options
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         Options::set('syntax__default_lang', 'php');
         Options::set('syntax__line_numbers', '');
     }
 }
예제 #3
0
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('calendar__week_start', 0);
 }
예제 #4
0
 /**
  * Add the subpage vocabulary
  *
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         $params = array('name' => self::$vocabulary, 'description' => 'A vocabulary for describing hierarchical relationships between pages', 'features' => array('hierarchical'));
         $subpages = new Vocabulary($params);
         $subpages->insert();
     }
 }
예제 #5
0
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('woopra__tag_registered', false);
     Options::set('woopra__display_avatar', 'no');
 }
 public function action_plugin_deactivation($file = '')
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         $class_name = strtolower(get_class($this));
         // dump our cached list
         Cache::expire($class_name . ':list');
     }
 }
 /**
  * Remove notify_all options on deactivation
  */
 public function action_plugin_deactivation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         Options::delete('notify_all__notify_posts');
         Options::delete('notify_all__notify_comments');
         Options::delete('notify_all__user_can_override');
     }
 }
 /**
  * action_plugin_deactivation
  * Unregisters the core modules.
  * @param string $file plugin file
  */
 public function action_plugin_deactivation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         foreach ($this->reports as $rpt => $data) {
             Modules::remove_by_name($data['module']);
         }
     }
 }
예제 #9
0
 /**
  * action_plugin_deactivation
  * Unregisters the core modules.
  * @param string $file plugin file
  */
 function action_plugin_deactivation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         Modules::remove_by_name('Latest Entries');
         Modules::remove_by_name('Latest Comments');
         Modules::remove_by_name('Latest Log Activity');
     }
 }
예제 #10
0
	/**
	 * Returns a unique id for this pluggable
	 * @return string A plugin id
	 */
	final public function plugin_id()
	{
		static $id;
		if ( !isset( $id ) ) {
			$id = Plugins::id_from_file( str_replace( '\\', '/', $this->get_file() ) );
		}
		return $id;
	}
예제 #11
0
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         if (Options::get('dateyurl__format') == null) {
             Options::set('dateyurl__format', 'date');
         }
     }
 }
예제 #12
0
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('socialink__link_pos', 'top');
     Options::set('socialink__services', serialize(array('digg', 'delicious', 'technorati', 'google', 'yahoo', 'furl', 'reddit', 'magnolia')));
 }
 /**
  * Sets default to always show themeswitcher in footer if not using $theme->swithcer();
  **/
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         if (Options::get('themeswitcher__show') == null) {
             Options::set('themeswitcher__show', 1);
         }
     }
 }
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('photozousilo__username', '');
     Options::set('photozousilo__password', '');
 }
 public function action_plugin_deactivation($file = '')
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         CronTab::delete_cronjob('optimize database tables initial');
         CronTab::delete_cronjob('optimize database tables');
         Options::delete('database_optimizer__frequency');
     }
 }
예제 #16
0
 /**
  * On activation, check and set default options
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         foreach (self::default_options() as $name => $value) {
             Options::set('jambo__' . $name, $value);
         }
     }
 }
예제 #17
0
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('fireeagle__refresh_interval', 3600);
     Modules::add(_t('Fire Eagle', 'fireeagle'));
 }
 /**
  * action_plugin_activation
  * Registers the core modules with the Modules class. 
  * @param string $file plugin file
  */
 function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         Modules::add('My Tickets');
         if (Options::get('tracdashmodule__trac_query') == null) {
             Options::set('tracdashmodule__trac_query', 'enter query');
         }
     }
 }
예제 #19
0
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('dnsbl__ipbl', "dnsbl.spam-champuru.livedoor.com");
     // URL blacklist not implemented, perhaps for the future?
     // Options::set('dnsbl__urlbl', "bsb.spamlookup.net");
 }
예제 #20
0
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('dropiosilo__api_key', '');
     Options::set('dropiosilo__drop_name', '');
     Options::set('dropiosilo__password', '');
 }
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('twitter_avatar__cache_expire', 24);
     Options::set('twitter_avatar__default_icon', '');
     Options::set('twitter_avatar__fallback_gravatar', true);
 }
예제 #22
0
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('amazon__country', 'com');
     Options::set('amazon__associate_tag', '');
     Options::set('amazon__template', 'reviewsummary');
 }
예제 #23
0
 /**
  * Handler FormUI success action and do the replacement
  **/
 public function filter_do_replace($show_form, $form)
 {
     if (DB::query('UPDATE {posts} SET content = REPLACE(content, ? , ?)', array($form->search->value, $form->replace->value))) {
         Session::notice(sprintf(_t('Successfully replaced \'%s\' with \'%s\' in all posts'), $form->search->value, $form->replace->value));
         Utils::redirect(URL::get('admin', array('page' => 'plugins', 'configure' => Plugins::id_from_file(__FILE__), 'configaction' => _t('Replace'))), false);
     } else {
         Session::error(_t('There was an error with replacement.'));
     }
     return false;
 }
예제 #24
0
 /**
  * Add the shelf vocabulary and create the admin token
  *
  **/
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         $params = array('name' => self::$vocabulary, 'description' => 'A vocabulary for describing Shelves', 'features' => array('hierarchical'));
         Vocabulary::create($params);
         // create default access token
         ACL::create_token('manage_shelves', _t('Manage ') . Options::get('shelves__plural', _t('shelves', 'shelves')), 'Administration', false);
         $group = UserGroup::get_by_name('admin');
         $group->grant('manage_shelves');
     }
 }
예제 #25
0
 function action_plugin_deactivation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         // remove the module from the dash if it is active
         Modules::remove_by_name('Incoming Links');
         // Remove the periodical execution event
         CronTab::delete_cronjob('incoming_links');
         // Clear the cached links
         Cache::expire('incoming_links');
     }
 }
 /**
  * Sets the new 'hide_replies' option to '0' to mimic current, non-reply-hiding
  * functionality.
  **/
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         if (Options::get('related_posts__count') == null) {
             Options::set('related_posts__count', 5);
         }
         if (Options::get('related_posts__header') == null) {
             Options::set('related_posts__header', '<h2>Related Posts</h2>');
         }
     }
 }
 /**
  * Set default text & link behavior
  **/
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         if (Options::get('diggbarblocker__message') == null) {
             Options::set('diggbarblocker__message', _t('This site does not support use of the DiggBar.'));
         }
         if (Options::get('diggbarblocker__add_link') == null) {
             Options::set('diggbarblocker__addlink', 1);
         }
     }
 }
예제 #28
0
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('googlemaps__api_key', '');
     Options::set('googlemaps__map_width', 500);
     Options::set('googlemaps__map_height', 300);
     Options::set('googlemaps__streetview_width', 500);
     Options::set('googlemaps__streetview_height', 200);
 }
 /**
  * action: plugin_activation
  *
  * @access public
  * @param string $file
  * @return void
  */
 public function action_plugin_activation($file)
 {
     if (Plugins::id_from_file($file) != Plugins::id_from_file(__FILE__)) {
         return;
     }
     Options::set('twiple_tweetback__auto_insert', 1);
     Options::set('twiple_tweetback__default_style', 1);
     Options::set('twiple_tweetback__limit', 30);
     Options::set('twiple_tweetback__load_message', '');
     Options::set('twiple_tweetback__notweets_message', '');
 }
예제 #30
0
 /**
  * Set default values for unset option
  *
  * @param unknown_type $file
  */
 public function action_plugin_activation($file)
 {
     $default_options = array('title' => 'Recent Comments', 'format' => '[[user]] on [[post]]', 'dateformat' => 'Mj n:ia', 'count' => '5');
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         foreach ($default_options as $name => $value) {
             $current_value = Options::get('recentcomments__' . $name);
             if (!isset($current_value)) {
                 Options::set('recentcomments__' . $name, $value);
             }
         }
     }
 }