Back to PhocaDownloadRenderFront class

Method renderAllCSS

public static
renderAllCSS
(mixed $noBootStrap = 0)

Method renderAllCSS - Source code

public static function renderAllCSS($noBootStrap = 0)
{
    $app = Factory::getApplication();
    $itemid = $app->input->get('Itemid', 0, 'int');
    $db = Factory::getDBO();
    $query = 'SELECT a.filename as filename, a.type as type, a.menulink as menulink' . ' FROM #__phocadownload_styles AS a' . ' WHERE a.published = 1' . ' ORDER BY a.type, a.ordering ASC';
    $db->setQuery($query);
    $filenames = $db->loadObjectList();
    if (!empty($filenames)) {
        foreach ($filenames as $fk => $fv) {
            $path = PhocaDownloadFile::getCSSPath($fv->type, 1);
            if ($fv->menulink != '' && (int) $fv->menulink > 1) {
                $menuLinks = explode(',', $fv->menulink);
                $isIncluded = in_array((int) $itemid, $menuLinks);
                if ($isIncluded) {
                    HTMLHelper::stylesheet($path . $fv->filename);
                }
            } else {
                HTMLHelper::stylesheet($path . $fv->filename);
            }
        }
    }
}