/**
  * Respond to post requests on the admin_cctypes template
  *
  * @param AdminHandler $handler The admin handler object
  * @param Theme $theme The admin theme object
  */
 function action_admin_theme_post_admin_cctypes($handler, $theme)
 {
     $action = Controller::get_var('cct_action');
     switch ($action) {
         case 'addtype':
             Post::add_new_type($_POST['newtype']);
             $typeid = Post::type($_POST['newtype']);
             $handled = Options::get('cctypes_types');
             if (!is_array($handled)) {
                 $handled = array();
             }
             $handled[$typeid] = $typeid;
             array_unique($handled);
             Options::set('cctypes_types', $handled);
             Session::notice(_t('Added post type "' . $_POST['newtype'] . '".'));
             break;
         case 'deletetype':
             $typename = Post::type_name($_POST['deltype']);
             Post::deactivate_post_type($_POST['deltype']);
             $handled = Options::get('cctypes_types');
             if (isset($handled[$_POST['deltype']])) {
                 unset($handled[$_POST['deltype']]);
             }
             Options::set('cctypes_types', $handled);
             Session::notice(_t('Deactivated post type "' . $typename . '".'));
     }
     Utils::redirect();
 }
Example #2
0
 public function remove_template()
 {
     Post::deactivate_post_type('poll');
     $this->remove_template('widget', dirname(__FILE__) . '/widget.php');
     Stack::remove('template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery');
     Stack::remove('template_stylesheet', array(URL::get_from_filesystem(__FILE__) . '/widget.css', 'screen'), 'pollwigitcss');
     $this->remove_template('poll.single', dirname(__FILE__) . '/poll.single.php');
 }
 public function action_plugin_deactivation($plugin_file)
 {
     Post::deactivate_post_type('link');
 }
Example #4
0
 /**
  * Remove stuff we installed
  **/
 public function uninstall()
 {
     Post::deactivate_post_type('project');
 }
 public function action_plugin_deactivation($plugin_file)
 {
     Post::deactivate_post_type('photoset');
 }
 /**
  * Hook on deactivation of this plugin
  */
 public function action_plugin_deactivation()
 {
     // when deactivating, don't destroy data, just turn it 'off'
     Post::deactivate_post_type('addon');
     ACL::destroy_token('manage_versions');
 }
Example #7
0
 public function action_plugin_deactivation($file)
 {
     if (realpath($file) == __FILE__) {
         Post::deactivate_post_type('snippet');
     }
 }
Example #8
0
 public function action_plugin_deactivation($plugin_file)
 {
     if (Plugins::id_from_file(__FILE__) == Plugins::id_from_file($plugin_file)) {
         Post::deactivate_post_type('podcast');
     }
 }
 public function action_plugin_deactivation($plugin_file)
 {
     Post::deactivate_post_type('urlbounce');
 }
 public function action_plugin_deactivation($file = '')
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         // @todo it has yet been decided whether or not this is a good idea - MellerTime
         /*
         // get all the posts of our update type, so we can delete them
         $posts = Posts::get( array( 'content_type' => 'plugin', 'nolimit' => true ) );
         
         foreach ( $posts as $post ) {
         
         	$post->delete();
         
         }
         */
         // deactivate our custom post type
         Post::deactivate_post_type('plugin');
     }
 }
 /**
  * Set up needed permissions
  */
 private static function uninstall()
 {
     // Deactivate post types
     Post::deactivate_post_type('thread');
     Post::deactivate_post_type('forum');
     // Remove tokens
     ACL::destroy_token('forum_close_thread');
     ACL::destroy_token('forum_see_private');
 }