コード例 #1
0
 function definition()
 {
     $mform =& $this->_form;
     //Is the & symbol for error supression needed?  Perhaps it is when $this->_form is not yet defined
     $mform->addElement('select', 'category', get_string('category'), category_menu());
     $options = array('rows' => 7);
     $mform->addElement('htmleditor', 'question', get_string('question'), $options);
     $mform->setType('question', PARAM_RAW);
     //Perhaps not filtering this is when multi-media is showing extra stuff.  Check into using something other than PARAM_RAW
     $mform->addElement('htmleditor', 'answer', get_string('answer'), $options);
     $mform->setType('answer', PARAM_RAW);
     $mform->addElement('text', 'reference', 'Reference', array('size' => '70'));
     unset($options);
     $options[0] = get_string("zerodef", "memorybank");
     $options[1] = get_string("onedef", "memorybank");
     $options[2] = get_string("twodef", "memorybank");
     $options[3] = get_string("threedef", "memorybank");
     $options[4] = get_string("fourdef", "memorybank");
     $options[5] = get_string("fivedef", "memorybank");
     $mform->addElement('select', 'initialgrade', get_string("initialgrade", "memorybank"), $options);
     $mform->setDefault('initialgrade', 4);
     $mform->addElement('checkbox', 'visible', get_string('visible'));
     $mform->setDefault('visible', true);
     $currentyear = date('Y');
     $options = array('startyear' => $currentyear, 'stopyear' => $currentyear + 1, 'timezone' => 99, 'applydst' => true, 'optional' => false);
     $mform->addElement('date_time_selector', 'initviewtime', get_string("nextviewing", "memorybank"), $options);
     $mform->setDefault('initviewtime', nextViewingDay() - 24 * 60 * 60);
     //$mform->disabledIf('visible', 'initviewtime[off]', 'checked');  //Check if this is working
     $instid = required_param('instid');
     $mform->addElement('hidden', 'instid', $instid);
     $mform->addElement('hidden', 'qid', null);
     $mform->addElement('hidden', 'what', 'add');
     $this->add_action_buttons();
     $what = optional_param('what', null);
     if ($what === 'edit') {
         $qid = required_param('qid');
         $question = get_record('memorybank_bank', 'id', $qid);
         $mform->setDefault('initialgrade', $question->initialgrade);
         $mform->setDefault('question', $question->question);
         $mform->setDefault('answer', $question->answer);
         $mform->setDefault('reference', $question->reference);
         $mform->setDefault('initviewtime', $question->initviewtime);
         $mform->setDefault('visible', $question->visible);
         $mform->setDefault('what', 'edit');
         $mform->setDefault('qid', $qid);
         $mform->setDefault('category', $question->modid);
     }
 }
コード例 #2
0
ファイル: index.php プロジェクト: norby1994/webaruhaz-repo
    <body>
        <div id="wrapper">
            <header class="title-head">
                <h1 class="cim pull-left"><a rel="external" href="/netshop/index.php"><img src="/netshop/img/header.png" alt="Netshop" /></a></h1>
				<?php 
require_once '/template/bejelentkezes-menu.php';
?>

				<br class="clearfix" />

				<nav>
					<ul>
						<?php 
require_once 'php/categories.php';
category_menu();
?>
					</ul>
				</nav>
			</header>
			<br class="clearfix" />

			<div id="core" class="landing pull-left">
				<h2>Üdvözlünk a NetShop oldalán!</h2>
				<h3 class="pull-center top5-title">Legújabb Termékeink</h3>
				<?php 
