/** * Displayes Overview of all registered Users */ public function action_list() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Show'), '/users/show'); // Defining initial variables $currentPage = (int) $this->request->getParameter('page'); $resultsPerPage = (int) self::getConfigValue('resultsPerPage', '10'); /* @todo news with status: draft, published, private, private+protected*/ // Creating Pager Object with a Query Object inside $pager_layout = new Doctrine_Pager_Layout(new Doctrine_Pager(Doctrine_Query::create()->select('u.user_id, u.nick, u.email, u.joined, g.name, g.color, p.icq')->from('CsUsers u')->leftJoin('u.CsGroups g')->leftJoin('u.CsProfiles p')->orderby('u.user_id ASC'), $currentPage, $resultsPerPage), new Doctrine_Pager_Range_Sliding(array('chunk' => 5)), '?mod=news&action=show&page={%page}'); // Assigning templates for page links creation $pager_layout->setTemplate('[<a href="{%url}">{%page}</a>]'); $pager_layout->setSelectedTemplate('[{%page}]'); // Retrieving Doctrine_Pager instance $pager = $pager_layout->getPager(); // Fetching userslist $userslist = $pager->execute(array(), Doctrine::HYDRATE_ARRAY); // Get Number of Rows $count = count($userslist); // Get Render Engine $view = $this->getView(); // Assign $userslist array to Smarty for template output $view->assign('userslist', $userslist); // Pagination $view->assignGlobal('pager', $pager); $view->assignGlobal('pager_layout', $pager_layout); // specifiy the template manually #$view->setTemplate('userslist/view/show.tpl'); $this->display(); }
/** * prettyPhoto Test Video Show (vimeo, youtube, ....) */ public function action_ajaxprettyphoto() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('prettyphoto'), 'testunit/ajaxprettyphoto'); $view = $this->getView(); $this->display(); }
/** * @todo Implement testGetTrail(). */ public function testGetTrail() { // test data $array = array(array('title' => 'modulenameA', 'link' => 'index.php?mod=modulenameA')); // insert $this->object->add($array[0]['title'], $array[0]['link']); // fetch $t_array = $this->object->getTrail(false); // return value is an array $this->assertIsA($t_array, 'array'); // array is not empty $bool = empty($t_array) ? true : false; $this->assertFalse($bool); }
public function action_admin_settings() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Settings'), '/statistics/admin/settings'); $settings = array(); $settings['form'] = array('name' => 'statistic_settings', 'method' => 'POST', 'action' => '/statistics/admin/settings_update'); $settings['statistics'][] = array('id' => 'deleteTimeWho', 'name' => 'deleteTimeWho', 'label' => 'delete Time', 'description' => _('Delete time of old database entries for the WhoIsOnline table. Value in days. After x days delete old entries !'), 'formfieldtype' => 'text', 'value' => self::getConfigValue('deleteTimeWho', '1')); $settings['statistics'][] = array('id' => 'timoutWho', 'name' => 'timoutWho', 'label' => 'Online Timeout', 'description' => _('Defines the timeout for a user or guest. Value in minutes.'), 'formfieldtype' => 'text', 'value' => self::getConfigValue('timoutWho', '5')); // fill the settings array into the formgenerator $form = new Clansuite_Form($settings); // add additional buttons to the form $form->addElement('submitbutton')->setName('Save'); $form->addElement('resetbutton'); // assign the html of the form to the view $this->getView()->assign('form', $form->render()); $this->display(); }
public function action_list() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Show'), '/mibbitirc/show'); // Try to get Mibbit Options from config or set default ones $mibbit_options['nick'] = preg_replace('/ /', '_', $_SESSION['user']['nick']); $mibbit_options['title'] = self::getConfigValue('mibbit_irc_page_title', 'Clansuite Live Chat'); $mibbit_options['nick_prefix'] = self::getConfigValue('mibbit_irc_nickname_prefix', 'Guest'); $mibbit_options['server'] = self::getConfigValue('mibbit_irc_server', 'irc.quakenet.org'); $mibbit_options['channel'] = self::getConfigValue('mibbit_irc_channel', '#clansuite'); $mibbit_options['width'] = self::getConfigValue('mibbit_irc_width', '500'); $mibbit_options['height'] = self::getConfigValue('mibbit_irc_height', '280'); // Set options to the view $this->getView()->assign('mibbit_options', $mibbit_options); // Output $this->display(); }
public function action_multisearch() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Show'), '/search/multisearch'); #Clansuite_Debug::printR( $_POST ); $qmod = $this->request->getParameterFromPost('qmod'); $qmodOut = ucwords($qmod); $qfields = $this->request->getParameterFromPost('qfields'); $qfieldsOut = str_replace(',', ', ', $qfields); $qstring = trim($this->request->getParameterFromPost('q')); $qstringOut = $qstring; // Get Render Engine $view = $this->getView(); $view->assign('qstring', $qstringOut); $view->assign('qmod', $qmodOut); $view->assign('qfields', $qfieldsOut); $this->display(); }
/** * Display Categories and Boards * if exist only one category, will display the boards for this category widthout the category */ public function action_show() { $subboards = array(); // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Show'), '/forum/show'); // Get Render Engine $view = $this->getView(); $resultCategory = $this->getModel('Entities\\ForumCategory')->findAllCategories(); #Clansuite_Debug::printR( $resultCategory ); if (count($resultCategory) > 1) { $view->assign('withcat', true); $view->assign('categories', $resultCategory); } else { $view->assign('withcat', false); $resultBoards = $this->getModel('Entities\\ForumBoards')->findBoards(); #Clansuite_Debug::printR( $resultBoards ); foreach ($resultBoards as $board) { $aBoards = $board; $resultSubBoards = $this->getModel('Entities\\ForumBoards')->findSubBoards($board['board_id']); if (count($resultSubBoards) > 0) { $aBoards['subb'] = 1; foreach ($resultSubBoards as $sboard) { $subboards[] = $sboard; } $aBoards['subboards'] = $subboards; $aBoards['subboardscount'] = count($subboards); } else { $aBoards['subb'] = 0; } $AllBoards[] = $aBoards; } #Clansuite_Debug::printR( $AllBoards ); $view->assign('boards', $AllBoards); //unset( $AllBoards ); unset( $aBoards ); unset( $subboards ); unset( $resultSubBoards ); unset( $resultCategory ); } $this->display(); }
public function action_show() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Show'), '/guestbook/show'); // Defining initial variables // Pager Chapter in Doctrine Manual -> http://www.phpdoctrine.org/documentation/manual/0_10?one-page#utilities $currentPage = $this->request->getParameter('page'); $resultsPerPage = (int) self::getConfigValue('resultsPerPage', '10'); // Creating Pager Object with a Query Object inside $pager_layout = new Doctrine_Pager_Layout(new Doctrine_Pager(Doctrine_Query::create()->select('i.*,g.*,u.nick')->from('CsGuestbook g')->leftJoin('g.CsImages i')->leftJoin('g.CsUsers u')->orderby('g.gb_added DESC'), $currentPage, $resultsPerPage), new Doctrine_Pager_Range_Sliding(array('chunk' => 5)), '?mod=guestbook&action=show&page={%page}'); // Assigning templates for page links creation $pager_layout->setTemplate('[<a href="{%url}">{%page}</a>]'); $pager_layout->setSelectedTemplate('[{%page}]'); // Retrieving Doctrine_Pager instance $pager = $pager_layout->getPager(); // Fetching guestbook entries #var_dump($pager->getExecuted()); $guestbook = $pager->execute(array(), Doctrine::HYDRATE_ARRAY); // if array contains data proceed, else show empty message if (!is_array($guestbook)) { $error['gb_empty'] = '1'; } else { // total number of guestbook entries by counting the array $number_of_guestbook_entries = count($guestbook); // Finally: assign total number of rows to SmartyPaginate #$SmartyPaginate->setTotal($number_of_guestbook_entries); // assign the {$paginate} to $tpl (smarty var) #$SmartyPaginate->assign($tpl); $bbcode = new Clansuite_Bbcode($this->getInjector()); // Set 'not specified's foreach ($guestbook as $entry_key => $entry_value) { foreach ($entry_value as $key => $value) { switch ($key) { case 'gb_comment': if (empty($value)) { unset($guestbook[$entry_key][$key]); } else { $guestbook[$entry_key][$key] = $bbcode->parse($guestbook[$entry_key][$key]); } break; case 'gb_text': $guestbook[$entry_key][$key] = $bbcode->parse($guestbook[$entry_key][$key]); break; default: $guestbook[$entry_key][$key] = empty($value) ? '<span class="not_specified">' . _('not specified') . '</span>' : $value; break; } } } } $view = $this->getView(); $view->assign('guestbook', $guestbook); if (isset($error)) { $view->assign('error', $error); } $view->assignGlobal('pager', $pager); $view->assignGlobal('pager_layout', $pager_layout); $form = new Clansuite_Form('eingabe', 'post', $_SERVER['PHP_SELF']); $view->assign('form', $form); $this->display(); }
public function action_settings() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Settings'), '/controlcenter/admin/settings'); $settings = array(); $settings['form'] = array('name' => 'controlcenter_settings', 'method' => 'POST', 'action' => '/controlcenter/settings_update'); $settings['controlcenter'][] = array('id' => 'show_box_shortcuts', 'name' => 'show_box_shortcuts', 'description' => _('Show Shortcuts'), 'formfieldtype' => 'selectyesno', 'value' => self::getConfigValue('show_box_shortcuts', '1')); $settings['controlcenter'][] = array('id' => 'show_box_news', 'name' => 'show_box_news', 'description' => _('Show News'), 'formfieldtype' => 'selectyesno', 'value' => self::getConfigValue('show_box_news', '1')); $settings['controlcenter'][] = array('id' => 'show_box_security', 'name' => 'show_box_security', 'description' => _('Show Security'), 'formfieldtype' => 'selectyesno', 'value' => self::getConfigValue('show_box_security', '1')); $settings['controlcenter'][] = array('id' => 'show_box_extensions', 'name' => 'show_box_extensions', 'description' => _('Show Extensions'), 'formfieldtype' => 'selectyesno', 'value' => self::getConfigValue('show_box_extensions', '1')); $form = new Clansuite_Form($settings); // display formgenerator object #Clansuite_Debug::printR($form); $form->addElement('submitbutton')->setName('Save'); $form->addElement('resetbutton'); // display form html #Clansuite_Debug::printR($form->render()); // assign the html of the form to the view $this->getView()->assign('form', $form->render()); $this->display(); }
/** * Static Pages * show all static pages */ public function action_overview() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Overview'), '/staticpages/overview'); // get all static pages without page content $result = Doctrine_Query::create()->select('id,title,description')->from('CsStaticPages')->setHydrationMode(Doctrine::HYDRATE_ARRAY)->execute(); if (is_array($result)) { // Get Render Engine $this->getView()->assign('overview', $result); $view->setTemplate('overview.tpl'); } else { echo _('No static pages found.'); } $this->display(); }
public function action_admin_show_logfiles() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Show'), '/sysinfo/showapc'); // Get APC Cache $cache_apc = Clansuite_Cache_Factory::getCache('apc'); // Assign Data to the View $this->getView()->assign('apc_sysinfos', $cache_apc->stats()); // Set Layout Template $this->getView()->setLayoutTemplate('index.tpl'); $this->display(); }
/** * module news action_fullarchive() * * 1. Get news with nick of author and category * 2. Add general data of comments for each news * 3. Paginate * 4. news_status: * 1: draft * 2: published * 3: unpublished * ??? 4: archive * */ public function action_fullarchive() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Archiv'), '/news/fullarchive'); // Defining initial variables $currentPage = (int) $this->request->getParameter('page'); // SmartyColumnSort -- Easy sorting of html table columns. include ROOT_LIBRARIES . 'smarty/libs/SmartyColumnSort.class.php'; // A list of database columns to use in the table. $columns = array('n.created_at', 'n.news_title', 'c.cat_id', 'u.user_id', 'nr_news_comments'); // Create the columnsort object $columnsort = new SmartyColumnSort($columns); // And set the the default sort column and order. $columnsort->setDefault('n.created_at', 'desc'); // Get sort order from columnsort $sortorder = $columnsort->sortOrder(); // Returns 'name ASC' as default // set custom starting and ending date $startdate = '1980-04-19'; $enddate = date('Y-m-d'); // get resultsPerPage from ModuleConfig $resultsPerPage = self::getConfigValue('resultsPerPage_fullarchive', '25'); #Fetch News for Archiv with Doctrine $newsQuery = Doctrine::getTable('CsNews')->fetchNewsForFullArchiv($sortorder, $startdate, $enddate, $currentPage, $resultsPerPage); // import array variables into the current symbol table extract($newsQuery); unset($newsQuery); // Get Render Engine $view = $this->getView(); // Assign $news array to Smarty for template output // Also pass the complete pager object to smarty (referenced to save memory - no extra vars needed) => assign() $view->assign('news', $news); $view->assignGlobal('pager', $pager); $view->assignGlobal('pager_layout', $pager_layout); $this->display(); }
/** * Action for displaying the Settings of a Module News */ public function action_admin_settings() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Settings'), '/news/admin/settings'); $this->loadForm(); $this->display(); }
public function action_admin_menueditor2() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Adminmenu Editor II'), '/menu/admin/menueditor2'); $model = 'CsAdminmenuShortcuts'; $treeObject = Doctrine::getTable($model)->getTree(); $rootColumnName = $treeObject->getAttribute('rootColumnName'); $lastLevel = 0; $html = ''; // open unordered list tag $html .= "\n\t<ul>\n"; // retrieve the roots foreach ($treeObject->fetchRoots() as $root) { $options = array('root_id' => $root->{$rootColumnName}); // start iterating the tree beginning with a specific root_id foreach ($treeObject->fetchTree($options) as $node) { // we are on the item of the same level, closing <li> tag before printing item if ($lastLevel > 0 and $node['level'] == $lastLevel) { $html .= "</li>\n"; } // we are printing a next-level item, starting a new <ul> if ($node['level'] > $lastLevel) { $html .= "\t\n<ul>\n"; } elseif ($node['level'] < $lastLevel) { $html .= str_repeat('</ul></li>', $lastLevel - $node['level']); } // Print the NODE $html .= '<li id="node_' . $node['id'] . '">'; $html .= '<a href="#">Name: ' . $node['name'] . ' ID: ' . $node['id'] . '</a>'; #$html .= '</li>'; // Refreshing last level of the item $lastLevel = $node['level']; } } // close unordered list tag $html .= "\n</ul>"; $html .= "\n</div>"; #Clansuite_Debug::printR($html); // assign the html of the tree to the view $view = $this->getView(); $view->assign('modelname', $model); $view->assign('tree', $html); $this->display(); }
public function action_admin_settings() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Settings'), '/categories/admin/settings'); $settings = array(); $settings['form'] = array('name' => 'categories_settings', 'method' => 'POST', 'action' => '/categories/admin/settings_update'); $settings['categories'][] = array('id' => 'items_resultsPerPage', 'name' => 'items_resultsPerPage', 'label' => _('Categories per Page'), 'description' => _('Categories per Page'), 'formfieldtype' => 'text', 'value' => self::getConfigValue('items_resultsPerPage', '25')); $form = new Clansuite_Form($settings); // display formgenerator object #Clansuite_Debug::printR($form); $form->addElement('submitbutton')->setName('Save'); $form->addElement('resetbutton'); // display form html #Clansuite_Debug::printR($form->render()); // assign the html of the form to the view $this->getView()->assign('form', $form->render()); $this->display(); }
public function action_admin_firsttimeinstall() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Show'), '/modulemanager/admin/firsttimeinstall'); // Set Layout Template $this->getView()->setLayoutTemplate('index.tpl'); $actions = array(); $lastModuleID = 0; if ($this->request->getParameter('xinst') == 1) { $tables = array('cs_acl_actions', 'cs_acl_rules', 'cs_modules'); // tables truncate Clansuite_DoctrineTools::truncateTables($tables); $moduleinfo = new Clansuite_ModuleInfoController(); $modules_info_array = $moduleinfo->getModuleInformations(); array_pop($modules_info_array); #Clansuite_Debug::printR( $modules_info_array ); foreach ($modules_info_array as $modules_info) { $lastModuleID = self::createModulFirstTime($modules_info); #Clansuite_Debug::printR( $lastModuleID ); self::createModulAclFirstTime($modules_info, $lastModuleID); } } // Prepare the Output $this->display(); }
public function action_admin_settings() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Settings'), '/forum/admin/settings'); $settings = array(); $settings['form'] = array('name' => 'forum_settings', 'method' => 'POST', 'action' => '/forum/admin/settings_update'); $settings['forum'][] = array('id' => 'list_max', 'name' => 'list_max', 'description' => _('list_max'), 'formfieldtype' => 'text', 'value' => self::getConfigValue('list_max', '30')); $settings['forum'][] = array('id' => 'char_max', 'name' => 'char_max', 'description' => _('Maximum Textcharacter'), 'formfieldtype' => 'text', 'value' => self::getConfigValue('char_max', '999')); $settings['forum'][] = array('id' => 'allow_bb_code', 'name' => 'allow_bb_code', 'description' => _('Allow BBCode'), 'formfieldtype' => 'selectyesno', 'value' => array('selected' => self::getConfigValue('allow_bb_code', '1'))); $settings['forum'][] = array('id' => 'allow_html', 'name' => 'allow_html', 'description' => _('Allow HTML'), 'formfieldtype' => 'text', 'value' => self::getConfigValue('allow_html', '0')); $settings['forum'][] = array('id' => 'allow_geshi_highlight', 'name' => 'allow_geshi_highlight', 'description' => _('Allow Geshi Highlighting'), 'formfieldtype' => 'text', 'value' => self::getConfigValue('allow_geshi_highlight', '1')); $form = new Clansuite_Form($settings); // display formgenerator object #Clansuite_Debug::printR($form); $form->addElement('submitbutton')->setName('Save'); $form->addElement('resetbutton'); // display form html #Clansuite_Debug::printR($form->render()); // assign the html of the form to the view $this->getView()->assign('form', $form->render()); $this->display(); }
/** * */ public function action_admin_new() { Clansuite_Breadcrumb::add(_('Add language'), '/languages/admin/new'); // handle get request if ($this->request->getRequestMethod() == 'GET') { $module = $this->request->getParameter('modulename', 'GET'); $form = new Clansuite_Form('languages_dropdown', 'post', WWW_ROOT . 'index.php?mod=languages&sub=admin&action=new'); $form->setLegend(_('Select the language to add')); // $_POST['locale'] $form->addElement('selectlocale')->setDescription('Use the dropdown to select a locale by name or abbreviation.'); // $_POST['module'] $form->addElement('hidden')->setName('module')->setValue($module); $form->addElement('buttonbar'); $view = $this->getView(); $view->assign('modulename', $module); $view->assign('form_languages_dropdown', $form->render()); $this->display(); } }
/** * Logout * * If logout is confirmed: Destroy Session, Delete Cookie and Redirect to index.php */ public function action_logout() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Logout'), '/account/logout'); $confirm = (bool) $this->request->getParameterFromPost('confirm'); if ($confirm == true) { // log the user OUT $this->getInjector()->instantiate('Clansuite_User')->logoutUser(); $this->setFlashmessage('success', _('Logout successfull. Have a nice day. Goodbye.')); $this->redirect(WWW_ROOT, 3, 200); exit; } else { $this->display(); } }
/** * Show the modulemanager */ public function action_admin_list() { $success = $error = array(); // Permission check #$Clansuite_ACL::checkPermission('modulesettings.action_admin_show'); // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Show'), '/modulesettings/admin/show'); $formdata = array(); $modulename = $this->request->getParameterFromGet('modulename'); // Get Render Engine $view = $this->getView(); $view->assign('modulename', $modulename); /* --------------------------------------------------------- Form Submitted --------------------------------------------------------- */ if ($this->request->issetParameter('submit', 'POST')) { $submitted = true; } else { $submitted = false; } if ($submitted === true) { // get parameter for module data $configfile = $this->request->getParameter('mod_settings_configfile'); if (!is_writeable(ROOT_MOD . $modulename . DIRECTORY_SEPARATOR . $modulename . '.config.php')) { $error['mod_config_not_writeable'] = true; } else { file_put_contents(ROOT_MOD . $modulename . DIRECTORY_SEPARATOR . $modulename . '.config.php', utf8_decode($configfile)); $success['mod_config_success'] = true; } } /* --------------------------------------------------------- else --------------------------------------------------------- */ // -------------------------------------------- // read module config file // -------------------------------------------- if (file_exists(ROOT_MOD . $modulename . DIRECTORY_SEPARATOR . $modulename . '.config.php')) { $configfile = file_get_contents(ROOT_MOD . $modulename . DIRECTORY_SEPARATOR . $modulename . '.config.php'); } else { $configfile = ''; } $view->assign('mod_settings_configfile', $configfile); // -------------------------------------------- // read module info file // -------------------------------------------- if (file_exists(ROOT_MOD . $modulename . DIRECTORY_SEPARATOR . $modulename . '.info.php')) { $infofile = file_get_contents(ROOT_MOD . $modulename . DIRECTORY_SEPARATOR . $modulename . '.info.php'); } else { $infofile = ''; } $view->assign('mod_settings_infofile', utf8_encode($infofile)); // -------------------------------------------- // read routes // -------------------------------------------- // -------------------------------------------- // output // -------------------------------------------- $view->assign('error', $error); $view->assign('success', $success); $this->display(); }
public function action_admin_settings() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Settings'), '/account/admin/settings'); $settings = array(); $settings['form'] = array('name' => 'account_settings', 'method' => 'POST', 'action' => '/account/admin/settings_update'); $settings['account'][] = array('id' => 'resultsPerPage_show', 'name' => 'resultsPerPage_show', 'label' => 'Newsitems', 'description' => _('Newsitems to show in Newsmodule'), 'formfieldtype' => 'text', 'value' => self::getConfigValue('resultsPerPage_show', '3')); $form = new Clansuite_Form($settings); #Clansuite_Debug::printR($form); $form->addElement('submitbutton')->setName('Save'); $form->addElement('resetbutton'); // display form html #Clansuite_Debug::printR($form->render()); // assign the html of the form to the view $this->getView()->assign('form', $form->render()); $this->display(); }
public function action_admin_settings() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Settings'), '/templatemanager/admin/settings'); $this->display(); }
/** * Action for displaying the Settings of a Module Users */ public function action_admin_settings() { // Set Pagetitle and Breadcrumbs Clansuite_Breadcrumb::add(_('Settings'), '/users/admin/settings'); $settings = array(); $settings['form'] = array('name' => 'users_settings', 'method' => 'POST', 'action' => '/users/admin/settings_update'); $settings['users'][] = array('id' => 'items_lastregisteredusers', 'name' => 'items_lastregisteredusers', 'label' => 'Label', 'description' => _('How many Last Users'), 'formfieldtype' => 'text', 'value' => self::getConfigValue('items_lastregisteredusers', '4')); $form = new Clansuite_Form($settings); $form->addElement('submitbutton')->setName('Save'); $form->addElement('resetbutton'); // assign the html of the form to the view $this->getView()->assign('form', $form->render()); $this->display(); }