Example #1
0
/**
 * display available polls
 * @global type $course_id
 * @global type $course_code
 * @global type $urlServer
 * @global type $tool_content
 * @global type $id
 * @global type $langPollNone
 * @global type $langQuestionnaire
 * @global type $langChoice
 * @global type $langAddModulesButton
 */
function list_polls() {
    
    global $course_id, $course_code, $urlServer, $tool_content, $id,
            $langPollNone, $langQuestionnaire, $langChoice, $langAddModulesButton;
    
    $result = Database::get()->queryArray("SELECT * FROM poll WHERE course_id = ?d AND active = 1", $course_id);
    $pollinfo = array();
    foreach ($result as $row) {
        $pollinfo[] = array(
            'id' => $row->pid,
            'title' => $row->name,
            'active' => $row->active);
    }
    if (count($pollinfo) == 0) {
        $tool_content .= "<div class='alert alert-warning'>$langPollNone</div>";
    } else {
        $tool_content .= "<form action='insert.php?course=$course_code' method='post'>" .
                "<input type='hidden' name='id' value='$id'>" .
                "<table class='table-default'>" .
                "<tr class='list-header'>" .
                "<th class='text-left'>&nbsp;$langQuestionnaire</th>" .
                "<th style='width:20px;' class='text-center'>$langChoice</th>" .
                "</tr>";        
        foreach ($pollinfo as $entry) {            
            $tool_content .= "<tr>";
            $tool_content .= "<td>&nbsp;".icon('fa-question')."&nbsp;&nbsp;<a href='${urlServer}modules/questionnaire/pollresults.php?course=$course_code&amp;pid=$entry[id]'>" . q($entry['title']) . "</a></td>";
            $tool_content .= "<td class='text-center'><input type='checkbox' name='poll[]' value='$entry[id]'></td>";
            $tool_content .= "</tr>";            
        }
        $tool_content .= "</table>";
        $tool_content .= "<div class='text-right'>";
        $tool_content .= "<input class='btn btn-primary' type='submit' name='submit_poll' value='$langAddModulesButton'></div></form>";
    }    
}
Example #2
0
    public static function fileUploadBlock()
    {
        if (self::$invalid) {
            return;
        }
        i18n::set('admin');
        $uploader = new Uploader('editFiles', 'EditPage::handleUpload', false, array('multi' => true));
        queue_js_string("/*\$(function(){\$('.view-uploads').overlay({\n\tmask: {\n\t\tcolor: '#000',\n\t\tloadSpeed: 200,\n\t\topacity: 0.7\n\t},\n\n\tcloseOnClick: true\n});});*/");
        $uploadedButton = sprintf("<a href='#' class='action view-uploads' rel='#cc_uploaded_overlay'>%s%s</a>", icon('folder_picture'), __('admin', 'view-all-files'));
        $uploadedFiles = <<<EOT
<div class="cc_uploaded_files">
{$uploadedButton}
\t<div id="cc_uploaded_overlay" class="cc_modal">
\t\t<h2>%s</h2>
\t\t<ul class="cc_file_list">
\t\t\t%s
\t\t</ul>
\t</div>
</div>
EOT;
        //foreach(Uploads::getAllFiles() as $)
        $r .= sprintf("<h3>%s</h3>%s%s", __('upload-files'), sprintf($uploadedFiles, __('uploaded-files'), $files), $uploader->createHTML());
        i18n::restore();
        return $r;
    }
Example #3
0
function contact_info($contactid, $email, $name)
{
    global $strUnknown;
    //$info .= "<span style='float:right;'>".gravatar($email, 16) . '</span>';
    if (!empty($contactid)) {
        $info .= "<a href='contact.php?id={$contactid}'>";
        $info .= icon('contact', 16);
        $info .= "</a>";
    } else {
        $info .= icon('email', 16);
    }
    $info .= ' ';
    if (!empty($email)) {
        $info .= "<a href=\"mailto:{$email}\" class='info'>";
    }
    if (!empty($name)) {
        $info .= "{$name}";
    } elseif (!empty($email)) {
        $info .= "{$email}";
    } else {
        $info .= "{$strUnknown}";
    }
    if (!empty($email)) {
        $info .= "<span>" . gravatar($email, 50, FALSE);
        $info .= "{$email}";
        $info .= "</span>";
        $info .= "</a>";
    }
    if (!empty($contactid)) {
        $info .= " (" . contact_site($contactid) . ")";
    }
    return $info;
}
Example #4
0
 function lists()
 {
     $this->load->library(array('pagination', 'querystring'));
     $this->load->helper('admin');
     $param =& $this->querystring;
     $page = $this->uri->segment(5, 1);
     $sst = $param->get('sst', 'gr_id');
     $sod = $param->get('sod', 'asc');
     $sfl = $param->get('sfl');
     $stx = $param->get('stx');
     $config['suffix'] = $param->output();
     $config['base_url'] = RT_PATH . '/' . ADM_F . '/boardgroup/lists/page/';
     $config['per_page'] = 15;
     $offset = ($page - 1) * $config['per_page'];
     $result = $this->Boardgroup_model->list_result($sst, $sod, $sfl, $stx, $config['per_page'], $offset);
     $config['total_rows'] = $result['total_cnt'];
     $this->pagination->initialize($config);
     $list = array();
     $token = get_token();
     foreach ($result['qry'] as $i => $row) {
         $list[$i] = new stdClass();
         $list[$i]->bo_cnt = $row['bo_cnt'];
         $list[$i]->id = $row['gr_id'];
         $list[$i]->subject = $row['gr_subject'];
         $list[$i]->admin = $row['gr_admin'];
         $list[$i]->s_mod = icon('수정', 'boardgroup/form/u/' . $row['gr_id']);
         $list[$i]->s_del = icon('삭제', "javascript:post_send('" . ADM_F . "/_trans/boardgroup/delete', {gr_id:'" . $row['gr_id'] . "', token:'" . $token . "'}, true);");
     }
     $head = array('title' => '게시판그룹관리');
     $data = array('token' => $token, 'list' => $list, 's_add' => icon('작성', 'boardgroup/form'), 'sfl' => $sfl, 'stx' => $stx, 'total_cnt' => number_format($result['total_cnt']), 'paging' => $this->pagination->create_links(), 'sort_gr_id' => $param->sort('gr_id', 'desc'), 'sort_gr_subject' => $param->sort('gr_subject'), 'sort_gr_admin' => $param->sort('gr_admin'));
     widget::run('head', $head);
     $this->load->view(ADM_F . '/boardgroup_list', $data);
     widget::run('tail');
 }