require_once "/php/connection.php";
$friss_termek = "SELECT * FROM termek WHERE rownum <= 6 ORDER BY termek_id DESC";
$stid = oci_parse($connect, $friss_termek);
if (!$stid) {
    $e = oci_error($connect);
コード例 #3
0
ファイル: locallib.php プロジェクト: kopohi/memorybank
function print_main_page($instid, $action = 'a')
{
    global $CFG, $USER;
    $currenttime = time();
    $thequestion = '-';
    $thereference = '-';
    $theanswer = '-';
    $qid = '';
    $thecategory = 0;
    $id = optional_param('id', 0);
    $qcount = count_records_select('memorybank_schedule', "userid = {$USER->id} AND nextviewing <= {$currenttime}");
    $select = "SELECT s.*";
    $from = "  FROM {$CFG->prefix}memorybank_schedule s\r\n        INNER JOIN {$CFG->prefix}memorybank_bank b ON (s.questionid=b.id)    \r\n    ";
    $where = " WHERE s.userid = {$USER->id} AND s.nextviewing <= {$currenttime} AND b.modid = '{$instid}'";
    $order = " ORDER BY s.nextviewing ASC";
    $sql = $select . $from . $where . $order;
    if (!($schedules = get_records_sql($sql))) {
        // echo('Error: No questions');
        //die;
    } else {
        $qcount = count($schedules);
        $schedule = array_shift($schedules);
        $select = "SELECT q.*";
        $from = "  FROM {$CFG->prefix}memorybank_bank q";
        $where = " WHERE q.id = {$schedule->questionid}";
        $order = " ORDER BY q.id DESC";
        $limit = " LIMIT 1";
        $sql = $select . $from . $where . $order . $limit;
        if (!($questions = get_records_sql($sql))) {
            echo 'ERROR: Questions missing';
        }
        foreach ($questions as $question) {
            break;
        }
        $formatoptions = new stdClass();
        $formatoptions->noclean = true;
        $formatoptions->para = false;
        $qid = $question->id;
        $thequestion = format_text($question->question, FORMAT_MOODLE, $formatoptions);
        $thereference = format_text($question->reference, FORMAT_MOODLE, $formatoptions);
        $theanswer = format_text($question->answer, FORMAT_MOODLE, $formatoptions);
        $thecategory = $question->modid;
    }
    $catlock = optional_param('catlock', 'false') == 'true';
    $catmenu = choose_from_menu(category_menu(), 'category', $thecategory, get_string('all_categories', 'memorybank'), '', '0', true, $catlock);
    $isteacher = false;
    global $USER;
    //echo $USER->username;
    //echo $CFG->mod_memorybank_teachers;
    $teachers = array('ganderson', 'bwoodman', 'admin', 'dchapin', 'connorgrosnick');
    //echo(count($teachers));
    //echo(' ');
    if (!empty($CFG->mod_memorybank_teachers)) {
        $teachers = explode(',', $CFG->mod_memorybank_teachers);
    }
    if (in_array($USER->username, $teachers, false)) {
        $isteacher = true;
    }
    //print_r( $teachers);
    //echo(count($teachers));
    //$isteacher = true;
    include 'mainform.html';
}
コード例 #4
0
ファイル: category.php プロジェクト: alx/douce-offensive
<?php

get_header();
?>

	<div id="menu-left" class="menu">
		<ul>
			<?php 
$current_cat = get_query_var('cat');
$category_menu = category_menu($current_cat);
echo $category_menu;
?>
		</ul>
	</div>

	<div id="content" class="autosize">
		
		<div id="photobook">
			
			<div class='nav'>
				<a class="next"><img src="<?php 
bloginfo('template_directory');
?>
/images/arrow_next.png"/></a>
			</div>

<?php 
$category_posts = new WP_Query("cat=" . $current_cat . "&showposts=-1");
if ($category_posts->have_posts()) {
    while ($category_posts->have_posts()) {
        $category_posts->the_post();
コード例 #5
0
ファイル: index.php プロジェクト: alx/douce-offensive
<?php

get_header();
?>

	<div id="menu-left" class="menu">
		<ul>
			<?php 
$category_menu = category_menu(get_query_var('cat'));
echo $category_menu;
?>
		</ul>
	</div>
	
	<div id="content" class="autosize">
		
		<div id="photobook">
			
			<div class='nav'>
				<a class="next"><img src="<?php 
bloginfo('template_directory');
?>
/images/arrow_next.png"/></a>
			</div>

<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>