Esempio n. 1
0
 public static function _($type)
 {
     $type = preg_replace('#[^A-Z0-9_\\.]#i', '', $type);
     $args = func_get_args();
     array_shift($args);
     $item = $args[0];
     $i = $args[1];
     $prefix = isset($args[2]) ? $args[2] : null;
     $result = '';
     switch ($type) {
         case 'grid.id':
             if (JCOMMENTS_JVERSION == '1.0') {
                 $result = mosHTML::idBox($i, $item->id);
             } elseif (JCOMMENTS_JVERSION == '1.7') {
                 $result = JHTML::_('grid.id', $i, $item->id);
             } else {
                 $result = JHtml::_('grid.id', $i, $item->id);
             }
             break;
         case 'grid.checkedout':
             if (JCOMMENTS_JVERSION == '1.0') {
                 $result = mosCommonHTML::CheckedOutProcessing($item, $i);
             } elseif (JCOMMENTS_JVERSION == '1.7') {
                 $result = JHTML::_('grid.checkedout', $item, $i);
             } else {
                 $result = JHtml::_('grid.checkedout', $item, $i);
             }
             break;
         case 'grid.published':
             if (JCOMMENTS_JVERSION == '1.0') {
                 $result = mosCommonHTML::PublishedProcessing($item, $i);
             } elseif (JCOMMENTS_JVERSION == '1.7') {
                 $result = JHTML::_('grid.published', $item, $i, 'tick.png', 'publish_x.png', $prefix);
             } else {
                 $result = JHtml::_('grid.published', $item, $i, 'tick.png', 'publish_x.png', $prefix);
             }
             break;
     }
     return $result;
 }
Esempio n. 2
0
    static function showRequestRentBooksCB($option, $rent_requests, &$pageNav, $params)
    {
        global $my, $mosConfig_live_site, $mainframe, $Itemid, $booklibrary_configuration;
        $session = JFactory::getSession();
        $acl = JFactory::getACL();
        $arr = $session->get("array", "default");
        $doc = JFactory::getDocument();
        $doc->addScript($mosConfig_live_site . '/components/com_booklibrary/includes/functions.js');
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/custom.css');
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/booklibrary.css');
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/custom.css');
        // for 1.6
        if ($option == 'com_booklibrary') {
            $user = JFactory::getuser();
            $db = JFactory::getDBO();
            $query = "SELECT * FROM #__booklibrary_lend_request AS b WHERE b.status=0";
            $db->setQuery($query);
            $current_user_rent_request_array = $db->loadObjectList();
            $check_for_show_rent_request = 0;
            if (isset($current_user_rent_request_array)) {
                $check_for_show_rent_request = 1;
            }
            if ($booklibrary_configuration['cb_mybook']['show'] == '1' && checkAccessBL($booklibrary_configuration['cb_mybook']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl)) {
                echo "<span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=show_my_books&layout=mybooks') . "'>" . _BOOKLIBRARY_LABEL_CBBOOKS_TT . "</a></span>";
            }
            if ($booklibrary_configuration['cb_edit']['show'] == '1' && checkAccessBL($booklibrary_configuration['cb_mybook']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl)) {
                echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=showmybooks&layout=mybooks') . "'>" . _BOOKLIBRARY_LABEL_CBEDIT . "</a></span>";
            }
            if ($booklibrary_configuration['cb_history']['show']) {
                $params->def('show_history', 1);
                $i = checkAccessBL($booklibrary_configuration['cb_history']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl);
                if ($i) {
                    $params->def('show_history_registrationlevel', 1);
                }
                if ($params->get('show_history')) {
                    if ($params->get('show_history_registrationlevel')) {
                        if ($check_for_show_rent_request != 0) {
                            echo " <span class='books_button'>\n\t\t\t\t\t\t\t\t\t\t<a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=com_booklibrary&task=rent_history_books&name=' . $user->name . '&user='******'&is_show_data=1') . "'>" . _BOOKLIBRARY_MY_LEND_HISTORY . "</a></span>";
                        }
                        //echo "<div style=\" border:1px solid black; padding: 10px; text-align:center; \">you dont have rent_history_lable</div>";
                    }
                }
            }
            if ($booklibrary_configuration['cb_rent']['show']) {
                $params->def('show_rent', 1);
                $i = checkAccessBL($booklibrary_configuration['cb_rent']['registrationlevel'], 'NORECURSE', userGID_BL($my->id), $acl);
                if ($i) {
                    $params->def('show_rent_registrationlevel', 1);
                }
                if ($params->get('show_rent')) {
                    if ($params->get('show_rent_registrationlevel')) {
                        if ($check_for_show_rent_request != 0) {
                            echo " <span class='books_button'><a class='my_btn my_btn-primary' href='" . JRoute::_('index.php?option=' . $option . '&task=rent_requests_cb_books&is_show_data=1') . "'>" . _BOOKLIBRARY_LEND_REQUESTS . "</a></span>";
                        }
                    }
                }
            }
            ?>
            <style type="text/css">
                .row0 {background-color:#F9F9F9;}
            </style><br/><br/><br/>
        <?php 
        }
        ?>
        <script>
            function vm_buttonClickCB()  {
                document.getElementById('adminFormTaskInput').value = 'decline_rent_requests_cb_book';
                document.getElementById('adminForm').submit();
            }
        </script>
        <script type="text/javascript">
            function checkAll(all) 
            { var c = document.getElementsByName('bid[]');
                for(var i=0;i<c.length;i++)
                {if(all.checked!=true)
                    {c[i].checked=false;}
                    else {c[i].checked=true;}
                }
            }
            function buttonClick(button)
            {if(button.name=='addbook')
                {submitform('add_book_fe');return;}
                var c = document.getElementsByName('bid[]');
                for(var i=0;i<c.length;i++)
                {if(c[i].checked)
                    {var checkedbooks = true;break;}
                }
                if(!checkedbooks){ alert("<?php 
        echo _BOOKLIBRARY_ERROR_DEL;
        ?>
");return;}
                if(button.name=='delete'){ resultat = confirm("<?php 
        echo _BOOKLIBRARY_LABEL_EBOOK_DELETE;
        ?>
");
                    if (resultat) { submitform('delete');}
                    return;}
                if(button.name=='unpublish'){ submitform('unpublish');return;}
                if(button.name=='publish'){ submitform('publish');return;}
            }
            function submitform(submit){
                var button=document.getElementsByName('submitbutton');
                button[0].value=submit;document.forms["adminForm1"].submit();
            }
        </script>
        <form class="bl_all_categories_show_my_book_lend_requests_form" action="index.php" method="get" name="adminForm" id="adminForm">
            <table cellpadding="4" cellspacing="0" border="0" width="100%" class="bl_all_categories_show_my_book_lend_requests my_table my_table-bordered basictable my_table-hover">
                <tr>
                    <th align = "center" width="5%">
                        <input type="checkbox" name="toggle" value="" onClick="checkAll(this<?php 
        //echo count($rent_requests);
        ?>
);" />
                    </th>
                    <th align = "center" width="5%">#</th>
                    <th align = "center" class="title" width="10%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_ORDER_LEND_FROM;
        ?>
</th>
                    <th align = "center" class="title" width="10%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_ORDER_LEND_UNTIL;
        ?>
</th>
                    <th align = "center" class="title" width="5%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_LABEL_BOOKID;
        ?>
</th>
                    <th align = "center" class="title" width="70%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_LABEL_TITLE;
        ?>
</th>
                    <th align = "center" class="title" width="15%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_LABEL_LEND_USER;
        ?>
</th>
                    <th align = "center" class="title" width="10%" nowrap="nowrap">
                        <?php 
        echo _BOOKLIBRARY_LABEL_LEND_EMAIL;
        ?>
</th>
                    <th align = "center" class="title" width="20%" nowrap="nowrap">
                <?php 
        echo _BOOKLIBRARY_LABEL_LEND_ADRES;
        ?>
</th>
                </tr>

                <?php 
        for ($i = 0, $n = count($rent_requests); $i < $n; $i++) {
            $row = $rent_requests[$i];
            ?>
                    <tr class="row<?php 
            echo $i % 2;
            ?>
">
                        <td width="20" align="center"><?php 
            echo mosHTML::idBox($i, $row->id, 0, 'bid');
            ?>
</td>
                        <td align = "center"><?php 
            echo $row->id;
            ?>
</td>
                        <td align = "center"><?php 
            echo $row->lend_from;
            ?>
</td>
                        <td align = "center"><?php 
            echo $row->lend_until;
            ?>
</td>
                        <td align = "center"><?php 
            $data = JFactory::getDBO();
            $query = "SELECT bookid FROM #__booklibrary where id = " . $row->fk_bookid . " ";
            $data->setQuery($query);
            $bookid = $data->loadObjectList();
            echo $bookid[0]->bookid;
            ?>
                        </td>
                        <td align = "center"><?php 
            echo $row->title;
            ?>
</td>
                        <td align = "center"><?php 
            echo $row->user_name;
            ?>
</td>
                        <td align = "center">
                            <a href='mailto:"<?php 
            echo $row->user_email;
            ?>
'><?php 
            echo $row->user_email;
            ?>
</a>
                        </td>
                        <td align= "center"><?php 
            echo $row->user_mailing;
            ?>
</td>
                    </tr>
                        <?php 
        }
        ?>

                <tr class="for_paginator">
                    <td colspan = "9" align="center" id="pagenavig">
                        <?php 
        $paginations = $arr;
        if ($paginations && $pageNav->total > $pageNav->limit) {
            echo $pageNav->getPagesLinks();
        }
        ?>
                    </td>
                </tr>
            </table>
        <?php 
        if ($option == 'com_booklibrary') {
            ?>
                <input type="hidden" name="option" value="com_booklibrary" />
        <?php 
        } else {
            ?>
                <input type="hidden" name="option" value="com_comprofiler" />
                <input type="hidden" name="tab" value="getmybooksTab" /><?php 
        }
        ?>
            <input type="hidden" name="is_show_data" value="1" />
            <input type="hidden" id="adminFormTaskInput" name="task" value="accept_rent_requests_cb_book" />
            <input type="hidden" name="boxchecked" value="0" />
            <input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />  
            <input class="my_btn my_btn-success" type="submit" name="submitButton" value="accept request"/>
            <input class="my_btn my_btn-danger" type="button" name="declineButton" value="decline request" onclick="vm_buttonClickCB()"/>

        </form>
        <?php 
    }
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showArchive(&$rows, $section, &$lists, $search, $pageNav, $option, $all = NULL, $redirect)
    {
        global $my, $acl;
        ?>
		<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton) {
			if (pressbutton == 'remove') {
				if (document.adminForm.boxchecked.value == 0) {
					alert('Por favor, selecione um item na lista para enviar a lixeira');
				} else if ( confirm('Você tem certeza que deseja enviar esse item para lixeira? \nIsto não apagará os artigos permanentemente.')) {
					submitform('remove');
				}
			} else {
				submitform(pressbutton);
			}
		}
		</script>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="edit" rowspan="2">
			<?php 
        if ($all) {
            ?>
				Administrar Arquivo <small><small>[ Seção: Todas ]</small></small>
				<?php 
        } else {
            ?>
				Administrar Arquivo <small><small>[ Seção: <?php 
            echo $section->title;
            ?>
 ]</small></small>
				<?php 
        }
        ?>
			</th>
			<?php 
        if ($all) {
            ?>
				<td align="right" rowspan="2" valign="top">
				<?php 
            echo $lists['sectionid'];
            ?>
				</td>
				<?php 
        }
        ?>
			<td align="right" valign="top">
			<?php 
        echo $lists['catid'];
        ?>
			</td>
			<td valign="top">
			<?php 
        echo $lists['authorid'];
        ?>
			</td>
		</tr>
		<tr>
			<td align="right">
			Filtro:
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo htmlspecialchars($search);
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5">
			nº
			</th>
			<th width="20">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			Título 
			</th>
			<th width="2%">
			Ordem
			</th>
			<th width="1%">
			<a href="javascript: saveorder( <?php 
        echo count($rows) - 1;
        ?>
 )"><img src="images/filesave.png" border="0" width="16" height="16" alt="Salvar Ordem" /></a>
			</th>
			<th width="15%" align="left">
			Categoria
			</th>
			<th width="15%" align="left">
			Autor
			</th>
			<th align="center" width="10">
			Data
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $row->cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id=' . $row->catid;
            if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->created_by;
                    $author = '<a href="' . $linkA . '" title="Editar Usuário">' . $row->author . '</a>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->author;
                }
            }
            $date = mosFormatDate($row->created, '%x');
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td width="20">
				<?php 
            echo mosHTML::idBox($i, $row->id);
            ?>
				</td>
				<td>
				<?php 
            echo $row->title;
            ?>
				</td>
				<td align="center" colspan="2">
				<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" class="text_area" style="text-align: center" />
				</td>
				<td>
				<a href="<?php 
            echo $row->cat_link;
            ?>
" title="Editar Categoria">
				<?php 
            echo $row->name;
            ?>
				</a>
				</td>
				<td>
				<?php 
            echo $author;
            ?>
				</td>
				<td>
				<?php 
            echo $date;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>

		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="sectionid" value="<?php 
        echo $section->id;
        ?>
" />
		<input type="hidden" name="task" value="showarchive" />
		<input type="hidden" name="returntask" value="showarchive" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="redirect" value="<?php 
        echo $redirect;
        ?>
" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
Esempio n. 4
0
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showList(&$rows, $search, $pageNav, $option)
    {
        global $my, $adminLanguage;
        global $mosConfig_live_site;
        ?>
		<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th class="frontpage">
			<?php 
        echo $adminLanguage->A_COMP_FRONT_PAGE_ITEMS;
        ?>
			</th>
			<td>
			<?php 
        echo $adminLanguage->A_COMP_FILTER;
        ?>
:
			</td>
			<td> 
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="inputbox" onChange="document.adminForm.submit();" />
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="20"> 
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title" width="50%">
			<?php 
        echo $adminLanguage->A_COMP_TITLE;
        ?>
			</th>
			<th width="10%" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_PUBLISHED;
        ?>
			</th>
			<th colspan="2" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_REORDER;
        ?>
			</th>
			<th width="10%" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_ACCESS;
        ?>
			</th>
			<th width="15%" align="left">
			<?php 
        echo $adminLanguage->A_COMP_CATEG;
        ?>
			</th>
			<th>
			<?php 
        echo $adminLanguage->A_COMP_FRONT_ORDER;
        ?>
			</th>
			<th width="10%" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_CHECKED_OUT;
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td width="20">
				<?php 
            echo mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
            ?>
				</td>
				<td>
				<?php 
            echo $row->title;
            ?>
 
				</td>
				<?php 
            $now = date("Y-m-d h:i:s");
            if ($now <= $row->publish_up && $row->state == "1") {
                $img = 'publish_y.png';
                $alt = $adminLanguage->A_COMP_PUBLISHED;
            } else {
                if (($now <= $row->publish_down || $row->publish_down == "0000-00-00 00:00:00") && $row->state == "1") {
                    $img = 'publish_g.png';
                    $alt = $adminLanguage->A_COMP_PUBLISHED;
                } else {
                    if ($now > $row->publish_down && $row->state == "1") {
                        $img = 'publish_r.png';
                        $alt = $adminLanguage->A_COMP_EXPIRED;
                    } elseif ($row->state == "0") {
                        $img = "publish_x.png";
                        $alt = $adminLanguage->A_COMP_UNPUBLISHED;
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_START_ALWAYS . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_START . ": " . $row->publish_up . "</td></tr>";
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_FIN_NOEXP . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_FINISH . ": " . $row->publish_down . "</td></tr>";
                }
            }
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onmouseover="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, 'Publish Information', BELOW, RIGHT);" onMouseOut="return nd();" onclick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? "unpublish" : "publish";
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td>
				<?php 
            echo $pageNav->orderUpIcon($i);
            ?>
				</td>
				<td>
				<?php 
            echo $pageNav->orderDownIcon($i, $n);
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->groupname;
            ?>
				</td>
				<td>
				<?php 
            echo $row->name;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->fpordering;
            ?>
				</td>
				<?php 
            if ($row->checked_out) {
                ?>
					<td align="center">
					<?php 
                echo $row->editor;
                ?>
					</td>
					<?php 
            } else {
                ?>
					<td align="center">&nbsp;</td>
					<?php 
            }
            ?>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<br />
	
		<?php 
        mosCommonHTML::ContentLegend();
        ?>
		<script language="Javascript" src="<?php 
        echo $mosConfig_live_site;
        ?>
/includes/js/overlib_mini.js"></script>
		<?php 
    }
Esempio n. 5
0
    static function showLanguageManager($const_languages, $pageNav, $search)
    {
        global $my, $mosConfig_live_site, $mainframe, $templateDir;
        // for 1.6
        global $doc;
        $doc->addStyleSheet($mosConfig_live_site . '/components/com_booklibrary/includes/booklibrary.css');
        $doc->addScript($mosConfig_live_site . '/components/com_booklibrary/includes/functions.js');
        $html = "<div class='book_manager_caption' ><img src='./components/com_booklibrary/images/cfg.png' alt ='Config' /> " . _BOOKLIBRARY_ADMIN_LANGUAGE_MANAGER . "</div>";
        $app = JFactory::getApplication();
        $app->JComponentTitle = $html;
        ?>

        <form action="index.php" method="post" name="adminForm" id="adminForm">

            <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist language_manager bl_admin_language_manager_table
                   my_table my_table-hover my_table-bordered">

        <?php 
        if (version_compare(JVERSION, "3.0.0", "ge")) {
            ?>
                    <tr>
                        <td width="5%"></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td>
                            <div class="btn-group pull-right hidden-phone">
                                <label for="limit" class="element-invisible"><?php 
            echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');
            ?>
</label>
            <?php 
            echo $pageNav->getLimitBox();
            ?>
                            </div>
                        </td>
                    </tr>
        <?php 
        }
        ?>

                <tr>
                    <td style="text-align:right;" width="5%"><?php 
        echo _BOOKLIBRARY_SHOW_SEARCH;
        ?>
</td>
                    <td width="35%">
                        <input type="text" name="search_const" value="<?php 
        echo $search['const'];
        ?>
" class="inputbox input-medium" onChange="document.adminForm.submit();" />
                    </td>
                    <td width="35%">
                        <input type="text" name="search_const_value" value="<?php 
        echo $search['const_value'];
        ?>
" class="inputbox input-medium" onChange="document.adminForm.submit();" />
                    </td>
                    <td colspan="2"></td>
                </tr>
                <tr>
                    <td></td>
                    <td width="35%">
        <?php 
        echo $search['languages'];
        ?>
                    </td>
                    <td width="35%">
        <?php 
        echo $search['sys_type'];
        ?>
                    </td>
                    <td colspan="2"></td>
                </tr>
                <tr>
                    <th width="5%" align="center"></th>
                    <th align = "center" class="title" width="35%" nowrap="nowrap">
        <?php 
        echo _BOOKLIBRARY_ADMIN_LANGUAGE_MANAGER_CONST;
        ?>
                    </th>
                    <th align = "center" class="title" width="35%" nowrap="nowrap">
        <?php 
        echo _BOOKLIBRARY_ADMIN_LANGUAGE_MANAGER_VALUE_CONST;
        ?>
                    </th>
                    <th align = "center" class="title" width="35%" nowrap="nowrap">
        <?php 
        echo _BOOKLIBRARY_LABEL_LANGUAGE;
        ?>
                    </th>
                    <th align = "center" class="title" width="35%" nowrap="nowrap">
        <?php 
        echo _BOOKLIBRARY_ADMIN_LANGUAGE_MANAGER_SYS_TYPE;
        ?>
                    </th>
                </tr>

        <?php 
        $i = 0;
        foreach ($const_languages as $const_language) {
            ?>
                    <tr>
                        <td align="center">
            <?php 
            echo mosHTML::idBox($i, $const_language->id, false, 'bid');
            ?>
                        </td>
                        <td>
                            <a href="#edit" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','edit')">
            <?php 
            echo $const_language->const;
            ?>
                            </a>
                        </td>
                        <td>
                            <a href="#edit" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','edit')">
            <?php 
            echo $const_language->value_const;
            ?>
                            </a>
                        </td>
                        <td align="center">
            <?php 
            echo $const_language->title;
            ?>
                        </td>
                        <td align="center"><?php 
            echo $const_language->sys_type;
            ?>
</td>
                    </tr>
            <?php 
            $i++;
        }
        ?>
                <tr class="for_paginator">
                    <td colspan = "13"><?php 
        echo $pageNav->getListFooter();
        ?>
</td>
                </tr>
            </table>
            <input type="hidden" name="option" value="com_booklibrary" />
            <input type="hidden" name="section" value="language_manager" />
            <input type="hidden" name="task" value="" />
            <input type="hidden" value="0" name="boxchecked">
        </form>

    <?php 
    }
    function addUser($usrs, $option, $course_id, $group_id, $utype, $pageNav, $u_search, &$lists)
    {
        global $Itemid, $JLMS_CONFIG;
        $user_data = new stdClass();
        if ($utype == 1) {
            $is_lifetime = true;
            $user_data->publish_start = 1;
            $user_data->publish_end = 0;
            $user_data->start_date = date('Y-m-d');
            $user_data->end_date = date('Y-m-d');
        }
        $is_dis_start = !(isset($user_data->publish_start) && $user_data->publish_start == 1);
        $is_dis_end = !(isset($user_data->publish_end) && $user_data->publish_end == 1);
        ?>
<script language="javascript" type="text/javascript">
<!--
window.addEvent('domready', function() {
			document.adminForm.startday.disabled = true;
			document.adminForm.startmonth.disabled = true;
			document.adminForm.startyear.disabled = true;
				
			document.adminForm.endday.disabled = true;
			document.adminForm.endmonth.disabled = true;
			document.adminForm.endyear.disabled = true;		
}
);
function setgood() {
	return true;
}
function jlms_changeUserSelect(c_e) {
	var sel_value = c_e.options[c_e.selectedIndex].value;
	var sel1 = c_e.form.user_name;
	for (var i = 0; i < sel1.options.length; i++) {
		if (sel1.options[i].value == sel_value) {
			sel1.options[i].selected = true;
		}
	}
	var sel2 = c_e.form.user_email;
	for (var i = 0; i < sel2.options.length; i++) {
		if (sel2.options[i].value == sel_value) {
			sel2.options[i].selected = true;
		}
	}
	var sel3 = c_e.form.user_id;
	for (var i = 0; i < sel3.options.length; i++) {
		if (sel3.options[i].value == sel_value) {
			sel3.options[i].selected = true;
		}
	}
}
function submitbutton(pressbutton) {
	var form = document.adminForm;
	try {
		form.onsubmit();
	} catch(e) {
		//alert(e);
	}
	var form2 = document.importForm;
	try {
		form2.onsubmit();
	} catch(e) {
		//alert(e);
	}
	if ((pressbutton == 'add_user_save') && (form.boxchecked.value == '0') ) {
		alert( "<?php 
        echo _JLMS_USER_SELECT_USER;
        ?>
" );
	} else if ((pressbutton == 'import_users') && (form2.csv_file.value == '') ) {
		alert( "<?php 
        echo _JLMS_SELECT_FILE;
        ?>
" );
	} else if((pressbutton == 'add_user_save') && form.role_id && form.role_id.value == '0'){
		alert( "<?php 
        echo _JLMS_USERS_SELECT_ROLE;
        ?>
" );
		form.role_id.focus();
	} else {
		if (pressbutton == 'import_users') {
			form2.task.value = pressbutton;
			form2.submit();
		} else {
			form.task.value = pressbutton;
			form.submit();
		}
	}
}
function f_submitbutton(pressbutton){
	var form = document.filterForm;
	form.task.value = pressbutton;
	form.submit();	
}
<?php 
        if ($utype == 1) {
            ?>
var is_start_c = <?php 
            echo $user_data->publish_start ? '1' : '0';
            ?>
; var is_end_c = <?php 
            echo $user_data->publish_end ? '1' : '0';
            ?>
;
function jlms_Change_start() {
	var form=document.adminForm;
	if (is_start_c == 1) {		
		is_start_c = 0
		form.startday.disabled = true;
		form.startmonth.disabled = true;
		form.startyear.disabled = true;
	} else {
		is_start_c = 1
		form.startday.disabled = false;
		form.startmonth.disabled = false;
		form.startyear.disabled = false;
	}
}
function jlms_Change_end() {
	var form=document.adminForm;
	if (is_end_c == 1) {
		is_end_c = 0
		form.endday.disabled = true;
		form.endmonth.disabled = true;
		form.endyear.disabled = true;
	} else {
		is_end_c = 1
		form.endday.disabled = false;
		form.endmonth.disabled = false;
		form.endyear.disabled = false;
	}
}
function jlms_um_change_type(type_elem) {
	if (type_elem.checked) {
		val = type_elem.value;
		if (val == 1 || val == '1') {
			type_elem.form.publish_end.disabled = true;
			type_elem.form.publish_start.disabled = true;
			type_elem.form.days_number.disabled = true;
			type_elem.form.endday.disabled = true;
			type_elem.form.endmonth.disabled = true;
			type_elem.form.endyear.disabled = true;
			type_elem.form.startday.disabled = true;
			type_elem.form.startmonth.disabled = true;
			type_elem.form.startyear.disabled = true;
		} else if (val == 2 || val == '2') {
			type_elem.form.publish_end.disabled = false;
			type_elem.form.publish_start.disabled = false;
			type_elem.form.days_number.disabled = true;
			if (is_start_c != 1) {
				type_elem.form.startday.disabled = true;
				type_elem.form.startmonth.disabled = true;
				type_elem.form.startyear.disabled = true;
			} else {
				type_elem.form.startday.disabled = false;
				type_elem.form.startmonth.disabled = false;
				type_elem.form.startyear.disabled = false;
			}
			if (is_end_c != 1) {
				type_elem.form.endday.disabled = true;
				type_elem.form.endmonth.disabled = true;
				type_elem.form.endyear.disabled = true;
			} else {
				type_elem.form.endday.disabled = false;
				type_elem.form.endmonth.disabled = false;
				type_elem.form.endyear.disabled = false;
			}
		} else if (val == 3 || val == '3') {
			type_elem.form.publish_end.disabled = true;
			type_elem.form.publish_start.disabled = true;
			type_elem.form.days_number.disabled = false;
			type_elem.form.endday.disabled = true;
			type_elem.form.endmonth.disabled = true;
			type_elem.form.endyear.disabled = true;
			type_elem.form.startday.disabled = true;
			type_elem.form.startmonth.disabled = true;
			type_elem.form.startyear.disabled = true;
		}
	}
}
<?php 
        }
        /*if ($utype == 1) {*/
        ?>
//-->
</script>
<?php 
        JLMS_TMPL::OpenMT();
        $hparams = array();
        $toolbar = array();
        $toolbar[] = array('btn_type' => 'save', 'btn_js' => "javascript:submitbutton('add_user_save');");
        $toolbar[] = array('btn_type' => 'cancel', 'btn_js' => "javascript:submitbutton('cancel_user');");
        JLMS_TMPL::ShowHeader('user', $utype == 1 ? _JLMS_USER_ADD_TITLE : _JLMS_USER_ASSIST_ADD_TITLE, $hparams, $toolbar);
        JLMS_TMPL::OpenTS();
        ?>
		
		<form action="<?php 
        echo sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}");
        ?>
" method="post" name="filterForm">
			<table  width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders">
				<tr>
					<td>
						<input type="text" class="inputbox" name="u_search" value="<?php 
        echo $u_search;
        ?>
" />
						<input type="button" value="Search" onclick="javascript:f_submitbutton('add_user');" />
					</td>
				</tr>
			</table>
			<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
			<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
			<input type="hidden" name="id" value="0" />
			<input type="hidden" name="task" value="add_user" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="course_id" value="<?php 
        echo $course_id;
        ?>
" />
			<input type="hidden" name="group_id" value="<?php 
        echo $group_id;
        ?>
" />
			<input type="hidden" name="utype" value="<?php 
        echo $utype;
        ?>
" />
		</form>
		<form action="<?php 
        echo sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}");
        ?>
" method="post" name="adminForm" onsubmit="setgood();">

			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
        echo JLMSCSS::_('jlmslist');
        ?>
">
				<tr>
					<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 width="20" class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
">#</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
					<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 width="20" class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
">&nbsp;</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
					<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 width="15%" valign="middle" style="vertical-align:middle " class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
">
						<?php 
        echo _JLMS_USER_USERNAME;
        ?>
					</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
					<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 width="15%" valign="middle" style="vertical-align:middle " class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
">
						<?php 
        echo _JLMS_USER_NAME;
        ?>
					</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
					<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 valign="middle" style="vertical-align:middle " class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
">
						<?php 
        echo _JLMS_USER_EMAIL;
        ?>
					</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
				</tr>
				<?php 
        for ($i = 0; $i < count($usrs); $i++) {
            ?>
				<tr class="<?php 
            echo JLMSCSS::_('sectiontableentry' . ($i % 2 + 1));
            ?>
">
					<td><?php 
            echo $i + 1;
            ?>
</td>
					<?php 
            $checked = mosHTML::idBox($i, $usrs[$i]->id);
            ?>
					<td><?php 
            echo $checked;
            ?>
</td>
					<td><?php 
            echo $usrs[$i]->username;
            ?>
</td>
					<td><?php 
            echo $usrs[$i]->name;
            ?>
</td>
					<td><?php 
            echo $usrs[$i]->email;
            ?>
</td>
				</tr>
				<?php 
        }
        ?>
				<tr>
					<td colspan="5" align="center" class="<?php 
        echo JLMSCSS::_('jlmslist-footer_td');
        ?>
">
						<div align="center" style="white-space: nowrap;">
						<?php 
        $link = "index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=add_user&amp;course_id={$course_id}&amp;utype={$utype}&amp;group_id={$group_id}";
        if ($u_search != '') {
            $link .= '&amp;u_search=' . $u_search;
        }
        echo $pageNav->writePagesLinks($link);
        ?>
						</div>
					</td>
				</tr>
			</table>	
			<?php 
        if ($utype == 2) {
            if (isset($lists['user_role_id']) && $lists['user_role_id']) {
                echo '<input type="hidden" name="role_id" value="' . $lists['user_role_id'] . '" />';
            } else {
                ?>
					<table  width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders">
						<tr>
							<td colspan="2"><?php 
                echo JLMSCSS::h2(_JLMS_USERS_ROLE);
                ?>
</td>
						</tr>
						<tr>
							<td>
							<?php 
                echo $lists['user_role'];
                ?>
							</td>
						</tr>
					</table>
					<?php 
            }
        }
        ?>
			<?php 
        /* Added additional access period information (DEN) - 21 August 2007 */
        if ($utype == 1) {
            if (isset($lists['role_id']) && $lists['role_id']) {
                echo '<input type="hidden" name="role_id" value="' . $lists['role_id'] . '" />';
            } else {
                ?>
					<table width="100%" cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders">
						<tr>
							<td colspan="2"><?php 
                echo JLMSCSS::h2(_JLMS_USERS_ROLE);
                ?>
</td>
						</tr>
						<tr>
							<td>
							<?php 
                echo $lists['role'];
                ?>
							</td>
						</tr>
					</table>
					<?php 
            }
            ?>
			<table width="100%" cellpadding="0" cellspacing="0" border="0" id="jlms_item_properties">
				<tr>
					<td colspan="2"><br /><?php 
            echo JLMSCSS::h2(_JLMS_USERS_TBL_HEAD_USER_ACC_PERIOD);
            ?>
</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align:left">
					<input onclick="jlms_um_change_type(this);" type="radio" id="access_period_type_1" name="access_period_type" value="1"<?php 
            echo $is_lifetime ? ' checked="checked"' : '';
            ?>
 />
					<label for="access_period_type_1"><?php 
            echo _JLMS_USERS_LIFETIME_ACC;
            ?>
</label></td>
				</tr>
				<tr>
					<td colspan="2" style="text-align:left"><br />
					<input onclick="jlms_um_change_type(this);" type="radio" id="access_period_type_2" name="access_period_type" value="2"<?php 
            echo !$is_lifetime ? ' checked="checked"' : '';
            ?>
 />
					<label for="access_period_type_2"><?php 
            echo _JLMS_USERS_DTD_ACC;
            ?>
</label></td>
				</tr>
				<tr>
					<td width="20%" valign="middle"><br /><?php 
            echo _JLMS_START_DATE;
            ?>
</td>
					<td valign="middle" style="vertical-align:middle "><br />
						<table cellpadding="0" cellspacing="0" border="0" class="jlms_table_no_borders">
							<tr>
								<td valign="middle">
									<input disabled="disabled" type="checkbox" value="1" name="publish_start" onclick="jlms_Change_start()"<?php 
            echo $user_data->publish_start ? ' checked="checked"' : '';
            ?>
 />
								</td>
								<td valign="middle" style="vertical-align:middle ">
									<?php 
            $s_date = $is_dis_start ? date('Y-m-d') : $user_data->start_date;
            echo JLMS_HTML::_('calendar.calendar', $s_date, 'start', 'start');
            ?>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td valign="middle"><br /><?php 
            echo _JLMS_END_DATE;
            ?>
</td>
					<td valign="middle" style="vertical-align:middle "><br />
						<table cellpadding="0" cellspacing="0" border="0" class="jlms_date_outer"><tr><td valign="middle">
						<input disabled="disabled" type="checkbox" value="1" name="publish_end" onclick="jlms_Change_end()"<?php 
            echo $user_data->publish_end ? ' checked="checked"' : '';
            ?>
 /></td>
						<td valign="middle" style="vertical-align:middle ">
						<?php 
            $e_date = $is_dis_end ? date('Y-m-d') : $user_data->end_date;
            echo JLMS_HTML::_('calendar.calendar', $e_date, 'end', 'end');
            ?>
						</td></tr></table>
					</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align:left"><br />
					<input onclick="jlms_um_change_type(this);" type="radio" id="access_period_type_3" name="access_period_type" value="3" />
					<label for="access_period_type_3"><?php 
            echo _JLMS_USERS_XDAYS_ACC;
            ?>
</label></td>
				</tr>
				<tr>
					<td valign="middle"><br /><?php 
            echo _JLMS_USERS_XDAYS_NUMBER;
            ?>
</td>
					<td valign="middle" style="vertical-align:middle "><br />
						<input type="text" name="days_number" value="" disabled="disabled" />
					</td>
				</tr>
			
				<tr>
					<td colspan="2" valign="top"><br /><?php 
            echo _JLMS_TEACHER_COMMENT;
            ?>
</td>
				</tr>
				<tr>
					<td colspan="2">
					<?php 
            JLMS_editorArea('editor1', '', 'teacher_comment', '100%', '250', '40', '20');
            ?>
					</td>
				</tr>
			</table>
			<?php 
        }
        ?>
			<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
			<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
			<input type="hidden" name="id" value="0" />
			<input type="hidden" name="task" value="add_user" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="course_id" value="<?php 
        echo $course_id;
        ?>
" />
			<input type="hidden" name="group_id" value="<?php 
        echo $group_id;
        ?>
" />
			<input type="hidden" name="utype" value="<?php 
        echo $utype;
        ?>
" />
		</form>
<?php 
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::CloseMT();
    }
    /**
     * Writes a list of the Trash items
     */
    function showList($option, $content, $pageNav, $list, $catid)
    {
        global $my;
        ?>
		<script language="javascript" type="text/javascript">
		/**
		* Toggles the check state of a group of boxes
		*
		* Checkboxes must have an id attribute in the form cb0, cb1...
		* @param The number of box to 'check'
		*/
		function checkAll_xtd ( n ) {
			var f = document.adminForm;
			var c = f.toggle1.checked;
			var n2 = 0;
			for ( i=0; i < n; i++ ) {
				cb = eval( 'f.cb1' + i );
				if (cb) {
					cb.checked = c;
					n2++;
				}
			}
			if (c) {
				document.adminForm.boxchecked.value = n2;
			} else {
				document.adminForm.boxchecked.value = 0;
			}
		}
		</script>
		<form action="index2.php?option=com_trash" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th class="trash">Administrar Lixeira</th>
			<td width="right">
				<?php 
        echo $list;
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist" width="90%">
		<tr>
			<th width="20">Qtd.</th>
			<th width="20">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($content);
        ?>
);" />
			</th>
			<th width="20px">&nbsp;</th>
			<th class="title">
			Título
			</th>
			<th>
			Seções
			</th>
			<th>
			Categoria 
			</th>
			<th width="70px">
			ID
			</th>
		</tr>
		<?php 
        $k = 0;
        $i = 0;
        $n = count($content);
        foreach ($content as $row) {
            ?>
			<tr class="<?php 
            echo "row" . $k;
            ?>
">
				<td align="center" width="30px">
				<?php 
            echo $i + 1 + $pageNav->limitstart;
            ?>
				</td>
				<td width="20px" align="center"><?php 
            if ($catid == "content") {
                echo mosHTML::idBox($i, $row->id);
            } else {
                echo "<input type=\"checkbox\" id=\"cb{$i}\" name=\"mid[]\" value=\"{$row->id}\" onclick=\"isChecked(this.checked);\" />";
            }
            ?>
</td>
				<td width="20px"></td>
				<td nowrap="nowrap">
				<?php 
            echo $row->title;
            ?>
				</td>
				<td align="center" width="20%">
				<?php 
            echo $row->sectname;
            ?>
				</td>
				<td align="center" width="20%">
				<?php 
            echo $row->catname;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
            $i++;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="com_trash" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
Esempio n. 8
0
    function showDocuments($rows, $lists, $search, $pageNav, $number_pending, $number_unpublished, $view_type = 1)
    {
        global $database, $my, $_DOCMAN;
        global $mosConfig_live_site, $mosConfig_absolute_path;
        ?>

        <form action="index2.php" method="post" name="adminForm">

        <?php 
        dmHTML::adminHeading(_DML_DOCS, 'documents');
        ?>

        <div class="dm_filters">
            <?php 
        echo _DML_FILTER;
        ?>
            <input class="text_area" type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="inputbox" onChange="document.adminForm.submit();" />
            <?php 
        echo $lists['catid'];
        ?>

            <span class="small">
                <?php 
        if ($number_pending > 0) {
            echo " [{$number_pending} " . _DML_DOCS_NOT_APPROVED . "] ";
        }
        if ($number_unpublished > 0) {
            echo " [{$number_unpublished} " . _DML_DOCS_NOT_PUBLISHED . "] ";
        }
        if ($number_unpublished < 1 && $number_pending < 1) {
            echo " [" . _DML_NO_PENDING_DOCS . "] ";
        }
        ?>
            </span>
        </div>

        <table class="adminlist">
          <thead>
          <tr>
            <th width="2%" align="left" >
            <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
            </th>
            <th width="15%" align="left">
            <a href="index2.php?option=com_docman&section=documents&sort=name"><?php 
        echo _DML_NAME;
        ?>
</a>
            </th>
            <th width="15%" align="left" >
            <a href="index2.php?option=com_docman&section=documents&sort=filename"><?php 
        echo _DML_FILE;
        ?>
</a>
            </th>
            <th width="15%" align="left">
            <a href="index2.php?option=com_docman&section=documents&sort=catsubcat"><?php 
        echo _DML_CATEGORY;
        ?>
</a>
            </th>
            <th width="10%" align="center">
            <a href="index2.php?option=com_docman&section=documents&sort=date"><?php 
        echo _DML_DATE;
        ?>
</a>
            </th>
            <th width="10%">
            <?php 
        echo _DML_OWNER;
        ?>
            </th>
            <th width="5%">
            <?php 
        echo _DML_PUBLISHED;
        ?>
            </th>
            <th width="5%">
            <?php 
        echo _DML_APPROVED;
        ?>
            </th>
            <th width="5%">
            <?php 
        echo _DML_SIZE;
        ?>
            </th>
            <th width="5%">
            <?php 
        echo _DML_HITS;
        ?>
            </th>
            <th width="5%" nowrap="nowrap">
            <?php 
        echo _DML_CHECKED_OUT;
        ?>
            </th>
          </tr>
          </thead>

          <tfoot><tr><td colspan="11"><?php 
        echo $pageNav->getListFooter();
        ?>
</td></tr></tfoot>

          <tbody>
          <?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $task = $row->published ? 'unpublish' : 'publish';
            $img = $row->published ? 'publish_g.png' : 'publish_x.png';
            $alt = $row->published ? _DML_PUBLISHED : _DML_UNPUBLISH;
            $file = new DOCMAN_File($row->dmfilename, $_DOCMAN->getCfg('dmpath'));
            ?>
<tr class="row<?php 
            echo $k;
            ?>
">
                <td width="20">
				<?php 
            echo mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
            ?>
				</td>
				<td width="15%">
			<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                ?>
					<?php 
                echo $row->dmname;
                ?>
					&nbsp;[ <i><?php 
                echo _DML_CHECKED_OUT;
                ?>
</i> ]
			<?php 
            } else {
                ?>
					<a href="#edit" onclick="return listItemTask('cb<?php 
                echo $i;
                ?>
','edit')">
					<?php 
                echo $row->dmname;
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
                <td>
                <?php 
            if ($file->exists()) {
                ?>
                    <a href="index2.php?option=com_docman&section=documents&task=download&bid=<?php 
                echo $row->id;
                ?>
" target="_blank">
                    <?php 
                echo DOCMAN_Utils::urlSnippet($row->dmfilename);
                ?>
</a>
               	<?php 
            } else {
                echo _DML_FILE_MISSING;
            }
            ?>
            	</td>
            	<td width="15%"><?php 
            echo $row->treename;
            ?>
</td>
               	<td width="10%" align="center"><?php 
            echo mosFormatDate($row->dmdate_published);
            ?>
</td>
               	<td align="center"><?php 
            echo DOCMAN_Utils::getUserName($row->dmowner);
            ?>
</td>
                <td width="10%" align="center">
					<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
					<img src="images/<?php 
            echo $img;
            ?>
" border="0" alt="<?php 
            echo $alt;
            ?>
" />
					</a>
				</td>
			<?php 
            if (!$row->approved) {
                ?>
	            	<td width="5%" align="center"><a href="#approve" onClick="return listItemTask('cb<?php 
                echo $i;
                ?>
','approve')"><img src="images/publish_x.png" border=0 alt="approve" /></a></td>
	            <?php 
            } else {
                ?>
	            	<td width="5%" align="center"><img src="images/tick.png" /></td>
	            <?php 
            }
            ?>
	            <td width="5%" align="center">
	       	<?php 
            if ($file->exists()) {
                echo $file->getSize();
            }
            ?>
            </td>
            <td width="5%" align="center"><?php 
            echo $row->dmcounter;
            ?>
</td>
			<?php 
            if ($row->checked_out) {
                ?>
                	<td width="5%" align="center"><?php 
                echo $row->editor;
                ?>
</td>
            	<?php 
            } else {
                ?>
                <td width="5%" align="center">---</td>
                <?php 
            }
            ?>
</tr><?php 
            $k = 1 - $k;
        }
        ?>
        </tbody>

      </table>


      <input type="hidden" name="option" value="com_docman" />
      <input type="hidden" name="section" value="documents" />
      <input type="hidden" name="task" value="" />
      <input type="hidden" name="boxchecked" value="0" />
      <?php 
        echo DOCMAN_token::render();
        ?>
      </form>

   	  <?php 
        include_once $mosConfig_absolute_path . "/components/com_docman/footer.php";
    }
    function showStepConditions($course_id, $lpath_id, $step_id, $option, &$conds, &$lists, $step_name)
    {
        global $Itemid, $JLMS_CONFIG;
        ?>
<script language="javascript" type="text/javascript">
<!--
function submitbutton_del(pressbutton) {
	var form = document.adminForm;
	if (form.boxchecked.value == '0') {
		alert('<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
');
	} else {
		form.task.value = pressbutton;
		form.submit();
	}
}
function submitbutton_add(pressbutton) {
	var form = document.newcondForm;
	form.task.value = pressbutton;
	form.submit();
}
//-->
</script>
<?php 
        JLMS_TMPL::OpenMT();
        $hparams = array();
        $toolbar = array();
        $toolbar[] = array('btn_type' => 'back', 'btn_js' => sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=compose_lpath&amp;course_id={$course_id}&amp;id={$lpath_id}"));
        JLMS_TMPL::ShowHeader('lpath', '', $hparams, $toolbar);
        JLMS_TMPL::OpenTS();
        echo JLMSCSS::h2(_JLMS_LPATH_TITLE_CONDITIONS . $step_name);
        ?>
	<form action="<?php 
        echo sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid);
        ?>
" method="post" name="adminForm">
		<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
        echo JLMSCSS::_('jlmslist');
        ?>
">
			<tr>
				<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 width="20" class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" align="center">#</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
				<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 width="20" class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
">&nbsp;</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
				<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
">&nbsp;</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
				<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
"><?php 
        echo _JLMS_LPATH_COND_REF_STEP;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
			</tr>
		<?php 
        $k = 1;
        for ($i = 0, $n = count($conds); $i < $n; $i++) {
            $row_cond = $conds[$i];
            $checked = mosHTML::idBox($i, $row_cond->id);
            ?>
			<tr id="tree_row_<?php 
            echo $row_cond->id;
            ?>
" class="<?php 
            echo JLMSCSS::_('sectiontableentry' . $k);
            ?>
">
				<td align="center" valign="middle"><?php 
            echo $i + 1;
            ?>
</td>
				<td valign="middle"><?php 
            echo $checked;
            ?>
</td>
				<td valign="middle"><?php 
            echo _JLMS_LPATH_CONDTYPE_COMPLETE;
            ?>
</td>
				<td valign="middle" style="vertical-align:middle ">
					<?php 
            if (isset($row_cond->cond_time) && $row_cond->cond_time) {
                $row_cond->ref_step_name .= ' (' . _JLMS_LPATH_CONDTYPE_SPENT . ' ' . $row_cond->cond_time . ' ' . _JLMS_LPATH_CONDTYPE_TIME_SPENT_MIN . ')';
            }
            echo $row_cond->ref_step_name;
            ?>
				</td>
			</tr>
			<?php 
            $k = 3 - $k;
        }
        ?>
		</table>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
		<input type="hidden" name="task" value="lpath_item_delete" />
		<input type="hidden" name="id" value="<?php 
        echo $step_id;
        ?>
" />
		<input type="hidden" name="step_id" value="<?php 
        echo $step_id;
        ?>
" />
		<input type="hidden" name="lpath_id" value="<?php 
        echo $lpath_id;
        ?>
" />
		<input type="hidden" name="course_id" value="<?php 
        echo $course_id;
        ?>
" />
		<input type="hidden" name="boxchecked" value="0" />
	</form>
	<form action="<?php 
        echo sefRelToAbs("index.php?option=" . $option . "&ampItemid=" . $Itemid);
        ?>
" method="post" name="newcondForm">
<?php 
        echo '<table cellpadding="0" cellspacing="0" border="0" width="100%" class="jlms_table_no_borders">';
        $controls = array();
        $controls[] = array('href' => "javascript:submitbutton_del('lpath_cond_delete');", 'title' => _JLMS_LPATH_LINK_DEL_COND, 'img' => 'buttons_22/btn_delete_22.png');
        $controls[] = array('href' => "javascript:submitbutton_add('lpath_save_cond');", 'title' => _JLMS_LPATH_LINK_NEW_COND, 'img' => 'buttons_22/btn_add_22.png');
        $custom = _JLMS_LPATH_CONDTYPE_COMPLETE . '&nbsp;' . $lists['lpath_steps'];
        if ($JLMS_CONFIG->get('enable_timetracking')) {
            $custom .= '&nbsp;' . _JLMS_LPATH_CONDTYPE_AND_SPENT . ': <input type="text" name="cond_time" value="" size="5" class="inputbox" style="text-align: center;" /> <small>min</small>';
        }
        $controls[] = array('href' => '', 'title' => '', 'img' => '', 'custom' => $custom);
        JLMS_TMPL::ShowControlsFooter($controls, '', false, true);
        echo '</table>';
        /*
        		<table width="100%" cellpadding="0" cellspacing="0" border="0">
        			<tr>
        				<td>
        					<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
        						<td align="center" valign="middle" width="16"><a href="javascript:submitbutton_del('lpath_cond_delete');" title="<?php echo _JLMS_LPATH_LINK_DEL_COND;?>"><img class="JLMS_png" src="<?php echo $JLMS_CONFIG->get('live_site');?>/components/com_joomla_lms/lms_images/toolbar/btn_remove.png" width="16" height="16" border="0" alt="<?php echo _JLMS_LPATH_LINK_DEL_COND;?>" title="<?php echo _JLMS_LPATH_LINK_DEL_COND;?>" /></a></td>
        						<td align="center" valign="middle" width="16"><a href="javascript:submitbutton_add('lpath_save_cond');" title="<?php echo _JLMS_LPATH_LINK_NEW_COND;?>"><img class="JLMS_png" src="<?php echo $JLMS_CONFIG->get('live_site');?>/components/com_joomla_lms/lms_images/toolbar/btn_add.png" width="16" height="16" border="0" alt="<?php echo _JLMS_LPATH_LINK_NEW_COND;?>" title="<?php echo _JLMS_LPATH_LINK_NEW_COND;?>" /></a></td>
        						<td align="left" valign="middle">
        							&nbsp;<?php echo _JLMS_LPATH_CONDTYPE_COMPLETE. "&nbsp;" . $lists['lpath_steps']; ?>
        							&nbsp;<?php echo _JLMS_LPATH_CONDTYPE_AND_SPENT;?>: <input type="text" name="cond_time" value="" size="5" class="inputbox" style="text-align: center;" /> <small>min</small>
        						</td>
        					</tr></table>
        				</td>
        			</tr>
        		</table>
        */
        ?>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
		<input type="hidden" name="task" value="lpath_save_cond" />
		<input type="hidden" name="id" value="<?php 
        echo $step_id;
        ?>
" />
		<input type="hidden" name="step_id" value="<?php 
        echo $step_id;
        ?>
" />
		<input type="hidden" name="lpath_id" value="<?php 
        echo $lpath_id;
        ?>
" />
		<input type="hidden" name="course_id" value="<?php 
        echo $course_id;
        ?>
" />
	</form>
<?php 
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::CloseMT();
    }
Esempio n. 10
0
    function showCoursesForGuest($option, &$lists, &$rows, &$pageNav, $enrollment)
    {
        global $Itemid, $JLMS_CONFIG;
        //		$show_fee_col = $JLMS_CONFIG->get('show_fee_column');
        $lms_img_path = $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images', 'components/com_joomla_lms/lms_images');
        $show_paid_courses = $JLMS_CONFIG->get('show_paid_courses', 1);
        $show_course_author = $JLMS_CONFIG->get('show_course_authors', 1);
        $price_fee_type = $JLMS_CONFIG->get('price_fee_type', 1);
        $show_short_description = $JLMS_CONFIG->get('show_short_description', 0);
        $show_course_publish_dates = $JLMS_CONFIG->get('show_course_publish_dates', 0);
        $jlms_cs = $JLMS_CONFIG->get('jlms_cur_sign');
        $colspan_sh_description = 4;
        if ($show_course_publish_dates) {
            $colspan_sh_description = 6;
        }
        if (!$price_fee_type) {
            $colspan_sh_description = $colspan_sh_description - 1;
        }
        //FLMS multicat
        $multicat = array();
        if ($JLMS_CONFIG->get('multicat_use', 0)) {
            $multicat = array();
            $i = 0;
            foreach ($lists as $key => $item) {
                if (substr($key, 0, 7) == 'filter_') {
                    $multicat[] = $lists['filter_' . $i];
                    $i++;
                }
            }
        }
        ?>
		
	<?php 
        if ($enrollment) {
            ?>
		<script language="javascript" type="text/javascript">
		<!--//--><![CDATA[//><!--
		function submitbutton(pressbutton, course_id) {
			var form = document.adminForm;
			if ( (pressbutton == 'delete_course') || (pressbutton == 'edit_course') || (pressbutton == 'export_course_pre') ) {
				form.id.value = course_id;
				form.task.value = pressbutton;
				form.submit();
			}
			else if( (pressbutton == 'enroll') && (form.boxchecked.value == '0') ){
				alert( "<?php 
            echo _JLMS_ALERT_SELECT_ITEM;
            ?>
" );
			}
			else {
				if (pressbutton == 'enroll'){
					form.task.value = 'subscription';
					form.submit();
				}
			}
		}
		function isChecked(isitchecked){
			if (isitchecked == true){
				document.adminForm.boxchecked.value++;
			}
			else {
				document.adminForm.boxchecked.value--;
			}
		}
		var old_filters = new Array();
		function read_filter(){
			var form = document.adminForm;
			var count_levels = '<?php 
            echo count($lists['levels']);
            ?>
';
			for(var i=0;i<parseInt(count_levels);i++){
				if(form['filter_id_'+i] != null){
					old_filters[i] = form['filter_id_'+i].value;
				}
			}
		}
		function write_filter(){
			var form = document.adminForm;
			var count_levels = '<?php 
            echo count($lists['levels']);
            ?>
';
			var j;
			for(var i=0;i<parseInt(count_levels);i++){
				if(form['filter_id_'+i+''] != null && form['filter_id_'+i+''].value != old_filters[i]){
					j = i;
				}
				if(i > j){
					if(form['filter_id_'+i] != null){
						form['filter_id_'+i].value = 0;	
					}
				}
			}
		}
		//--><!]]>
		</script>
	<?php 
        }
        JLMS_TMPL::OpenMT();
        $params = array('show_menu' => true, 'simple_menu' => true);
        JLMS_TMPL::OpenTS('', ' align="right" style="text-align:right " width="100%"');
        JLMS_showTopMenu_simple($option);
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::OpenTS('', ' align="left"');
        echo JLMS_ShowText_WithFeatures($lists['homepage_text']);
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::OpenTS();
        if ($enrollment) {
            ?>
			<form action="<?php 
            echo JURI::base() . "index.php?option={$option}&amp;Itemid={$Itemid}";
            ?>
" method="post" name="adminForm">
		<?php 
        }
        ?>
			<table width="100%" cellpadding="0" cellspacing="0" border="0" id="jlms_courses_guest">
<?php 
        if ($enrollment) {
            if ($JLMS_CONFIG->get('multicat_use', 0)) {
                JLMS_TMPL::OpenTS('', ' align="right" style="text-align:right " width="100%"');
                echo (isset($lists['levels'][0]->cat_name) && $lists['levels'][0]->cat_name != '' ? $lists['levels'][0]->cat_name : _JLMS_COURSES_COURSES_GROUPS) . " " . $lists['filter_0'];
                JLMS_TMPL::CloseTS();
            } else {
                JLMS_TMPL::OpenTS('', ' align="right" style="text-align:right " width="100%"');
                echo _JLMS_COURSES_COURSES_GROUPS . " " . $lists['groups_course'];
                JLMS_TMPL::CloseTS();
            }
            if (count($multicat)) {
                for ($i = 0; $i < count($multicat); $i++) {
                    if ($i > 0) {
                        JLMS_TMPL::OpenTS('', ' align="right" style="text-align:right " width="100%"');
                        echo (isset($lists['levels'][$i]->cat_name) && $lists['levels'][$i]->cat_name != '' ? $lists['levels'][$i]->cat_name : _JLMS_COURSES_COURSES_GROUPS) . " " . $lists['filter_' . $i];
                        JLMS_TMPL::CloseTS();
                    }
                }
            }
            $controls = array();
            $controls[] = array('href' => "javascript:submitbutton('enroll','');", 'noscript' => 'submit', 'value' => '1', 'title' => _JLMS_ENROLL, 'img' => 'publish');
            JLMS_TMPL::ShowControlsFooter($controls, '', false);
        }
        ?>
<tr><td><table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
        echo JLMSCSS::_('jlmslist');
        ?>
">
				<tr>
					<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" align="center" width="1%">#</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
			<?php 
        if ($enrollment) {
            ?>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center" width="1%">&nbsp;</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
			<?php 
        }
        ?>
					<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" width="35%" align="left" id="jlms_courselist_name"><?php 
        echo _JLMS_COURSES_TBL_HEAD_NAME;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
					<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" width="20%" align="left" id="jlms_courselist_category"><?php 
        echo _JLMS_COURSES_COURSES_CAT;
        ?>
</<?php 
        echo JLMSCSS::tableheadertag();
        ?>
>
					<?php 
        if ($show_course_publish_dates) {
            ?>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="6%" align="left" nowrap="nowrap"><?php 
            echo _JLMS_COURSES_ST_DATE;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="6%" align="left" nowrap="nowrap"><?php 
            echo _JLMS_COURSES_END_DATE;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<?php 
        }
        if ($price_fee_type == 1) {
            ?>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="4%" align="left" nowrap="nowrap"><?php 
            echo _JLMS_COURSES_FEETYPE;
            ?>
</<?php 
            echo JLMSCSS::tableheadertag();
            ?>
>
					<?php 
        } else {
            if ($price_fee_type == 2) {
                ?>
					<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="4%" align="left" nowrap="nowrap"><?php 
                echo _JLMS_COURSES_PRICE;
                ?>
</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>							
					<?php 
            }
        }
        ?>
				</tr>
			<?php 
        $k = 1;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            if (!$show_paid_courses && $row->paid) {
                continue;
            }
            $course_descr = strip_tags($row->course_description);
            if (strlen($course_descr) > 100) {
                $course_descr = substr($course_descr, 0, 100) . "...";
            }
            if ($row->self_reg == 0) {
                $checked = "<a href='mailto:" . $row->email . "'><img class='JLMS_png' src=\"" . $lms_img_path . "/dropbox/dropbox_corr.png\" width='16' height='16' border='0' alt='' title='' /></a>";
            } else {
                if ($row->gid) {
                    $checked = "<a href='mailto:" . $row->email . "'><img class='JLMS_png' src=\"" . $lms_img_path . "/dropbox/dropbox_corr.png\" width='16' height='16' border='0' alt='' title='' /></a>";
                } else {
                    $checked = mosHTML::idBox($i, $row->id);
                }
            }
            $link = sefRelToAbs("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=course_guest&amp;id=" . $row->id);
            ?>
				<?php 
            if ($show_short_description) {
                ?>
				<tr valign="middle" style="vertical-align:middle" class="<?php 
                echo JLMSCSS::_('sectiontableentry2');
                ?>
">
				<?php 
            } else {
                ?>
				<tr valign="middle" style="vertical-align:middle" class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">				
				<?php 
            }
            ?>
					<td align="center"><?php 
            echo $pageNav->limitstart + $i + 1;
            ?>
</td>
					<?php 
            if ($enrollment) {
                ?>
					<td align="center"><?php 
                echo $checked;
                ?>
</td>
					<?php 
            }
            ?>
					<td align="left">
						<a href="<?php 
            echo $link;
            ?>
" title="<?php 
            echo _JLMS_VIEW_DETAILS;
            ?>
">
							<?php 
            echo $row->course_name;
            ?>
							</a><br />
							<?php 
            if ($show_course_author) {
                ?>
							<span class="small"><?php 
                echo _JLMS_HOME_AUTHOR . "&nbsp;" . $row->user_fullname;
                ?>
</span>
							<?php 
            }
            ?>
					</td>
					<td align="left"><?php 
            echo $row->c_category ? $row->c_category : '&nbsp;';
            ?>
</td>
					<?php 
            //						if (!$JLMS_ACL->CheckPermissions('lms', 'order_courses')) {
            if ($show_course_publish_dates) {
                ?>
						<td align="center" nowrap="nowrap"><?php 
                echo $row->publish_start ? JLMS_dateToDisplay($row->start_date) : '&nbsp;';
                ?>
</td>
						<td align="center" nowrap="nowrap"><?php 
                echo $row->publish_end ? JLMS_dateToDisplay($row->end_date) : '&nbsp;';
                ?>
</td>
						<?php 
            }
            //						}
            ?>
					<?php 
            /*if($show_fee_col == 1){?>
            		<td align="left"><?php echo $row->paid ? _JLMS_COURSES_PAID : _JLMS_COURSES_FREE;?></td>
            		<?php }*/
            if ($price_fee_type) {
                if ($price_fee_type == 1) {
                    ?>
						<td align="center"><?php 
                    echo $row->paid ? _JLMS_COURSES_PAID : _JLMS_COURSES_FREE;
                    ?>
</td>
						<?php 
                } else {
                    if ($price_fee_type == 2) {
                        ?>
						<td align="center"><?php 
                        echo $row->paid ? $jlms_cs . sprintf('%.2f', round($row->course_price, 2)) : _JLMS_COURSES_FREE;
                        ?>
</td>	
						<?php 
                    }
                }
            }
            ?>
				</tr>
				<?php 
            if ($show_short_description) {
                if (strlen($row->course_sh_description)) {
                    ?>
					<tr class="<?php 
                    echo JLMSCSS::_('sectiontableentry1');
                    ?>
">
						<td>&nbsp;</td>
						<td colspan="<?php 
                    echo $colspan_sh_description;
                    ?>
" style="text-align: justify;">
							<?php 
                    echo $row->course_sh_description;
                    ?>
						</td>
					</tr>
					<?php 
                }
            }
            ?>
				<?php 
            $k = 3 - $k;
        }
        ?>
				<tr>
					<td class="<?php 
        echo JLMSCSS::_('jlmslist-footer_td');
        ?>
" colspan="<?php 
        echo $colspan_sh_description + 1;
        ?>
" align="center"><div align="center">
<?php 
        $filter_groups = intval(mosGetParam($_REQUEST, 'groups_course', 0));
        $link = "index.php?option={$option}&amp;Itemid={$Itemid}";
        if ($filter_groups) {
            $link = $link . "&amp;groups_course={$filter_groups}";
        }
        echo $pageNav->writePagesLinks($link);
        ?>
 
					</div></td>
				</tr></table></td></tr>
				
<?php 
        if ($enrollment) {
            JLMS_TMPL::ShowControlsFooter($controls);
        }
        ?>
</table>
							
	<?php 
        if ($enrollment) {
            ?>
			<input type="hidden" name="task" value="subscription" />
			<input type="hidden" name="id" value="" />
			<input type="hidden" name="boxchecked" value="0" />
		</form>
	<?php 
        }
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::CloseMT();
    }
Esempio n. 11
0
    /**
     * Writes a list of the Trash items
     */
    function showList($option, $contents, $menus, $pageNav_content, $pageNav_menu)
    {
        global $my;
        $tabs = new mosTabs(1);
        ?>
		<script language="javascript" type="text/javascript">
		/**
		* Toggles the check state of a group of boxes
		*
		* Checkboxes must have an id attribute in the form cb0, cb1...
		* @param The number of box to 'check'
		*/
		function checkAll_xtd ( n ) {
			//var f = document.adminForm;
			var f=document.getElementById("adminForm1");
			var d=document.getElementById("adminForm");
			var c = f.toggle1.checked;
			var n2 = 0;
			for ( i=0; i < n; i++ ) {
				cb = eval ( 'f.cb1' + i );
				dcb = eval ('d.dcb' + i );
				if (cb) {
					cb.checked = c;
					dcb.checked = c;
					n2++;
				}
			}
			if (c) {
				f.boxchecked.value = n2;
				d.boxchecked.value = n2;
			} else {
				f.boxchecked.value = 0;
				d.boxchecked.value = 0;
			}
		}
		</script>
		<form action="index2.php" method="post" name="adminForm" id="adminForm">
		<table class="adminheading">
		<tr>
			<th class="trash"><?php 
        echo T_('Trash Manager');
        ?>
</th>
		</tr>
		</table>

		<?php 
        $tabs->startPane("content-pane");
        $tabs->startTab(T_("Content Items"), "content_items");
        ?>
		<table class="adminheading" width="90%">
		<tr>
			<th><small><?php 
        echo T_('Content Items');
        ?>
</small></th>
		</tr>
		</table>

		<table class="adminlist" width="90%">
		<tr>
			<th width="20">#</th>
			<th width="20">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($contents);
        ?>
);" />
			</th>
			<th width="20px">&nbsp;</th>
			<th class="title">
			<?php 
        echo T_('Title');
        ?>
			</th>
			<th>
			<?php 
        echo T_('Section');
        ?>
			</th>
			<th>
			<?php 
        echo T_('Category');
        ?>
			</th>
			<th width="70px">
			<?php 
        echo T_('ID');
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        $i = 0;
        $n = count($contents);
        foreach ($contents as $row) {
            ?>
			<tr class="<?php 
            echo "row" . $k;
            ?>
">
				<td align="center" width="30px">
				<?php 
            echo $i + 1 + $pageNav_content->limitstart;
            ?>
				</td>
				<td width="20px" align="center"><?php 
            echo mosHTML::idBox($i, $row->id);
            ?>
</td>
				<td width="20px"></td>
				<td nowrap>
				<?php 
            echo $row->title;
            ?>
				</td>
				<td align="center" width="20%">
				<?php 
            echo $row->sectname;
            ?>
				</td>
				<td align="center" width="20%">
				<?php 
            echo $row->catname;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
            $i++;
        }
        ?>
		</table>
		<?php 
        echo $pageNav_content->getListFooter();
        ?>
		<?php 
        $tabs->endTab();
        ?>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />

		<?php 
        $i = 0;
        foreach ($menus as $row) {
            ?>
			<input type="checkbox" style="visibility:hidden;" id="dcb<?php 
            echo $i;
            ?>
" name="mid[]" value="<?php 
            echo $row->id;
            ?>
">
			<?php 
            $i++;
        }
        ?>
		</form>

		<form action="index2.php" method="post" name="adminForm1" id="adminForm1">
		<?php 
        $tabs->startTab(T_("Menu Items"), "menu_items");
        ?>
		<table class="adminheading" width="90%">
		<tr>
			<th><small><?php 
        echo T_('Menu Items');
        ?>
</small></th>
		</tr>
		</table>

		<table class="adminlist" width="90%">
		<tr>
			<th width="20">#</th>
			<th width="20">
			<input type="checkbox" name="toggle1" value="" onClick="checkAll_xtd(<?php 
        echo count($menus);
        ?>
);" />
			</th>
			<th width="20px">&nbsp;</th>
			<th class="title">
			<?php 
        echo T_('Title');
        ?>
			</th>
			<th>
			<?php 
        echo T_('Menu');
        ?>
			</th>
			<th>
			<?php 
        echo T_('Type');
        ?>
			</th>
			<th width="70px">
			<?php 
        echo T_('ID');
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        $i = 0;
        $n = count($menus);
        foreach ($menus as $row) {
            ?>
			<tr class="<?php 
            echo "row" . $k;
            ?>
">
				<td align="center" width="30px">
				<?php 
            echo $i + 1 + $pageNav_menu->limitstart;
            ?>
				</td>
				<td width="30px" align="center">
				<input type="checkbox" id="cb1<?php 
            echo $i;
            ?>
" name="mid[]" value="<?php 
            echo $row->id;
            ?>
" onclick="isChecked(this.checked);document.getElementById('dcb<?php 
            echo $i;
            ?>
').checked=this.checked;" />
				</td>
				<td width="20px"></td>
				<td nowrap>
				<?php 
            echo $row->name;
            ?>
				</td>
				<td align="center" width="20%">
				<?php 
            echo $row->menutype;
            ?>
				</td>
				<td align="center" width="20%">
				<?php 
            echo $row->type;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
            $i++;
        }
        ?>
		</table>
		<?php 
        echo $pageNav_menu->getListFooter();
        ?>
		<?php 
        $tabs->endTab();
        $tabs->endPane();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<?php 
    }
    function showMessages(&$rows, $pageNav, $search, $option)
    {
        ?>
		<form action="index2.php" method="post" name="adminForm">
		
		<table class="adminheading">
		<tr>
			<th class="inbox">
				Mensagem Privada
			</th>
			<td>
				Procurar:
			</td>
			<td> 
				<input type="text" name="search" value="<?php 
        echo htmlspecialchars($search);
        ?>
" class="inputbox" onChange="document.adminForm.submit();" />
			</td>
		</tr>
		</table>
  
		<table class="adminlist">
		<tr>
			<th width="20">
				nº
			</th>
			<th width="5%" class="title"> 
				<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th width="60%" class="title">
				Assunto
			</th>
			<th width="15%" class="title">
				De
			</th>
			<th width="15%" class="title">
				Data
			</th>
			<th width="5%" class="title">
				Lida
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td width="20">
					<?php 
            echo $i + 1 + $pageNav->limitstart;
            ?>
				</td>
				<td width="5%">
					<?php 
            echo mosHTML::idBox($i, $row->message_id);
            ?>
				</td>
				<td width="60%"> 
					<a href="#edit" onClick="hideMainMenu();return listItemTask('cb<?php 
            echo $i;
            ?>
','view')">
						<?php 
            echo $row->subject;
            ?>
</a> 
				</td>
				<td width="15%">
					<?php 
            echo $row->user_from;
            ?>
				</td>
				<td width="15%">
					<?php 
            echo $row->date_time;
            ?>
				</td>
				<td width="15%">
					<?php 
            if (intval($row->state) == "1") {
                echo 'Lida';
            } else {
                echo 'Não Lida';
            }
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>
		
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
Esempio n. 13
0
    function showWeblinks($option, &$rows, &$lists, &$search, &$pageNav)
    {
        global $my, $adminLanguage;
        ?>
		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th>
			<?php 
        echo $adminLanguage->A_COMP_WEBL_MANAGER;
        ?>
			</th>
			<td>
			<?php 
        echo $adminLanguage->A_COMP_FILTER;
        ?>
:
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
			<td width="right">
			<?php 
        echo $lists['catid'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="20">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title" width="40%" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_TITLE;
        ?>
			</th>
			<th width="10%" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_PUBLISHED;
        ?>
			</th>
			<th width="10%" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_WEBL_APPROVED;
        ?>
			</th>
			<th colspan="2">
			<?php 
        echo $adminLanguage->A_COMP_REORDER;
        ?>
			</th>
			<th width="25%" align="center" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_CATEG;
        ?>
			</th>
			<th width="10%" align="left" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_HITS;
        ?>
			</th>
			<th width="10%" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_CHECKED_OUT;
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $task = $row->published ? 'unpublish' : 'publish';
            $img = $row->published ? 'publish_g.png' : 'publish_x.png';
            $alt = $row->published ? $adminLanguage->A_COMP_PUBLISHED : $adminLanguage->A_COMP_UNPUBLISHED;
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td width="20">
				<?php 
            echo mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
            ?>
				</td>
				<td width="50%">
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                ?>
					<?php 
                echo $row->title;
                ?>
					&nbsp;[ <i><?php 
                echo $adminLanguage->A_COMP_CHECKED_OUT;
                ?>
</i> ]
					<?php 
            } else {
                ?>
					<a href="#edit" onclick="return listItemTask('cb<?php 
                echo $i;
                ?>
','edit')">
					<?php 
                echo $row->title;
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<td width="10%" align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
				<img src="images/<?php 
            echo $img;
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $alt;
            ?>
" />
				</a>
				</td>
				<?php 
            if ($row->approved) {
                ?>
					<td width="10%" align="center">
					<img src="images/tick.png">
					</td>
					<?php 
            } else {
                ?>
					<td width="10%" align="center">&nbsp;</td>
					<?php 
            }
            ?>
				<td>
				<?php 
            echo $pageNav->orderUpIcon($i, $row->catid == @$rows[$i - 1]->catid);
            ?>
				</td>
      			<td>
				<?php 
            echo $pageNav->orderDownIcon($i, $n, $row->catid == @$rows[$i + 1]->catid);
            ?>
				</td>
				<td width="25%" align="center">
				<?php 
            echo $row->category;
            ?>
				</td>
				<td width="10%">
				<?php 
            echo $row->hits;
            ?>
				</td>
				<?php 
            if ($row->checked_out) {
                ?>
					<td width="10%" align="center"><?php 
                echo $row->editor;
                ?>
</td>
					<?php 
            } else {
                ?>
					<td width="10%" align="center">&nbsp;</td>
					<?php 
            }
            ?>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<?php 
    }
Esempio n. 14
0
    function show(&$rows, $myid, &$pageNav, &$lists, $type)
    {
        global $my, $mosConfig_absolute_path;
        $section = "com_docman";
        $section_name = "DOCman";
        ?>
		<form action="index2.php" method="post" name="adminForm">

        <?php 
        dmHTML::adminHeading(_DML_CATS, 'categories');
        ?>


		<table class="adminlist">
        <thead>
		<tr>
			<th width="20">
			#
			</th>
			<th width="20">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title"><?php 
        echo _DML_CATNAME;
        ?>
</th>
			<th width="10%"><?php 
        echo _DML_PUBLISHED;
        ?>
</th>
			<th colspan="2"><?php 
        echo _DML_REORDER;
        ?>
</th>
			<th width="10%"><?php 
        echo _DML_ACCESS;
        ?>
</th>
			<th width="12%"><?php 
        echo _DML_CATEGORY;
        ?>
 ID</th>
			<th width="12%"># <?php 
        echo _DML_DOCS;
        ?>
</th>
			<th width="12%"><?php 
        echo _DML_CHECKED_OUT;
        ?>
</th>
		  </tr>
        </thead>
        <tfoot><tr><td colspan="11"><?php 
        echo $pageNav->getListFooter();
        ?>
</td></tr></tfoot>
        <tbody>
		<?php 
        $k = 0;
        $i = 0;
        $n = count($rows);
        foreach ($rows as $row) {
            $img = $row->published ? 'tick.png' : 'publish_x.png';
            $task = $row->published ? 'unpublish' : 'publish';
            $alt = $row->published ? 'Published' : 'Unpublished';
            if (!$row->access) {
                $color_access = 'style="color: green;"';
                $task_access = 'accessregistered';
            } else {
                if ($row->access == 1) {
                    $color_access = 'style="color: red;"';
                    $task_access = 'accessspecial';
                } else {
                    $color_access = 'style="color: black;"';
                    $task_access = 'accesspublic';
                }
            }
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td width="20" align="right">
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td width="20">
				<?php 
            echo mosHTML::idBox($i, $row->id, $row->checked_out_contact_category && $row->checked_out_contact_category != $my->id);
            ?>
				</td>
				<td width="35%">
				<?php 
            if ($row->checked_out_contact_category && $row->checked_out_contact_category != $my->id) {
                ?>
					<?php 
                echo $row->treename . ' ( ' . $row->title . ' )';
                ?>
					&nbsp;[ <i><?php 
                echo _DML_CHECKED_OUT;
                ?>
</i> ]
					<?php 
            } else {
                ?>
					<a href="#edit" onClick="return listItemTask('cb<?php 
                echo $i;
                ?>
','edit')">
					<?php 
                echo $row->treename . ' ( ' . $row->title . ' )';
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<td align="center">
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
				<img src="images/<?php 
            echo $img;
            ?>
"  border="0" alt="<?php 
            echo $alt;
            ?>
" />
				</a>
				</td>
				<?php 
            if ($section != 'content') {
                ?>
					<td>
					<?php 
                echo $pageNav->orderUpIcon($i);
                ?>
					</td>
					<td>
					<?php 
                echo $pageNav->orderDownIcon($i, $n);
                ?>
					</td>
					<?php 
            }
            ?>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task_access;
            ?>
')" <?php 
            echo $color_access;
            ?>
>
				<?php 
            echo $row->groupname;
            ?>
				</a>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->documents;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->checked_out_contact_category ? $row->editor : "";
            ?>
				</td>
				<?php 
            $k = 1 - $k;
            ?>
			</tr>
			<?php 
            $k = 1 - $k;
            $i++;
        }
        ?>
        </tbody>
		</table>


		<input type="hidden" name="option" value="com_docman" />
		<input type="hidden" name="section" value="categories" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="chosen" value="" />
		<input type="hidden" name="act" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="type" value="<?php 
        echo $type;
        ?>
" />
        <?php 
        echo DOCMAN_token::render();
        ?>
		</form>
		<?php 
        include_once $mosConfig_absolute_path . "/components/com_docman/footer.php";
    }
Esempio n. 15
0
    function showPolls(&$rows, &$pageNav, $option)
    {
        global $my, $adminLanguage;
        ?>
		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th><?php 
        echo $adminLanguage->A_COMP_POLL_MANAGER;
        ?>
</th>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="20">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th align="<?php 
        echo $adminLanguage->RTLsupport ? 'right' : 'left';
        ?>
"> <!-- rtl change -->
			<?php 
        echo $adminLanguage->A_COMP_POLL_TITLE;
        ?>
			</th>
			<th width="15%" align="center">
			<?php 
        echo $adminLanguage->A_COMP_POLL_OPTIONS;
        ?>
			</th>
			<th width="15%" align="center">
			<?php 
        echo $adminLanguage->A_COMP_PUBLISHED;
        ?>
			</th>
			<th width="20%" align="center">
			<?php 
        echo $adminLanguage->A_COMP_CHECKED_OUT;
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $task = $row->published ? 'unpublish' : 'publish';
            $img = $row->published ? 'publish_g.png' : 'publish_x.png';
            $alt = $row->published ? $adminLanguage->A_COMP_PUBLISHED : $adminLanguage->A_COMP_UNPUBLISHED;
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td width="20">
				<?php 
            echo mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
            ?>
				</td>
				<td width="50%">
				<a href="#edit" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','edit')">
				<?php 
            echo $row->title;
            ?>
				</a>
				</td>
				<td width="" align="center">
				<?php 
            echo $row->numoptions;
            ?>
&nbsp;
				</td>
				<td width="10%" align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
				<img src="images/<?php 
            echo $img;
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $alt;
            ?>
" />
				</a>
				</td>
				<td width="10%" align="center">
				<?php 
            echo $row->editor;
            ?>
&nbsp;
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>
		
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<?php 
    }
Esempio n. 16
0
    function FLMS_vListCategories($option, $rows, $pageNav, $levellist)
    {
        global $JLMS_CONFIG;
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php" method="post" name="adminForm">		
		<table width="100%" >
			<tr>
				<td valign="top" width="220">
					<div>
						<?php 
        echo joomla_lms_adm_html::JLMS_menu();
        ?>
					</div>
				</td>
				<td valign="top">			
					<?php 
        if (!class_exists('JToolBarHelper')) {
            ?>
					<table class="adminheading" cellpadding="0" cellspacing="0" border="0">
					<tr>
						<th class="categories">
						<?php 
            echo _JOOMLMS_COMP_NAME;
            ?>
: <small><?php 
            echo _JLMS_FLMS_CATS_MANG;
            ?>
</small>
						</th>
						<?php 
            if ($JLMS_CONFIG->get('multicat_show_admin_levels', 0)) {
                ?>
						<td align="right">
							<table class="adminlist">
								<tr class="row1">
									<td nowrap="true">
										<?php 
                echo _JLMS_OTH_MAX_LEVLS;
                ?>
									</td>
									<td>
										<?php 
                echo $levellist;
                ?>
									</td>
								</tr>
							</table>
						</td>
						<?php 
            }
            ?>
					</tr>
					</table>
					<?php 
        } else {
            ?>
					<div style="width: 100%;">
						<table  align="right" style="width: 10%;" class="adminlist">
							<tr class="row1">
								<td nowrap="nowrap" align="left" width="100%" style="padding:2px 10px 2px 10px;">
								<?php 
            echo _JLMS_FLMS_MAX_LEVLS;
            ?>
								</td>
								<td nowrap="nowrap">
									<?php 
            echo $levellist;
            ?>
								</td>
							</tr>
						</table>
					</div>
					<div style="clear: both;"><!--x--></div>
					<?php 
        }
        ?>
					
					<table class="adminlist">
						<thead>
							<tr>
								<th class="title" width="20">
									#
								</th>
								<th class="title" width="20">
									<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
								</th>
								<th class="title" width="40%">
									<?php 
        echo _JLMS_NAME;
        ?>
								</th>
								<th class="title" width="auto"></th>
							</tr>
						</thead>
						<tfoot>
							<tr> 
								<td colspan="4">
									<?php 
        echo $pageNav->getListFooter();
        ?>
								</td>
							</tr>
						</tfoot>
						<tbody>
							<?php 
        $k = 0;
        $i = 0;
        $n = count($rows);
        foreach ($rows as $row) {
            $checked = mosHTML::idBox($i, $row->id);
            $link = "index.php?option={$option}&task=multicat_editA&id=" . $row->id;
            ?>
								<tr class="<?php 
            echo "row{$k}";
            ?>
">
									<td>
									<?php 
            echo $i + 1 + $pageNav->limitstart;
            ?>
									</td>
									<td>
									<?php 
            echo $checked;
            ?>
									</td>
									<td nowrap="nowrap">
									<a href="<?php 
            echo $link;
            ?>
" title="<?php 
            echo $row->name;
            ?>
">
									<?php 
            echo $row->treename;
            ?>
									</a>
									</td>
									<td width="auto"></td>
								</tr>
								<?php 
            $k = 1 - $k;
            $i++;
        }
        ?>
						</tbody>
					</table>					
				</td>
			</tr>
		</table>

			<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
			<input type="hidden" name="task" value="multicat" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="hidemainmenu" value="0" />		
		</form>
		<?php 
    }
Esempio n. 17
0
    function showClients(&$rows, &$pageNav, $option)
    {
        global $adminLanguage;
        ?>
	<form action="index2.php" method="post" name="adminForm">
	<table class="adminheading">
		<tr>
			<th><?php 
        echo $adminLanguage->A_COMP_BANNERS_CLIENT_MANAGER;
        ?>
</th>
		</tr>
	</table>
	<table class="adminlist">
		<tr>
			<th width="20"><?php 
        echo $adminLanguage->A_COMP_BANNERS_ID;
        ?>
#</th>
			<th width="20"><input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" /></th>
			<th align="left" nowrap><?php 
        echo $adminLanguage->A_COMP_BANNERS_CLIENT;
        ?>
</th>
			<th align="left" nowrap><?php 
        echo $adminLanguage->A_COMP_CONTACT;
        ?>
</th>
			<th align="center" nowrap><?php 
        echo $adminLanguage->A_COMP_BANNERS_NO_ACTIVE;
        ?>
</th>
			<th align="center" nowrap><?php 
        echo $adminLanguage->A_COMP_BANNERS_LOCK;
        ?>
</th>
		</tr>
<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            ?>
		<tr class="<?php 
            echo "row{$k}";
            ?>
">
			<td width="20" align="center"><?php 
            echo $pageNav->rowNumber($i);
            ?>
</td>
			<td width="20"><?php 
            echo mosHTML::idBox($i, $row->cid);
            ?>
</td>
			<td width="40%"><a href="#edit" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','editclient')"><?php 
            echo $row->name;
            ?>
</a></td>
			<td width="40%"><?php 
            echo $row->contact;
            ?>
</td>
			<td width="20%" align="center"><?php 
            echo $row->bid;
            ?>
</td>
			<td width="10%" align="center"><?php 
            echo isset($row->editor) ? $row->editor : "&nbsp;";
            ?>
</td>
		</tr>
<?php 
            $k = 1 - $k;
        }
        ?>
	</table>
	<?php 
        echo $pageNav->getListFooter();
        ?>
	<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
">
	<input type="hidden" name="task" value="">
	<input type="hidden" name="boxchecked" value="0">
	</form>
<?php 
    }
Esempio n. 18
0
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showContent(&$rows, &$pageNav, $option, $search, &$lists)
    {
        global $my, $mosConfig_live_site, $adminLanguage;
        ?>
		<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="edit">
			<?php 
        echo $adminLanguage->A_COMP_TYPED_STATIC;
        ?>
			</th>
			<td>
			<?php 
        echo $adminLanguage->A_COMP_FILTER;
        ?>
:&nbsp;
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
			<td>
			&nbsp;&nbsp;&nbsp;<?php 
        echo $adminLanguage->A_COMP_FRONT_ORDER;
        ?>
:&nbsp;
			</td>
			<td>
			<?php 
        echo $lists['order'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5px">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title" width="40%">
			<?php 
        echo $adminLanguage->A_COMP_TITLE;
        ?>
			</th>
			<th width="5%">
			<?php 
        echo $adminLanguage->A_COMP_PUBLISHED;
        ?>
			</th>
			<th width="10%">
			<?php 
        echo $adminLanguage->A_COMP_ACCESS;
        ?>
			</th>
			<th width="5%">
			<?php 
        echo $adminLanguage->A_COMP_ID;
        ?>
			</th>
			<th width="10%" align="left">
			<?php 
        echo $adminLanguage->A_COMP_AUTHOR;
        ?>
			</th>
			<th width="1%" align="left">
			<?php 
        echo $adminLanguage->A_COMP_TYPED_LINKS;
        ?>
			</th>
			<th width="10%" nowrap="nowrap" align="center">
			<?php 
        echo $adminLanguage->A_COMP_CHECKED_OUT;
        ?>
			</th>
			<th></th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            if (!$row->access) {
                $color_access = 'style="color: green;"';
                $task_access = 'accessregistered';
            } else {
                if ($row->access == 1) {
                    $color_access = 'style="color: red;"';
                    $task_access = 'accessspecial';
                } else {
                    $color_access = 'style="color: black;"';
                    $task_access = 'accesspublic';
                }
            }
            $link = 'index2.php?option=com_typedcontent&task=edit&id=' . $row->id;
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
            ?>
				</td>
				<td>
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                ?>
					<?php 
                echo $row->title;
                if ($row->title_alias) {
                    echo ' (<i>' . $row->title_alias . '</i>)';
                }
                ?>
					[ <i><?php 
                echo $adminLanguage->A_COMP_CHECKED_OUT;
                ?>
</i> ]
					<?php 
            } else {
                ?>
					<a href="<?php 
                echo $link;
                ?>
">
					<?php 
                echo $row->title;
                if ($row->title_alias) {
                    echo ' (<i>' . $row->title_alias . '</i>)';
                }
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<?php 
            $now = date("Y-m-d h:i:s");
            if ($now <= $row->publish_up && $row->state == "1") {
                $img = 'publish_y.png';
                $alt = $adminLanguage->A_COMP_PUBLISHED;
            } else {
                if (($now <= $row->publish_down || $row->publish_down == "0000-00-00 00:00:00") && $row->state == "1") {
                    $img = 'publish_g.png';
                    $alt = $adminLanguage->A_COMP_PUBLISHED;
                } else {
                    if ($now > $row->publish_down && $row->state == "1") {
                        $img = 'publish_r.png';
                        $alt = $adminLanguage->A_COMP_EXPIRED;
                    } elseif ($row->state == "0") {
                        $img = "publish_x.png";
                        $alt = $adminLanguage->A_COMP_UNPUBLISHED;
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_START_ALWAYS . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_START . ": " . $row->publish_up . "</td></tr>";
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_FIN_NOEXP . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_FINISH . ": " . $row->publish_down . "</td></tr>";
                }
            }
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onMouseOver="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, '<?php 
                echo $adminLanguage->A_COMP_CONTENT_PUBLISH_INFO;
                ?>
', BELOW, RIGHT);" onMouseOut="return nd();" onClick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? $adminLanguage->A_COMP_UNPUBLISHED : $adminLanguage->A_COMP_PUBLISHED;
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task_access;
            ?>
')" <?php 
            echo $color_access;
            ?>
>
				<?php 
            echo $row->groupname;
            ?>
				</a>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
				<td align="left">
				<?php 
            echo $row->creator;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->links;
            ?>
				</td>
				<td align="left" colspan="2">
				<?php 
            if ($row->checked_out) {
                ?>
					<?php 
                echo $row->editor;
                ?>
					<?php 
            } else {
                ?>
					&nbsp;
					<?php 
            }
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<br />

		<?php 
        mosCommonHTML::ContentLegend();
        ?>
	    <script language="Javascript" src="<?php 
        echo $mosConfig_live_site;
        ?>
/includes/js/overlib_mini.js"></script>
		<?php 
    }
Esempio n. 19
0
    function showList(&$rows, $option, &$roles)
    {
        global $JLMS_CONFIG;
        ?>
	<script type="text/javascript">
	<!--
	function submitbutton(pressbutton) {
		var form = document.adminForm;

		form.page.value = pressbutton;
		form.submit();

	}
	
	<?php 
        if (JLMS_J16version()) {
            ?>
	Joomla.submitbutton = submitbutton;
	<?php 
        }
        ?>
	//-->
	</script>
	<?php 
        $forum_warning = false;
        if ($JLMS_CONFIG->get('plugin_forum', 0)) {
            if (!$JLMS_CONFIG->get('forum_path', '')) {
                $forum_warning = true;
            } elseif (!file_exists($JLMS_CONFIG->get('forum_path', '') . '/Settings.php')) {
                $forum_warning = true;
            } elseif (substr($JLMS_CONFIG->get('forum_path', ''), -1) == '/') {
                $forum_warning = true;
            }
        } else {
            $forum_warning = true;
        }
        if ($forum_warning) {
            ?>
	<div class="message">
		<?php 
            echo _JLMS_FRM_MSG_SMF_FRM_N_INSTALL;
            ?>
	</div>
	<?php 
        }
        ?>
		<form action="index.php" method="post" name="adminForm">		
		<table width="100%" >
			<tr>
			<td valign="top" width="220px">
			<div>
				<?php 
        echo joomla_lms_adm_html::JLMS_menu();
        ?>
			</div>
			</td>
			<td valign="top">
			<?php 
        if (!class_exists('JToolBarHelper')) {
            ?>
				<table class="adminheading">
					<tr>
						<th class="dbbackup">
							<?php 
            echo _JOOMLMS_COMP_NAME;
            ?>
: <small><?php 
            echo _JLMS_FRM_S;
            ?>
</small>
						</th>
					</tr>
				</table>
			<?php 
        }
        ?>
				<div class="width-100">
				<fieldset class="adminform">
				<table width="100%" border="0">
					<tr>
						<td valign="top">
							<table class="adminlist">
							<thead>
								<tr>
									<th width="20px">#</th>
									<th width="20px" class="title"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" /></th>
									<th width="16px">&nbsp;</th>
									<th class="title"><?php 
        echo _JLMS_FRM_MSG_FRM_NAME;
        ?>
</th>
									<th class="title" width= "20px"><?php 
        echo _JLMS_PUBLISHED;
        ?>
</th>
									<th class="title"><?php 
        echo _JLMS_FRM_TYPE;
        ?>
</th>
									<th class="title"><?php 
        echo _JLMS_PERMISSIONS;
        ?>
</th>
									<th class="title" width="30px"><?php 
        echo _JLMS_ID;
        ?>
</th>
								</tr>
							</thead>
							<tbody>
							<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            $img = $row->published ? 'tick.png' : 'publish_x.png';
            $task = $row->published ? 'unpublish' : 'publish';
            $alt = $row->published ? _JLMS_PUBLISHED : _JLMS_UNPUBLISHED;
            $checked = mosHTML::idBox($i, $row->id);
            ?>
								<tr class="<?php 
            echo "row{$k}";
            ?>
">
									<td><?php 
            echo $i + 1;
            ?>
</td>
									<td><?php 
            echo $checked;
            ?>
</td>
									<?php 
            if ($row->parent_forum) {
                $img_p = isset($rows[$i + 1]) && $rows[$i + 1]->parent_forum == $row->parent_forum ? 'sub1' : 'sub2';
                echo $row->parent_forum ? '<td width="16"><img src="' . $JLMS_CONFIG->getCfg('live_site') . "/components/com_joomla_lms/lms_images/treeview/" . $img_p . ".png" . '" width="16" height="16" alt="L" /></td>' : '';
            }
            ?>
									<td align="left"<?php 
            echo $row->parent_forum ? '' : 'colspan = "2"';
            ?>
>
										<?php 
            echo $row->forum_name;
            ?>
									</td>
									<td>
										<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
										<img src="<?php 
            echo ADMIN_IMAGES_PATH . $img;
            ?>
" border="0" alt="<?php 
            echo $alt;
            ?>
" />
									</td>
									<td>
									<?php 
            if ($row->forum_level) {
                echo _JLMS_FRM_LP_SPEC_BOARD;
            } elseif ($row->user_level == 1) {
                echo _JLMS_FRM_CRS_SPEC_BOARD;
            } elseif ($row->user_level == 2) {
                echo _JLMS_FRM_SYS_SPEC_BOARD;
            } else {
                echo _JLMS_FRM_REG_BOARD;
            }
            ?>
									</td>
									<td>
									<?php 
            if ($row->forum_access) {
                $forum_roles = explode(',', $row->forum_permissions);
                $forum_roles_names = array();
                foreach ($forum_roles as $forum_role) {
                    if (isset($roles[$forum_role]) && isset($roles[$forum_role]->role_name)) {
                        $forum_roles_names[] = $roles[$forum_role]->role_name;
                    }
                }
                if (empty($forum_roles_names)) {
                    echo '<font color="red">' . _JLMS_FRM_PERM_NOT_CONF . '</font>';
                } else {
                    echo _JLMS_FRM_CUSTOM . ': ' . implode(', ', $forum_roles_names);
                }
            } else {
                echo _JLMS_FRM_ANY_CRS_PART;
            }
            ?>
									</td>
									<td align="left">
										<?php 
            echo $row->id;
            ?>
									</td>
								</tr>
								<?php 
            $k = 1 - $k;
        }
        ?>
							</tbody>
							</table>
						</td>
					</tr>
				</table>
				</fieldset>
				</div>
		</td></tr></table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="lms_forums" />
		<input type="hidden" name="page" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />		
		</form>
		<?php 
    }
    function showCourseLinks($id, $option, &$rows)
    {
        $user = JLMSFactory::getUser();
        $db =& JFactory::getDbo();
        $JLMS_ACL =& JLMSFactory::getACL();
        $JLMS_CONFIG = JLMSFactory::getConfig();
        $Itemid = $JLMS_CONFIG->get('Itemid');
        ?>
<script language="javascript" type="text/javascript">
<!--//--><![CDATA[//><!--
function submitbutton(pressbutton) {
	var form = document.adminForm;
	if ( ((pressbutton == 'link_delete') || (pressbutton == 'pre_link_edit')) && (form.boxchecked.value == "0")){
		alert("<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
");
	} else {
		form.task.value = pressbutton;
		form.submit();
	}
}
function submitbutton_order(pressbutton, item_id) {
	var form = document.adminForm;
	if ((pressbutton == 'link_orderup') || (pressbutton == 'link_orderdown')){
		if (item_id) {
		form.task.value = pressbutton;
		form.row_id.value = item_id;
		form.submit();
		}
	}
}
function submitbutton_change(pressbutton, state) {
	var form = document.adminForm;
	if (pressbutton == 'change_link'){
		if (form.boxchecked.value == "0") {
			alert("<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
");
		} else {
			form.task.value = pressbutton;
			form.state.value = state;
			form.submit();
		}
	}
}
function submitbutton_change2(pressbutton, state, cid_id) {
	var form = document.adminForm;
	if (pressbutton == 'change_link'){
		form.task.value = pressbutton;
		form.state.value = state;
		form.cid2.value = cid_id;
		form.submit();
	}
}
//--><!]]>
</script>
<?php 
        JLMS_TMPL::OpenMT();
        $hparams = array();
        JLMS_TMPL::ShowHeader('link', _JLMS_LINKS_COURSE_LINKS, $hparams);
        JLMS_TMPL::OpenTS();
        ?>
		<form action="<?php 
        echo $JLMS_CONFIG->get('live_site') . "/index.php?option={$option}&amp;Itemid={$Itemid}";
        ?>
" method="post" name="adminForm">
<?php 
        if (!empty($rows)) {
            ?>
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
            echo JLMSCSS::_('jlmslist');
            ?>
">
				<tr>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 width="20" class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" align="center">#</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
				<?php 
            if ($JLMS_ACL->CheckPermissions('links', 'manage') || $JLMS_ACL->CheckPermissions('links', 'publish')) {
                ?>
					<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 width="20" class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" align="center"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
                echo count($rows);
                ?>
);" /></<?php 
                echo $JLMS_CONFIG->get('tableheader_tag', 'td');
                ?>
>
				<?php 
            }
            ?>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="40%"><?php 
            echo _JLMS_LINKS_TBL_HEAD_LINK;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
				<?php 
            if ($JLMS_ACL->CheckPermissions('links', 'publish')) {
                ?>
					<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="1">&nbsp;</<?php 
                echo $JLMS_CONFIG->get('tableheader_tag', 'td');
                ?>
>
				<?php 
            }
            if ($JLMS_ACL->CheckPermissions('links', 'order')) {
                ?>
					<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" colspan="2" width="1">&nbsp;</<?php 
                echo $JLMS_CONFIG->get('tableheader_tag', 'td');
                ?>
>
				<?php 
            }
            ?>
					<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="60%"><?php 
            echo _JLMS_LINKS_TBL_HEAD_DESCR;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
				</tr>
			<?php 
            $there_were_squeezeboxes = false;
            $k = 1;
            for ($i = 0, $n = count($rows); $i < $n; $i++) {
                $is_squeezebox = false;
                $row = $rows[$i];
                $link = $row->link_href;
                if ($row->link_type == 2) {
                    $link = sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}&task=view_inline_link&course_id={$id}&id={$row->id}");
                }
                if ($row->link_type == 3) {
                    $is_squeezebox = true;
                    $there_were_squeezeboxes = true;
                }
                $alt = $row->published ? _JLMS_STATUS_PUB : _JLMS_STATUS_UNPUB;
                $image = $row->published ? 'btn_accept.png' : 'btn_cancel.png';
                $state = $row->published ? 0 : 1;
                if ($row->is_time_related) {
                    $tooltip_txt = _JLMS_WILL_BE_RELEASED_IN;
                    $showperiod = $row->show_period;
                    $ost1 = $showperiod % (24 * 60);
                    $sp_days = ($showperiod - $ost1) / (24 * 60);
                    $ost2 = $showperiod % 60;
                    $sp_hours = ($ost1 - $ost2) / 60;
                    $sp_mins = $ost2;
                    $release_time_info = false;
                    if ($sp_days) {
                        $tooltip_txt .= ' ' . $sp_days . ' ' . _JLMS_RELEASED_IN_DAYS;
                        $release_time_info = true;
                    }
                    if ($sp_hours) {
                        $tooltip_txt .= ' ' . $sp_hours . ' ' . _JLMS_RELEASED_IN_HOURS;
                        $release_time_info = true;
                    }
                    if ($sp_mins) {
                        $tooltip_txt .= ' ' . $sp_mins . ' ' . _JLMS_RELEASED_IN_MINUTES;
                        $release_time_info = true;
                    }
                    if ($release_time_info) {
                        $tooltip_txt .= ' ' . _JLMS_RELEASED_AFTER_ENROLLMENT;
                    }
                }
                $checked = mosHTML::idBox($i, $row->id);
                ?>
				<tr class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">
					<td align="center"><?php 
                echo $i + 1;
                ?>
</td>
				<?php 
                if ($JLMS_ACL->CheckPermissions('links', 'manage') || $JLMS_ACL->CheckPermissions('links', 'publish')) {
                    $show_check = true;
                    if ($JLMS_ACL->CheckPermissions('links', 'only_own_items') && $row->owner_id != $user->get('id')) {
                        $show_check = false;
                    } elseif ($JLMS_ACL->CheckPermissions('links', 'only_own_role') && $JLMS_ACL->GetRole() != $JLMS_ACL->UserSystemRole($db, $row->owner_id)) {
                        $show_check = false;
                    }
                    ?>
					<td>
					<?php 
                    echo $show_check ? $checked : '&nbsp;';
                    ?>
					</td>
				<?php 
                }
                ?>
					<td align="left">
						<?php 
                if ($is_squeezebox) {
                    $tmp_params = new JLMSParameters($row->params);
                    $x_size = 0;
                    $y_size = 0;
                    if (is_object($tmp_params) && $tmp_params->get('display_width')) {
                        $x_size = intval($tmp_params->get('display_width'));
                    } elseif (isset($tmp_params->display_width)) {
                        $x_size = intval($tmp_params->display_width);
                    }
                    if (is_object($tmp_params) && $tmp_params->get('display_height')) {
                        $y_size = intval($tmp_params->get('display_height'));
                    } elseif (isset($tmp_params->display_height)) {
                        $y_size = intval($tmp_params->display_height);
                    }
                    ?>
							<a class="jlms_modal" rel="{handler:'iframe', size:{x:<?php 
                    echo $x_size;
                    ?>
,y:<?php 
                    echo $y_size;
                    ?>
}}" href="<?php 
                    echo $link;
                    ?>
" title="<?php 
                    echo str_replace('"', '&quot;', $row->link_name);
                    ?>
">
								<?php 
                    echo $row->link_name;
                    ?>
							</a>
						<?php 
                } else {
                    ?>
							<?php 
                    if ($link) {
                        ?>
							<a <?php 
                        echo !$row->link_type ? 'target="_blank" ' : ' ';
                        ?>
href="<?php 
                        echo $link;
                        ?>
" title="<?php 
                        echo str_replace('"', '&quot;', $row->link_name);
                        ?>
">
								<?php 
                        echo $row->link_name;
                        ?>
							</a>
							<?php 
                    } else {
                        echo $row->link_name;
                    }
                    ?>
						<?php 
                }
                ?>
						<?php 
                if ($JLMS_CONFIG->get('show_links_authors', 0)) {
                    ?>
						<br />
						<span class="small"><?php 
                    echo _JLMS_HOME_AUTHOR . "&nbsp;" . $row->author_name;
                    ?>
</span>
						<?php 
                }
                ?>
					</td>
				<?php 
                if ($JLMS_ACL->CheckPermissions('links', 'publish')) {
                    ?>
					<td valign="middle">
					<?php 
                    if ($JLMS_ACL->CheckPermissions('links', 'only_own_items') && $row->owner_id != $user->get('id')) {
                        ?>
						<img class="JLMS_png" src="<?php 
                        echo $JLMS_CONFIG->get('live_site');
                        ?>
/components/com_joomla_lms/lms_images/toolbar/<?php 
                        echo $image;
                        ?>
" width="16" height="16" border="0" alt="<?php 
                        echo $alt;
                        ?>
" />
					<?php 
                    } elseif ($JLMS_ACL->CheckPermissions('links', 'only_own_role') && $JLMS_ACL->GetRole() != $JLMS_ACL->UserSystemRole($db, $row->owner_id)) {
                        ?>
						<img class="JLMS_png" src="<?php 
                        echo $JLMS_CONFIG->get('live_site');
                        ?>
/components/com_joomla_lms/lms_images/toolbar/<?php 
                        echo $image;
                        ?>
" width="16" height="16" border="0" alt="<?php 
                        echo $alt;
                        ?>
" />
					<?php 
                    } else {
                        if ($row->is_time_related) {
                            if ($row->published) {
                                $image = 'btn_publish_wait.png';
                            }
                            $tooltip_link = 'javascript:submitbutton_change2(\'change_link\',' . $state . ',' . $row->id . ')';
                            $tooltip_name = '<img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/' . $image . '" width="16" height="16" border="0" alt="' . $alt . '" />';
                            echo JLMS_toolTip($alt, $tooltip_txt, $tooltip_name, $tooltip_link);
                        } else {
                            echo '<a href="javascript:submitbutton_change2(\'change_link\',' . $state . ',' . $row->id . ')" title="' . $alt . '">';
                            echo '<img class="JLMS_png" src="' . $JLMS_CONFIG->get('live_site') . '/components/com_joomla_lms/lms_images/toolbar/' . $image . '" width="16" height="16" border="0" alt="' . $alt . '" />';
                            echo '</a>';
                        }
                    }
                    ?>
					</td>
				<?php 
                }
                if ($JLMS_ACL->CheckPermissions('links', 'order')) {
                    ?>
					<td><?php 
                    echo JLMS_orderUpIcon($i, $row->id, true, 'link_orderup');
                    ?>
</td>
					<td><?php 
                    echo JLMS_orderDownIcon($i, $n, $row->id, true, 'link_orderdown');
                    ?>
</td>
				<?php 
                }
                ?>
					<td><?php 
                echo $row->link_description ? $row->link_description : '&nbsp;';
                ?>
</td>
				</tr>
				<?php 
                $k = 3 - $k;
            }
            ?>
			</table>
<?php 
            if ($there_were_squeezeboxes) {
                JLMS_initialize_SqueezeBox(false);
            }
        } else {
            echo '<div class="joomlalms_user_message">' . _JLMS_NO_ITEMS_HERE . '</div>';
        }
        ?>
			<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
			<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
			<input type="hidden" name="task" value="setup_category" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="id" value="<?php 
        echo $id;
        ?>
" />
			<input type="hidden" name="row_id" value="0" />
			<input type="hidden" name="state" value="0" />
			<input type="hidden" name="cid2" value="0" />
		</form>
<?php 
        JLMS_TMPL::CloseTS();
        if ($id && ($JLMS_ACL->CheckPermissions('links', 'manage') || $JLMS_ACL->CheckPermissions('links', 'publish'))) {
            $link_new = JLMSRoute::_("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=pre_create_link&amp;id={$id}");
            $controls = array();
            if ($JLMS_ACL->CheckPermissions('links', 'publish')) {
                $controls[] = array('href' => "javascript:submitbutton_change('change_link',1);", 'title' => _JLMS_SET_PUB, 'img' => 'publish');
                $controls[] = array('href' => "javascript:submitbutton_change('change_link',0);", 'title' => _JLMS_SET_UNPUB, 'img' => 'unpublish');
                if ($JLMS_ACL->CheckPermissions('links', 'manage')) {
                    $controls[] = array('href' => 'spacer');
                }
            }
            if ($JLMS_ACL->CheckPermissions('links', 'manage')) {
                $controls[] = array('href' => $link_new, 'onclick' => "", 'title' => _JLMS_LINKS_IMG_NEW_LINK, 'img' => 'add');
                $controls[] = array('href' => "javascript:submitbutton('link_delete');", 'title' => _JLMS_LINKS_IMG_DEL_LINK, 'img' => 'delete');
                $controls[] = array('href' => "javascript:submitbutton('pre_link_edit');", 'title' => _JLMS_LINKS_IMG_EDIT_LINK, 'img' => 'edit');
            }
            JLMS_TMPL::ShowControlsFooter($controls);
        }
        JLMS_TMPL::CloseMT();
    }
Esempio n. 21
0
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showArchive(&$rows, $section, &$lists, $search, $pageNav, $option, $all = NULL, $redirect)
    {
        global $my, $acl;
        ?>
		<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton) {
			if (pressbutton == 'remove') {
				if (document.adminForm.boxchecked.value == 0) {
					alert('<?php 
        echo T_('Please make a selection from the list to send to Trash');
        ?>
');
				} else if ( confirm('<?php 
        echo T_('Are you sure you want to Trash the selected items? \\nThis will not permanently delete the items.');
        ?>
')) {
					submitform('remove');
				}
			} else {
				submitform(pressbutton);
			}
		}
		</script>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="edit" rowspan="2">
			<?php 
        if ($all) {
            ?>
				<?php 
            echo T_('Archive Manager');
            ?>
 <small><small>[ <?php 
            echo T_('Section:');
            ?>
 <?php 
            echo T_('All');
            ?>
 ]</small></small>
				<?php 
        } else {
            ?>
				<?php 
            echo T_('Archive Manager');
            ?>
 <small><small>[ <?php 
            echo T_('Section:');
            ?>
 <?php 
            echo $section->title;
            ?>
 ]</small></small>
				<?php 
        }
        ?>
			</th>
			<?php 
        if ($all) {
            ?>
				<td width="right" rowspan="2" valign="top">
				<?php 
            echo $lists['sectionid'];
            ?>
				</td>
				<?php 
        }
        ?>
			<td width="right">
			<?php 
        echo $lists['catid'];
        ?>
			</td>
			<td width="right">
			<?php 
        echo $lists['authorid'];
        ?>
			</td>
		</tr>
		<tr>
			<td align="right">
			<?php 
        echo T_('Filter:');
        ?>
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5">
			#
			</th>
			<th width="20">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			<?php 
        echo T_('Title');
        ?>
			</th>
			<th width="2%">
			<?php 
        echo T_('Order');
        ?>
			</th>
			<th width="1%">
			<a href="javascript: saveorder( <?php 
        echo count($rows) - 1;
        ?>
 )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php 
        echo T_('Save Order');
        ?>
" /></a>
			</th>
			<th width="15%" align="left">
			<?php 
        echo T_('Category');
        ?>
			</th>
			<th width="15%" align="left">
			<?php 
        echo T_('Author');
        ?>
			</th>
			<th align="center" width="10">
			<?php 
        echo T_('Date');
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $row->cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id=' . $row->catid;
            if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->created_by;
                    $author = '<a href="' . $linkA . '" title="' . T_('Edit User') . '">' . $row->author . '</a>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->author;
                }
            }
            $date = mosFormatDate($row->created, '%x');
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td width="20">
				<?php 
            echo mosHTML::idBox($i, $row->id);
            ?>
				</td>
				<td>
				<?php 
            echo $row->title;
            ?>
				</td>
				<td align="center" colspan="2">
				<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" class="text_area" style="text-align: center" />
				</td>
				<td>
				<a href="<?php 
            echo $row->cat_link;
            ?>
" title="<?php 
            echo T_('Edit Category');
            ?>
">
				<?php 
            echo $row->name;
            ?>
				</a>
				</td>
				<td>
				<?php 
            echo $author;
            ?>
				</td>
				<td>
				<?php 
            echo $date;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>

		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="sectionid" value="<?php 
        echo $section->id;
        ?>
" />
		<input type="hidden" name="task" value="showarchive" />
		<input type="hidden" name="returntask" value="showarchive" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="redirect" value="<?php 
        echo $redirect;
        ?>
" />
		</form>
		<?php 
    }
Esempio n. 22
0
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showContent(&$rows, &$pageNav, $option, $search, &$lists)
    {
        global $my, $acl;
        mosCommonHTML::loadOverlib();
        ?>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="edit">
			<?php 
        echo T_('Static Content Manager');
        ?>
			</th>
			<td>
			<?php 
        echo T_('Filter:');
        ?>
&nbsp;
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
			<td>
			&nbsp;&nbsp;&nbsp;<?php 
        echo T_('Order:');
        ?>
&nbsp;
			</td>
			<td>
			<?php 
        echo $lists['order'];
        ?>
			</td>
			<td width="right">
			<?php 
        echo $lists['authorid'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5">
			#
			</th>
			<th width="5px">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			<?php 
        echo T_('Title');
        ?>
			</th>
			<th width="5%">
			<?php 
        echo T_('Published');
        ?>
			</th>
			<th nowrap="nowrap" width="5%">
			<?php 
        echo T_('Front Page');
        ?>
			</th>
			<th width="2%">
			<?php 
        echo T_('Order');
        ?>
			</th>
			<th width="1%">
			<a href="javascript: saveorder( <?php 
        echo count($rows) - 1;
        ?>
 )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php 
        echo T_('Save Order');
        ?>
" /></a>
			</th>
			<th width="10%">
			<?php 
        echo T_('Access');
        ?>
			</th>
			<th width="5%">
			<?php 
        echo T_('ID');
        ?>
			</th>
			<th width="1%" align="left">
			<?php 
        echo T_('Links');
        ?>
			</th>
			<th width="20%" align="left">
			<?php 
        echo T_('Author');
        ?>
			</th>
			<th align="center" width="10">
			<?php 
        echo T_('Date');
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $now = date("Y-m-d H:i:s");
            if ($now <= $row->publish_up && $row->state == "1") {
                $img = 'publish_y.png';
                $alt = T_('Published');
            } else {
                if (($now <= $row->publish_down || $row->publish_down == "0000-00-00 00:00:00") && $row->state == "1") {
                    $img = 'publish_g.png';
                    $alt = T_('Published');
                } else {
                    if ($now > $row->publish_down && $row->state == "1") {
                        $img = 'publish_r.png';
                        $alt = T_('Expired');
                    } elseif ($row->state == "0") {
                        $img = "publish_x.png";
                        $alt = T_('Unpublished');
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . T_('Start:') . " " . T_('Always') . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . T_('Start:') . " {$row->publish_up}</td></tr>";
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . T_('Finish:') . " " . T_('No Expiry') . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . T_('Finish:') . " {$row->publish_down}</td></tr>";
                }
            }
            if (!$row->access) {
                $color_access = 'style="color: green;"';
                $task_access = 'accessregistered';
            } else {
                if ($row->access == 1) {
                    $color_access = 'style="color: red;"';
                    $task_access = 'accessspecial';
                } else {
                    $color_access = 'style="color: black;"';
                    $task_access = 'accesspublic';
                }
            }
            $link = 'index2.php?option=com_typedcontent&task=edit&hidemainmenu=1&id=' . $row->id;
            if ($row->checked_out) {
                $checked = mosCommonHTML::checkedOut($row);
            } else {
                $checked = mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
            }
            if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->created_by;
                    $author = '<a href="' . $linkA . '" title="' . T_('Edit User') . '">' . $row->creator . '</a>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->creator;
                }
            }
            $date = mosFormatDate($row->created, '%x');
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td>
				<?php 
            echo $checked;
            ?>
				</td>
				<td>
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                echo $row->title;
                if ($row->title_alias) {
                    echo ' (<i>' . $row->title_alias . '</i>)';
                }
            } else {
                ?>
					<a href="<?php 
                echo $link;
                ?>
" title="<?php 
                echo T_('Edit Static Content');
                ?>
">
					<?php 
                echo $row->title;
                if ($row->title_alias) {
                    echo ' (<i>' . $row->title_alias . '</i>)';
                }
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<?php 
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onMouseOver="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, '<?php 
                echo T_('Publish Information');
                ?>
', BELOW, RIGHT);" onMouseOut="return nd();" onClick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? "unpublish" : "publish";
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td align="center">
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','toggle_frontpage')">
				<img src="images/<?php 
            echo $row->frontpage ? 'tick.png' : 'publish_x.png';
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $row->frontpage ? T_('Yes') : T_('No');
            ?>
" />
				</a>
				</td>
				<td align="center" colspan="2">
				<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" class="text_area" style="text-align: center" />
				</td>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task_access;
            ?>
')" <?php 
            echo $color_access;
            ?>
>
				<?php 
            echo $row->groupname;
            ?>
				</a>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->links;
            ?>
				</td>
				<td align="left">
				<?php 
            echo $author;
            ?>
				</td>
				<td>
				<?php 
            echo $date;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>

		<?php 
        echo $pageNav->getListFooter();
        ?>
		<?php 
        mosCommonHTML::ContentLegend();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		</form>
		<?php 
    }
