예제 #1
0
function forums_news()
{
    require_once AT_INCLUDE_PATH . '../mods/_standard/forums/lib/forums.inc.php';
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = 'SELECT E.approved, E.last_cid, C.* FROM ' . TABLE_PREFIX . 'course_enrollment E, ' . TABLE_PREFIX . 'courses C WHERE C.course_id in ' . $enrolled_courses . '  AND E.member_id=' . $_SESSION['member_id'] . ' AND E.course_id=C.course_id ORDER BY C.title';
    $rows_en_courses = queryDB($sql, array());
    if (count($rows_en_courses) > 0) {
        foreach ($rows_en_courses as $row) {
            $all_forums = get_forums($row['course_id']);
            if (is_array($all_forums)) {
                foreach ($all_forums as $forums) {
                    if (is_array($forums)) {
                        foreach ($forums as $forum_obj) {
                            $forum_obj['course_id'] = $row['course_id'];
                            $link_title = $forum_obj['title'];
                            $news[] = array('time' => $forum_obj['last_post'], 'object' => $forum_obj, 'alt' => _AT('forum'), 'thumb' => 'images/pin.png', 'course' => $system_courses[$row['course_id']]['title'], 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'pu=' . urlencode('mods/_standard/forums/forum/index.php?fid=' . $forum_obj['forum_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'forums.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'forums.title') . '</a>');
                        }
                    }
                }
            }
        }
    }
    return $news;
}
예제 #2
0
function blogs_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = "SELECT G.group_id, G.title, G.modules, T.course_id FROM " . TABLE_PREFIX . "groups G INNER JOIN " . TABLE_PREFIX . "groups_types  T USING (type_id) WHERE T.course_id IN {$enrolled_courses} ORDER BY G.title";
    $result = mysql_query($sql, $db);
    if ($result) {
        if (mysql_num_rows($result) > 0) {
            while ($row = mysql_fetch_assoc($result)) {
                if (strpos($row['modules'], '_standard/blogs') !== FALSE) {
                    // retrieve the last posted date/time from this blog
                    $sql = "SELECT MAX(date) AS date FROM " . TABLE_PREFIX . "blog_posts WHERE owner_type=" . BLOGS_GROUP . " AND owner_id={$row['group_id']}";
                    $date_result = mysql_query($sql, $db);
                    $row2 = mysql_fetch_assoc($date_result);
                    $last_updated = ' - ' . _AT('last_updated', AT_date(_AT('forum_date_format'), $row2['date'], AT_DATE_MYSQL_DATETIME));
                    $link_title = $row['title'];
                    $news[] = array('time' => $row2['date'], 'object' => $row, 'alt' => _AT('blogs'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-blogs_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/blogs/view.php?ot=' . BLOGS_GROUP . SEP . 'oid=' . $row['group_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'blog_posts.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'blog_posts.title') . '</a>');
                }
            }
        }
    }
    return $news;
}
예제 #3
0
function file_storage_news()
{
    global $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    // As personal files are listed in any enrolled courses of the student,
    // randomly pick one course for bouce.php
    $end_of_first_course = strpos($enrolled_courses, ",") - 1;
    $any_one_enrolled_course = substr($enrolled_courses, 1, $end_of_first_course ? $end_of_first_course : -1);
    $sql = "(SELECT date, file_id, file_name, owner_id course_id, description \n\t           FROM " . TABLE_PREFIX . "files \n\t          WHERE owner_type = " . WORKSPACE_COURSE . " AND owner_id IN " . $enrolled_courses . ")\n\t        UNION\n\t        (SELECT date, file_id, file_name, " . $any_one_enrolled_course . " course_id, description \n\t           FROM " . TABLE_PREFIX . "files\n\t          WHERE owner_type = " . WORKSPACE_PERSONAL . " AND owner_id = " . $_SESSION['member_id'] . ")\n\t        UNION\n\t        (SELECT f.date, f.file_id, f.file_name, gt.course_id, f.description \n\t           FROM " . TABLE_PREFIX . "files f, " . TABLE_PREFIX . "groups g, " . TABLE_PREFIX . "groups_types gt\n\t          WHERE owner_type = " . WORKSPACE_GROUP . " \n\t            AND f.owner_id = g.group_id \n\t            AND g.type_id = gt.type_id \n\t            AND gt.course_id IN " . $enrolled_courses . "\n\t            AND " . $_SESSION['member_id'] . " in \n\t               (select member_id \n\t                from " . TABLE_PREFIX . "groups_members gm \n\t                where gm.group_id = g.group_id))\n\t         ORDER BY date DESC";
    $rows_files = queryDB($sql, array());
    if (count($rows_files) > 0) {
        foreach ($rows_files as $row) {
            if ($row['description'] != "") {
                $filetext = $row['description'];
            } else {
                $filetext = $row['file_name'];
            }
            $sql = "SELECT course_id, home_links, main_links from %scourses WHERE course_id = %d";
            $row2 = queryDB($sql, array(TABLE_PREFIX, $row['course_id']), TRUE);
            // check if course has file storage enabled
            if (strstr($row2['home_links'], 'file_storage') || strstr($row2['main_links'], 'file_storage')) {
                $news[] = array('time' => $row['date'], 'object' => $row, 'course' => $system_courses[$row['course_id']]['title'], 'alt' => _AT('download'), 'thumb' => 'images/application_get.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/file_storage/index.php?download=1' . SEP . 'files[]=' . $row['file_id']) . '"' . (strlen($filetext) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($filetext, 'input.text') . '"' : '') . '>' . AT_print(validate_length($filetext, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'input.text') . '</a>');
            }
        }
    }
    return $news;
}
예제 #4
0
function blogs_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = "SELECT G.group_id, G.title, G.modules, T.course_id FROM %sgroups G INNER JOIN %sgroups_types  T USING (type_id) WHERE T.course_id IN %s ORDER BY G.title";
    $rows_enrolled = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $enrolled_courses));
    if (count($rows_enrolled) > 0) {
        foreach ($rows_enrolled as $row) {
            if (strpos($row['modules'], '_standard/blogs') !== FALSE) {
                // check for group membership before showing news.
                $sql = "SELECT member_id FROM %sgroups_members WHERE member_id=%d AND group_id= %d";
                $row_group_member = queryDB($sql, array(TABLE_PREFIX, $_SESSION['member_id'], $row['group_id']), TRUE);
                // check for course instructor, show blog news if so
                $sql = "SELECT member_id from %scourses WHERE member_id =%d";
                $row_instructor = queryDB($sql, array(TABLE_PREFIX, $_SESSION['member_id']));
                if (count($row_group_member) > 0 || count($row_instructor) > 0) {
                    // retrieve the last posted date/time from this blog
                    $sql = "SELECT MAX(date) AS date FROM %sblog_posts WHERE owner_type=%d AND owner_id=%d";
                    $row2 = queryDB($sql, array(TABLE_PREFIX, BLOGS_GROUP, $row['group_id']), TRUE);
                    $last_updated = ' - ' . _AT('last_updated', AT_date(_AT('forum_date_format'), $row2['date'], AT_DATE_MYSQL_DATETIME));
                    $link_title = $row['title'];
                    $news[] = array('time' => $row2['date'], 'object' => $row, 'alt' => _AT('blogs'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-blogs_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/blogs/view.php?ot=' . BLOGS_GROUP . SEP . 'oid=' . $row['group_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'blog_posts.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'blog_posts.title') . '</a>');
                }
            }
        }
    }
    return $news;
}
예제 #5
0
function print_entry2($row)
{
    global $page, $system_courses, $forum_info;
    static $counter;
    $counter++;
    $reply_link = '<a href="forum/view.php?fid=' . $row['forum_id'] . SEP . 'pid=';
    if ($row['parent_id'] == 0) {
        $reply_link .= $row['post_id'];
    } else {
        $reply_link .= $row['parent_id'];
    }
    $reply_link .= SEP . 'reply=' . $row['post_id'] . SEP . 'page=' . $page . '#post" >' . _AT('reply') . '</a>';
    ?>

	<li class="<?php 
    if ($counter % 2) {
        echo 'odd';
    } else {
        echo 'even';
    }
    ?>
">
		<a name="<?php 
    echo $row['post_id'];
    ?>
"></a>
		<div class="forum-post-author">
			<label class="title"><?php 
    echo htmlspecialchars(get_display_name($row['member_id']));
    ?>
</label><br />
		</div>

		<div class="forum-post-content">
			
			<div class="date">
                <p><?php 
    echo AT_date(_AT('forum_date_format'), $row['date'], AT_DATE_MYSQL_DATETIME);
    ?>
</p>
            </div>
            <div class="postheader"><h3><?php 
    echo AT_Print($row['subject'], 'forums_threads.subject');
    ?>
</h3></div>
				
			<div class="body">
				<p><?php 
    echo AT_print($row['body'], 'forums_threads.body');
    ?>
</p>
			</div>
		</div>
	</li>
<?php 
}
예제 #6
0
function file_storage_news() {
	global $db, $enrolled_courses, $system_courses;
	$news = array();

	if ($enrolled_courses == '') {
		return $news;
	}
	
	// As personal files are listed in any enrolled courses of the student,
	// randomly pick one course for bouce.php
	$end_of_first_course = strpos($enrolled_courses, ",") - 1;
	$any_one_enrolled_course = substr($enrolled_courses, 1, $end_of_first_course ? $end_of_first_course : -1);
	
	$sql = "(SELECT date, file_id, file_name, owner_id course_id, description 
	           FROM ".TABLE_PREFIX."files 
	          WHERE owner_type = ".WORKSPACE_COURSE." AND owner_id IN ".$enrolled_courses.")
	        UNION
	        (SELECT date, file_id, file_name, ".$any_one_enrolled_course." course_id, description 
	           FROM ".TABLE_PREFIX."files
	          WHERE owner_type = ".WORKSPACE_PERSONAL." AND owner_id = ".$_SESSION['member_id'].")
	        UNION
	        (SELECT f.date, f.file_id, f.file_name, gt.course_id, f.description 
	           FROM ".TABLE_PREFIX."files f, ".TABLE_PREFIX."groups g, ".TABLE_PREFIX."groups_types gt
	          WHERE owner_type = ".WORKSPACE_GROUP." 
	            AND f.owner_id = g.group_id 
	            AND g.type_id = gt.type_id 
	            AND gt.course_id IN ".$enrolled_courses.")
	         ORDER BY date DESC";
	$result = mysql_query($sql, $db);
	
	if($result){
		while($row = mysql_fetch_assoc($result)){
			if($row['description'] !=""){
				$filetext = $row['description'];
			} else {
				$filetext = $row['file_name'];
			}
			$news[] = array('time'=>$row['date'], 
			      'object'=>$row, 
			      'course'=>$system_courses[$row['course_id']]['title'],
			      'alt'=>_AT('download'),
			      'thumb'=>'images/application_get.png', 
			      'link'=>'<a href="bounce.php?course='.$row['course_id'].SEP.'p='.urlencode('mods/_standard/file_storage/index.php?download=1'.SEP.'files[]='. $row['file_id']).'"'.
		          (strlen($filetext) > SUBLINK_TEXT_LEN ? ' title="'.AT_print($filetext, 'input.text').'"' : '') .'>'. 
		          AT_print(validate_length($filetext, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'input.text') .'</a>');
		}
	}
	return $news;
}
예제 #7
0
function faq_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = "SELECT * FROM %sfaq_topics T INNER JOIN %sfaq_entries E ON T.topic_id = E.topic_id WHERE T.course_id IN %s ORDER BY E.revised_date DESC";
    $rows_faqs = queryDB($sql, array(TABLE_PREFIX, TABLE_PREFIX, $enrolled_courses));
    if (count($rows_faqs) > 0) {
        foreach ($rows_faqs as $row) {
            $news[] = array('time' => $row['revised_date'], 'alt' => _AT('faq'), 'object' => $row, 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-faq_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/faq/index.php#' . $row['entry_id']) . '"' . (strlen($row['question']) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($row['question'], 'faqs.question') . '"' : '') . '>' . AT_print(validate_length($row['question'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'faqs.question') . '</a>');
        }
    }
    return $news;
}
예제 #8
0
function polls_news()
{
    global $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = "SELECT * FROM %spolls WHERE course_id IN %s ORDER BY created_date DESC";
    $rows_polls = queryDB($sql, array(TABLE_PREFIX, $enrolled_courses));
    if (count($rows_polls) > 0) {
        foreach ($rows_polls as $row) {
            $news[] = array('time' => $row['created_date'], 'object' => $row, 'alt' => _AT('polls'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-polls_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/polls/index.php#' . $row['poll_id']) . '"' . (strlen($row['question']) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($row['question'], 'polls.question') . '"' : '') . '>' . AT_print(validate_length($row['question'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'polls.question') . '</a>');
        }
    }
    return $news;
}
예제 #9
0
function polls_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'polls WHERE course_id IN' . $enrolled_courses . ' ORDER BY created_date DESC';
    $result = mysql_query($sql, $db);
    if ($result) {
        while ($row = mysql_fetch_assoc($result)) {
            $news[] = array('time' => $row['created_date'], 'object' => $row, 'alt' => _AT('polls'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-polls_sm.png', 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'p=' . urlencode('mods/_standard/polls/index.php#' . $row['poll_id']) . '"' . (strlen($row['question']) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($row['question'], 'polls.question') . '"' : '') . '>' . AT_print(validate_length($row['question'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'polls.question') . '</a>');
        }
    }
    return $news;
}
예제 #10
0
function get_additions($sql, $sqlParams, $module, $module_name, $group_id)
{
    global $_base_path;
    $record_limit = 3;
    $str = '';
    $rows = queryDB($sql, $sqlParams);
    if (count($rows) > 0) {
        echo "<h4 class = 'page-title'>" . $module->getName() . "</h4>";
        $str .= '<ol id = "tools"><li class = "top-tool">';
        foreach ($rows as $row) {
            switch ($module_name) {
                case _AT('forums'):
                    $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/forums/forum/view.php?fid=' . $row[forum_id] . SEP . 'pid=' . $row['post_id']) . '" title="' . AT_print($full_subject, 'forums_threads.subject') . '">' . $row['subject'] . '</a></br>';
                    break;
                case _AT('file_storage'):
                    if ($row['description'] != "") {
                        $filetext = $row['description'];
                    } else {
                        $filetext = $row['file_name'];
                    }
                    $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/file_storage/index.php?download=1' . SEP . 'files[]=' . $row['file_id']) . '"' . (strlen($filetext) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($filetext, 'input.text') . '"' : '') . '>' . AT_print(validate_length($filetext, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'input.text') . '</a><br/>';
                    break;
                case _AT('blogs'):
                    $link_title = $row['title'];
                    $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/blogs/post.php?ot=' . BLOGS_GROUP . SEP . 'oid=' . $group_id . SEP . 'id=' . $row['post_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'blog_posts.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'blog_posts.title') . '</a><br/>';
                    break;
                case _AT('links'):
                    $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/links/index.php?view=' . $row['link_id']) . '"' . (strlen($row['LinkName']) > SUBLINK_TEXT_LEN ? ' title="' . $row['LinkName'] . '"' : '') . '>' . validate_length($row['LinkName'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a><br/>';
                    break;
                default:
                    return 0;
                    break;
            }
        }
        $str .= "</li></ol>";
        echo $str;
        return 1;
    } else {
        return 0;
    }
}
예제 #11
0
function forums_news()
{
    global $db, $enrolled_courses, $system_courses;
    $news = array();
    if ($enrolled_courses == '') {
        return $news;
    }
    $sql = 'SELECT E.approved, E.last_cid, C.* FROM ' . TABLE_PREFIX . 'course_enrollment E, ' . TABLE_PREFIX . 'courses C WHERE C.course_id in ' . $enrolled_courses . '  AND E.member_id=' . $_SESSION['member_id'] . ' AND E.course_id=C.course_id ORDER BY C.title';
    $rows_en_courses = queryDB($sql, array());
    if (count($rows_en_courses) > 0) {
        foreach ($rows_en_courses as $row) {
            $all_forums = get_forums($row['course_id']);
            if (is_array($all_forums)) {
                foreach ($all_forums as $forums) {
                    if (is_array($forums)) {
                        foreach ($forums as $forum_obj) {
                            $latest_post = get_last_post($forum_obj['forum_id']);
                            $forum_obj['course_id'] = $row['course_id'];
                            $link_title = $forum_obj['title'];
                            // attached the first 120 characters of the message to the news item
                            if (strlen($latest_post[0]['body']) > 120) {
                                $last_post = substr($latest_post[0]['body'], 0, 120) . '...';
                            } else {
                                $last_post = $latest_post[0]['body'];
                            }
                            // if this is the only message in a thread, replace parent_id with the post_id
                            if ($latest_post[0]['parent_id'] == 0) {
                                $latest_post[0]['parent_id'] = $latest_post[0]['post_id'];
                            }
                            if ($latest_post[0]['subject'] != '') {
                                $news[] = array('time' => $forum_obj['last_post'], 'object' => $forum_obj, 'alt' => _AT('forum'), 'thumb' => 'images/pin.png', 'course' => $system_courses[$row['course_id']]['title'], 'link' => '<a href="bounce.php?course=' . $row['course_id'] . SEP . 'pu=' . urlencode('mods/_standard/forums/forum/view.php?fid=' . $forum_obj['forum_id'] . SEP . 'pid=' . $latest_post[0]['parent_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'forums.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'forums.title') . ': ' . $latest_post[0]['subject'] . ' </a> - ' . $last_post);
                            }
                        }
                    }
                }
            }
        }
    }
    return $news;
}
예제 #12
0
    if (empty($list)) {
        ?>
			<tr>
				<td colspan="4"><?php 
        echo _AT('none_found');
        ?>
</td>
			</tr><?php 
        $num_backups++;
    } else {
        foreach ($list as $row) {
            echo '<tr onmousedown="document.form1[\'c' . $row['backup_id'] . '_' . $row['course_id'] . '\'].checked = true; rowselect(this);" id="r_' . $row['backup_id'] . '"><td><input type="radio" value="' . $row['backup_id'] . '_' . $row['course_id'] . '" name="backup_id" id="c' . $row['backup_id'] . '_' . $row['course_id'] . '" />';
            echo '<label for="c' . $row['backup_id'] . '_' . $row['course_id'] . '">' . $row['file_name'] . '</label></td>';
            echo '<td>' . AT_date(_AT('filemanager_date_format'), $row['date_timestamp'], AT_DATE_UNIX_TIMESTAMP) . '</td>';
            echo '<td align="right" class="hidecol480">' . get_human_size($row['file_size']) . '</td>';
            echo '<td class="hidecol480">' . AT_print($row['description'], 'backups.description') . '</td>';
            echo '</tr>';
            $num_backups++;
        }
    }
}
if (!$num_backups) {
    ?>
	<tr>
		<td colspan="4"><?php 
    echo _AT('none_found');
    ?>
</td>
	</tr>
<?php 
}
예제 #13
0
echo _AT('title');
?>
</label><br />
		<input type="text" name="title" size="40" id="title" value="<?php 
echo htmlspecialchars(stripslashes($this->row['title']));
?>
" />
	</div>

	<div class="row">
		<label for="body"><?php 
echo _AT('description');
?>
</label><br />
		<textarea name="body" cols="40" rows="2" id="body" wrap="wrap"><?php 
echo AT_print($this->row['description'], 'input.text');
?>
</textarea>
	</div>

	<div class="row">
		<label for="edit"><?php 
echo _AT('allow_editing');
?>
</label><br />
		<input type="text" name="edit" size="3" id="edit" value="<?php 
echo intval($this->row['mins_to_edit']);
?>
" /> <?php 
echo _AT('in_minutes');
?>
예제 #14
0
function get_home_navigation($home_array = '')
{
    global $_pages, $_list, $_base_path, $_tool;
    // set default home_array to course index navigation array
    if (!is_array($home_array)) {
        $home_array = $_pages[AT_NAV_HOME];
    }
    $home_links = array();
    foreach ($home_array as $child) {
        //esecuzione del ciclo fin quando non saranno terminati i moduli presenti nella home-page del corso
        if (page_available($child)) {
            // initialization
            $title = $icon = $sub_file = $image = $text = $tool_file = $table = '';
            if (isset($_pages[$child]['title'])) {
                //viene prelevato il titolo che dovr� poi essere utilizzato nella visualizzazione
                $title = $_pages[$child]['title'];
            } else {
                $title = _AT($_pages[$child]['title_var']);
            }
            if (isset($_pages[$child]['icon'])) {
                //si controlla se è presente l'icona inserita nel modulo di rifrimento. si ricorda che l'icona � inserita solo per i moduli che prevedono possibili sottocontenuti.
                $icon = AT_print($_base_path, 'url.page') . $_pages[$child]['icon'];
                //in caso positivo viene prelevata e inserita in una variabile di appoggio che poi sar� a sua volta inserita all'interno dell'array finale home_links[]
            }
            if (isset($_pages[$child]['text'])) {
                //nel caso in cui non sia presente un' icona associata si controlla se � stato settata il testo (per moduli privi di sottocontenuti).
                $text = $_pages[$child]['text'];
                //il testo viene inserito in una variabile d'appoggio e successivamente nell'array.
            }
            if (isset($_list[$_pages[$child]['title_var']])) {
                //viene prelevato il path del file che dovr� poi essere richiamato nella visualizzazione dei sottocontenuti. solo i moduli che prevedono sottocontenuti avranno un file di riferimento.
                $sub_file = $_list[$_pages[$child]['title_var']]['file'];
            }
            if (isset($_tool[$_pages[$child]['title_var']])) {
                //viene prelevato il file nel caso in cui lo strumento sia valido per essere inserito nella toolbar in fase di editing dei conenuti del corso
                $tool_file = $_tool[$_pages[$child]['title_var']]['file'];
                $table = $_tool[$_pages[$child]['title_var']]['table'];
            }
            $real_image_in_theme = AT_INCLUDE_PATH . '../themes/' . $_SESSION['prefs']['PREF_THEME'] . '/' . $_pages[$child]['img'];
            $image_in_theme = AT_print($_base_path, 'url.page') . 'themes/' . $_SESSION['prefs']['PREF_THEME'] . '/' . $_pages[$child]['img'];
            // look for images in theme folder. If not exists, use images relative to ATutor root folder
            if (file_exists($real_image_in_theme)) {
                $image = $image_in_theme;
            } else {
                $image = AT_print($_base_path, 'url.page') . $_pages[$child]['img'];
            }
            // inclusion of all data necessary for displaying the modules on the home-page. Set by default to check the visible because the modules will be loaded all visible in the home.
            $home_links[] = array('url' => AT_print($_base_path, 'url.page') . url_rewrite($child), 'title' => $title, 'img' => $image, 'icon' => $icon, 'text' => $text, 'sub_file' => $sub_file, 'tool_file' => $tool_file, 'table' => $table);
        }
    }
    return $home_links;
}
예제 #15
0
						<textarea name="body_text" id="body_text" rows="15" class="formfield" style="width: 99%;"></textarea>
					</td>
				</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="1" class="row2" colspan="2"></td>
		</tr>
		<tr>
			<td colspan="2" valign="top" align="center" class="row1">
				<input type="button" name="paste"  value="<?php 
echo _AT('paste');
?>
" class="button" onclick="javascript:insertTo('<?php 
echo AT_print($area, 'input.text');
?>
');" />
			</td>
		</tr>
	</table>
</form>
<br />


<script type="text/javascript">
<!--
function insertTo(field) {
  if (window.opener.document.getElementById(field)) {
    //use the following if we want to apply absolute path.	-harris.
    //window.opener.document.getElementById(field).value = tinyMCE.activeEditor.getContent({format : 'raw'});
예제 #16
0
'].checked = true;rowselect(this);" id="r_<?php 
            echo $id;
            ?>
">
			<td width="10"><input type="radio" name="cat_id" value="<?php 
            echo $id;
            ?>
" id="m<?php 
            echo $id;
            ?>
" /></td>
			<td><label for="m<?php 
            echo $id;
            ?>
"><?php 
            echo AT_print($row['cat_name'], 'members.first_name');
            ?>
</label></td>
			<td><?php 
            echo $parent_cat_name;
            ?>
</td>
		</tr>
		</tbody>

<?php 
        }
    }
} else {
    ?>
	<tr>
예제 #17
0
<?php

global $addslashes;
//escape all strings
$university = AT_print($this->university, 'input.text');
$country = AT_print($this->country, 'input.text');
$province = AT_print($this->province, 'input.text');
$degree = AT_print($this->degree, 'input.text');
$field = AT_print($this->field, 'input.text');
$from = AT_print($this->from, 'input.text');
$to = AT_print($this->to, 'input.text');
$description = AT_print($this->description, 'input.text');
?>
<script type='text/javascript' src='jscripts/lib/calendar.js'></script>
<script type="text/javascript"> 
<!--
	//overwrite calendar dates range settings.
	scwBaseYear			= scwDateNow.getFullYear()-50; 
	scwDropDownYears	= 70; 
-->
</script>
<div class="headingbox"><h3><?php 
if ($_GET['id']) {
    echo _AT('edit_education');
} else {
    echo _AT('add_new_education');
}
?>
</h3></div>
<div class="contentbox">
<form method="post" action="<?php 
예제 #18
0
        ?>
" target="_new" title="<?php 
        echo AT_print($row['LinkName'], 'links.LinkName');
        ?>
"><?php 
        echo AT_print($row['LinkName'], 'links.LinkName');
        ?>
</a></td>
			<td><?php 
        if (empty($row['name'])) {
            $row['name'] = get_group_name($row['owner_id']);
        }
        echo AT_print($row['name'], 'links.name');
        ?>
</td>
			<td><?php 
        echo AT_print($row['Description'], 'links.Description');
        ?>
</td>
		</tr>
	<?php 
    }
} else {
    echo sprintf('<td colspan="3">%s</td>', _AT('none_found'));
}
?>
</tbody>
</table>

<?php 
require AT_INCLUDE_PATH . 'footer.inc.php';
예제 #19
0
<?php function print_data_table($result, $type) {
	if (@mysql_num_rows($result) == 0) return;
?>
<h3><?php if ($type == DESKTOP_DEVICE) echo _AT('themes_for_desktop'); else echo _AT('themes_for_mobile');?></h3><br />
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get" name="form_<?php echo $type; ?>">
<input type="hidden" name="type" value="<?php echo $type; ?>" />
<table class="data" summary="" rules="cols">
<thead>
<tr>
	<th scope="col">&nbsp;</th>
	<th scope="col"><?php echo _AT('title'); ?></th>
	<th scope="col"><?php echo _AT('status'); ?></th>
	<th scope="col"><?php echo _AT('version'); ?></th>
	<th scope="col"><?php echo _AT('directory_name'); ?></th>
	<th scope="col"><?php echo _AT('description'); ?></th>
	<th scope="col"><?php echo _AT('theme_screenshot'); ?></th>
</tr>
</thead>
<tfoot>
<tr>
	<td colspan="7">
		<input type="submit" name="preview"  value="<?php echo _AT('preview'); ?>" />
		<input type="submit" name="enable"  value="<?php echo _AT('enable'); ?>" />
		<input type="submit" name="disable" value="<?php echo _AT('disable'); ?>" />
		<input type="submit" name="default" value="<?php echo _AT('set_default').'&nbsp;'; if ($type == DESKTOP_DEVICE) echo _AT('desktop_theme'); else echo _AT('mobile_theme'); ?>" />
		<input type="submit" name="export"  value="<?php echo _AT('export'); ?>" />
		<input type="submit" name="delete"  value="<?php echo _AT('delete'); ?>" />
	</td>
</tr>
</tfoot>
<?php while($row = mysql_fetch_assoc($result)) : ?>
	<tbody>
	<tr onmousedown="document.form_<?php echo $type; ?>['t_<?php echo $row['dir_name']; ?>'].checked = true; rowselect(this);" id="r_<?php echo $row['dir_name']; ?>">
		<td valign="top">
			<input type="radio" id="t_<?php echo $row['dir_name']; ?>" name="theme_dir" value="<?php echo $row['dir_name']; ?>" />
			<input type="hidden" name="<?php echo $row['dir_name']; ?>_version" value="<?php echo $row['version']; ?>" />
		</td>
		<td nowrap="nowrap" valign="top"><label for="t_<?php echo $row['dir_name']; ?>"><?php echo AT_print($row['title'], 'themes.title'); ?></label></td>
		<td valign="top"><?php
			if ($row['status'] == 0) {
				echo _AT('disabled');
			} else if ($row['status'] == 1) {
				echo _AT('enabled');
			} else if (($type == DESKTOP_DEVICE && $row['status'] == 2) || ($type == MOBILE_DEVICE && $row['status'] == 3)) {
				echo '<strong>'._AT('default').'</strong>'; 
			}
			?>
		</td>
		<td valign="top"><?php echo $row['version']; ?></td>
		<td valign="top"><code><?php echo $row['dir_name']; ?>/</code></td>
		<td valign="top"><?php echo $row['extra_info']; ?></td>
		<td valign="top"><?php
			if (file_exists('../../../themes/'.$row['dir_name'].'/screenshot.jpg')) { ?>
				  <img src="<?php echo AT_BASE_HREF; ?>themes/<?php echo $row['dir_name']; ?>/screenshot.jpg" border="1" alt="<?php echo _AT('theme_screenshot'); ?>" />
			<?php		
			} else if (file_exists('../../../themes/'.$row['dir_name'].'/screenshot.gif')) { ?>
				 <img src="<?php echo AT_BASE_HREF; ?>themes/<?php echo $row['dir_name']; ?>/screenshot.gif" border="1" alt="<?php echo _AT('theme_screenshot'); ?>" />
			<?php } ?>
		</td>
	</tr>
	</tbody>
<?php endwhile; ?>
</table>
</form>
<?php
}
예제 #20
0
        }
        ?>
/></td>
			<td><?php 
        echo _AT($_rl_types[$row['type']]);
        ?>
</td>
			<td><label for="t<?php 
        echo $row['resource_id'];
        ?>
"><strong><?php 
        echo AT_print($row['title'], 'input.text');
        ?>
</strong></label></td>
			<td><?php 
        echo AT_print($row['author'], 'input.text');
        ?>
</td>
			</tr>
		<?php 
    } while ($row = mysql_fetch_assoc($result));
    ?>
</tbody>
<?php 
} else {
    ?>
	<tr>
		<td colspan="2"><strong><?php 
    echo _AT('none_found');
    ?>
</strong></td>
예제 #21
0
<p><?php echo AT_print($this->row['question'], 'tests_questions.question'); ?></p>

<?php if ($this->row['properties'] == 1): /* one word */ ?>
	<input type="text" name="answers[<?php echo $this->row['question_id']; ?>]" class="formfield" size="15" value="<?php echo htmlspecialchars($this->response); ?>" />

<?php elseif ($this->row['properties'] == 2): /* sentence */ ?>
	<input type="text" name="answers[<?php echo $this->row['question_id']; ?>]" class="formfield" size="45" value="<?php echo htmlspecialchars($this->response); ?>" />

<?php elseif ($this->row['properties'] == 3): /* paragraph */ ?>
	<textarea cols="55" rows="5" name="answers[<?php echo $this->row['question_id']; ?>]" class="formfield"><?php echo htmlspecialchars($this->response); ?></textarea>

<?php elseif ($this->row['properties'] == 4): /* page */ ?>
	<textarea cols="55" rows="25" name="answers[<?php echo $this->row['question_id']; ?>]" class="formfield"><?php echo htmlspecialchars($this->response); ?></textarea>

<?php endif; ?>
예제 #22
0
			<td width="10"><input type="radio" name="id" value="<?php 
        echo $row['forum_id'];
        ?>
" id="f<?php 
        echo $row['forum_id'];
        ?>
" /></td>
			<td><label for="f<?php 
        echo $row['forum_id'];
        ?>
"><?php 
        echo AT_print($row['title'], 'forums.title');
        ?>
</label></td>
			<td><?php 
        echo AT_print($row['description'], 'forums.description');
        ?>
</td>
			<!-- REMOVED FOR MOBILE <td>
				<?php 
        if (!$row['mins_to_edit']) {
            ?>
					<?php 
            echo _AT('no');
            ?>
				<?php 
        } else {
            ?>
					<?php 
            echo _AT('minutes', $row['mins_to_edit']);
            ?>
예제 #23
0
    $news = array();
} else {
    $sql = "SELECT COUNT(*) AS cnt FROM " . TABLE_PREFIX . "news WHERE course_id={$course_id}";
    $result = mysql_query($sql, $db);
}
if ($result && ($row = mysql_fetch_assoc($result))) {
    $num_results = $row['cnt'];
    $results_per_page = NUM_ANNOUNCEMENTS;
    $num_pages = ceil($num_results / $results_per_page);
    $count = ($page - 1) * $results_per_page + 1;
    $offset = ($page - 1) * $results_per_page;
    $sql = "SELECT N.*, DATE_FORMAT(N.date, '%Y-%m-%d %H:%i:%s') AS date, first_name, last_name \n\t          FROM " . TABLE_PREFIX . "news N, " . TABLE_PREFIX . "members M \n\t         WHERE N.course_id={$course_id} \n\t           AND N.member_id = M.member_id\n\t         ORDER BY date DESC LIMIT {$offset}, {$results_per_page}";
    $result = mysql_query($sql, $db);
    while ($row = mysql_fetch_assoc($result)) {
        /* this can't be cached because it called _AT */
        $news[$row['news_id']] = array('date' => AT_date(_AT('announcement_date_format'), $row['date'], AT_DATE_MYSQL_DATETIME), 'author' => $row['first_name'] . ' ' . $row['last_name'], 'title' => AT_print($row['title'], 'news.title'), 'body' => format_content($row['body'], $row['formatting'], $glossary));
    }
}
$sql = "SELECT banner FROM " . TABLE_PREFIX . "courses WHERE course_id={$course_id}";
$result = mysql_query($sql, $db);
if ($row = mysql_fetch_assoc($result)) {
    $savant->assign('banner', AT_print($row['banner'], 'courses.banner'));
} else {
    $savant->assign('banner', '');
}
$savant->assign('view_mode', $home_view);
$savant->assign('announcements', $news);
$savant->assign('num_pages', $num_pages);
$savant->assign('current_page', $page);
$savant->display('index.tmpl.php');
require AT_INCLUDE_PATH . 'footer.inc.php';
예제 #24
0
        } else {
            $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
            header('Location: index.php?fid=' . $fid);
            exit;
        }
    }
}
$_pages['mods/_standard/forums/forum/index.php?fid=' . $fid]['title'] = get_forum_name($fid);
$_pages['mods/_standard/forums/forum/index.php?fid=' . $fid]['parent'] = 'forum/list.php';
$_pages['mods/_standard/forums/forum/index.php?fid=' . $fid]['children'] = array('mods/_standard/forums/forum/new_thread.php?fid=' . $fid);
$_pages['mods/_standard/forums/forum/new_thread.php?fid=' . $fid]['title_var'] = 'new_thread';
$_pages['mods/_standard/forums/forum/new_thread.php?fid=' . $fid]['parent'] = 'mods/_standard/forums/forum/index.php?fid=' . $fid;
$_pages['mods/_standard/forums/forum/view.php']['title'] = $post_row['subject'];
$_pages['mods/_standard/forums/forum/view.php']['parent'] = 'forum/index.php?fid=' . $fid;
$_pages['mods/_standard/forums/forum/delete_thread.php']['title_var'] = 'delete_post';
$_pages['mods/_standard/forums/forum/delete_thread.php']['parent'] = 'mods/_standard/forums/forum/index.php?fid=' . $fid;
$_pages['mods/_standard/forums/forum/delete_thread.php']['children'] = array();
require AT_INCLUDE_PATH . 'header.inc.php';
$sql = "SELECT * from %sforums_threads WHERE post_id = %d";
$row = queryDB($sql, array(TABLE_PREFIX, $pid), TRUE);
$title = AT_print($row['subject'], 'forums_threads.subject');
$hidden_vars['fid'] = $_GET['fid'];
$hidden_vars['pid'] = $_GET['pid'];
$hidden_vars['ppid'] = $_GET['ppid'];
$hidden_vars['nest'] = $_GET['nest'];
$msg->addConfirm(array('DELETE', $title), $hidden_vars);
if ($ppid == '' || $ppid == '0') {
    $ppid = '0';
}
$msg->printConfirm();
require AT_INCLUDE_PATH . 'footer.inc.php';
예제 #25
0
<?php

