function Load() { $this->SetData('style', $this->mStyle); $this->SetData('items', $this->mItems); $this->SetData('selected', $this->mSelected); parent::Load(); }
function _test_static($mode = null) { $analyser_program = '../tools/static_analysis/analyser.pl'; $root_directory = '..'; if (null !== $mode) { if ('text' == $mode || 'ajax' == $mode) { $text = ''; $tests = $_POST['tests']; if (false !== $tests) { if (preg_match('/^\\w+(,\\w+)*$/', $tests)) { $tests = explode(',', $tests); $command = $analyser_program . ' ' . $root_directory; foreach ($tests as $test) { $command .= ' -t ' . $test; } $text = `{$command} 2>&1`; } } if ('text' == $mode) { $data = array('Text' => ''); $main_view = new FramesView('general/text', $data); } else { $data = array('RootTag' => array('_tag' => 'result')); foreach (explode("\n", $text) as $line) { $data['RootTag'][] = array('_tag' => 'line', $line); } $main_view = new FramesView('general/xml', $data); } $main_view->Load(); } else { show_404(); } } else { $data = array('Tests' => array(), 'TestSets' => array()); $lines = `{$analyser_program} -m`; $lines = explode("\n", $lines); foreach ($lines as $line) { if (preg_match('/^\\t(.*)\\t(.*)$/', $line, $matches)) { $data['Tests'][$matches[1]] = $matches[2]; } } $this->pages_model->SetPageCode('admin_tools_test_static'); $this->main_frame->IncludeJs('javascript/admin/static_analysis.js'); $this->main_frame->IncludeJs('javascript/simple_ajax.js'); $this->main_frame->SetContentSimple('admin/tools/test/static', $data); $this->main_frame->load(); } }
/** * @brief Echo's out the byline */ function Load() { $this->SetData('reporters', $this->mReporters); $this->SetData('article_date', $this->mDate); parent::Load(); }
function Load() { // Validate the included comment. if (!is_numeric($this->mIncludedComment)) { if ($this->mIncludedComment == 'last') { $this->mIncludedComment = count($this->mComments); } else { $this->mIncludedComment = 1; } } $CI =& get_instance(); $this->SetData('Items', $this->mComments); $this->SetData('InnerView', 'comments/comment'); $this->SetData('InnerItemName', 'Comment'); $this->SetData('MaxPerPage', $this->mMaxPerPage); $this->SetData('PageLinkSpan', $this->mPageLinkSpan); $this->SetData('IncludedIndex', $this->mIncludedComment); $this->SetData('PageUrlPrefix', $CI->comment_views->GetUriPrefix()); $this->SetData('PageUrlPostfix', $CI->comment_views->GetUriPostfix() . '#comments'); $this->SetData('ThreadUrlPrefix', '/comments/thread/'); $this->SetData('ThreadUrlPostfix', ''); // for subviews (comments) foreach (array('Report' => 'report', 'Edit' => 'edit', 'Delete' => 'delete', 'Undelete' => 'undelete', 'Good' => 'flaggood', 'Ungood' => 'unflaggood') as $key => $value) { $this->SetData($key . 'UrlPrefix', '/comments/' . $value . '/'); $this->SetData($key . 'UrlPostfix', $CI->uri->uri_string()); } parent::Load(); }
function Load() { /// Process the data before loading $this->ProcessEvents($this->mData, $this->mCategories); /// Make some links if (NULL !== $this->mPaths && NULL !== $this->mRangeFormat && NULL !== $this->mStartTime && NULL !== $this->mEndTime) { $days = Academic_time::DaysBetweenTimestamps($this->mStartTime, $this->mEndTime); $start = new Academic_time($this->mStartTime); $end = new Academic_time($this->mEndTime); $now = new Academic_time(time()); $try_again = TRUE; if (0 === $start->AcademicDay() && 0 === $end->AcademicDay()) { $CI =& get_instance(); $terms_apart = ($end->AcademicYear() - $start->AcademicYear()) * 6 + $end->AcademicTerm() - $start->AcademicTerm(); // don't really need to scroll in years if (FALSE && $terms_apart >= 6) { $this->SetData('ForwardUrl', $this->GenerateRangeUrl($CI->academic_calendar->Academic($start->AcademicYear() + 1, $start->AcademicTerm(), $start->AcademicWeek()), $CI->academic_calendar->Academic($end->AcademicYear() + 1, $end->AcademicTerm(), $end->AcademicWeek()))); $this->SetData('BackwardUrl', $this->GenerateRangeUrl($CI->academic_calendar->Academic($start->AcademicYear() - 1, $start->AcademicTerm(), $start->AcademicWeek()), $CI->academic_calendar->Academic($end->AcademicYear() - 1, $end->AcademicTerm(), $end->AcademicWeek()))); $try_again = FALSE; } elseif ($terms_apart > 0) { $this->SetData('ForwardUrl', $this->GenerateRangeUrl($CI->academic_calendar->Academic($start->AcademicYear() + (5 === $start->AcademicTerm() ? 1 : 0), ($start->AcademicTerm() + 1) % 6, $start->AcademicWeek()), $CI->academic_calendar->Academic($end->AcademicYear() + (5 === $start->AcademicTerm() ? 1 : 0), ($end->AcademicTerm() + 1) % 6, $end->AcademicWeek()))); $this->SetData('BackwardUrl', $this->GenerateRangeUrl($CI->academic_calendar->Academic($start->AcademicYear() - (0 === $start->AcademicTerm() ? 1 : 0), ($start->AcademicTerm() + 5) % 6, $start->AcademicWeek()), $CI->academic_calendar->Academic($end->AcademicYear() - (0 === $start->AcademicTerm() ? 1 : 0), ($end->AcademicTerm() + 5) % 6, $end->AcademicWeek()))); $try_again = FALSE; } $this->SetData('NowUrl', $this->GenerateRangeUrl($CI->academic_calendar->Academic($now->AcademicYear(), $now->AcademicTerm(), 1), $CI->academic_calendar->Academic($now->AcademicYear() + (5 === $start->AcademicTerm() ? 1 : 0), ($now->AcademicTerm() + 1) % 6, 1))); $this->SetData('NowUrlLabel', 'This term'); } if ($try_again) { $now = $now->Midnight(); if ($days >= 7) { $forward_jump = '1week'; $now = $now->BackToMonday(); $this->SetData('NowUrlLabel', 'This week'); } else { $forward_jump = '1day'; $this->SetData('NowUrlLabel', 'Today'); } $this->SetData('ForwardUrl', $this->GenerateRangeUrl($start->Adjust($forward_jump), $end->Adjust($forward_jump))); $this->SetData('BackwardUrl', $this->GenerateRangeUrl($start->Adjust('-' . $forward_jump), $end->Adjust('-' . $forward_jump))); $this->SetData('NowUrl', $this->GenerateRangeUrl($now, $now->Adjust('+' . $forward_jump))); } } parent::Load(); }