Esempio n. 23
0
    /**
     * Writes a list of the defined modules
     * @param array An array of category objects
     */
    function showModules(&$rows, $myid, $client, &$pageNav, $option)
    {
        global $adminLanguage;
        ?>
		<form action="index2.php" method="post" name="adminForm">
	
		<table class="adminheading">
		<tr>
			<th class="modules">
			<?php 
        echo $client == 'admin' ? $adminLanguage->A_COMP_MAMB_ADMIN : $adminLanguage->A_COMP_MAMB_SITE;
        ?>
            <?php 
        echo $adminLanguage->A_COMP_MOD_MANAGER;
        ?>
			</th>
		</tr>
		</table>
	
		<table class="adminlist">
		<tr>
			<th width="20px">#</th>
			<th width="20px">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title" width="30%">
			<?php 
        echo $adminLanguage->A_COMP_MOD_NAME;
        ?>
			</th>
			<th nowrap="nowrap" width="10%">
			<?php 
        echo $adminLanguage->A_COMP_PUBLISHED;
        ?>
			</th>
			<th colspan="2" nowrap="nowrap" width="5%">
			<?php 
        echo $adminLanguage->A_COMP_REORDER;
        ?>
			</th>
			<th nowrap="nowrap" width="7%">
			<?php 
        echo $adminLanguage->A_COMP_ACCESS;
        ?>
			</th>
			<th nowrap="nowrap" width="7%">
			<?php 
        echo $adminLanguage->A_COMP_MOD_POSITION;
        ?>
			</th>
			<th nowrap="nowrap" width="5%">
			<?php 
        echo $adminLanguage->A_COMP_MOD_PAGES;
        ?>
			</th>
			<th nowrap="nowrap" width="5%">
			<?php 
        echo $adminLanguage->A_COMP_ID;
        ?>
			</th>
			<th nowrap="nowrap" width="10%" align="left">
			<?php 
        echo $adminLanguage->A_COMP_TYPE;
        ?>
			</th>
			<th nowrap="nowrap" width="10%">
			<?php 
        echo $adminLanguage->A_COMP_CHECKED_OUT;
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $img = $row->published ? 'publish_g.png' : 'publish_x.png';
            $task = $row->published ? 'unpublish' : 'publish';
            $alt = $row->published ? $adminLanguage->A_COMP_PUBLISHED : $adminLanguage->A_COMP_UNPUBLISHED;
            if (!$row->access) {
                $color_access = 'style="color: green;"';
                $task_access = 'accessregistered';
            } else {
                if ($row->access == 1) {
                    $color_access = 'style="color: red;"';
                    $task_access = 'accessspecial';
                } else {
                    $color_access = 'style="color: black;"';
                    $task_access = 'accesspublic';
                }
            }
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td align="right">
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td><?php 
            echo mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $myid);
            ?>