Example #5
0
 public function index($start = 0)
 {
     $this->load->library("admin");
     $this->session->set_userdata("URL_BACK", uri_string());
     $items = ITEMS_POR_PAG;
     $this->load->library("admin");
     $items_lista = crearConsulta("SELECT p FROM " . $this->entityStr . " p");
     $this->load->library('pagination');
     $config['base_url'] = site_url($this->ctrlPath . "/index");
     $config['total_rows'] = count($items_lista->execute());
     $config['per_page'] = $items;
     $config['uri_segment'] = 3;
     //1->Controlador, 2->Metodo, 3 en adelante son los argumentos
     $this->pagination->initialize($config);
     $items_lista->setMaxResults($items)->setFirstResult($start);
     $this->admin->listado($items_lista->execute());
     $this->admin->campos($this->camposTabla);
     $this->admin->id("id");
     $this->admin->titulos($this->titulosTabla);
     if ($this->accionesDefault) {
         $this->acciones = array("agregar" => array("url" => $this->ctrlPath . "agregar"), "editar" => array("url" => $this->ctrlPath . "/editar", "texto" => icon("fa-pencil") . " Editar", "propiedades" => array("class" => "btn-primary")), "eliminar" => array("texto" => i("", array("class" => "glyphicon glyphicon-remove")) . " Eliminar", "url" => $this->ctrlPath . "/eliminar", "propiedades" => array("class" => "eliminar_link btn-danger")));
     }
     $this->admin->acciones($this->acciones);
     if ($this->vistaPre !== NULL) {
         $this->admin->agregarVistaPre($this->vistaPre, $this->datosPre);
     }
     $this->admin->titulo($this->tituloMaestro);
     $this->admin->show();
 }
Example #6
0
function wlist()
{
    $lines = null;
    $args = func_get_args();
    switch ($args[0]) {
        case 'scan':
            if ($elements = scan_dir($args[2]['path'], 'DIR')) {
                foreach ($elements as $value) {
                    if (is_file($args[2]['path'] . $value . $args[2]['find'])) {
                        $about = @parse_ini_file($args[2]['path'] . $value . '/protocol/about.gl.php');
                        $name = $about['product'] ? $about['product'] : $value;
                        $lines[$name] = $args[3] ? href(THIS, $args[3], $value) : href($value);
                        unset($about);
                    }
                }
            }
            break;
        default:
            if (is_array($args[2])) {
                foreach ($args[2] as $link => $name) {
                    $lines[$link] = href(THIS, $args[3], $name);
                }
            }
            break;
    }
    //Выводим массив ссылок ;)
    if ($lines) {
        foreach ($lines as $name => $link) {
            form("label", icon($args[1]) . '<a href="' . $link . '">' . $name . '</a>');
        }
    } else {
        html('<br> Wlist lib. (C) Kazin Fedor, 2010');
    }
}
Example #7
0
/**
 * @brief display list of available learning paths (if any)
 * @global type $id
 * @global type $course_id
 * @global type $tool_content
 * @global type $urlServer
 * @global type $langComments
 * @global type $langAddModulesButton
 * @global type $langChoice
 * @global type $langNoLearningPath
 * @global type $langLearningPaths
 * @global type $course_code 
 */