if (!defined('AT_INCLUDE_PATH')) {
    exit;
}
$polls_limit = 3;
//Numero massimo dei possibili sottocontenuti visualizzabili nella home-page
$sql = "SELECT poll_id, question FROM %spolls WHERE course_id=%d ORDER BY created_date DESC LIMIT %d";
$rows_polls = queryDB($sql, array(TABLE_PREFIX, $_SESSION['course_id'], $polls_limit));
if (count($rows_polls) > 0) {
    foreach ($rows_polls as $row) {
        $list[] = '<a href="' . url_rewrite('mods/_standard/polls/index.php#' . $row['poll_id'], AT_PRETTY_URL_IS_HEADER) . '"' . (strlen($row['question']) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($row['question'], 'polls.question') . '"' : '') . '>' . AT_print(validate_length($row['question'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'polls.question') . '</a>';
    }
    return $list;
} else {
    return 0;
}
예제 #26
0
                echo '<small>' . AT_print($row['choice' . $i], 'polls.choice') . '</small><br />';
                echo '<img src="' . $_base_path . 'images/blue.gif" height="5" width="' . $width . '" alt="" /> ' . $row['count' . $i];
                echo '</td></tr>';
            }
        }
    } else {
        // show the form to vote
        echo '<tr>';
        echo '<td valign="top" class="dropdown" align="left"><strong>' . AT_print($row['question'], 'polls.question') . '</strong>';
        echo '<form method="post" action="' . htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES) . '"><input type="hidden" name="poll_id" value="' . $row['poll_id'] . '" />';
        echo '<table width="100%" border="0" cellspacing="0" cellpadding="0" summary="">';
        for ($i = 1; $i <= AT_NUM_POLL_CHOICES; $i++) {
            if ($row['choice' . $i]) {
                echo '<tr>';
                echo '<td valign="top" align="left">';
                echo '<small><input type="radio" name="choice" value="' . $i . '" id="c' . $i . '" /><label for="c' . $i . '">' . AT_print($row['choice' . $i], 'polls.choice') . '</label></small></td></tr>';
            }
        }
        echo '<tr>';
        echo '<td valign="top" align="center"><input type="submit" name="poll_submit" value="' . _AT('submit') . '" class="button" />';
        echo '<br /><small>' . _AT('vote_to_see_results') . '</small>';
        echo '</td></tr>';
        echo '</table></form></td></tr>';
    }
    echo '</table>';
} else {
    echo '<strong>' . _AT('none_found') . '</strong><br />';
}
$savant->assign('dropdown_contents', ob_get_contents());
ob_end_clean();
$savant->assign('title', _AT('polls'));
예제 #27
0
			<td><input type="radio" name="id" value="<?php 
            echo $row['course_id'];
            ?>
