| | 105 | public static function stylesheet($style, $index = FALSE, $media = FALSE) |
| | 106 | { |
| | 107 | $compiled = ''; |
| | 108 | |
| | 109 | if (is_array($style)) |
| | 110 | { |
| | 111 | foreach($style as $name) |
| | 112 | { |
| | 113 | $compiled .= self::stylesheet($name, $index, $media)."\n"; |
| | 114 | } |
| | 115 | } |
| | 116 | else |
| | 117 | { |
| | 118 | $media = ($media == FALSE) ? '' : ' media="'.$media.'"'; |
| | 119 | |
| | 120 | $compiled = '<link rel="stylesheet" href="'.url::base($index).$style.'.css"'.$media.' />'; |
| | 121 | } |
| | 122 | |
| | 123 | return $compiled; |
| | 124 | } |
| | 125 | |
| | 126 | /** |
| | 127 | * Script generator |
| | 128 | * |
| | 129 | * @access public |
| | 130 | * @param mixed String or array of script names |
| | 131 | * @param boolean Add index to the URL |
| | 132 | * @return string |
| | 133 | */ |
| | 134 | public static function script($script, $index = FALSE) |
| | 135 | { |
| | 136 | $compiled = ''; |
| | 137 | |
| | 138 | if (is_array($script)) |
| | 139 | { |
| | 140 | foreach($script as $name) |
| | 141 | { |
| | 142 | $compiled .= self::script($name, $index)."\n"; |
| | 143 | } |
| | 144 | } |
| | 145 | else |
| | 146 | { |
| | 147 | $compiled = '<script type="text/javascript" src="'.url::base($index).$script.'.js"></script>'; |
| | 148 | } |
| | 149 | |
| | 150 | return $compiled; |
| | 151 | } |
| | 152 | |