OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



schedConfStyleSheet status

OCS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, michael

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

schedConfStyleSheet status

Postby spatialguru » Thu Feb 14, 2008 1:51 pm

Hi all,
I started digging into how to set up scheduled conference specified stylesheets and was delighted to find the code already to use in TemplateManager.inc.php. Is it set right? I don't see the code showing up in the output page.
Code: Select all
 
// Assign scheduled conference stylesheet and footer (after conference stylesheet!)
if($schedConf) {
     $schedConfStyleSheet = $schedConf->getSetting('schedConfStyleSheet', false);
     if ($schedConfStyleSheet) {
          $this->addStyleSheet(Request::getBaseUrl() .
          '/' .   PublicFileManager::getSchedConfFilesPath($schedConf->getSchedConfId()) .
          '/' . $schedConfStyleSheet['uploadName']);
      }
}


I manually added the value to the sched_conf_settings table:

Code: Select all
INSERT INTO sched_conf_settings VALUES (
1,'','schedConfStyleSheet',
'a:3:{s:4:"name";s:23:"schedConfStyleSheet.css";s:10:"uploadName";s:23:"schedConfStyleSheet.css";s:12:"dateUploaded";s:19:"2008-02-14 10:51:52";}',
'object'
);


and saved a css as:
Code: Select all
/public/conferences/1/schedConfs/1/schedConfStyleSheet.css"


I can make it work by hardcoding the path as a test, so I assume it's not grabbing the variable right:
Code: Select all
if($schedConf) {
    $schedConfStyleSheet = $schedConf->getSetting('schedConfStyleSheet', false);
    $this->addStyleSheet('http://localhost/ocs2/public/conferences/1/schedConfs/1/schedConfStyleSheet.css');
}


Any pointers on making this work?

Tyler
spatialguru
 
Posts: 112
Joined: Mon Jun 25, 2007 1:23 pm
Location: British Columbia, Canada

Re: schedConfStyleSheet status

Postby spatialguru » Wed Feb 20, 2008 4:13 pm

Since I couldn't solve the above problem, I made one very minor change to one file and have my custom stylesheets working. So, if you're in the same boat as me and are desperate for a separate style sheet/css for each scheduled conference (not just for each conference), you can try this simple change.

Edit classes/template/TemplateManager.inc.php (I'm using CVS version of OCS), comment out a couple lines and change one to point to the static name for the .css you want to use instead of looking it up in the db. Then you can save the css file, with the same name in your public/conferences/X/schedConf/Y - Y folder, and it will be picked up if there.

Here's are the changes I made, as a patch - it looks a lot worse than it is!

Code: Select all
--- TemplateManager.inc.php     2008-02-20 18:04:49.000000000 -0500
+++ TemplateManager.inc.php~    2008-02-20 18:03:14.000000000 -0500
@@ -188,12 +188,12 @@
 
                                // Assign scheduled conference stylesheet and footer (after conference stylesheet!)
                                if($schedConf) {
-                                       //$schedConfStyleSheet = $schedConf->getSetting('schedConfStyleSheet', false);
-                                       //if ($schedConfStyleSheet) {
+                                       $schedConfStyleSheet = $schedConf->getSetting('schedConfStyleSheet', false);
+                                       if ($schedConfStyleSheet) {
                                                $this->addStyleSheet(Request::getBaseUrl() .
                                                '/' .   PublicFileManager::getSchedConfFilesPath($schedConf->getSchedConfId()) .
-                                               '/' . 'schedConfStyleSheet.css');  // $schedConfStyleSheet['uploadName']);
-                                       //}
+                                               '/' . $schedConfStyleSheet['uploadName']);
+                                       }
                                }
                        } else { // Not within conference context
                                // Add the site-wide logo, if set for this locale or the primary locale



But of course, it looks like a better way to do this is in the works, since the basic code is in there already anyway. So hopefully you won't need this hack unless desperate ;-)

Enjoy,
Tyler
spatialguru
 
Posts: 112
Joined: Mon Jun 25, 2007 1:23 pm
Location: British Columbia, Canada


Return to OCS Development

Who is online

Users browsing this forum: No registered users and 0 guests