" id="m<?php 
            echo $row['course_id'];
            ?>
" /></td>
			<td><label for="m<?php 
            echo $row['course_id'];
            ?>
"><?php 
            echo AT_print($row['title'], 'courses.title');
            ?>
</label></td>
			<td><?php 
            echo AT_print($row['login'], 'members.login');
            ?>
</td>
		<!-- REMOVED FOR MOBILE	<td><?php 
            //echo _AT($row['access']);
            ?>
</td> -->
		<!-- 	<td><?php 
            //echo AT_date($startend_date_long_format, $row['created_date'], AT_DATE_UNIX_TIMESTAMP);
            ?>
</td> -->
		<!--	<td><?php 
            //echo ($row['cat_name'] ? $row['cat_name'] : '-')
            ?>
</td>-->
			<td><?php 
예제 #28
0
<ul style="padding: 0px; margin: 0px; list-style-type: none">
	<?php 
for ($i = 0; $i < $this->num_choices; $i++) {
    ?>
		<li style="padding: 4px">
			<input type="checkbox" name="answers[<?php 
    echo $this->row['question_id'];
    ?>
][]" value="<?php 
    echo $i;
    ?>
" id="choice_<?php 
    echo $this->row['question_id'] . '_' . $i;
    ?>
" <?php 
    if (in_array($i, $this->response)) {
        ?>
checked="checked"<?php 
    }
    ?>
/><label for="choice_<?php 
    echo $this->row['question_id'] . '_' . $i;
    ?>
"><?php 
    echo AT_print($this->row['choice_' . $i], 'tests_questions.choice_' . $i);
    ?>
</label>
	<?php 
}
?>
</ul>
예제 #29
0
<p><?php 
echo AT_print($this->row['question'], 'tests_questions.quotesNotConverted');
?>
</p>

<p style="font-family: curior new; font-size: medium"><?php 
echo AT_print($this->answer, 'tests_answers.answer');
?>
</p>
예제 #30
0
    }
    echo '/>';
}
?>
	</div>

	<div class="row">
		<span class="required" title="<?php 
echo _AT('required_field');
?>
">*</span><label for="body_text"><?php 
echo _AT('body');
?>
</label><br />
		<textarea name="body_text" cols="55" rows="15" id="body_text" wrap="wrap"><?php 
echo AT_print($this->row['body'], 'input.text');
?>
</textarea>
	</div>

	<div class="row buttons">
		<input type="submit" name="submit" value="<?php 
echo _AT('save');
?>
" accesskey="s" />
		<input type="submit" name="cancel" value="<?php 
echo _AT('cancel');
?>
 " />
	</div>