function list_lps()
{
    global $id, $course_id, $tool_content, $urlServer, $langComments, $langAddModulesButton, $langChoice, $langNoLearningPath, $langLearningPaths, $course_code;
    $result = Database::get()->queryArray("SELECT * FROM lp_learnPath WHERE course_id = ?d ORDER BY name", $course_id);
    $lpinfo = array();
    foreach ($result as $row) {
        $lpinfo[] = array('id' => $row->learnPath_id, 'name' => $row->name, 'comment' => $row->comment, 'visible' => $row->visible, 'rank' => $row->rank);
    }
    if (count($lpinfo) == 0) {
        $tool_content .= "<div class='alert alert-warning'>{$langNoLearningPath}</div>";
    } else {
        $tool_content .= "<form action='insert.php?course={$course_code}' method='post'>" . "<input type='hidden' name='id' value='{$id}'>" . "<table class='table-default'>" . "<tr>" . "<th><div align='left'>&nbsp;{$langLearningPaths}</div></th>" . "<th><div align='left'>{$langComments}</div></th>" . "<th width='80'>{$langChoice}</th>" . "</tr>";
        foreach ($lpinfo as $entry) {
            if ($entry['visible'] == 0) {
                $vis = 'invisible';
            } else {
                $vis = '';
            }
            $tool_content .= "<tr class='{$vis}'>";
            $tool_content .= "<td>&nbsp;" . icon('fa-ellipsis-h') . "&nbsp;&nbsp;<a href='{$urlServer}/modules/learnPath/learningPath.php?course={$course_code}&amp;path_id={$entry['id']}'>" . q($entry['name']) . "</a></td>";
            $tool_content .= "<td>" . q($entry['comment']) . "</td>";
            $tool_content .= "<td class='text-center'><input type='checkbox' name='lp[]' value='{$entry['id']}'></td>";
            $tool_content .= "</tr>";
        }
        $tool_content .= "<tr>" . "<th colspan='3'><div align='right'>";
        $tool_content .= "<input class='btn btn-primary' type='submit' name='submit_lp' value='{$langAddModulesButton}'></div></th>";
        $tool_content .= "</tr></table></form>\n";
    }
}
Example #8
0
/**
 * 
 * @global type $id
 * @global type $course_id
 * @global type $course_code
 * @global type $tool_content
 * @global type $urlServer
 * @global type $mysqlMainDb
 * @global type $langAddModulesButton
 * @global type $langChoice
 * @global type $langNoEbook
 * @global type $langEBook
 * @global type $course_code
 */
function list_ebooks()
{
    global $id, $course_id, $course_code, $tool_content, $urlServer, $langAddModulesButton, $langChoice, $langNoEBook, $langEBook, $course_code;
    $result = Database::get()->queryArray("SELECT * FROM ebook WHERE course_id = ?d ORDER BY `order`", $course_id);
    if (count($result) == 0) {
        $tool_content .= "<div class='alert alert-warning'>{$langNoEBook}</div>";
    } else {
        $tool_content .= "<form action='insert.php?course={$course_code}' method='post'>\n\t\t\t\t<input type='hidden' name='id' value='{$id}' />" . "<table class='table-default'>" . "<tr>" . "<th class='text-left'>&nbsp;{$langEBook}</th>" . "<th width='80' class='text-center'>{$langChoice}</th>" . "</tr>";
        $unit_parameter = 'unit=' . $id;
        foreach ($result as $catrow) {
            $tool_content .= "<tr>";
            $tool_content .= "<td class='bold'>" . icon('fa-folder-o') . "&nbsp;&nbsp;" . q($catrow->title) . "</td>";
            $tool_content .= "<td class='text-center'>\n                            <input type='checkbox' name='ebook[]' value='{$catrow->id}' />\n                            <input type='hidden' name='ebook_title[{$catrow->id}]'\n                               value='" . q($catrow->title) . "'></td>";
            $tool_content .= "</tr>";
            $q = Database::get()->queryArray("SELECT ebook_section.id AS sid,\n                                    ebook_section.public_id AS psid,\n                                    ebook_section.title AS section_title,\n                                    ebook_subsection.id AS ssid,\n                                    ebook_subsection.public_id AS pssid,\n                                    ebook_subsection.title AS subsection_title,\n                                    document.path,\n                                    document.filename\n                                    FROM ebook, ebook_section, ebook_subsection, document\n                                    WHERE ebook.id = ?d AND\n                                        ebook.course_id = ?d AND\n                                        ebook_section.ebook_id = ebook.id AND\n                                        ebook_section.id = ebook_subsection.section_id AND\n                                        document.id = ebook_subsection.file_id AND\n                                        document.course_id = ?d AND\n                                        document.subsystem = " . EBOOK . "\n                                        ORDER BY CONVERT(psid, UNSIGNED), psid,\n                                                 CONVERT(pssid, UNSIGNED), pssid", $catrow->id, $course_id, $course_id);
            $ebook_url_base = "{$urlServer}modules/ebook/show.php/{$course_code}/{$catrow->id}/";
            $old_sid = false;
            foreach ($q as $row) {
                $sid = $row->sid;
                $ssid = $row->ssid;
                $display_id = $sid . ',' . $ssid;
                $surl = $ebook_url_base . $display_id . '/' . $unit_parameter;
                if ($old_sid != $sid) {
                    $tool_content .= "<tr>\n                                    <td class='section'>" . icon('fa-link') . "&nbsp;&nbsp;\n                                        " . q($row->section_title) . "</td>\n                                    <td align='center'><input type='checkbox' name='section[]' value='{$sid}' />\n                                        <input type='hidden' name='section_title[{$sid}]'\n                                               value='" . q($row->section_title) . "'></td></tr>";
                }
                $tool_content .= "<tr>\n                                <td class='subsection'>" . icon('fa-link') . "&nbsp;&nbsp;\n                                <a href='" . q($surl) . "' target='_blank'>" . q($row->subsection_title) . "</a></td>\n                                <td align='center'><input type='checkbox' name='subsection[]' value='{$ssid}' />\n                                   <input type='hidden' name='subsection_title[{$ssid}]'\n                                          value='" . q($row->subsection_title) . "'></td>\n                            </tr>";
                $old_sid = $sid;
            }
        }
        $tool_content .= "<tr>" . "<th colspan='2'><div align='right'>" . "<input class='btn btn-primary' type='submit' name='submit_ebook' value='{$langAddModulesButton}' /></div></th>" . "</tr></table></form>";
    }
}
Example #9
0
 /**
  * Go back n steps in history
  * @param $n How many steps to go back
  * @param $displayTitle Display the title of the target page if true. If false, show 'Back'
  * @return string
  */
 function backn($n = 1, $displayTitle = false)
 {
     if (isset($_SESSION['TRACE'][$n])) {
         return '<a href="' . url(array_merge(@$_SESSION['TRACE'][$n]['_GET'], array('history' => 'back')), null, false) . '">' . icon('small/arrow_left') . ($displayTitle ? $Controller->get(@$_SESSION['TRACE'][$n]['id']) : __('Back')) . '</a>';
     }
     return '';
 }