</td>
				<td>
				<a href="#edit" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','edit')">
				<?php 
            echo $row->title;
            ?>
				</a>
				</td>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
				<img src="images/<?php 
            echo $img;
            ?>
" border="0" alt="<?php 
            echo $alt;
            ?>
" />
				</a>
				</td>
				<td><?php 
            echo $pageNav->orderUpIcon($i, $row->position == @$rows[$i - 1]->position);
            ?>
</td>
				<td><?php 
            echo $pageNav->orderDownIcon($i, $n, $row->position == @$rows[$i + 1]->position);
            ?>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task_access;
            ?>
')" <?php 
            echo $color_access;
            ?>
>
				<?php 
            echo $row->groupname;
            ?>
				</a>
				</td>
				<td align="center">
				<?php 
            echo $row->position;
            ?>
				</td>
				<td align="center">
				<?php 
            if (is_null($row->pages)) {
                echo $adminLanguage->A_COMP_NONE;
            } else {
                if ($row->pages > 0) {
                    echo $adminLanguage->A_COMP_MOD_VARIES;
                } else {
                    echo $adminLanguage->A_COMP_MOD_ALL;
                }
            }
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
				<td align="left">
				<?php 
            echo $row->module ? $row->module : $adminLanguage->A_COMP_MOD_USER;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->editor;
            ?>
