Exemple #1
0
 /**
  * Standard modular run function for setting features from the setup wizard.
  */
 function set_fields()
 {
     if (!addon_installed('news')) {
         return;
     }
     $admin_groups = $GLOBALS['FORUM_DRIVER']->get_super_admin_groups();
     $groups = $GLOBALS['FORUM_DRIVER']->get_usergroup_list(false, true);
     $GLOBALS['SITE_DB']->query_delete('gsp', array('specific_permission' => 'have_personal_category', 'the_page' => 'cms_news'));
     if (post_param_integer('keep_blogs', 0) == 1) {
         foreach (array_keys($groups) as $group_id) {
             if (!in_array($group_id, $admin_groups)) {
                 $GLOBALS['SITE_DB']->query_insert('gsp', array('specific_permission' => 'have_personal_category', 'group_id' => $group_id, 'module_the_name' => '', 'category_name' => '', 'the_page' => 'cms_news', 'the_value' => 1));
             }
         }
     }
     if (post_param_integer('keep_news_categories', 0) == 0) {
         $news_cats = $GLOBALS['SITE_DB']->query_select('news_categories', array('id'), array('nc_owner' => NULL));
         foreach ($news_cats as $news_cat) {
             if ($news_cat['id'] > db_get_first_id() && $news_cat['id'] < db_get_first_id() + 7) {
                 require_code('news');
                 delete_news_category($news_cat['id']);
             }
         }
     }
 }
Exemple #2
0
 function tearDown()
 {
     delete_news_category($this->news_id);
     parent::tearDown();
 }
Exemple #3
0
 /**
  * Standard aed_module delete actualiser.
  *
  * @param  ID_TEXT		The entry being deleted
  */
 function delete_actualisation($id)
 {
     delete_news_category(intval($id));
 }