Example #10
0
 /**
  * Добавляем активную иконку в меню
  *
  * @param object $menu
  */
 public function hookUserMenu($menu)
 {
     if (!user()->id) {
         return;
     }
     $menu->add(array('label' => icon('user'), 'tooltip' => t('Профиль'), 'link' => user()->getLink(), 'place' => 'left', 'title' => FALSE, 'order' => 3));
 }
Example #11
0
function booleanToIcon($bool)
{
    if ($bool) {
        return icon("icon check");
    }
    return icon("icon icon-bar");
}
function dashboard_incoming($dashletid)
{
    global $sit, $CONFIG, $iconset;
    global $dbUpdates, $dbTempIncoming;
    $content = "<p align='center'><img src='{$CONFIG['application_webpath']}images/ajax-loader.gif' alt='Loading icon' /></p>";
    echo dashlet('incoming', $dashletid, icon('emailin', 16), 'Holding Queue Emails', 'holding_queue.php', $content);
}
 public function get_forums($forum_id = NULL, $mini = FALSE)
 {
     if ($forum_id) {
         $this->db->where('f.parent_id', $forum_id)->where('f.is_subforum', TRUE);
     } else {
         $this->db->join('nf_forum f2', 'f2.parent_id = f.forum_id AND f2.is_subforum = "1"')->where('f.is_subforum', FALSE);
     }
     $forums = $this->db->select('f.forum_id', 'f.parent_id', 'f.title', 'f.description', !$forum_id ? 'f.count_messages + SUM(IFNULL(f2.count_messages, 0)) as count_messages' : 'f.count_messages', !$forum_id ? 'f.count_topics   + SUM(IFNULL(f2.count_topics, 0))   as count_topics' : 'f.count_topics', 'f.last_message_id', 'u.user_id', 'u.username', 't.topic_id', 't.title as last_title', 'm.date as last_message_date', 't.count_messages as last_count_messages', 'u2.url', 'u2.redirects', (!$forum_id ? 'COUNT(f2.forum_id)' : 0) . ' as subforums', 'up.avatar', 'up.sex')->from('nf_forum f')->join('nf_forum_messages m', 'm.message_id = f.last_message_id')->join('nf_forum_topics t', 't.topic_id = m.topic_id')->join('nf_users u', 'u.user_id = m.user_id AND u.deleted = "0"')->join('nf_users_profiles up', 'u.user_id = up.user_id')->join('nf_forum_url u2', 'u2.forum_id = f.forum_id')->group_by('f.forum_id')->order_by('f.order', 'f.forum_id')->get();
     foreach ($forums as &$forum) {
         $forum['has_unread'] = $forum['url'] ? FALSE : $this->_has_unread($forum);
         if ($forum['subforums']) {
             foreach ($forum['subforums'] = $this->get_forums($forum['forum_id'], TRUE) as $subforum) {
                 if (!$forum['has_unread'] && $subforum['has_unread']) {
                     $forum['has_unread'] = TRUE;
                 }
                 if ($subforum['last_message_id'] > $forum['last_message_id']) {
                     foreach (['last_message_id', 'user_id', 'username', 'topic_id', 'last_title', 'last_message_date', 'last_count_messages'] as $var) {
                         $forum[$var] = $subforum[$var];
                     }
                 }
             }
         } else {
             $forum['subforums'] = [];
         }
         $forum['icon'] = icon(($forum['url'] ? 'fa-globe' : 'fa-comments' . ($forum['has_unread'] ? '' : '-o')) . ($mini ? '' : ' fa-3x'));
     }
     return $forums;
 }