&nbsp;
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>
	
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="client" value="<?php 
        echo $client;
        ?>
" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<?php 
    }
Esempio n. 24
0
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showArchive(&$rows, $section, &$lists, $search, $pageNav, $option, $all = NULL, $redirect)
    {
        global $my, $adminLanguage;
        ?>
		<script language="javascript" type="text/javascript">
		function submitbutton(pressbutton) {
			if (pressbutton == 'remove') {
				if (document.adminForm.boxchecked.value == 0) {
					alert("<?php 
        echo $adminLanguage->A_COMP_CONTENT_TRASH;
        ?>
");
				} else if ( confirm("<?php 
        echo $adminLanguage->A_COMP_CONTENT_TRASH_MESS;
        ?>
")) {
					submitform('remove');
				}
			} else {
				submitform(pressbutton);
			}
		}
		</script>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="edit">
			<?php 
        echo $section->title;
        echo $adminLanguage->A_COMP_CONTENT_ARCHIVE;
        if ($all) {
            echo $adminLanguage->A_COMP_CONTENT_MANAGER;
        }
        ?>
			</th>
			<td>
			<?php 
        echo $adminLanguage->A_COMP_FILTER;
        ?>
:
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="textarea" onChange="document.adminForm.submit();" />
			</td>
			<?php 
        if ($all) {
            ?>
				<td width="right">
				<?php 
            echo $lists['sectionid'];
            ?>
				</td>
				<?php 
        }
        ?>
			<td width="right">
			<?php 
        echo $lists['catid'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="20">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title" width="50%">
			<?php 
        echo $adminLanguage->A_COMP_TITLE;
        ?>
			</th>
			<th width="15%" align="left">
			<?php 
        echo $adminLanguage->A_COMP_CATEG;
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td width="20">
				<?php 
            echo mosHTML::idBox($i, $row->id);
            ?>
				</td>
				<td width="85%">
				<?php 
            echo $row->title;
            ?>
				</td>
				<td width="15%">
				<?php 
            echo $row->name;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>

		<?php 
        echo $pageNav->getListFooter();
        ?>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="sectionid" value="<?php 
        echo $section->id;
        ?>
" />
		<input type="hidden" name="task" value="showarchive" />
		<input type="hidden" name="returntask" value="showarchive" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="redirect" value="<?php 
        echo $redirect;
        ?>
" />
		</form>
		<?php 
    }
Esempio n. 25
0
 function CheckedOutProcessing(&$row, $i)
 {
     $my = mamboCore::get('currentUser');
     if ($row->checked_out) {
         $checked = mosCommonHTML::checkedOut($row);
     } else {
         $checked = mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
     }
     return $checked;
 }
    function viewCourses(&$rows, &$pageNav, $option, $usertype, $lists, $levels)
    {
        global $Itemid, $JLMS_CONFIG, $my, $JLMS_DB, $acl;
        $JLMS_ACL =& JLMSFactory::getACL();
        $pres_icons = new stdClass();
        $pres_icons->mail = 0;
        $pres_icons->already = 0;
        $pres_icons->my = 0;
        $pres_icons->wl = 0;
        $lms_img_path = $JLMS_CONFIG->get('live_site') . '/' . $JLMS_CONFIG->get('lms_path_to_images', 'components/com_joomla_lms/lms_images');
        //		$show_fee_col = $JLMS_CONFIG->get('show_fee_column', 1);
        $price_fee_type = $JLMS_CONFIG->get('price_fee_type', 1);
        $show_short_description = $JLMS_CONFIG->get('show_short_description', 0);
        $show_course_publish_dates = $JLMS_CONFIG->get('show_course_publish_dates', 0);
        $jlms_cs = $JLMS_CONFIG->get('jlms_cur_sign');
        $colspan_sh_description = 4;
        if ($show_course_publish_dates) {
            $colspan_sh_description = 6;
        }
        if (!$price_fee_type) {
            $colspan_sh_description = $colspan_sh_description - 1;
        }
        $show_course_author = $JLMS_CONFIG->get('show_course_authors', 1);
        $course_id = mosGetParam($_REQUEST, 'c_id', '');
        if ($course_id) {
            //TODO: replace this db query with usage of new lmstitles object
            $query = "SELECT course_name FROM #__lms_courses WHERE id = '{$course_id}'";
            $JLMS_DB->setQuery($query);
            $course_name = $JLMS_DB->loadResult();
        }
        //FLMS multicat
        $multicat = array();
        if ($JLMS_CONFIG->get('multicat_use', 0)) {
            $multicat = array();
            $i = 0;
            foreach ($lists as $key => $item) {
                if (substr($key, 0, 7) == 'filter_') {
                    $multicat[] = $lists['filter_' . $i];
                    $i++;
                }
            }
        }
        ?>
		
		<script language="javascript" type="text/javascript">
		<!--//--><![CDATA[//><!--
		function submitbutton(pressbutton, course_id) {
			var form = document.adminForm;
			if ( (pressbutton == 'delete_course') || (pressbutton == 'edit_course') || (pressbutton == 'export_course_pre') ) {
				form.id.value = course_id;
				form.task.value = pressbutton;
				form.submit();
			}
			else if( (pressbutton == 'enroll') && (form.boxchecked.value == '0') ){
				alert( "<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
" );
			}
			else {
				if (pressbutton == 'enroll'){
					form.task.value = 'subscription';
					form.submit();
				}
			}
		}
		<?php 
        if ($JLMS_CONFIG->get('multicat_use', 0)) {
            ?>
		var old_filters = new Array();
		function read_filter(){
			var form = document.adminForm;
			var count_levels = '<?php 
            echo count($levels);
            ?>
';
			for(var i=0;i<parseInt(count_levels);i++){
				if(form['filter_id_'+i] != null){
					old_filters[i] = form['filter_id_'+i].value;
				}
			}
		}
		function write_filter(){
			var form = document.adminForm;
			var count_levels = '<?php 
            echo count($levels);
            ?>
';
			var j;
			for(var i=0;i<parseInt(count_levels);i++){
				if(form['filter_id_'+i+''] != null && form['filter_id_'+i+''].value != old_filters[i]){
					j = i;
				}
				if(i > j){
					if(form['filter_id_'+i] != null){
						form['filter_id_'+i].value = 0;	
					}
				}
			}
		}
		<?php 
        }
        ?>
		<?php 
        if ($JLMS_CONFIG->get('lms_courses_sortby', 0) == 1) {
            ?>
		function submitbutton_order(pressbutton, item_id){
			var form = document.adminForm;
			if ((pressbutton == 'fcourse_orderup') || (pressbutton == 'fcourse_orderdown')){
				if (item_id) {
				form.task.value = pressbutton;
				form.row_id.value = item_id;
				form.submit();
				}
			}
		}
		function cf_saveorder(){
			var form = document.adminForm;	
			form.task.value = 'fcourse_save_order';
					form.submit();
				//submitform('fcourse_save_order');
		}
		<?php 
        }
        ?>
	
		//--><!]]>
		</script>
<?php 
        $style = "\n\t\ttable.jlmslist td.sectiontableheader, table.jlmslist th.sectiontableheader{\n\t\t\twhite-space: nowrap;\n\t\t}";
        $doc =& JFactory::getDocument();
        $doc->addStyleDeclaration($style);
        ?>
		<form action="<?php 
        echo JURI::base() . "index.php?option={$option}&amp;Itemid={$Itemid}";
        ?>
" method="post" name="adminForm">
<?php 
        JLMS_TMPL::OpenMT();
        $params = array('show_menu' => true, 'simple_menu' => true);
        JLMS_TMPL::ShowHeader('course', _JLMS_COURSES_COURSES_LIST, $params);
        JLMS_TMPL::ShowPageTip('courses');
        JLMS_TMPL::OpenTS('', ' align="right" style="text-align:right " width="100%"');
        $link = "index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=courses";
        //		echo _JLMS_PN_DISPLAY_NUM . $pageNav->getLimitBox( $link );
        //		echo _JLMS_COURSES_FILTER." : ".$lists['courses_type'];
        if ($JLMS_CONFIG->get('multicat_use', 0)) {
            echo (isset($levels[0]->cat_name) && $levels[0]->cat_name != '' ? $levels[0]->cat_name : _JLMS_COURSES_COURSES_GROUPS) . " " . $lists['filter_0'];
        } else {
            echo _JLMS_COURSES_COURSES_GROUPS . " " . $lists['groups_course'];
        }
        JLMS_TMPL::CloseTS();
        if (count($multicat)) {
            for ($i = 0; $i < count($multicat); $i++) {
                if ($i > 0) {
                    JLMS_TMPL::OpenTS('', ' align="right" style="text-align:right " width="100%"');
                    echo (isset($levels[$i]->cat_name) && $levels[$i]->cat_name != '' ? $levels[$i]->cat_name : _JLMS_COURSES_COURSES_GROUPS) . " " . $lists['filter_' . $i];
                    JLMS_TMPL::CloseTS();
                }
            }
        }
        $controls = array();
        //	if ($usertype == 1) {
        $JLMS_ACL =& JLMSFactory::getACL();
        if ($JLMS_ACL->CheckPermissions('lms', 'create_course')) {
            $controls[] = array('href' => JLMSRoute::_("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=add_course"), 'title' => _JLMS_COURSES_NEW, 'img' => 'add');
            $controls[] = array('href' => JLMSRoute::_("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=course_import"), 'title' => _JLMS_COURSES_IMPORT, 'img' => 'courseimport');
            $controls[] = array('href' => 'spacer');
        }
        $controls[] = array('href' => "javascript:submitbutton('enroll','');", 'title' => _JLMS_ENROLL, 'img' => 'publish');
        JLMS_TMPL::ShowControlsFooter($controls, '', false);
        JLMS_TMPL::OpenTS();
        ?>
		
	 			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="<?php 
        echo JLMSCSS::_('jlmslist');
        ?>
">
					<tr>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" align="center" width="1%">#</<?php 
        echo $JLMS_CONFIG->get('tableheader_tag', 'td');
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" align="center" width="1%">&nbsp;</<?php 
        echo $JLMS_CONFIG->get('tableheader_tag', 'td');
        ?>
>
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" width="35%" align="left"><?php 
        echo _JLMS_COURSES_TBL_HEAD_NAME;
        ?>
</<?php 
        echo $JLMS_CONFIG->get('tableheader_tag', 'td');
        ?>
>
						
						<?php 
        if (isset($lists['extra_columns']) && count($lists['extra_columns'])) {
            foreach ($lists['extra_columns'] as $column) {
                ?>
								<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="20%" align="left"><?php 
                echo ucfirst($column->name);
                ?>
</<?php 
                echo $JLMS_CONFIG->get('tableheader_tag', 'td');
                ?>
>
								<?php 
            }
        }
        ?>
						
						
						<<?php 
        echo JLMSCSS::tableheadertag();
        ?>
 class="<?php 
        echo JLMSCSS::_('sectiontableheader');
        ?>
" width="20%" align="left"><?php 
        echo _JLMS_COURSES_COURSES_CAT;
        ?>
</<?php 
        echo $JLMS_CONFIG->get('tableheader_tag', 'td');
        ?>
>
						<?php 
        if (!$JLMS_ACL->CheckPermissions('lms', 'order_courses')) {
            if ($show_course_publish_dates) {
                ?>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="6%" align="left" nowrap="nowrap"><?php 
                echo _JLMS_COURSES_ST_DATE;
                ?>
</<?php 
                echo $JLMS_CONFIG->get('tableheader_tag', 'td');
                ?>
>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="6%" align="left" nowrap="nowrap"><?php 
                echo _JLMS_COURSES_END_DATE;
                ?>
</<?php 
                echo $JLMS_CONFIG->get('tableheader_tag', 'td');
                ?>
>
						<?php 
            }
        }
        ?>
						<?php 
        if ($price_fee_type == 1) {
            ?>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="4%" align="left" nowrap="nowrap"><?php 
            echo _JLMS_COURSES_FEETYPE;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
						<?php 
        } else {
            if ($price_fee_type == 2) {
                ?>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
" width="4%" align="left" nowrap="nowrap"><?php 
                echo _JLMS_COURSES_PRICE;
                ?>
</<?php 
                echo $JLMS_CONFIG->get('tableheader_tag', 'td');
                ?>
>							
						<?php 
            }
        }
        if ($JLMS_CONFIG->get('lms_courses_sortby', 0) == 1) {
            if ($JLMS_ACL->CheckPermissions('lms', 'order_courses')) {
                ?>
						<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 colspan="2" width="5%" class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
">
									<?php 
                echo _JLMS_REORDER;
                ?>
									</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
									<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 width="2%" class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
">
									<?php 
                echo _JLMS_ORDER;
                ?>
									</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
									<<?php 
                echo JLMSCSS::tableheadertag();
                ?>
 width="1%" class="<?php 
                echo JLMSCSS::_('sectiontableheader');
                ?>
">
									<a href="javascript:cf_saveorder();"><img src="<?php 
                echo $lms_img_path;
                ?>
/toolbar/tlb_filesave.png" border="0" width="16" height="16" alt="<?php 
                echo _JLMS_SAVEORDER;
                ?>
" title="<?php 
                echo _JLMS_SAVEORDER;
                ?>
" /></a>
									</<?php 
                echo JLMSCSS::tableheadertag();
                ?>
>
						<?php 
            }
        }
        if ($JLMS_ACL->CheckPermissions('lms', 'create_course')) {
            ?>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="40" align="center"><?php 
            echo _JLMS_COURSES_PUBLISHED_COURSE;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="40" align="center"><?php 
            echo _JLMS_COURSES_DELETE_COURSE;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="40" align="center"><?php 
            echo _JLMS_COURSES_EDIT_COURSE;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
						<<?php 
            echo JLMSCSS::tableheadertag();
            ?>
 class="<?php 
            echo JLMSCSS::_('sectiontableheader');
            ?>
" width="30" align="center"><?php 
            echo _JLMS_COURSES_EXPORT;
            ?>
</<?php 
            echo $JLMS_CONFIG->get('tableheader_tag', 'td');
            ?>
>
						<?php 
        }
        ?>
					</tr>
				<?php 
        $k = 1;
        $iii = 0;
        $number_of_columns_in_table = 0;
        $show_paid_courses = $JLMS_CONFIG->get('show_paid_courses', 1);
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            $number_of_columns_in_table = 0;
            $course_usertype = 0;
            if (in_array($row->id, $JLMS_CONFIG->get('teacher_in_courses', array(0)))) {
                $course_usertype = 1;
            } elseif (in_array($row->id, $JLMS_CONFIG->get('student_in_courses', array(0)))) {
                $course_usertype = 2;
            }
            //$course_usertype = JLMS_GetUserType($my->id, $row->id);
            if (!$show_paid_courses && !$course_usertype && $row->paid) {
                continue;
            }
            $course_descr = strip_tags($row->course_description);
            if (strlen($course_descr) > 100) {
                $course_descr = substr($course_descr, 0, 100) . "...";
            }
            $link = sefRelToAbs("index.php?option=" . $option . "&Itemid=" . $Itemid . "&task=details_course&id=" . $row->id);
            $checked = '';
            if ($course_usertype) {
                $bg = '';
                if ($course_usertype == 1) {
                    $checked = '<img class="JLMS_png" src="' . $lms_img_path . '/toolbar/tlb_courses.png" width="16" height="16" border="0" alt="" title="" />';
                    $pres_icons->my = 1;
                } elseif ($course_usertype == 2) {
                    $checked = '<img class="JLMS_png" src="' . $lms_img_path . '/buttons/btn_complete.png" width="16" height="16" border="0" alt="" title="" />';
                    $pres_icons->already = 1;
                }
            } elseif ($row->self_reg == 0) {
                $checked = "<a href='mailto:" . $row->email . "'><img class='JLMS_png' src=\"" . $lms_img_path . "/dropbox/dropbox_corr.png\" width='16' height='16' border='0' alt='' title='' /></a>";
                $pres_icons->mail = 1;
            } else {
                if ($row->in_wl) {
                    $checked = '<img class="JLMS_png" src="' . $lms_img_path . '/buttons/btn_waiting.png" width="16" height="16" border="0" alt="" title="" />';
                    $pres_icons->wl = 1;
                } else {
                    $can_enroll = JLMS_checkCourseGID($my->id, $row->gid);
                    if ($can_enroll) {
                        $checked = mosHTML::idBox($i, $row->id);
                    } else {
                        $checked = "<a href='mailto:" . $row->email . "'><img class='JLMS_png' src=\"" . $lms_img_path . "/dropbox/dropbox_corr.png\" width='16' height='16' border='0' alt='' title='' /></a>";
                        $pres_icons->mail = 1;
                    }
                }
            }
            ?>
					<?php 
            if ($show_short_description && !$JLMS_ACL->CheckPermissions('lms', 'order_courses')) {
                ?>
					<tr valign="middle" style="vertical-align:middle" class="<?php 
                echo JLMSCSS::_('sectiontableentry2');
                ?>
">
					<?php 
            } else {
                ?>
					<tr valign="middle" style="vertical-align:middle" class="<?php 
                echo JLMSCSS::_('sectiontableentry' . $k);
                ?>
">					
					<?php 
            }
            $number_of_columns_in_table = $number_of_columns_in_table + 4;
            // index, checkbox, name,category
            ?>
						<td align="center"><?php 
            echo $pageNav->limitstart + $iii + 1;
            ?>
</td>
						<td align="center"><?php 
            echo $checked;
            ?>
</td>
						<td align="left" class="jlms_coursename_cont_td">
							<a href="<?php 
            echo $link;
            ?>
" title="<?php 
            echo str_replace('"', '&quot;', $row->course_name);
            ?>
">
								<?php 
            echo $row->course_name;
            ?>
							</a>
							<br />
							<?php 
            if ($show_course_author) {
                ?>
								<span class="small"><?php 
                echo _JLMS_HOME_AUTHOR . "&nbsp;" . $row->user_fullname;
                ?>
</span>
							<?php 
            }
            ?>
							<?php 
            if (isset($row->plugin_course_list_extra_information) && count($row->plugin_course_list_extra_information)) {
                echo '<br />';
                $fields = $row->plugin_course_list_extra_information;
                $c = 1;
                foreach ($fields as $field) {
                    echo '<span class="small">' . $field->name . ': ' . $field->value . '</span>';
                    if ($c < count($fields)) {
                        echo '<br />';
                    }
                    $c++;
                }
            }
            ?>
						</td>
						
						<?php 
            if (isset($lists['extra_columns']) && count($lists['extra_columns'])) {
                foreach ($lists['extra_columns'] as $column) {
                    ?>
								<td align="left">
								<?php 
                    if (isset($row->plugin_course_list_extra_column) && count($row->plugin_course_list_extra_column)) {
                        $fields = $row->plugin_course_list_extra_column;
                        foreach ($fields as $field) {
                            //										echo $field->name.' '.$column->value;
                            //										echo '<br />';
                            if ($column->value == $field->name) {
                                echo $field->value;
                            }
                        }
                    }
                    ?>
								</td>
							<?php 
                }
            }
            ?>
						
						<td align="left"><?php 
            echo $row->c_category ? $row->c_category : '&nbsp;';
            ?>
</td>
						<?php 
            if (!$JLMS_ACL->CheckPermissions('lms', 'order_courses')) {
                if ($show_course_publish_dates) {
                    $number_of_columns_in_table = $number_of_columns_in_table + 2;
                    ?>
								<td align="center" nowrap="nowrap"><?php 
                    echo $row->publish_start ? JLMS_dateToDisplay($row->start_date) : '&nbsp;';
                    ?>
</td>
								<td align="center" nowrap="nowrap"><?php 
                    echo $row->publish_end ? JLMS_dateToDisplay($row->end_date) : '&nbsp;';
                    ?>
</td>
								<?php 
                }
            }
            if ($price_fee_type) {
                if ($price_fee_type == 1) {
                    $number_of_columns_in_table++;
                    ?>
							<td align="center"><?php 
                    echo $row->paid ? _JLMS_COURSES_PAID : _JLMS_COURSES_FREE;
                    ?>
</td>
							<?php 
                } else {
                    if ($price_fee_type == 2) {
                        $number_of_columns_in_table++;
                        ?>
							<td align="center"><?php 
                        echo $row->paid ? $jlms_cs . sprintf('%.2f', round($row->course_price, 2)) : _JLMS_COURSES_FREE;
                        ?>
</td>	
							<?php 
                    }
                }
            }
            if ($JLMS_CONFIG->get('lms_courses_sortby', 0) == 1) {
                if ($JLMS_ACL->CheckPermissions('lms', 'order_courses')) {
                    $number_of_columns_in_table = $number_of_columns_in_table + 4;
                    //up, down, number(colspan=2)
                    ?>
								<td>
								<?php 
                    echo JLMS_orderUpIcon($i, $row->id, true, 'fcourse_orderup');
                    ?>
								</td>
								<td>
								<?php 
                    echo JLMS_orderDownIcon($i, $n, $row->id, true, 'fcourse_orderdown');
                    ?>
								</td>
								<td align="center" colspan="2">
								<input type="text" name="order[]" size="5" value="<?php 
                    echo $row->ordering;
                    ?>
" class="text_area" style="text-align: center" />
								<input type="checkbox" name="t_chk[]" value="<?php 
                    echo $row->id;
                    ?>
" style="visibility:hidden; display:none;" checked="checked" />
								</td>
							<?php 
                }
            }
            if ($JLMS_ACL->CheckPermissions('lms', 'create_course')) {
                $number_of_columns_in_table = $number_of_columns_in_table + 4;
                // publish, delete, edit, export
                ?>
			
						<td align="center" valign="middle">
							<?php 
                if ($course_usertype == 1) {
                    $time_p = $row->publish_start || $row->publish_end;
                    $alt = $row->published ? $time_p ? _JLMS_STATUS_PUB : _JLMS_STATUS_PUB : _JLMS_STATUS_UNPUB;
                    $image = $row->published ? $time_p ? 'btn_publish_wait.png' : 'btn_accept.png' : 'btn_cancel.png';
                    $add_options = '';
                    $html_txt = '';
                    $html_txt_title = '';
                    if ($time_p) {
                        $html_txt_title = $alt;
                        $is_expired = false;
                        $is_future_course = false;
                        $html_txt = '<table cellpadding=0 cellspacing=0 border=0>';
                        if ($row->publish_start) {
                            $html_txt .= '<tr><td align=left>' . _JLMS_START_DATE . '&nbsp;</td><td align=left>' . $row->start_date . '</td></tr>';
                            $s_date = strtotime($row->start_date);
                            if ($s_date > time()) {
                                $is_future_course = true;
                            }
                        } else {
                            $html_txt .= '<tr><td align=left>' . _JLMS_START_DATE . '&nbsp;</td><td align=left>-</td></tr>';
                        }
                        if ($row->publish_end) {
                            $html_txt .= '<tr><td align=left>' . _JLMS_END_DATE . '&nbsp;</td><td align=left>' . $row->end_date . '</td></tr>';
                            $e_date = strtotime($row->end_date);
                            if ($e_date < time()) {
                                $is_expired = true;
                            }
                        } else {
                            $html_txt .= '<tr><td align=left>' . _JLMS_END_DATE . '&nbsp;</td><td align=left>-</td></tr>';
                        }
                        if ($is_expired) {
                            $alt = _JLMS_STATUS_EXPIRED;
                            $html_txt_title = _JLMS_STATUS_EXPIRED;
                            $image = 'btn_expired.png';
                        } elseif ($is_future_course) {
                            $alt = _JLMS_STATUS_FUTURE_COURSE;
                            if (!$row->published) {
                                $alt .= ' / ' . _JLMS_STATUS_UNPUB;
                            }
                            $html_txt_title = $alt;
                            $image = 'btn_expired.png';
                            if ($JLMS_CONFIG->get('show_future_courses', false) && $is_future_course && $row->published) {
                                $image = 'btn_publish_wait.png';
                            }
                        }
                        $html_txt .= '</table>';
                    }
                    $state = $row->published ? 0 : 1;
                    $plink = JLMSRoute::_("index.php?option=" . $option . "&amp;Itemid=" . $Itemid . "&amp;task=change_course&amp;state=" . $state . "&amp;id=" . $row->id);
                    $inside_tag = '<img class="JLMS_png" src="' . $lms_img_path . '/toolbar/' . $image . '" width="16" height="16" border="0" alt="' . $alt . '" title="' . $alt . '" />';
                    echo JLMS_toolTip($html_txt_title, $html_txt, $inside_tag, $plink, 1, 30, true, 'jlms_ttip jlms_img_link');
                    ?>
							<?php 
                } else {
                    echo '&nbsp;';
                }
                ?>
						</td>
						<td align="center" valign="middle">
							<?php 
                if ($course_usertype == 1) {
                    ?>
							<a class="jlms_img_link" href="javascript:submitbutton('delete_course',<?php 
                    echo $row->id;
                    ?>
);" title="<?php 
                    echo _JLMS_DELETE;
                    ?>
"><img class="JLMS_png" src="<?php 
                    echo $lms_img_path;
                    ?>
/toolbar/btn_delete.png" width="16" height="16" border="0" alt="<?php 
                    echo _JLMS_DELETE;
                    ?>
" title="<?php 
                    echo _JLMS_DELETE;
                    ?>
" /></a>
							<?php 
                } else {
                    echo '&nbsp;';
                }
                ?>
						</td>
						<td align="center" valign="middle">
							<?php 
                if ($course_usertype == 1) {
                    ?>
							<a class="jlms_img_link" href="javascript:submitbutton('edit_course',<?php 
                    echo $row->id;
                    ?>
);" title="<?php 
                    echo _JLMS_EDIT;
                    ?>
"><img class="JLMS_png" src="<?php 
                    echo $lms_img_path;
                    ?>
/toolbar/btn_edit.png" width="16" height="16" border="0" alt="<?php 
                    echo _JLMS_EDIT;
                    ?>
" title="<?php 
                    echo _JLMS_EDIT;
                    ?>
" /></a>
							<?php 
                } else {
                    echo '&nbsp;';
                }
                ?>
						</td>
						<td align="center" valign="middle">
							<?php 
                if ($course_usertype == 1) {
                    ?>
							<a class="jlms_img_link" href="javascript:submitbutton('export_course_pre',<?php 
                    echo $row->id;
                    ?>
);" title="<?php 
                    echo _JLMS_EDIT;
                    ?>
"><img class="JLMS_png" src="<?php 
                    echo $lms_img_path;
                    ?>
/toolbar/btn_export.png" width="16" height="16" border="0" alt="<?php 
                    echo _JLMS_COURSES_EXPORT;
                    ?>
" title="<?php 
                    echo _JLMS_COURSES_EXPORT;
                    ?>
" /></a>
							<?php 
                } else {
                    echo '&nbsp;';
                }
                ?>
						</td>
						<?php 
            }
            ?>
					</tr>
					<?php 
            if (!$JLMS_ACL->CheckPermissions('lms', 'order_courses')) {
                if ($show_short_description) {
                    if (strlen($row->course_sh_description)) {
                        ?>
						<tr class="<?php 
                        echo JLMSCSS::_('sectiontableentry1');
                        ?>
">
							<td>&nbsp;</td>
							<td colspan="<?php 
                        echo $number_of_columns_in_table ? $number_of_columns_in_table - 1 : $colspan_sh_description;
                        ?>
" style="text-align: justify;">
								<?php 
                        echo $row->course_sh_description;
                        ?>
							</td>
						</tr>
						<?php 
                    }
                }
            }
            ?>
					<?php 
            $k = 3 - $k;
            $iii++;
        }
        ?>
				<?php 
        if ($pageNav->isMultiPages()) {
            ?>
					<tr>
						<?php 
            if ($JLMS_ACL->CheckPermissions('lms', 'order_courses')) {
                $colspan_sh_description = $colspan_sh_description + 7;
            }
            ?>
						<td class="<?php 
            echo JLMSCSS::_('jlmslist-footer_td');
            ?>
" colspan="<?php 
            echo $number_of_columns_in_table ? $number_of_columns_in_table : $colspan_sh_description + 1;
            ?>
" align="center">
							<div align="center" style="text-align:center">
							<?php 
            $link = "index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=courses";
            echo _JLMS_PN_DISPLAY_NUM . $pageNav->getLimitBox($link) . ' ' . $pageNav->getPagesCounter();
            ?>
							</div>
							<br />
							<div align="center" style="text-align:center">
							<?php 
            $link = "index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=courses";
            echo $pageNav->writePagesLinks($link);
            ?>
							</div>
						</td>
					</tr>
				<?php 
        }
        ?>
				</table>
				
	<?php 
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::ShowControlsFooter($controls);
        if ($pres_icons->already || $pres_icons->mail || $pres_icons->my || $pres_icons->wl) {
            JLMS_TMPL::OpenTS('', ' align="left"');
            ?>
			<div class="joomlalms_info_legend">
			<?php 
            if ($pres_icons->already) {
                ?>
				<div style="text-align:left ">
					<img class="JLMS_png" src="<?php 
                echo $lms_img_path;
                ?>
/buttons/btn_complete.png" align="top" width="16" height="16" border="0" alt="<?php 
                echo _JLMS_COURSES_ALREADY;
                ?>
" title="<?php 
                echo _JLMS_COURSES_ALREADY;
                ?>
" />
					&nbsp;- <?php 
                echo _JLMS_COURSES_ALREADY;
                ?>
.
				</div>
			<?php 
            }
            ?>
			<?php 
            if ($pres_icons->mail) {
                ?>
				<div style="text-align:left ">
					<img class='JLMS_png' src="<?php 
                echo $lms_img_path;
                ?>
/dropbox/dropbox_corr.png" align="top" width='16' height='16' border='0' alt='' title='' />
					&nbsp;- <?php 
                echo _JLMS_COURSES_ADMIN_SENT;
                ?>
				</div>
			<?php 
            }
            ?>
			<?php 
            if ($pres_icons->my) {
                ?>
				<div style="text-align:left ">
					<img class="JLMS_png" src="<?php 
                echo $lms_img_path;
                ?>
/toolbar/tlb_courses.png" align="top" width="16" height="16" border="0" alt="<?php 
                echo _JLMS_COURSES_TITLE_MY_COURSES;
                ?>
" title="<?php 
                echo _JLMS_COURSES_TITLE_MY_COURSES;
                ?>
" />
					&nbsp;- <?php 
                echo _JLMS_COURSES_TITLE_MY_COURSES;
                ?>
.
				</div>
			<?php 
            }
            ?>
			<?php 
            if ($pres_icons->wl) {
                ?>
				<div style="text-align:left ">
					<img class="JLMS_png" src="<?php 
                echo $lms_img_path;
                ?>
/buttons/btn_waiting.png" align="top" width="16" height="16" border="0" alt="<?php 
                echo _JLMS_COURSES_TITLE_MY_COURSES;
                ?>
" title="<?php 
                echo _JLMS_COURSES_TITLE_MY_COURSES;
                ?>
" />
					&nbsp;- <?php 
                echo _JLMS_COURSES_IN_WL;
                ?>
.
				</div>
			<?php 
            }
            ?>
			</div>
<?php 
            JLMS_TMPL::CloseTS();
        }
        JLMS_TMPL::CloseMT();
        ?>
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="id" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="itemid" value="" />
		<input type="hidden" name="row_id" value="0" />
		</form>
		<?php 
    }
    function jlms_booking_users($course_id, $option, $lists, $pid, $rows)
    {
        global $Itemid, $my, $JLMS_DB;
        JLMS_TMPL::OpenMT();
        $params = array('show_menu' => true);
        JLMS_TMPL::ShowHeader('conference', _JLMS_HEAD_CONF_STR, $params);
        JLMS_TMPL::OpenTS();
        ?>
	<script type="text/javascript" language="javascript">
	<!--//--><![CDATA[//><!--
	function submitbutton(pressbutton) {
		var form = document.adminForm;

			form.mode.value = pressbutton;
			form.submit();
		
	}
	//--><!]]>
	</script>
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td colspan="2">&nbsp;
					
				</td>
				<td style="text-align:right;"><br />
					<?php 
        $toolbar = array();
        //$toolbar[] = array('btn_type' => 'edit', 'btn_js' => sefRelToAbs("index.php?option=$option&amp;Itemid=$Itemid&amp;task=conference&amp;id=$course_id&amp;mode=archive") );
        $toolbar[] = array('btn_type' => 'save', 'btn_js' => "javascript:submitbutton('save_users');");
        $toolbar[] = array('btn_type' => 'cancel', 'btn_js' => sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=conference&amp;mode=booking&amp;id={$course_id}"));
        //echo JLMS_ShowToolbar($toolbar);
        ?>
				</td>
			</tr>
		</table>
<?php 
        JLMS_TMPL::CloseTS();
        JLMS_TMPL::OpenTS();
        ?>
		<form action="<?php 
        echo sefRelToAbs("index.php?option={$option}&Itemid={$Itemid}");
        ?>
" method="post" name="adminForm">
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
				<tr>
					<td width="20%">
						Select user
					</td>
					<td>
						<?php 
        echo $lists['usrs'];
        ?>
					</td>
				</tr>
			</table>
			
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td class="sectiontableheader" align="left" width="15">#</td>

					<td class="sectiontableheader" align="left" width="10"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" /></td>
					<td class="sectiontableheader" align="left"><?php 
        echo "Username";
        ?>
</td>
				</tr>
			<?php 
        $k = 1;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            $checked = mosHTML::idBox($i, $row->user_id);
            ?>
			
				<tr valign="middle" style="vertical-align:middle" class="<?php 
            echo "sectiontableentry{$k}";
            ?>
">
					<td align="left"><?php 
            echo $i + 1;
            ?>
</td>
					<td align="left"><?php 
            echo $checked;
            ?>
</td>
					<td align="left">
						<?php 
            echo $row->name . "(" . $row->username . ")";
            ?>
 
					</td>
				</tr>
				<?php 
            $k = 3 - $k;
        }
        ?>
			</table>
			<input type="hidden" name="task" value="conference" />
			<input type="hidden" name="mode" value="" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="p_id" value="<?php 
        echo $pid;
        ?>
" />
			<input type="hidden" name="id" value="<?php 
        echo $course_id;
        ?>
" />
			<input type="hidden" name="state" value="0" />
		</form>
		<?php 
        JLMS_TMPL::CloseTS();
        $controls = array();
        $controls[] = array('href' => "javascript:submitbutton('save_users');", 'title' => 'Save', 'img' => 'save');
        $controls[] = array('href' => "javascript:submitbutton('delete_users_from_conference');", 'title' => _JLMS_DELETE, 'img' => 'delete');
        JLMS_TMPL::ShowControlsFooter($controls, sefRelToAbs("index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=conference&amp;mode=booking&amp;id={$course_id}"));
        /*$controls = array();
        		$controls[] = array('href' => "javascript:submitbutton('period_cancel');", 'title' => _JLMS_CANCEL_ALT_TITLE, 'img' => 'cancel');
        		$controls[] = array('href' => "javascript:submitbutton('save_users');", 'title' => _JLMS_SAVE_ALT_TITLE, 'img' => 'save');
        		
        		JLMS_TMPL::ShowControlsFooter($controls, sefRelToAbs("index.php?option=$option&amp;Itemid=$Itemid&amp;task=conference&amp;mode=booking&amp;id=$course_id"));
        */
        JLMS_TMPL::CloseMT();
    }
