/** * Breadcrumbs for the Perfectum Theme * * @version 1.0 * @since 1.0 * @author Daniel Noel-Davies * * @param array $block Array of block values * */ function block_pagination($block) { // Get instances... $objPage = coreObj::getPage(); $objTPL = coreObj::getTPL(); $breadcrumbs = $objPage->getOptions('breadcrumbs'); $length = sizeOf($breadcrumbs); // Check we have breadcrumbs to work with if (!empty($breadcrumbs)) { return false; } // Give this block a handle $objTPl->set_filenames(array('perfectum_breadcrumbs', Page::$THEME_ROOT . 'breadcrumbs.tpl')); // Loop through breadcrumbs and assign the array values to each template block foreach ($breadcrumbs as $index => $crumb) { if ($index < $length) { $objTPL->assign_block_vars('crumb', array('URL' => $crumb['url'], 'TITLE' => $crumb['name'])); // If this is the last crumb, make it un-clickable } else { $objTPL->assign_block_vars('crumb', array('TITLE' => $crumb['name'])); } } // Return the block's contents return $objTPL->get_html('perfectum_breadcrumbs'); }
/** * Gets the comment count on the specified id * * @version 1.0.0 * @since 1.0.0 * @author Richard Clifford, Dan Aldridge * * @return bool */ function makeSubmitForm() { $rand = rand(1, 99); $objTPL = coreObj::getTPL(); $objPage = coreObj::getPage(); $objSession = coreObj::getSession(); $objForm = coreObj::getForm(); $objTPL->set_filenames(array('submitCommentsForm_' . $rand => 'modules/core/template/comments/submitComment.tpl')); $objPage->addJSFile('/' . root() . 'scripts/comments.js'); $sess_id = $_SESSION[$this->module]['comment_' . $this->module_id] = md5(time() . $rand); $objTPL->assign_vars(array('FORM_START' => $objForm->start('comments', array('method' => 'POST', 'action' => $this->aURL[0] . '?mode=postComment')), 'FORM_END' => $objForm->finish(), 'SUBMIT' => $objForm->button('submit', 'Submit'), 'L_SUBMIT_COMMENT' => 'Submit a comment:', 'TEXTAREA' => $objForm->textarea('comment', ''), 'HIDDEN' => $objForm->inputbox('sessid', 'hidden', $sess_id) . $objForm->inputbox('module', 'hidden', $this->module))); //and then output the comments to the parent template $objTPL->assign_var_from_handle('_NEW_COMMENT', 'submitCommentsForm_' . $rand); return true; }