block() public static method

public static block ( ) : self
return self
Ejemplo n.º 1
0
 /**
  * Install the module
  */
 public function install()
 {
     // load install.sql
     $this->importSQL(__DIR__ . '/Data/install.sql');
     // add 'search' as a module
     $this->addModule('Search');
     // import locale
     $this->importLocale(__DIR__ . '/Data/locale.xml');
     // general settings
     $this->setSetting('Search', 'overview_num_items', 10);
     $this->setSetting('Search', 'validate_search', true);
     // module rights
     $this->setModuleRights(1, 'Search');
     // action rights
     $this->setActionRights(1, 'Search', 'AddSynonym');
     $this->setActionRights(1, 'Search', 'EditSynonym');
     $this->setActionRights(1, 'Search', 'DeleteSynonym');
     $this->setActionRights(1, 'Search', 'Settings');
     $this->setActionRights(1, 'Search', 'Statistics');
     $this->setActionRights(1, 'Search', 'Synonyms');
     // set navigation
     $navigationModulesId = $this->setNavigation(null, 'Modules');
     $navigationSearchId = $this->setNavigation($navigationModulesId, 'Search');
     $this->setNavigation($navigationSearchId, 'Statistics', 'search/statistics');
     $this->setNavigation($navigationSearchId, 'Synonyms', 'search/synonyms', array('search/add_synonym', 'search/edit_synonym'));
     // settings navigation
     $navigationSettingsId = $this->setNavigation(null, 'Settings');
     $navigationModulesId = $this->setNavigation($navigationSettingsId, 'Modules');
     $this->setNavigation($navigationModulesId, 'Search', 'search/settings');
     // add extra's
     $searchId = $this->insertExtra('Search', ModuleExtraType::block(), 'Search', null, null, 'N', 2000);
     $this->insertExtra('Search', ModuleExtraType::widget(), 'SearchForm', 'Form', null, 'N', 2001);
     // loop languages
     foreach ($this->getLanguages() as $language) {
         // check if a page for search already exists in this language
         // @todo refactor this nasty if statement...
         if (!(bool) $this->getDB()->getVar('SELECT 1
              FROM pages AS p
              INNER JOIN pages_blocks AS b ON b.revision_id = p.revision_id
              WHERE b.extra_id = ? AND p.language = ?
              LIMIT 1', array($searchId, $language))) {
             // insert search
             $this->insertPage(array('title' => \SpoonFilter::ucfirst($this->getLocale('Search', 'Core', $language, 'lbl', 'Frontend')), 'type' => 'root', 'language' => $language), null, array('extra_id' => $searchId, 'position' => 'main'));
         }
     }
     // activate search on 'pages'
     $this->searchPages();
     // create module cache path
     $filesystem = new Filesystem();
     if (!$filesystem->exists(PATH_WWW . '/src/Frontend/Cache/Search')) {
         $filesystem->mkdir(PATH_WWW . '/src/Frontend/Cache/Search');
     }
 }
Ejemplo n.º 2
0
 /**
  * Install the module
  */
 public function install()
 {
     // load install.sql
     $this->importSQL(__DIR__ . '/Data/install.sql');
     // add 'blog' as a module
     $this->addModule('Tags');
     // import locale
     $this->importLocale(__DIR__ . '/Data/locale.xml');
     // module rights
     $this->setModuleRights(1, 'Tags');
     // action rights
     $this->setActionRights(1, 'Tags', 'Autocomplete');
     $this->setActionRights(1, 'Tags', 'Edit');
     $this->setActionRights(1, 'Tags', 'Index');
     $this->setActionRights(1, 'Tags', 'MassAction');
     // set navigation
     $navigationModulesId = $this->setNavigation(null, 'Modules');
     $this->setNavigation($navigationModulesId, 'Tags', 'tags/index', array('tags/edit'));
     // add extra
     $tagsID = $this->insertExtra('Tags', ModuleExtraType::block(), 'Tags', null, null, 'N', 30);
     $this->insertExtra('Tags', ModuleExtraType::widget(), 'TagCloud', 'TagCloud', null, 'N', 31);
     $this->insertExtra('Tags', ModuleExtraType::widget(), 'Related', 'Related', null, 'N', 32);
     // get search extra id
     $searchId = (int) $this->getDB()->getVar('SELECT id FROM modules_extras WHERE module = ? AND type = ? AND action = ?', array('Search', ModuleExtraType::WIDGET, 'Form'));
     // loop languages
     foreach ($this->getLanguages() as $language) {
         // check if a page for tags already exists in this language
         // @todo refactor this if statement
         if (!(bool) $this->getDB()->getVar('SELECT 1
              FROM pages AS p
              INNER JOIN pages_blocks AS b ON b.revision_id = p.revision_id
              WHERE b.extra_id = ? AND p.language = ?
              LIMIT 1', array($tagsID, $language))) {
             // insert contact page
             $this->insertPage(array('title' => 'Tags', 'type' => 'root', 'language' => $language), null, array('extra_id' => $tagsID, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Install example data
  */
 private function installExampleData()
 {
     // insert/get extra ids
     $extras['blog_block'] = $this->insertExtra('Blog', ModuleExtraType::block(), 'Blog', null, null, 'N', 1000);
     $extras['blog_widget_recent_comments'] = $this->insertExtra('Blog', ModuleExtraType::widget(), 'RecentComments', 'RecentComments', null, 'N', 1001);
     $extras['blog_widget_categories'] = $this->insertExtra('Blog', ModuleExtraType::widget(), 'Categories', 'Categories', null, 'N', 1002);
     $extras['blog_widget_archive'] = $this->insertExtra('Blog', ModuleExtraType::widget(), 'Archive', 'Archive', null, 'N', 1003);
     $extras['blog_widget_recent_articles_full'] = $this->insertExtra('Blog', ModuleExtraType::widget(), 'RecentArticlesFull', 'RecentArticlesFull', null, 'N', 1004);
     $extras['blog_widget_recent_articles_list'] = $this->insertExtra('Blog', ModuleExtraType::widget(), 'RecentArticlesList', 'RecentArticlesList', null, 'N', 1005);
     $extras['search'] = $this->insertExtra('Search', ModuleExtraType::block(), 'Search', null, null, 'N', 2000);
     $extras['search_form'] = $this->insertExtra('Search', ModuleExtraType::widget(), 'SearchForm', 'Form', null, 'N', 2001);
     $extras['sitemap_widget_sitemap'] = $this->insertExtra('Pages', ModuleExtraType::widget(), 'Sitemap', 'Sitemap', null, 'N', 1);
     $extras['subpages_widget'] = $this->insertExtra('Pages', ModuleExtraType::widget(), 'Subpages', 'Subpages', serialize(array('template' => 'SubpagesDefault.html.twig')), 'N', 2);
     // loop languages
     foreach ($this->getLanguages() as $language) {
         // check if pages already exist for this language
         if (!(bool) $this->getDB()->getVar('SELECT 1 FROM pages WHERE language = ? AND id > ? LIMIT 1', array($language, 404))) {
             // re-insert homepage
             $this->insertPage(array('id' => 1, 'parent_id' => 0, 'template_id' => $this->getTemplateId('home'), 'title' => \SpoonFilter::ucfirst($this->getLocale('Home', 'Core', $language, 'lbl', 'Backend')), 'language' => $language, 'allow_move' => 'N', 'allow_delete' => 'N'), null, array('html' => __DIR__ . '/Data/' . $language . '/sample1.txt'), array('extra_id' => $extras['blog_widget_recent_articles_list'], 'position' => 'left'), array('extra_id' => $extras['blog_widget_recent_comments'], 'position' => 'right'), array('extra_id' => $extras['search_form'], 'position' => 'top'));
             // blog
             $this->insertPage(array('title' => \SpoonFilter::ucfirst($this->getLocale('Blog', 'Core', $language, 'lbl', 'Frontend')), 'language' => $language), null, array('extra_id' => $extras['blog_block']), array('extra_id' => $extras['blog_widget_recent_comments'], 'position' => 'left'), array('extra_id' => $extras['blog_widget_categories'], 'position' => 'left'), array('extra_id' => $extras['blog_widget_archive'], 'position' => 'left'), array('extra_id' => $extras['blog_widget_recent_articles_list'], 'position' => 'left'), array('extra_id' => $extras['search_form'], 'position' => 'top'));
             // about us parent
             $aboutUsId = $this->insertPage(array('title' => \SpoonFilter::ucfirst($this->getLocale('AboutUs', 'Core', $language, 'lbl', 'Frontend')), 'parent_id' => 1, 'language' => $language), null, array('extra_id' => $extras['subpages_widget']), array('extra_id' => $extras['search_form'], 'position' => 'top'));
             // location
             $this->insertPage(array('title' => \SpoonFilter::ucfirst($this->getLocale('Location', 'Core', $language, 'lbl', 'Frontend')), 'parent_id' => $aboutUsId, 'language' => $language), null, array('html' => __DIR__ . '/Data/' . $language . '/sample1.txt'), array('html' => __DIR__ . '/Data/' . $language . '/sample2.txt'), array('extra_id' => $extras['search_form'], 'position' => 'top'));
             // about us child
             $this->insertPage(array('title' => \SpoonFilter::ucfirst($this->getLocale('AboutUs', 'Core', $language, 'lbl', 'Frontend')), 'parent_id' => $aboutUsId, 'language' => $language), null, array('html' => __DIR__ . '/Data/' . $language . '/sample1.txt'), array('html' => __DIR__ . '/Data/' . $language . '/sample2.txt'), array('extra_id' => $extras['search_form'], 'position' => 'top'));
             // history
             $this->insertPage(array('title' => \SpoonFilter::ucfirst($this->getLocale('History', 'Core', $language, 'lbl', 'Frontend')), 'parent_id' => 1, 'language' => $language), null, array('html' => __DIR__ . '/Data/' . $language . '/sample1.txt'), array('html' => __DIR__ . '/Data/' . $language . '/sample2.txt'), array('extra_id' => $extras['search_form'], 'position' => 'top'));
             // insert lorem ipsum test page
             $this->insertPage(array('title' => 'Lorem ipsum', 'type' => 'root', 'language' => $language, 'hidden' => 'Y'), array('data' => array('seo_index' => 'noindex', 'seo_follow' => 'nofollow')), array('html' => __DIR__ . '/Data/' . $language . '/lorem_ipsum.txt'), array('extra_id' => $extras['search_form'], 'position' => 'top'));
         }
     }
 }
Ejemplo n.º 4
0
 /**
  * Install the module
  */
 public function install()
 {
     // load install.sql
     $this->importSQL(__DIR__ . '/Data/install.sql');
     // add 'blog' as a module
     $this->addModule('Blog');
     // import locale
     $this->importLocale(__DIR__ . '/Data/locale.xml');
     // general settings
     $this->setSetting('Blog', 'allow_comments', true);
     $this->setSetting('Blog', 'requires_akismet', true);
     $this->setSetting('Blog', 'spamfilter', false);
     $this->setSetting('Blog', 'moderation', true);
     // @TODO remove this when the api is kicked out
     $this->setSetting('Blog', 'ping_services', false);
     $this->setSetting('Blog', 'overview_num_items', 10);
     $this->setSetting('Blog', 'recent_articles_full_num_items', 3);
     $this->setSetting('Blog', 'recent_articles_list_num_items', 5);
     $this->setSetting('Blog', 'max_num_revisions', 20);
     $this->makeSearchable('Blog');
     // module rights
     $this->setModuleRights(1, 'Blog');
     // action rights
     $this->setActionRights(1, 'Blog', 'AddCategory');
     $this->setActionRights(1, 'Blog', 'Add');
     $this->setActionRights(1, 'Blog', 'Categories');
     $this->setActionRights(1, 'Blog', 'Comments');
     $this->setActionRights(1, 'Blog', 'DeleteCategory');
     $this->setActionRights(1, 'Blog', 'DeleteSpam');
     $this->setActionRights(1, 'Blog', 'Delete');
     $this->setActionRights(1, 'Blog', 'EditCategory');
     $this->setActionRights(1, 'Blog', 'EditComment');
     $this->setActionRights(1, 'Blog', 'Edit');
     $this->setActionRights(1, 'Blog', 'ImportWordpress');
     $this->setActionRights(1, 'Blog', 'Index');
     $this->setActionRights(1, 'Blog', 'MassCommentAction');
     $this->setActionRights(1, 'Blog', 'Settings');
     // insert dashboard widget
     $this->insertWidget();
     // set navigation
     $navigationModulesId = $this->setNavigation(null, 'Modules');
     $navigationBlogId = $this->setNavigation($navigationModulesId, 'Blog');
     $this->setNavigation($navigationBlogId, 'Articles', 'blog/index', array('blog/add', 'blog/edit', 'blog/import_wordpress'));
     $this->setNavigation($navigationBlogId, 'Comments', 'blog/comments', array('blog/edit_comment'));
     $this->setNavigation($navigationBlogId, 'Categories', 'blog/categories', array('blog/add_category', 'blog/edit_category'));
     // settings navigation
     $navigationSettingsId = $this->setNavigation(null, 'Settings');
     $navigationModulesId = $this->setNavigation($navigationSettingsId, 'Modules');
     $this->setNavigation($navigationModulesId, 'Blog', 'blog/settings');
     // add extra's
     $blogId = $this->insertExtra('Blog', ModuleExtraType::block(), 'Blog', null, null, 'N', 1000);
     $this->insertExtra('Blog', ModuleExtraType::widget(), 'RecentComments', 'RecentComments', null, 'N', 1001);
     $this->insertExtra('Blog', ModuleExtraType::widget(), 'Categories', 'Categories', null, 'N', 1002);
     $this->insertExtra('Blog', ModuleExtraType::widget(), 'Archive', 'Archive', null, 'N', 1003);
     $this->insertExtra('Blog', ModuleExtraType::widget(), 'RecentArticlesFull', 'RecentArticlesFull', null, 'N', 1004);
     $this->insertExtra('Blog', ModuleExtraType::widget(), 'RecentArticlesList', 'RecentArticlesList', null, 'N', 1005);
     // get search extra id
     $searchId = (int) $this->getDB()->getVar('SELECT id FROM modules_extras
          WHERE module = ? AND type = ? AND action = ?', array('Search', ModuleExtraType::WIDGET, 'Form'));
     // loop languages
     foreach ($this->getLanguages() as $language) {
         // fetch current categoryId
         $this->defaultCategoryId = $this->getCategory($language);
         // no category exists
         if ($this->defaultCategoryId == 0) {
             // add category
             $this->defaultCategoryId = $this->addCategory($language, 'Default', 'default');
         }
         // RSS settings
         $this->setSetting('Blog', 'rss_meta_' . $language, true);
         $this->setSetting('Blog', 'rss_title_' . $language, 'RSS');
         $this->setSetting('Blog', 'rss_description_' . $language, '');
         // check if a page for blog already exists in this language
         if (!(bool) $this->getDB()->getVar('SELECT 1
              FROM pages AS p
              INNER JOIN pages_blocks AS b ON b.revision_id = p.revision_id
              WHERE b.extra_id = ? AND p.language = ?
              LIMIT 1', array($blogId, $language))) {
             $this->insertPage(array('title' => 'Blog', 'language' => $language), null, array('extra_id' => $blogId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
         }
         if ($this->installExample()) {
             $this->installExampleData($language);
         }
     }
 }
Ejemplo n.º 5
0
 /**
  * Install the module.
  */
 public function install()
 {
     // load install.sql
     $this->importSQL(__DIR__ . '/Data/install.sql');
     // add 'profiles' as a module
     $this->addModule('Profiles');
     // import locale
     $this->importLocale(__DIR__ . '/Data/locale.xml');
     // general settings
     $this->setSetting('Profiles', 'allow_gravatar', true);
     $this->setSetting('Profiles', 'overwrite_profile_notification_email', false);
     $this->setSetting('Profiles', 'profile_notification_email', null);
     $this->setSetting('Profiles', 'send_mail_for_new_profile_to_admin', false);
     $this->setSetting('Profiles', 'send_mail_for_new_profile_to_profile', false);
     // add folders
     $filesystem = new Filesystem();
     $filesystem->mkdir(PATH_WWW . '/src/Frontend/Files/Profiles/avatars/source/');
     $filesystem->mkdir(PATH_WWW . '/src/Frontend/Files/Profiles/avatars/240x240/');
     $filesystem->mkdir(PATH_WWW . '/src/Frontend/Files/Profiles/avatars/64x64/');
     $filesystem->mkdir(PATH_WWW . '/src/Frontend/Files/Profiles/avatars/32x32/');
     // module rights
     $this->setModuleRights(1, 'Profiles');
     // action rights
     $this->setActionRights(1, 'Profiles', 'Add');
     $this->setActionRights(1, 'Profiles', 'AddGroup');
     $this->setActionRights(1, 'Profiles', 'AddProfileGroup');
     $this->setActionRights(1, 'Profiles', 'Block');
     $this->setActionRights(1, 'Profiles', 'DeleteGroup');
     $this->setActionRights(1, 'Profiles', 'DeleteProfileGroup');
     $this->setActionRights(1, 'Profiles', 'Delete');
     $this->setActionRights(1, 'Profiles', 'EditGroup');
     $this->setActionRights(1, 'Profiles', 'EditProfileGroup');
     $this->setActionRights(1, 'Profiles', 'Edit');
     $this->setActionRights(1, 'Profiles', 'ExportTemplate');
     $this->setActionRights(1, 'Profiles', 'Groups');
     $this->setActionRights(1, 'Profiles', 'Import');
     $this->setActionRights(1, 'Profiles', 'Index');
     $this->setActionRights(1, 'Profiles', 'MassAction');
     // set navigation
     $navigationModulesId = $this->setNavigation(null, 'Modules');
     $navigationProfilesId = $this->setNavigation($navigationModulesId, 'Profiles');
     $this->setNavigation($navigationProfilesId, 'Overview', 'profiles/index', array('profiles/add', 'profiles/edit', 'profiles/add_profile_group', 'profiles/edit_profile_group', 'profiles/import'));
     $this->setNavigation($navigationProfilesId, 'Groups', 'profiles/groups', array('profiles/add_group', 'profiles/edit_group'));
     // settings navigation
     $navigationSettingsId = $this->setNavigation(null, 'Settings');
     $navigationModulesId = $this->setNavigation($navigationSettingsId, 'Modules');
     $this->setNavigation($navigationModulesId, 'Profiles', 'profiles/settings');
     // add extra
     $activateId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'Activate', 'Activate', null, 'N', 5000);
     $forgotPasswordId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'ForgotPassword', 'ForgotPassword', null, 'N', 5001);
     $indexId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'Dashboard', null, null, 'N', 5002);
     $loginId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'Login', 'Login', null, 'N', 5003);
     $logoutId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'Logout', 'Logout', null, 'N', 5004);
     $changeEmailId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'ChangeEmail', 'ChangeEmail', null, 'N', 5005);
     $changePasswordId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'ChangePassword', 'ChangePassword', null, 'N', 5006);
     $settingsId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'Settings', 'Settings', null, 'N', 5007);
     $registerId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'Register', 'Register', null, 'N', 5008);
     $resetPasswordId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'ResetPassword', 'ResetPassword', null, 'N', 5008);
     $resendActivationId = $this->insertExtra('Profiles', ModuleExtraType::block(), 'ResendActivation', 'ResendActivation', null, 'N', 5009);
     $this->insertExtra('Profiles', ModuleExtraType::widget(), 'LoginBox', 'LoginBox', null, 'N', 5010);
     $this->insertExtra('Profiles', ModuleExtraType::widget(), 'LoginLink', 'LoginLink', null, 'N', 5011);
     $this->insertExtra('Profiles', ModuleExtraType::widget(), 'SecurePage', 'SecurePage', null, 'N', 5012);
     // get search widget id
     $searchId = (int) $this->getDB()->getVar('SELECT id FROM modules_extras WHERE module = ? AND action = ?', array('search', 'form'));
     $originalLocale = Language::getInterfaceLanguage();
     // loop languages
     foreach ($this->getLanguages() as $language) {
         // only add pages if profiles isn't linked anywhere
         // @todo refactor me, syntax sucks atm
         if (!(bool) $this->getDB()->getVar('SELECT 1
              FROM pages AS p
              INNER JOIN pages_blocks AS b ON b.revision_id = p.revision_id
              INNER JOIN modules_extras AS e ON e.id = b.extra_id
              WHERE e.module = ? AND p.language = ?
              LIMIT 1', array('Profiles', $language))) {
             // We must define the locale we want to insert the page into
             Language::setLocale($language);
             // activate page
             $this->insertPage(array('title' => ucfirst(Language::lbl('Activate')), 'type' => 'root', 'language' => $language), null, array('extra_id' => $activateId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
             // forgot password page
             $this->insertPage(array('title' => ucfirst(Language::lbl('ForgotPassword')), 'type' => 'root', 'language' => $language), null, array('extra_id' => $forgotPasswordId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
             // reset password page
             $this->insertPage(array('title' => ucfirst(Language::lbl('ResetPassword')), 'type' => 'root', 'language' => $language), null, array('extra_id' => $resetPasswordId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
             // resend activation email page
             $this->insertPage(array('title' => ucfirst(Language::lbl('ResendActivation')), 'type' => 'root', 'language' => $language), null, array('extra_id' => $resendActivationId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
             // login page
             $this->insertPage(array('title' => ucfirst(Language::lbl('Login')), 'type' => 'root', 'language' => $language), null, array('extra_id' => $loginId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
             // register page
             $this->insertPage(array('title' => ucfirst(Language::lbl('Register')), 'type' => 'root', 'language' => $language), null, array('extra_id' => $registerId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
             // logout page
             $this->insertPage(array('title' => ucfirst(Language::lbl('Logout')), 'type' => 'root', 'language' => $language), null, array('extra_id' => $logoutId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
             // index page
             $indexPageId = $this->insertPage(array('title' => ucfirst(Language::lbl('Profile')), 'type' => 'root', 'language' => $language), null, array('extra_id' => $indexId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
             // settings page
             $this->insertPage(array('title' => ucfirst(Language::lbl('ProfileSettings')), 'parent_id' => $indexPageId, 'language' => $language), null, array('extra_id' => $settingsId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
             // change email page
             $this->insertPage(array('title' => ucfirst(Language::lbl('ChangeEmail')), 'parent_id' => $indexPageId, 'language' => $language), null, array('extra_id' => $changeEmailId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
             // change password page
             $this->insertPage(array('title' => ucfirst(Language::lbl('ChangePassword')), 'parent_id' => $indexPageId, 'language' => $language), null, array('extra_id' => $changePasswordId, 'position' => 'main'), array('extra_id' => $searchId, 'position' => 'top'));
         }
     }
     // restore the original locale
     if (!empty($originalLocale)) {
         Language::setLocale($originalLocale);
     }
 }
Ejemplo n.º 6
0
 /**
  * Install the module
  */
 public function install()
 {
     $this->importSQL(__DIR__ . '/Data/install.sql');
     $this->addModule('Faq');
     $this->importLocale(__DIR__ . '/Data/locale.xml');
     $this->makeSearchable('Faq');
     $this->setModuleRights(1, 'Faq');
     $this->setActionRights(1, 'Faq', 'Index');
     $this->setActionRights(1, 'Faq', 'Add');
     $this->setActionRights(1, 'Faq', 'Edit');
     $this->setActionRights(1, 'Faq', 'Delete');
     $this->setActionRights(1, 'Faq', 'Sequence');
     $this->setActionRights(1, 'Faq', 'Categories');
     $this->setActionRights(1, 'Faq', 'AddCategory');
     $this->setActionRights(1, 'Faq', 'EditCategory');
     $this->setActionRights(1, 'Faq', 'DeleteCategory');
     $this->setActionRights(1, 'Faq', 'SequenceQuestions');
     $this->setActionRights(1, 'Faq', 'DeleteFeedback');
     $this->setActionRights(1, 'Faq', 'Settings');
     $faqId = $this->insertExtra('Faq', ModuleExtraType::block(), 'Faq');
     // Register widgets
     // Category faq widgets will be added on the fly
     $this->insertExtra('Faq', ModuleExtraType::widget(), 'MostReadQuestions', 'MostReadQuestions');
     $this->insertExtra('Faq', ModuleExtraType::widget(), 'AskOwnQuestion', 'AskOwnQuestion');
     $this->insertExtra('Faq', ModuleExtraType::widget(), 'Categories', 'Categories');
     $this->setSetting('Faq', 'overview_num_items_per_category', 0);
     $this->setSetting('Faq', 'most_read_num_items', 0);
     $this->setSetting('Faq', 'related_num_items', 0);
     $this->setSetting('Faq', 'spamfilter', false);
     $this->setSetting('Faq', 'allow_feedback', false);
     $this->setSetting('Faq', 'allow_own_question', false);
     $this->setSetting('Faq', 'allow_multiple_categories', true);
     $this->setSetting('Faq', 'send_email_on_new_feedback', false);
     foreach ($this->getLanguages() as $language) {
         $this->defaultCategoryId = $this->getCategory($language);
         // no category exists
         if ($this->defaultCategoryId == 0) {
             $this->defaultCategoryId = $this->addCategory($language, 'Default', 'default');
         }
         // check if a page for the faq already exists in this language
         $faqPageExists = (bool) $this->getDB()->getVar('SELECT 1
              FROM pages AS p
              INNER JOIN pages_blocks AS b ON b.revision_id = p.revision_id
              WHERE b.extra_id = ? AND p.language = ?
              LIMIT 1', array($faqId, $language));
         if (!$faqPageExists) {
             // insert page
             $this->insertPage(array('title' => 'FAQ', 'language' => $language), null, array('extra_id' => $faqId));
         }
     }
     $this->insertWidget();
     // set navigation
     $navigationModulesId = $this->setNavigation(null, 'Modules');
     $navigationFaqId = $this->setNavigation($navigationModulesId, 'Faq');
     $this->setNavigation($navigationFaqId, 'Questions', 'faq/index', array('faq/add', 'faq/edit'));
     $this->setNavigation($navigationFaqId, 'Categories', 'faq/categories', array('faq/add_category', 'faq/edit_category'));
     $navigationSettingsId = $this->setNavigation(null, 'Settings');
     $navigationModulesId = $this->setNavigation($navigationSettingsId, 'Modules');
     $this->setNavigation($navigationModulesId, 'Faq', 'faq/settings');
 }