function dashboard_holidays($dashletid)
{
    global $sit, $CONFIG, $iconset;
    global $dbUsers;
    $user = $sit[2];
    echo "<div class='windowbox' style='width: 95%;' id='{$dashletid}'>";
    echo "<div class='windowtitle'>" . icon('holiday', 16) . " {$GLOBALS['strWhosAwayToday']}</div>";
    echo "<div class='window'>";
    $sql = "SELECT * FROM `{$dbUsers}` WHERE status!=0 AND status!=1 ";
    // status=0 means left company
    $result = mysql_query($sql);
    if (mysql_error()) {
        trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
    }
    if (mysql_num_rows($result) >= 1) {
        while ($users = mysql_fetch_array($result)) {
            $title = userstatus_name($users['status']);
            $title .= " - ";
            if ($users['accepting'] == 'Yes') {
                $title .= "{$GLOBALS['strAcceptingIncidents']}";
            } else {
                $title .= "{$GLOBALS['strNotAcceptingIncidents']}";
            }
            if (!empty($users['message'])) {
                $title .= "\n(" . $users['message'] . ")";
            }
            echo "<strong>{$users['realname']}</strong>, {$title}";
            echo "<br />";
        }
    } else {
        echo "<p align='center'>{$GLOBALS['strNobody']}</p>\n";
    }
    echo "</div></div></div>";
}
Example #15
0
 function lists($page = 1)
 {
     $this->load->library('pagination');
     $this->load->helper('admin');
     $config['base_url'] = RT_PATH . '/' . ADM_F . '/mail/lists/';
     $config['per_page'] = 15;
     $offset = ($page - 1) * $config['per_page'];
     $result = $this->Mail_model->list_result($config['per_page'], $offset);
     $total_cnt = $result['total_cnt'];
     $config['total_rows'] = $total_cnt;
     $config['uri_segment'] = 4;
     $this->pagination->initialize($config);
     $list = array();
     $token = get_token();
     foreach ($result['qry'] as $i => $row) {
         $list[$i] = new stdClass();
         $list[$i]->num = number_format($total_cnt - ($page - 1) * $config['per_page'] - $i);
         $list[$i]->id = $row['ma_id'];
         $list[$i]->subject = $row['ma_subject'];
         $list[$i]->content = $row['ma_content'];
         $list[$i]->time = $row['ma_time'];
         $list[$i]->s_mod = icon('수정', 'mail/form/u/' . $row['ma_id']);
         $list[$i]->s_del = icon('삭제', "javascript:post_send('" . ADM_F . "/_trans/mail/delete', {ma_id:'" . $row['ma_id'] . "', token:'" . $token . "'}, true);");
         $list[$i]->s_vie = icon('보기', 'mail/preview/' . $row['ma_id'], "_blank");
     }
     $head = array('title' => '회원메일발송');
     $data = array('token' => $token, 'list' => $list, 's_add' => icon('작성', 'mail/form'), 'total_cnt' => number_format($total_cnt), 'paging' => $this->pagination->create_links());
     widget::run('head', $head);
     $this->load->view(ADM_F . '/mail_list', $data);
     widget::run('tail');
 }
Example #16
0
 public function index()
 {
     if (!$this->user()) {
         return $this->login();
     }
     $this->title($this('member_area'));
     return new Panel(array('title' => $this('member_area'), 'icon' => 'fa-user', 'content' => $this->load->view('index'), 'footer' => '<a class="btn btn-primary" href="' . url('user/edit.html') . '">' . icon('fa-cogs') . ' ' . $this('manage_my_account') . '</a> <a class="btn btn-danger" href="' . url('user/logout.html') . '">' . icon('fa-close') . ' ' . $this('logout') . '</a>'));
 }
Example #17
0
 public function index($config = array())
 {
     $count = count($links = $this->breadcrumb->get_links());
     array_walk($links, function (&$value, $key) use($count) {
         $value = '<li' . (($is_last = $key == $count - 1) ? ' class="active"' : '') . '><a href="' . url($value[1]) . '">' . ($is_last && $value[2] !== '' ? icon($value[2]) . ' ' : '') . $value[0] . '</a></li>';
     });
     return '<ol class="breadcrumb"><b>' . $this->config->nf_name . '</b>&nbsp;&nbsp;&nbsp;' . icon('fa-angle-right') . '&nbsp;&nbsp;&nbsp;' . implode($links) . '</ol>';
 }
Example #18
0
/**
 * display available forums (if any)
 * @global type $id
 * @global type $tool_content
 * @global type $urlServer
 * @global type $course_id
 * @global type $langComments
 * @global type $langAddModulesButton
 * @global type $langChoice
 * @global type $langNoForums
 * @global type $langForums
 * @global type $course_code
 */