Esempio n. 28
0
    /**
     * Writes a list of the categories for a section
     * @param array An array of category objects
     * @param string The name of the category section
     */
    function show(&$rows, $scope, $myid, &$pageNav, $option)
    {
        global $my, $adminLanguage;
        ?>
		<form action="index2.php" method="post" name="adminForm">
		
		<table class="adminheading">
		<tr>
			 <th class="sections">
			<?php 
        echo $adminLanguage->A_COMP_SECT_MANAGER;
        ?>
			</th>
		</tr>
		</table>
		
		<table class="adminlist">
		<tr>
			<th width="20">
			<?php 
        echo $adminLanguage->A_COMP_NB;
        ?>
			</th>
			<th width="20">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			<?php 
        echo $adminLanguage->A_COMP_SECT_NAME;
        ?>
			</th>
			<th width="10%">
			<?php 
        echo $adminLanguage->A_COMP_PUBLISHED;
        ?>
			</th>
			<th colspan="2">
			<?php 
        echo $adminLanguage->A_COMP_REORDER;
        ?>
			</th>
			<th width="10%">
			<?php 
        echo $adminLanguage->A_COMP_ACCESS;
        ?>
			</th>
			<th width="12%">
			<?php 
        echo $adminLanguage->A_COMP_SECT_ID;
        ?>
			</th>
			<th width="12%">
			<?php 
        echo $adminLanguage->A_COMP_SECT_NB_CATEG;
        ?>
			</th>
			<th width="12%">
			<?php 
        echo $adminLanguage->A_COMP_ACTIVE;
        ?>
			</th>
			<th width="12%">
			<?php 
        echo $adminLanguage->A_COMP_TRASH;
        ?>
			</th>
			<th width="10%">
			<?php 
        echo $adminLanguage->A_COMP_CHECKED_OUT;
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $img = $row->published ? 'tick.png' : 'publish_x.png';
            $task = $row->published ? 'unpublish' : 'publish';
            $alt = $row->published ? $adminLanguage->A_COMP_PUBLISHED : $adminLanguage->A_COMP_UNPUBLISHED;
            if (!$row->access) {
                $color_access = 'style="color: green;"';
                $task_access = 'accessregistered';
            } else {
                if ($row->access == 1) {
                    $color_access = 'style="color: red;"';
                    $task_access = 'accessspecial';
                } else {
                    $color_access = 'style="color: black;"';
                    $task_access = 'accesspublic';
                }
            }
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td width="20" align="right">
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td width="20">
				<?php 
            echo mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $myid);
            ?>
				</td>
				<td width="35%">
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                ?>
					<?php 
                echo $row->name . " ( " . $row->title . " )";
                ?>
					&nbsp;[ <i><?php 
                echo $adminLanguage->A_COMP_CHECKED_OUT;
                ?>
</i> ]
					<?php 
            } else {
                ?>
					<a href="#edit" onClick="return listItemTask('cb<?php 
                echo $i;
                ?>
','edit')">
					<?php 
                echo $row->name . " ( " . $row->title . " )";
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<td align="center">
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
				<img src="images/<?php 
            echo $img;
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $alt;
            ?>
" />
				</a>
				</td>
				<td>
				<?php 
            echo $pageNav->orderUpIcon($i);
            ?>
				</td>
				<td>
				<?php 
            echo $pageNav->orderDownIcon($i, $n);
            ?>
				</td>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task_access;
            ?>
')" <?php 
            echo $color_access;
            ?>
>
				<?php 
            echo $row->groupname;
            ?>
				</a>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->categories;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->active;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->trash;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->editor;
            ?>
&nbsp;
				</td>
				<?php 
            $k = 1 - $k;
            ?>
			</tr>
			<?php 
        }
        // for loop
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>
		
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="scope" value="<?php 
        echo $scope;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="chosen" value="" />
		<input type="hidden" name="act" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<?php 
    }
    function show_all_notices($option, $lists, $total, $pageNav, $limitstart, $limit)
    {
        global $JLMS_CONFIG, $Itemid;
        //FLMS multicat
        $multicat = array();
        if ($JLMS_CONFIG->get('multicat_use', 0)) {
            $multicat = array();
            $i = 0;
            foreach ($lists as $key => $item) {
                if (substr($key, 0, 7) == 'filter_') {
                    $multicat[] = $lists['filter_' . $i];
                    $i++;
                }
            }
        }
        $link_pages = "index.php?option={$option}&task=view_all_notices";
        ?>
		<script language="javascript" type="text/javascript">
		<!--//--><![CDATA[//><!--
		var old_filters = new Array();
		function read_filter(){
			var form = document.adminForm;
			var count_levels = '<?php 
        echo count($lists['levels']);
        ?>
';
			for(var i=0;i<parseInt(count_levels);i++){
				if(form['filter_id_'+i] != null){
					old_filters[i] = form['filter_id_'+i].value;
				}
			}
		}
		function write_filter(){
			var form = document.adminForm;
			var count_levels = '<?php 
        echo count($lists['levels']);
        ?>
';
			var j;
			for(var i=0;i<parseInt(count_levels);i++){
				if(form['filter_id_'+i+''] != null && form['filter_id_'+i+''].value != old_filters[i]){
					j = i;
				}
				if(i > j){
					if(form['filter_id_'+i] != null){
						form['filter_id_'+i].value = 0;	
					}
				}
			}
		}
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if ((pressbutton == 'delete_notice_no_ajax' || pressbutton == 'edit_notice_no_ajax') && form.boxchecked.value == '0') {
				alert('<?php 
        echo _JLMS_ALERT_SELECT_ITEM;
        ?>
');
			} else {
				form.task.value = pressbutton;
				form.submit();
			}
		}
		//--><!]]>
		</script>
		<form action="<?php 
        echo $JLMS_CONFIG->get('live_site') . "/index.php?option={$option}&amp;Itemid={$Itemid}";
        ?>
" method="post" name="adminForm">
			<?php 
        JLMS_TMPL::OpenMT();
        $params = array('show_menu' => true, 'simple_menu' => true);
        JLMS_TMPL::ShowHeader('doc', 'View notices', $params);
        $controls = array();
        $controls[] = array('href' => $JLMS_CONFIG->get('live_site') . "/index.php?option={$option}&amp;Itemid={$Itemid}&amp;task=new_notice_no_ajax", 'title' => 'New Notice', 'img' => 'add');
        $controls[] = array('href' => "javascript:submitbutton('edit_notice_no_ajax');", 'title' => 'Edit Notice', 'img' => 'edit');
        $controls[] = array('href' => "javascript:submitbutton('delete_notice_no_ajax');", 'title' => 'Delete Notice(s)', 'img' => 'delete');
        //			$controls[] = array('href' => 'spacer');
        JLMS_TMPL::ShowControlsFooter($controls, '', false);
        JLMS_TMPL::CloseMT();
        ?>
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td colspan="5">
						<table border="0" cellpadding="0" cellspacing="0" align="right">
							<tr>
								<td align="right">
									<?php 
        if ($JLMS_CONFIG->get('multicat_use', 0)) {
            echo (isset($lists['levels'][0]->cat_name) && $lists['levels'][0]->cat_name != '' ? $lists['levels'][0]->cat_name : _JLMS_COURSES_COURSES_GROUPS) . " " . $lists['filter_0'];
        } else {
            echo _JLMS_COURSES_COURSES_GROUPS . " " . $lists['groups_course'];
        }
        ?>
								</td>
							</tr>
							<?php 
        if (count($multicat)) {
            for ($i = 0; $i < count($multicat); $i++) {
                if ($i > 0) {
                    ?>
										<tr>
											<td align="right">
											<?php 
                    echo (isset($lists['levels'][$i]->cat_name) && $lists['levels'][$i]->cat_name != '' ? $lists['levels'][$i]->cat_name : _JLMS_COURSES_COURSES_GROUPS) . " " . $lists['filter_' . $i];
                    ?>
	
											</td>
										</tr>	
										<?php 
                }
            }
        }
        if (isset($lists['levels'][0]) || count($multicat)) {
            ?>
								<tr>
									<td align="right">
										<?php 
            echo $lists['f_course'];
            ?>
	
									</td>
								</tr>	
								<?php 
        }
        ?>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="5" align="center">
						<?php 
        echo $pageNav->writePagesCounter() . ' ' . $pageNav->getLimitBox($link_pages);
        ?>
					</td>
				</tr>
				<tr>
					<td class="sectiontableheader" width="1%">
						#
					</td>
					<td class="sectiontableheader" width="1%">
						<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($lists['my_notices']);
        ?>
);" />
					</td>
					<td class="sectiontableheader">
						Notice
					</td>
					<td class="sectiontableheader" width="20%">
						Course name
					</td>
					<td class="sectiontableheader" width="10%">
						Date
					</td>
				</tr>
				<?php 
        $link_base = 'index.php?option=com_joomla_lms';
        $z = $limitstart;
        $end = $limit + $z;
        if ($end > $total) {
            $end = $total + 1;
        }
        $k = 1;
        for ($i = $z; $i < $end; $i++) {
            if (isset($lists['my_notices'][$i])) {
                $m_n = $lists['my_notices'][$i];
                $link = $link_base;
                if ($m_n->doc_id) {
                    $link .= '&task=' . $m_n->task . '&course_id=' . $m_n->course_id . '&id=' . $m_n->doc_id . '';
                } else {
                    $link .= '&task=' . $m_n->task . '&id=' . $m_n->course_id . '';
                }
                $checked = mosHTML::idBox($i, $m_n->id);
                ?>
						<tr class="<?php 
                echo "sectiontableentry{$k}";
                ?>
">
							<td align="center" width="1%"><?php 
                echo $pageNav->limitstart + $i + 1;
                ?>
</td>
							<td align="center" width="1%"><?php 
                echo $checked;
                ?>
</td>
							<td style="text-align: justify;">
								<?php 
                if (!$m_n->course_id && !$m_n->doc_id) {
                    /*
                    if(strlen($m_n->notice) > 100){
                    	echo substr($m_n->notice, 0, 100).' ...';	
                    } else {
                    	echo substr($m_n->notice, 0, 100);	
                    }
                    */
                    echo $m_n->notice;
                } else {
                    ?>
								<a href="<?php 
                    echo sefRelToAbs($link);
                    ?>
" title="<?php 
                    echo str_replace('"', '&quot;', strip_tags(substr($m_n->notice, 0, 30)));
                    ?>
">
									<?php 
                    /*
                    if(strlen($m_n->notice) > 100){
                    	echo substr($m_n->notice, 0, 100).' ...';	
                    } else {
                    	echo substr($m_n->notice, 0, 100);	
                    }
                    */
                    echo $m_n->notice;
                    ?>
								</a>
								<?php 
                }
                ?>
							</td>
							<td>
								<?php 
                echo $m_n->course_name;
                ?>
							</td>
							<td width="10%" nowrap="nowrap">
							on 
							<?php 
                echo JLMS_dateToDisplay($m_n->data, false, 0, " H:m:s");
                ?>
							</td>
						</tr>
						<?php 
                $k = 3 - $k;
            }
        }
        ?>
				<tr>
					<td colspan="5" align="center">
					<br />
						<?php 
        echo $pageNav->writePagesLinks($link_pages);
        ?>
					</td>
				</tr>
			</table>
			
			<input type="hidden" name="task" value="" />
			<input type="hidden" name="boxchecked" value="0" />
		
		</form>
		<?php 
    }
    function showUsers(&$rows, $pageNav, $search, $option, $lists)
    {
        ?>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="user">
			Administrar Usuários 
			</th>
			<td>
			Filtro:
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo htmlspecialchars($search);
        ?>
" class="inputbox" onChange="document.adminForm.submit();" />
			</td>
			<td width="right">
			<?php 
        echo $lists['type'];
        ?>
			</td>
			<td width="right">
			<?php 
        echo $lists['logged'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="2%" class="title">
			nº
			</th>
			<th width="3%" class="title">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			Nome
			</th>
			<th width="15%" class="title" >
			Nome de Usuário
			</th>
			<th width="5%" class="title" nowrap="nowrap">
			Autenticado
			</th>
			<th width="5%" class="title">
			Ativo
			</th>
			<th width="15%" class="title">
			Grupo
			</th>
			<th width="15%" class="title">
			E-mail
			</th>
			<th width="10%" class="title">
			Última visita
			</th>
			<th width="1%" class="title">
			ID
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $img = $row->block ? 'publish_x.png' : 'tick.png';
            $task = $row->block ? 'unblock' : 'block';
            $alt = $row->block ? 'Ativado' : 'Bloqueado';
            $link = 'index2.php?option=com_users&amp;task=editA&amp;id=' . $row->id . '&amp;hidemainmenu=1';
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $i + 1 + $pageNav->limitstart;
            ?>
				</td>
				<td>
				<?php 
            echo mosHTML::idBox($i, $row->id);
            ?>
				</td>
				<td>
				<a href="<?php 
            echo $link;
            ?>
">
				<?php 
            echo $row->name;
            ?>
				</a>
				<td>
				<?php 
            echo $row->username;
            ?>
				</td>
				</td>
				<td align="center">
				<?php 
            echo $row->loggedin ? '<img src="images/tick.png" width="12" height="12" border="0" alt="" />' : '';
            ?>
				</td>
				<td>
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
				<img src="images/<?php 
            echo $img;
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $alt;
            ?>
" />
				</a>
				</td>
				<td>
				<?php 
            echo $row->groupname;
            ?>
				</td>
				<td>
				<a href="mailto:<?php 
            echo $row->email;
            ?>
">
				<?php 
            echo $row->email;
            ?>
				</a>
				</td>
				<td nowrap="nowrap">
				<?php 
            echo mosFormatDate($row->lastvisitDate, _CURRENT_SERVER_TIME_FORMAT);
            ?>
				</td>
				<td>
				<?php 
            echo $row->id;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }