[pmwiki-users] conditional stylesheets

Patrick R. Michaud pmichaud at pobox.com
Thu Apr 21 23:55:51 CDT 2005


On Thu, Apr 21, 2005 at 11:30:36PM -0400, Bronwyn Boltwood wrote:
> On 4/21/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > On Thu, Apr 21, 2005 at 09:36:44PM -0400, Bronwyn Boltwood wrote:
> > > How can I make PmWiki load the no-authoring stylesheet only when a
> > > visitor is NOT authorized to edit pages?
> > 
> > In 2.0.beta28 and later, the simplest is
> > 
> >    if (!RetrieveAuthPage($pagename, 'edit', false, READPAGE_CURRENT))
> >      $HTMLHeadersFmt[] =
> >        '<link rel="stylesheet" href="$SkinDirUrl/css/no-authoring.css" />';
> 
> I must be doing something wrong.  I created a skin.php that contains
> the following:
> 
> <?php if (!defined('PmWiki')) exit();
> /*
> hide authoring links if not authorized
> */
> if (!RetrieveAuthPage($pagename, 'edit', false, READPAGE_CURRENT))
> 	$HTMLHeadersFmt[] = '<link href="$SkinDirUrl/feature-author-off.css"
> media="screen, tv, projection, handheld" rel="stylesheet"
> type="text/css" />';
> ?>

Did you remember to do ...?

   global $HTMLHeadersFmt;

Pm



More information about the pmwiki-users mailing list