function list_forums() {
    global $id, $tool_content, $urlServer, $course_id,
    $langComments, $langAddModulesButton, $langChoice, $langNoForums, $langForums, $course_code;

    $result = Database::get()->queryArray("SELECT * FROM forum WHERE course_id = ?d", $course_id);
    $foruminfo = array();
    foreach ($result as $row) {
        $foruminfo[] = array(
            'id' => $row->id,
            'name' => $row->name,
            'comment' => $row->desc,
            'topics' => $row->num_topics);
    }
    if (count($foruminfo) == 0) {
        $tool_content .= "<div class='alert alert-warning'>$langNoForums</div>";
    } else {
        $tool_content .= "<form action='insert.php?course=$course_code' method='post'>" .
                "<input type='hidden' name='id' value='$id' />" .
                "<table class='table-default'>" .
                "<tr class='list-header'>" .
                "<th>$langForums</th>" .
                "<th>$langComments</th>" .
                "<th style='width:20px;' class='text-center'>$langChoice</th>" .
                "</tr>";

        foreach ($foruminfo as $entry) {
            $tool_content .= "<tr>";
            $tool_content .= "<td>
            <a href='${urlServer}modules/forum/viewforum.php?course=$course_code&amp;forum=$entry[id]'>" . q($entry['name']). "</a></td>";
            $tool_content .= "<td>" . q($entry['comment']) . "</td>";
            $tool_content .= "<td class='text-center'><input type='checkbox' name='forum[]' value='$entry[id]' /></td>";
            $tool_content .= "</tr>";
            $r = Database::get()->queryArray("SELECT * FROM forum_topic WHERE forum_id = ?d", $entry['id']);
            if (count($r) > 0) { // if forum topics found
                $topicinfo = array();
                foreach ($r as $topicrow) {
                    $topicinfo[] = array(
                        'topic_id' => $topicrow->id,
                        'topic_title' => $topicrow->title,
                        'topic_time' => $topicrow->topic_time);
                }
                foreach ($topicinfo as $topicentry) {
                    $tool_content .= "<tr>";
                    $tool_content .= "<td>&nbsp;".icon('fa-comments')."&nbsp;&nbsp;<a href='${urlServer}/modules/forum/viewtopic.php?course=$course_code&amp;topic=$topicentry[topic_id]&amp;forum=$entry[id]'>" . q($topicentry['topic_title']) . "</a></td>";
                    $tool_content .= "<td>&nbsp;</td>";
                    $tool_content .= "<td class='text-center'><input type='checkbox' name='forum[]'  value='$entry[id]:$topicentry[topic_id]' /></td>";
                    $tool_content .= "</tr>";
                }
            }
        }
        $tool_content .= 
                "</table>";
        $tool_content .= "<div class='text-right'>
                            <input class='btn btn-primary' type='submit' name='submit_forum' value='$langAddModulesButton' />
                        </div></form>";
        
    }
}
Example #19
0
 public function index($config = array())
 {
     $members = $this->db->select('user_id', 'username', 'registration_date')->from('nf_users')->where('deleted', FALSE)->order_by('registration_date DESC')->limit(5)->get();
     if (!empty($members)) {
         return new Panel(array('title' => $this('last_members'), 'content' => $this->load->view('index', array('members' => $members)), 'body' => FALSE, 'footer' => '<a href="' . url('members.html') . '">' . icon('fa-arrow-circle-o-right') . ' ' . $this('members_list') . '</a>', 'footer_align' => 'right'));
     } else {
         return new Panel(array('title' => $this('last_members'), 'content' => $this('no_members')));
     }
 }
Example #20
0
function wmysql_adminlist($method, $array)
{
    is_array($array) ? $param = $array : die('None array');
    $_GET = get_url_array();
    switch ($method) {
        case 'list':
            form("open");
            html($param['name']);
            $result = wmysql("page", "get", $param['sql'], $param['recsheet'], $_GET[$param['level']]);
            if (mysql_num_rows($result) > 0) {
                html("<table cellspacing='3px'><tr>");
                foreach ($param['description'] as $el) {
                    html("<td>" . $el . "</td>");
                }
                html("</tr>");
                while ($row = mysql_fetch_assoc($result)) {
                    html("<tr><td>");
                    form("input", array("type" => 'checkbox', "name" => 'arr[]', "value" => $row['id']));
                    html("</td>");
                    foreach ($param['getparam'] as $key) {
                        html("<td>" . $row[$key] . "</td>");
                    }
                    html("<td><a href='" . href(THIS, $param['level'] - 1, "edit", $row['id']) . "'>" . icon("edit", 20) . "</a></td>");
                    html("</tr>");
                }
                html("</table>");
            } else {
                if (intval($_GET[$param['level']]) > 1) {
                    die(header("location:" . href(THIS, $param['level'] - 1)));
                }
            }
            if ($page = wmysql("page", "draw", $param['level'] - 1)) {
                html("<br>Страницы: " . $page);
                html("&nbsp;&nbsp;Выбрать все на этой странице<input type='checkbox' \r\n        onChange='for(i in this.form.elements)this.form.elements[i].checked = this.checked'>");
                form("label");
            }
            form("input", array("type" => 'submit', "name" => 'qq', "value" => 'Удалить'));
            html("или <a href='" . href(THIS, $param['level'] - 1, "add") . "'>Добавить" . icon("add", 16) . "</a>");
            form("close");
            return;
        case 'delrec':
            foreach ($param['array'] as $value) {
                $value = mysql_escape_string($value);
                $condition = true;
                if ($param['condition']) {
                    $result = mysql_query($param['condition'] . " '" . $value . "'");
                    $condition = mysql_result($result, 0) == 0 ? true : false;
                    print_r(mysql_fetch_assoc($result));
                }
                if ($condition) {
                    mysql_query($param['true'] . " '" . $value . "'");
                }
            }
            die(header("location:" . href(THIS)));
            return;
    }
}
Example #21
0
 public function topics($config = array())
 {
     $topics = $this->model()->get_last_topics();
     if (!empty($topics)) {
         return new Panel(array('title' => $this('last_topics'), 'content' => $this->load->view('topics', array('topics' => $topics)), 'footer' => '<a href="' . url('forum.html') . '">' . icon('fa-arrow-circle-o-right') . ' ' . $this('access_forum') . '</a>', 'footer_align' => 'right'));
     } else {
         return new Panel(array('title' => $this('last_topics'), 'content' => $this('no_topics')));
     }
 }
Example #22
0
 public function item($icon, $label, $attr = array())
 {
     $a = new Brick('a', '', $attr);
     $a->append(icon($icon, 'left'));
     $a->append(l($label) ?: $label);
     $li = new Brick('li');
     $li->append($a);
     return $li;
 }
 function render()
 {
     $id = idfy($this->name);
     JS::loadjQuery(false);
     JS::lib('imgPicker');
     JS::raw('setupPreview("' . $id . '");');
     //FIXME: Flytta styling till stylesheet!
     return '<span class="formelem">' . ($this->label === false ? '' : '<label for="' . $id . '">' . $this->label . '</label>') . '<input name="' . $this->name . '" id="' . $id . '" class="text' . ($this->validate ? ' ' . $this->validate : '') . '" value="' . $this->value . '" type="hidden" />' . '<div class="tools">' . icon('small/cross', __('Remove'), "javascript:removePreview('{$id}');", $id . "remicon") . icon('small/folder_picture', __('Browse picture'), "javascript:explore('{$id}', " . ($this->dir ? $this->dir : 'false') . ");") . '</div>' . (strpos($this->validate, 'required') !== false ? '<span class="reqstar">*</span>' : '') . ($this->description ? '<span class="description">' . $this->description . '</span>' : '') . ($this->preview ? '<div id="' . $id . 'prev" style="margin:10px 0 5px 150px;"><img id="' . $id . 'img" src="index.php?id=' . $this->value . '&mw=300" /></div>' : '') . '</span>';
 }
Example #24
0
 /**
  * Конструктор
  *
  * @param Config $config
  */
 public function __construct($config)
 {
     $defaults = self::getDefaultSettings();
     $defaults->extend($config);
     parent::__construct($defaults);
     $this->initRegions();
     $this->template = new Template(THEMES . DS . $this->theme . DS . 'templates' . DS . 'index' . EXT);
     $this->menu = new Menu(array('name' => 'theme', 'render' => FALSE, 'elements' => array(array('label' => icon('download'), 'link' => l('/admin/theme/download') . '?themes=' . $this->theme, 'class' => 'btn btn-mini'))));
 }
Example #25
0
 function footerForPrint()
 {
     global $app_info;
     echo "<footer class='footerForPrint visible-print'>";
     echo "<div>";
     echo "<p>" . $app_info['site_title'] . " - " . icon('earphone') . " " . $app_info['contact'] . "</p>";
     echo "</div>";
     echo "</footer>";
 }
Example #26
0
 public function _gallery($gallery_id, $category_id, $image_id, $name, $published, $title, $description, $category_name, $category_title, $image, $category_icon, $images)
 {
     $this->css('gallery')->js('gallery')->js('modal-carousel');
     $panels = array(new Panel(array('title' => '<div class="pull-right"><a class="label label-default" href="' . url('gallery/' . $category_id . '/' . $category_name . '.html') . '">' . $category_title . '</a></div>' . $title, 'icon' => 'fa-photo', 'content' => $this->load->view('gallery', array('title' => $title, 'description' => $description, 'image_id' => $image_id, 'images' => $images, 'carousel_images' => $carousel_images = $this->model()->get_images($gallery_id), 'total_images' => count($carousel_images), 'pagination' => $this->pagination->get_pagination())), 'body' => FALSE)));
     if (empty($images)) {
         $panels[] = new Panel(array('title' => $this('photos'), 'icon' => 'fa-photo', 'style' => 'panel-info', 'content' => '<div class="text-center">' . icon('fa-photo fa-4x') . '<h4>' . $this('no_images_message') . '</h4></div>'));
     }
     return $panels;
 }
Example #27
0
    function renderNav($items)
    {
        foreach ($items as $item) {
            if (val('type', $item) == 'group') {
                $heading = val('text', $item);
                if (!$heading) {
                    $item['cssClass'] .= ' nav-group-noheading';
                }
                ?>
		<div type="group" class="nav-group <?php 
                echo val('cssClass', $item);
                ?>
">
		<?php 
                if ($heading) {
                    echo '<h3>' . val('text', $item) . '</h3>';
                }
                if (val('items', $item)) {
                    renderNav(val('items', $item));
                }
                echo '</div>';
            }
            if (val('type', $item) == 'link') {
                ?>
		<a role="menuitem" class="nav-link <?php 
                echo val('cssClass', $item);
                ?>
" tabindex="-1"
		   href="<?php 
                echo url(val('url', $item));
                ?>
">
		    <?php 
                if (val('badge', $item)) {
                    echo '<span class="Aside"><span class="Count">' . val('badge', $item) . '</span></span>';
                }
                ?>
                    <?php 
                if (val('icon', $item)) {
                    echo icon(val('icon', $item));
                }
                ?>
		    <?php 
                echo '<span class="text">' . val('text', $item) . '</span>';
                ?>
		</a>
            <?php 
            }
            if (val('type', $item) == 'dropdown') {
                echo val('dropdownmenu', $item);
            }
            if (val('type', $item) == 'divider') {
                echo '<hr/>';
            }
        }
    }
