Пример #1
0
        break;
    case 'edit_css':
        editThemeCSS($cid[0]);
        break;
    case 'apply_css':
    case 'save_css':
        saveThemeCSS();
        break;
    case 'remove':
        removeTheme($cid[0]);
        break;
    case 'publish':
        publishTheme($cid[0]);
        break;
    default:
        showThemes();
}
/**
* Compiles a list of installed, version 4.5+ templates
*
* Based on xml files found.  If no xml file found the template
* is ignored
*/
function showThemes()
{
    global $_DOCMAN;
    $database = JFactory::getDBO();
    $mainframe = JFactory::getApplication();
    $limit = $mainframe->getCfg('list_limit');
    $limit = $mainframe->getUserStateFromRequest('viewlistlimit', 'limit', $limit);
    $limitstart = $mainframe->getUserStateFromRequest("view{com_docman}limitstart", 'limitstart', 0);
function ShowTemplates($style)
{
    $StylewArray = array();
    //create array
    foreach (showThemes() as $key => $val) {
        $StylewArray[$val['theme_file']] = $key;
    }
    //end foreach
    asort($StylewArray);
    echo '<select name="style" class="textbox" onChange="showHint(this.value);">';
    foreach ($StylewArray as $key => $value) {
        ?>
<option value="<?php 
        echo $key;
        ?>
" <?php 
        if ($key == $style) {
            echo 'selected';
        }
        ?>
><?php 
        echo $value;
        ?>
</option>
        <?php 
    }
    //end foreach
    echo '</select>';
}