Revision history for WikkaSkinEditor


Revision [23429]

Last edited on 2016-05-20 07:38:48 by DarTar [Replaces old-style internal links with new pipe-split links.]
Additions:
This page refers to beta functionality supported until Wikka 1.1.x. As of [[Docs:WhatsNew12 | version 1.2]] Wikka introduces support for 100%-modular **themes**: check [[Docs:WikkaThemes | this page]] for more information or this [[http://blog.wikkawiki.org/2009/09/11/how-to-design-themes-for-wikkawiki/ | tutorial]] to learn how to design custom themes.
== 1. Add your custom [[Docs:WikkaSkins | skins]] ==
Deletions:
This page refers to beta functionality supported until Wikka 1.1.x. As of [[Docs:WhatsNew12 version 1.2]] Wikka introduces support for 100%-modular **themes**: check [[Docs:WikkaThemes this page]] for more information or this [[http://blog.wikkawiki.org/2009/09/11/how-to-design-themes-for-wikkawiki/ tutorial]] to learn how to design custom themes.
== 1. Add your custom [[Docs:WikkaSkins skins]] ==


Revision [20850]

Edited on 2009-09-12 07:37:53 by DarTar [link to blog post]
Additions:
This page refers to beta functionality supported until Wikka 1.1.x. As of [[Docs:WhatsNew12 version 1.2]] Wikka introduces support for 100%-modular **themes**: check [[Docs:WikkaThemes this page]] for more information or this [[http://blog.wikkawiki.org/2009/09/11/how-to-design-themes-for-wikkawiki/ tutorial]] to learn how to design custom themes.
Deletions:
This page refers to beta functionality supported until Wikka 1.1.x. As of [[Docs:WhatsNew12 version 1.2]] Wikka introduces support for 100%-modular **themes**: check [[Docs:WikkaThemes this page]] for more information.


Revision [20845]

Edited on 2009-09-12 07:34:57 by DarTar [[m] fixed version number]
Additions:
This page refers to beta functionality supported until Wikka 1.1.x. As of [[Docs:WhatsNew12 version 1.2]] Wikka introduces support for 100%-modular **themes**: check [[Docs:WikkaThemes this page]] for more information.
Deletions:
This page refers to beta functionality supported until Wikka 1.x. As of [[Docs:WhatsNew12 version 1.2]] Wikka introduces support for 100%-modular **themes**: check [[Docs:WikkaThemes this page]] for more information.


Revision [20813]

Edited on 2009-09-03 05:30:12 by DarTar [->1.2]

No Differences

Revision [20812]

Edited on 2009-09-03 05:29:59 by DarTar [->1.2]
Additions:
<<===Theme support available in 1.2!===
This page refers to beta functionality supported until Wikka 1.x. As of [[Docs:WhatsNew12 version 1.2]] Wikka introduces support for 100%-modular **themes**: check [[Docs:WikkaThemes this page]] for more information.
<<::c::
Deletions:
{{lastedit show="3"}}
<<This action is obsolete and has been replaced by the MySkin action. Want to test it? Give it a [[TestSkin try]]<<
---
---


Revision [18776]

Edited on 2008-01-28 00:12:36 by EgyszerJo [Modified links pointing to docs server]
Additions:
== 1. Add your custom [[Docs:WikkaSkins skins]] ==
Deletions:
== 1. Add your custom [[WikkaSkins skins]] ==


Revision [13366]

Edited on 2006-03-01 10:34:36 by EgyszerJo [Modified links pointing to docs server]
Additions:
'<input type="submit" name="action" value="Save modified skin" /><br />';
Deletions:
'<input type="submit" name="action" value="Save modified skin" /><br />';


Revision [9504]

Edited on 2005-06-23 10:54:50 by DarTar [minor]
Additions:
<<This action is obsolete and has been replaced by the MySkin action. Want to test it? Give it a [[TestSkin try]]<<
Deletions:
<<This action is obsolete and has been replaced by the MySkin action.
Want to test it? Give it a [[TestSkin try]]<<


Revision [9503]

Edited on 2005-06-23 10:54:27 by DarTar [minor]
Additions:
===== Wikka Skin Editor =====
{{lastedit show="3"}}

<<This action is obsolete and has been replaced by the MySkin action.
Want to test it? Give it a [[TestSkin try]]<<

---
---
This actions extends the WikkaSkinSelector giving Wikka Administrators the possibility to **edit skins** directly from a Wikka page.
The "edit" option is safely "masked" to normal users, who can only //select// alternate skins, but not modify them.
If you don't need to modify WikkaSkins, and just want to give the user the possibility to switch between alternate skins, please install the basic WikkaSkinSelector instead.
''Feedback is welcome, especially on security issues.''

==Important note==
The WikkaSkinEditor //writes// files to your wikka ##css/## folder.
Please backup all your css before testing this action and use sample css sheets if you are not sure of what you are doing.

==Requirements:==
~-Your browser must accept cookies in order for the skin selector to work.
~-The ##css/## folder of your wikka installation must be write-accessible for the skin editor to work (##chmod -R 777 css/ ##).

=== Installation ===

Here's the three-step installation:

== 1. Add your custom [[WikkaSkins skins]] ==

Just put all your skins in the ##css/## folder of your Wikka installation.
Many skins can be downloaded and shared from the unofficial WikkaSkinsRepository.

== 2. Create the skin editor action (##actions/editskin.php##) ==
''2004-11-25: minor update - xml.css and print.css masked''

Save the code below in a new file called ##actions/editskin.php##:

%%(php)
<?php
// Wikka Skin Editor
// Allows Wikka Administrators to switch, edit and modify Wikka skins.
// The "Edit" field is masked to non-administrators, who can only select alternate skins.
// The css/ folder must be write-accessible for the modifications to take effect.

$currentskin = $this->GetCookie("wikiskin");
echo $this->Format("=== Select a Wikka skin: === --- ");
switch ($_POST["action"]) {
case "Save modified skin":
// saves modified skin to file
$css_file = fopen("css/".$currentskin, "w+");
fwrite($css_file, $_POST["mod_css_content"]);
fclose($css_file);
// no break
case "Set skin":
$this->SetPersistentCookie("wikiskin", $_POST["skin"]);
$this->Redirect($this->href());
break;
case "Edit skin":
$css_file = fopen("css/".$currentskin, "r");
$css_contents = fread($css_file, filesize("css/".$currentskin));
$showskin = '<textarea name="mod_css_content" cols="50" rows="15">'.$css_contents.'</textarea><br />'.
'<input type="submit" name="action" value="Save modified skin" /><br />';
fclose($css_file);
break;
}
$handle = opendir('css/');
print $this->FormOpen("","","post");
echo '<select name="skin">';
$noskinmask = '^(xml.css|print.css|\.(.*))$';
while (false !== ($file = readdir($handle))) {
if (!preg_match('/'.$noskinmask.'/', $file)) {
$selected = ($file == $currentskin)? " selected=\"selected\"" : "";
print '<option value="'.$file.'"'.$selected.'>'.$file.'</option>';
}
}
echo '</select>';
echo '<input type="submit" name="action" value="Set skin" /><br />';
if ($this->IsAdmin()) {
echo $this->Format(" --- **".$currentskin."** ").'<input type="submit" name="action" value="Edit skin" /><br />';
echo $showskin;
}
print $this->FormClose();
closedir($handle);
?>
%%

== 3. Modify the Wikka Header (##actions/header.php##)==

To allow skin selection a small modification of the header is needed:

**original ##actions/header.php##**
%%(php)
<link rel="stylesheet" type="text/css" href="css/<?php echo $this->GetConfigValue("stylesheet") ?>" />
%%

**modified ##actions/header.php##**
%%(php)
<link rel="stylesheet" type="text/css" href="css/<?php echo ($this->GetCookie("wikiskin"))? $this->GetCookie("wikiskin"): $this->GetConfigValue("stylesheet") ?>" />
%%

=== How to use the skin editor ===

Just insert ##""{{editskin}}""## in a wikka page and start playing.


-- DarTar

----
Deletions:
===== Wikka Skin Editor =====
{{lastedit show="3"}}

<<This action has been replaced by the MySkin action.
Want to test it? Give it a [[TestSkin try]]<<

---
---
This actions extends the WikkaSkinSelector giving Wikka Administrators the possibility to **edit skins** directly from a Wikka page.
The "edit" option is safely "masked" to normal users, who can only //select// alternate skins, but not modify them.
If you don't need to modify WikkaSkins, and just want to give the user the possibility to switch between alternate skins, please install the basic WikkaSkinSelector instead.
''Feedback is welcome, especially on security issues.''

==Important note==
The WikkaSkinEditor //writes// files to your wikka ##css/## folder.
Please backup all your css before testing this action and use sample css sheets if you are not sure of what you are doing.

==Requirements:==
~-Your browser must accept cookies in order for the skin selector to work.
~-The ##css/## folder of your wikka installation must be write-accessible for the skin editor to work (##chmod -R 777 css/ ##).

=== Installation ===

Here's the three-step installation:

== 1. Add your custom [[WikkaSkins skins]] ==

Just put all your skins in the ##css/## folder of your Wikka installation.
Many skins can be downloaded and shared from the unofficial WikkaSkinsRepository.

== 2. Create the skin editor action (##actions/editskin.php##) ==
''2004-11-25: minor update - xml.css and print.css masked''

Save the code below in a new file called ##actions/editskin.php##:

%%(php)
<?php
// Wikka Skin Editor
// Allows Wikka Administrators to switch, edit and modify Wikka skins.
// The "Edit" field is masked to non-administrators, who can only select alternate skins.
// The css/ folder must be write-accessible for the modifications to take effect.

$currentskin = $this->GetCookie("wikiskin");
echo $this->Format("=== Select a Wikka skin: === --- ");
switch ($_POST["action"]) {
case "Save modified skin":
// saves modified skin to file
$css_file = fopen("css/".$currentskin, "w+");
fwrite($css_file, $_POST["mod_css_content"]);
fclose($css_file);
// no break
case "Set skin":
$this->SetPersistentCookie("wikiskin", $_POST["skin"]);
$this->Redirect($this->href());
break;
case "Edit skin":
$css_file = fopen("css/".$currentskin, "r");
$css_contents = fread($css_file, filesize("css/".$currentskin));
$showskin = '<textarea name="mod_css_content" cols="50" rows="15">'.$css_contents.'</textarea><br />'.
'<input type="submit" name="action" value="Save modified skin" /><br />';
fclose($css_file);
break;
}
$handle = opendir('css/');
print $this->FormOpen("","","post");
echo '<select name="skin">';
$noskinmask = '^(xml.css|print.css|\.(.*))$';
while (false !== ($file = readdir($handle))) {
if (!preg_match('/'.$noskinmask.'/', $file)) {
$selected = ($file == $currentskin)? " selected=\"selected\"" : "";
print '<option value="'.$file.'"'.$selected.'>'.$file.'</option>';
}
}
echo '</select>';
echo '<input type="submit" name="action" value="Set skin" /><br />';
if ($this->IsAdmin()) {
echo $this->Format(" --- **".$currentskin."** ").'<input type="submit" name="action" value="Edit skin" /><br />';
echo $showskin;
}
print $this->FormClose();
closedir($handle);
?>
%%

== 3. Modify the Wikka Header (##actions/header.php##)==

To allow skin selection a small modification of the header is needed:

**original ##actions/header.php##**
%%(php)
<link rel="stylesheet" type="text/css" href="css/<?php echo $this->GetConfigValue("stylesheet") ?>" />
%%

**modified ##actions/header.php##**
%%(php)
<link rel="stylesheet" type="text/css" href="css/<?php echo ($this->GetCookie("wikiskin"))? $this->GetCookie("wikiskin"): $this->GetConfigValue("stylesheet") ?>" />
%%

=== How to use the skin editor ===

Just insert ##""{{editskin}}""## in a wikka page and start playing.


-- DarTar

----


Revision [4750]

Edited on 2005-01-17 14:44:08 by NilsLindenberg [cat. changed]
Additions:
CategoryUserContributions CategoryLayout
Deletions:
CategoryDevelopment CategoryLayout


Revision [3005]

Edited on 2004-12-09 10:20:02 by DarTar [Adding link]
Additions:
<<This action has been replaced by the MySkin action.
Want to test it? Give it a [[TestSkin try]]<<
Deletions:
<<[[http://skins.openformats.org/images/skineditor.jpg Screenshot]]<<


Revision [2473]

Edited on 2004-11-26 12:11:23 by DarTar [Minor edit]
Additions:
<<[[http://skins.openformats.org/images/skineditor.jpg Screenshot]]<<
---
---
Deletions:
<<[[http://skins.openformats.org/images/skineditor.jpg Screenshot]]<<::c::


Revision [2464]

Edited on 2004-11-25 21:45:50 by DarTar [Fixing xhtml]
Additions:
$selected = ($file == $currentskin)? " selected=\"selected\"" : "";
echo '<input type="submit" name="action" value="Set skin" /><br />';
Deletions:
$selected = ($file == $currentskin)? " selected" : "";
echo '<input type="submit" name="action" value="Set skin"><br />';


Revision [2460]

Edited on 2004-11-25 17:52:53 by DarTar [Closing slash for input tag - thanks Nils!]
Additions:
echo $this->Format(" --- **".$currentskin."** ").'<input type="submit" name="action" value="Edit skin" /><br />';
Deletions:
echo $this->Format(" --- **".$currentskin."** ").'<input type="submit" name="action" value="Edit skin"><br />';


Revision [2459]

Edited on 2004-11-25 17:52:10 by DarTar [Closing slash for input tag - thanks Nils!]
Additions:
'<input type="submit" name="action" value="Save modified skin" /><br />';
Deletions:
'<input type="submit" name="action" value="Save modified skin"><br />';


Revision [2450]

Edited on 2004-11-25 13:24:00 by DarTar [Minor code modification]
Additions:
{{lastedit show="3"}}
''2004-11-25: minor update - xml.css and print.css masked''
$noskinmask = '^(xml.css|print.css|\.(.*))$';
Deletions:
''Last updated: 2004-11-22''
''2004-11-22: minor update - xml.css and print.css masked''
$noskinmask = '^(xml|print|\.(.*))$';


Revision [2353]

Edited on 2004-11-22 12:36:53 by DarTar [Masking xml.css and print.css - thanks JW for the hint]
Additions:
''Last updated: 2004-11-22''
''2004-11-22: minor update - xml.css and print.css masked''
$noskinmask = '^(xml|print|\.(.*))$';
while (false !== ($file = readdir($handle))) {
if (!preg_match('/'.$noskinmask.'/', $file)) {
Deletions:
while (false !== ($file = readdir($handle))) {
if (ereg("(.*)\.css", $file)) {


Revision [2345]

Edited on 2004-11-22 09:58:53 by DarTar [chmod mod]
Additions:
~-The ##css/## folder of your wikka installation must be write-accessible for the skin editor to work (##chmod -R 777 css/ ##).
Deletions:
~-The ##css/## folder of your wikka installation must be write-accessible for the skin editor to work (##chmod 777 css/ ##).


Revision [2344]

Edited on 2004-11-22 09:58:29 by DarTar [chmod mod]
Additions:
~-The ##css/## folder of your wikka installation must be write-accessible for the skin editor to work (##chmod 777 css/ ##).
Deletions:
~-The ##css/## folder of your wikka installation must be write-accessible for the skin editor to work (##chmod 666 css/ ##).


Revision [2323]

Edited on 2004-11-18 17:16:40 by DarTar [Adding screenshot]
Additions:
<<[[http://skins.openformats.org/images/skineditor.jpg Screenshot]]<<::c::
Deletions:
http://skins.openformats.org/images/skineditor.jpg


Revision [2322]

Edited on 2004-11-18 17:13:07 by DarTar [Adding screenshot]
Additions:
http://skins.openformats.org/images/skineditor.jpg


Revision [2317]

The oldest known version of this page was created on 2004-11-18 16:17:00 by DarTar [Adding screenshot]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki