public function page($slug = '') { // Invalid slug if (empty($slug)) { show_404(); } // We have slug, get page data $this->load->model('pages_m', 'page'); $pageData = $this->page->get_by('slug', $slug); // But first check if slug exists if (empty($pageData)) { show_404(); } // Check access rights if ($pageData->access == 'registered' && !$this->ion_auth->logged_in()) { show_404(); } if ($pageData->access == 'clan' && !$this->ion_auth->in_group('clan') && !$this->ion_auth->is_admin()) { show_404(); } // All is good, set custom layout if there is one if (!empty($pageData->layout)) { $customLayout = $pageData->layout; } else { $customLayout = get_layout(__CLASS__); } // Render page $this->template->set('data', $pageData)->set_layout($customLayout)->build('page.twig'); }
public function __construct() { parent::__construct(); $this->load->library('form_validation'); $this->redirect_to = $this->agent->referrer(); $this->template->set_layout(get_layout(__CLASS__)); }
public function __construct() { parent::__construct(); if (!$this->ion_auth->logged_in()) { redirect(); } $this->load->model('messages_m', 'msg'); $this->template->set_layout(get_layout(__CLASS__)); }
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * View note * @desc this page will view on author of notes * * @package local_note * @copyright 2015 MoodleOfIndia * @author shambhu kumar * @license MoodleOfIndia {@web http://www.moodleofindia.com} */ require_once './../../config.php'; require_once 'classes/note.php'; require_once 'locallib.php'; require_login(0, false); $PAGE->set_context(context_system::instance()); $PAGE->set_pagelayout(get_layout()); $PAGE->set_title(get_string('viewnote', 'local_note')); $PAGE->set_heading(get_string('viewnote', 'local_note')); $PAGE->set_url($CFG->wwwroot . '/local/note/view_all_note.php'); $note = new \moi\note($DB, $USER->id); $id = optional_param('id', false, PARAM_INT); $row = $note->get_note($id); $PAGE->navbar->add($row['title']); echo $OUTPUT->header(); echo html_writer::start_div('row'); if (!$note->haspermission($id)) { throw new moodle_exception('nopermissiontoshow'); } $content = html_writer::tag('p', $row['title'], ['class' => 'lead']); $link = html_writer::link(new moodle_url($CFG->wwwroot . '/user/profile.php?id=' . $row['publisherid']), $row['name']); $content .= html_writer::tag('p', get_string('author', 'local_note') . ' ' . $link);
function __construct() { parent::__construct(); $this->template->set_layout(get_layout(__CLASS__)); }
function check_invalid_results($element) { $acode = $element->activitycode; $jobid = $element->jobid; $labels = get_labels($acode, $jobid); //layout es un array de preguntas $layout = get_layout($acode); array_pop($layout); foreach ($layout as $numberofquestion) { $idqs = select_question($labels, $numberofquestion, $acode); $defaults = get_question_values($idqs, $acode, $jobid); if ($defaults !== null) { $sum = array_sum($defaults); //print('Suma :'.$sum); if ($sum > 1) { foreach ($idqs as $key => $params) { if ($params->questiontype == 'CIRCLE') { print 'actualizo ' . $params->label; set_field($table = 'blended_results', $field = 'invalid', $value = 1, $field2 = 'activitycode', $value2 = $acode, $field3 = 'jobid', $value3 = $jobid, $field4 = 'label', $value4 = $params->label); set_field($table = 'blended_results', $field = 'value', $value = 0, $field2 = 'activitycode', $value2 = $acode, $field3 = 'jobid', $value3 = $jobid, $field4 = 'label', $value4 = $params->label); } } } } } return; }
/** * Obtain question fields for a QUIZ attempt with $acode id * @param MoodleQuickForm $mform * @param unknown_type $acode * @param unknown_type $jobid * @param unknown_type $warnings */ function display_questions(MoodleQuickForm $mform, $acode, $jobid, $warnings) { $keys = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'); $rarray = array(); $iarray = array(); $keysarray = array(); $iresponses = array(); $labels = get_labels($acode, $jobid); //layout is the array with questions id. Warning does not correspond with actual order in page. $layout = get_layout($acode); $select = "activitycode={$acode} AND jobid={$jobid} AND label LIKE 'q%'"; $options = get_records_select('blended_results', $select, 'page, id'); /** * Convert to an array of questions */ $questions = array(); foreach ($options as $option) { $pos = strpos($option->label, '-'); $qid = substr($option->label, 1, $pos - 1); $questions[$qid][] = $option; } $i = 1; $page = -1; /** * iterate according with the fieldset order */ // print_object($questions);die; // foreach ($layout as $qid) foreach ($questions as $question) { //$question=$questions[(int)$qid]; $optpage = $question[0]->page; if ($page != $optpage) { $page = $optpage; $mform->addElement('static', 'PAGE' . $page, get_string('page', 'blended') . ' ' . $page); $mform->addElement('html', '<hr/>'); } //$idqs=select_question($labels,$numberofquestion,$acode); // $defaults=get_question_values($question,$acode,$jobid); $returnvalues = create_question($mform, $i, $question, $keys, $warnings); //,$defaults->invalid); $invalid = $returnvalues->invalid; if (isset($returnvalues->radioindex)) { $radioindex = $returnvalues->radioindex; } if ($radioindex !== null) { $rarray[$radioindex] = 1; } //creo un array con los numeros radiobutton if ($invalid !== null) { $iarray[$radioindex] = 1; //$iresponses[$radioindex] = $defaults; $ilabels = get_ilabels($defaults); $iname = 'ilabel' . $radioindex; $mform->addElement('hidden', $iname, $ilabels); } $i++; } if (count($iarray) !== 0) { //print_object($iarray); print "<CENTER>Por favor, corrija manualmente las respuestas inválidas</CENTER>"; } //print_object ($iarray); $keysarray = array_keys($rarray); $radiokeys = implode(',', $keysarray); $ikeysarray = array_keys($iarray); $invalidkeys = implode(',', $ikeysarray); // print_object ($invalidkeys); // print_object ($ilabels); $mform->addElement('hidden', 'radioindex', $radiokeys); if ($invalidkeys !== null) { $mform->addElement('hidden', 'invalidquestions', $invalidkeys); } return; }
function __construct() { parent::__construct(); $this->template->set_layout(get_layout('users')); // We need users since profile module does not exist }
<?php include_once 'admin_functions.php'; if (count($_POST)) { if (update_layout($_POST)) { header("Location: pages.php"); } } $link_info = get_link($_GET['id']); $layout = get_layout($_GET['id']); include 'common/header.php'; ?> <div id="page"> <div id="page-bgtop"> <div id="page-bgbtm"> <div id="content"> <h3 class="title">Edit Layout:</h3> <table width="100%"> <tr> <td><<<a href="pages.php"> Go back</a> <br /> <br /> </td> </tr> <tr> <td> <form method="post" action=""> <table width="100%" border="0"> <tr>
function layout($data = '', $layout = 'default', $base = 'index') { echo get_layout($data, $layout, $base); }
function include_raws() { if (!($layout =& get_layout())) { return; } foreach ($layout->get_raws() as $raw) { echo $raw . "\n"; } }
echo '<table id="thetopics" class="topics" summary="' . get_string('layouttable') . '">'; echo '<colgroup><col class="left" /><col class="content" /><col class="right" style="' . get_string('topcolltogglewidth', 'format_topcoll') . '" /></colgroup>'; // The string 'topcolltogglewidth' above can be set in the language file to allow for different lengths of words for different languages. // For example $string['topcolltogglewidth']='width: 42px;' - if not defined, then the default '#thetopics col.right' in topics_collapsed.css applies. /// If currently moving a file then show the current clipboard if (ismoving($course->id)) { $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname))); $strcancel = get_string('cancel'); echo '<tr class="clipboard">'; echo '<td colspan="3">'; echo $stractivityclipboard . ' (<a href="mod.php?cancelcopy=true&sesskey=' . $USER->sesskey . '">' . $strcancel . '</a>)'; echo '</td>'; echo '</tr>'; } // CONTRIB-3378 $layoutsetting = get_layout($course->id); if ($userisediting && has_capability('moodle/course:update', $coursecontext)) { echo '<tr class="section main">'; echo '<td class="left side"> </td>'; echo '<td class="content">'; echo '<a title="' . get_string('setlayout', 'format_topcoll') . '" href="format/topcoll/set_layout.php?id=' . $course->id . '&setelement=' . $layoutsetting->layoutelement . '&setstructure=' . $layoutsetting->layoutstructure . '&sesskey=' . sesskey() . '"><div id="set-layout"></div></a>'; echo '</td>'; echo '<td class="right side"> </td>'; echo '</tr>'; echo '<tr class="section separator"><td colspan="3" class="spacer"></td></tr>'; } /// Print Section 0 $section = 0; $thissection = $sections[$section]; if ($thissection->summary or $thissection->sequence or isediting($course->id)) { echo '<tr id="section-0" class="section main">';
<?php $widgets = get_widgets($id); $theme = get_layout(); if (null != $widgets) { $wid_count = 0; foreach ($widgets as $widget) { $page = $widget['page']; require APP_PATH . "/views/widgets/{$page}.php"; if (file_exists(APP_PATH . "/views/layouts/{$theme}/{$view}.php")) { $view = "layouts/{$theme}/{$view}.php"; } $data['wid_count'] = $wid_count; $this->load->view($view, $data); $wid_count++; } }
function create_new_attempt($quiz, $attemptnumber, $userid, $acode, $uniqueid, $timestamp) { global $CFG; $layarray = get_layout($acode); $layout = implode(',', $layarray); //print_object($layout); if (!$attemptnumber > 1 or !$quiz->attemptonlast or !($attempt = get_record('quiz_attempts', 'quiz', $quiz->id, 'userid', $userid, 'attempt', $attemptnumber - 1))) { // we are not building on last attempt so create a new attempt $attempt->quiz = $quiz->id; $attempt->userid = $userid; $attempt->preview = 0; $attempt->layout = $layout; } $attempt->attempt = $attemptnumber; $attempt->sumgrades = 0.0; $attempt->timestart = $timestamp; $attempt->timefinish = 0; $attempt->timemodified = $timestamp; $attempt->uniqueid = $uniqueid; //$attempt->id = $uniqueid; return $attempt; }
function __construct() { parent::__construct(); $this->template->set('logged_in', $this->ion_auth->logged_in())->set_layout(get_layout(__CLASS__)); }