Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#857 closed Frage (wontfix)

auto_include CSS in admin/includes/head.php

Reported by: voodoopupp Owned by: somebody
Priority: normal Milestone: modified-shop-2.0.1.0
Component: Admin Version: 2.0.0.0
Keywords: Cc:
Blocked By: Blocking:

Description

Hi,

aktuell wird ja in der head.php im Admin zusätzliches CSS aus dem Verzeichnis admin/includes/extra/css geladen:

foreach(auto_include(DIR_FS_ADMIN.'includes/extra/css/','php') as $file) require ($file);

Nun werden aber dort PHP Dateien abgefragt. Sollten hier nicht sinnvollerweise CSS Dateien inkludiert werden? Denn ansonsten muss man nun aus jeder Extra-CSS Datei erstmal eine entsprechende PHP Datei bauen...

Attachments (0)

Change History (6)

comment:1 by voodoopupp, 10 years ago

Und dann muss man dafür solche Konstrukte basteln:

<?php
?>

<html>
<head>
<style>
#product_bild a {
color:#ffffff;
font:bold 16px verdana, sans-serif;
text-decoration:none;
display:block;
padding:5px;
border:0px solid black;}
#product_bild a:hover {
color:black;
background:#9B0068;}
#product_bild a span {display:none;}
#product_bild a:hover span {
position:absolute; top:10px; right:10px; z-index:3;
display:block;
width:auto;
color:black;
background:#ffffff;
font:normal 16px courier, sans-serif;
border:0px solid black;
padding:10px;}
</style>
</head>
<body>
</body>
</html>

Das ist sicherlich nicht allzu sinnvoll.

comment:2 by Volker Strähle, 10 years ago

Warum so komplieziert? es geht doch z. B. auch so:

<link rel="stylesheet" href="<?php echo 'templates/'.CURRENT_TEMPLATE; ?>/javascript/CookieGuard/cookieStyles.css" type="text/css" media="screen" />

Damit ist jede beliebige CSS einbindbar.

comment:3 by voodoopupp, 10 years ago

Ja, das schon, aber dann brauch ich quasi dafür zwei Dateien. Besser wäre es in meinen Augen eben nur eine einzelne Datei da rein zu werfen und dann wird das inkludiert.

Und im admin was aus dem Tempalte inkludieren wäre natürlich auch nicht ganz richtig ;)

comment:4 by Ronald Parcinski, 10 years ago

Resolution: wontfix
Status: newclosed

Man kann Styles direct includen

<script>
...
</script>

Oder eine CSS Datei einbinden, der Pfad in href kann individuell gesetzt werden:

<link rel="stylesheet" type="text/css" href="includes/css/test.css" />

Einfach mal ausprobieren. Nur weil eine Dateiendung php heißt muss da kein PHP drin sein.
Wird dann wie html direkt ausgegeben.

comment:5 by anonymous, 10 years ago

einfach ordentlich machen:

foreach(auto_include(DIR_FS_ADMIN.'includes/extra/css/','{css, php}', '*', GLOB_BRACE) as $file) {
  echo '<link rel="stylesheet" type="text/css" href="'. str_replace(DIR_FS_ADMIN, '', $file) .'">' . PHP_EOL;
}

und wenn das nicht gemacht wird, einfach im admin/includes/extra/css Verzeichnis folgende Datei ablegen:
css_include.php

<?php
foreach(auto_include(DIR_FS_ADMIN.'includes/extra/css/','css') as $file) {
  echo '<link rel="stylesheet" type="text/css" href="'. str_replace(DIR_FS_ADMIN, '', $file) .'">' . PHP_EOL;
}
?>

und schon geht es wie gewünscht

comment:6 by voodoopupp, 10 years ago

Also die letzte Idee mit der Einbindung einer eigenen "css_include.php" in admin/includes/extra/css ist wohl die beste Lösung:
keine Änderung des Cores und die CSS Dateien werden einwandfrei eingebunden!

Super Idee, habs nun genau so umgesetzt. Danke!

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.