Example #28
0
 public function image($settings = array())
 {
     $image = $this->model()->get_random_image($settings['gallery_id']);
     $href = url('gallery/image/' . $image['image_id'] . '/' . url_title($image['title']) . '.html');
     if (!empty($image['file_id'])) {
         return new Panel(array('title' => $image['title'], 'content' => '<a href="' . $href . '"><img class="img-responsive" src="' . path($image['file_id']) . '" alt="" /></a>', 'body' => FALSE, 'footer' => '<a href="' . $href . '">' . icon('fa-arrow-circle-o-right') . ' ' . $this('details') . '</a>', 'footer_align' => 'right'));
     } else {
         return new Panel(array('title' => $this('random_picture'), 'content' => $this('no_picture')));
     }
 }
Example #29
0
function story_action($name, $story)
{
    $attrs = array('class' => 'icon');
    switch ($name) {
        case 'edit':
            return anchor('/story/edit/' . $story->id, icon('pencil'), $attrs);
        case 'delete':
            return anchor('/story/delete/' . $story->id, icon('delete'), $attrs);
    }
}
Example #30
0
function list_videos()
{
    global $id, $tool_content, $themeimg, $course_id, $langTitle, $langDescr, $langDate, $langChoice, $langCatVideoDirectory, $langAddModulesButton, $langNoVideo, $course_code;
    $count = 0;
    $video_found = FALSE;
    $cnt1 = Database::get()->querySingle("SELECT COUNT(*) AS cnt FROM video WHERE course_id = ?d", $course_id)->cnt;
    $cnt2 = Database::get()->querySingle("SELECT COUNT(*) AS cnt FROM videolink WHERE course_id = ?d", $course_id)->cnt;
    $count = $cnt1 + $cnt2;
    if ($count > 0) {
        $video_found = TRUE;
        $tool_content .= "<form action='insert.php?course={$course_code}' method='post'><input type='hidden' name='id' value='{$id}' />";
        $tool_content .= "<table class='table-default'>";
        $tool_content .= "<tr>" . "<th width='200' class='text-left'>&nbsp;{$langTitle}</th>" . "<th class='text-left'>{$langDescr}</th>" . "<th width='100'>{$langDate}</th>" . "<th width='80'>{$langChoice}</th>" . "</tr>";
        foreach (array('video', 'videolink') as $table) {
            $result = Database::get()->queryArray("SELECT * FROM {$table} WHERE (category IS NULL OR category = 0) AND course_id = ?d", $course_id);
            foreach ($result as $row) {
                $row->course_id = $course_id;
                if ($table == 'video') {
                    $vObj = MediaResourceFactory::initFromVideo($row);
                    $videolink = MultimediaHelper::chooseMediaAhref($vObj);
                } else {
                    $vObj = MediaResourceFactory::initFromVideoLink($row);
                    $videolink = MultimediaHelper::chooseMedialinkAhref($vObj);
                }
                $tool_content .= "<td>&nbsp;" . icon('fa-film') . "&nbsp;&nbsp;" . $videolink . "</td>" . "<td>" . q($row->description) . "</td>" . "<td class='text-center'>" . nice_format($row->date, true, true) . "</td>" . "<td class='text-center'><input type='checkbox' name='video[]' value='{$table}:{$row->id}' /></td>" . "</tr>";
            }
        }
        $sql = Database::get()->queryArray("SELECT * FROM video_category WHERE course_id = ?d ORDER BY name", $course_id);
        if ($sql) {
            $tool_content .= "<tr><td colspan='3' class='bold'>&nbsp;{$langCatVideoDirectory}</td></tr>";
            foreach ($sql as $videocat) {
                $tool_content .= "<tr>";
                $tool_content .= "<td>" . icon('fa-folder-o') . "&nbsp;&nbsp;" . q($videocat->name) . "</td>";
                $tool_content .= "<td colspan='2'>" . standard_text_escape($videocat->description) . "</td>";
                $tool_content .= "<td align='center'><input type='checkbox' name='videocatlink[]' value='{$videocat->id}' /></td>";
                $tool_content .= "</tr>";
                foreach (array('video', 'videolink') as $table) {
                    $sql2 = Database::get()->queryArray("SELECT * FROM {$table} WHERE category = ?d", $videocat->id);
                    foreach ($sql2 as $linkvideocat) {
                        $tool_content .= "<tr>";
                        $tool_content .= "<td>&nbsp;&nbsp;&nbsp;&nbsp;<img src='{$themeimg}/links_on.png' />&nbsp;&nbsp;<a href='" . q($linkvideocat->url) . "' target='_blank'>" . q($linkvideocat->title == '' ? $linkvideocat->url : $linkvideocat->title) . "</a></td>";
                        $tool_content .= "<td>" . standard_text_escape($linkvideocat->description) . "</td>";
                        $tool_content .= "<td class='text-center'>" . nice_format($linkvideocat->date, true, true) . "</td>";
                        $tool_content .= "<td class='text-center'><input type='checkbox' name='video[]' value='{$table}:{$linkvideocat->id}' /></td>";
                        $tool_content .= "</tr>";
                    }
                }
            }
        }
        $tool_content .= "<tr><th colspan='4'><div align='right'><input class='btn btn-primary' type='submit' name='submit_video' value='" . q($langAddModulesButton) . "' />&nbsp;&nbsp;</div></th></tr></table></form>";
    }
    if (!$video_found) {
        $tool_content .= "<div class='alert alert-warning'>{$langNoVideo}</div>";
    }
}