diff --git a/index.php b/index.php
index 6a65ac0..ebb93a9 100644
--- a/index.php
+++ b/index.php
@@ -44,11 +44,16 @@ $GLOBALS['config']['THEME'] = 'myShaarli';
// -----------------------------------------------------------------------------------------------
// You should not touch below (or at your own risks !)
// Optionnal config file.
+// Run config screen if first run:
+if (!is_file($GLOBALS['config']['CONFIG_FILE'])) install();
+
+require $GLOBALS['config']['CONFIG_FILE']; // Read login/password hash into $GLOBALS.
+
if (is_file($GLOBALS['config']['DATADIR'].'/options.php')){
require($GLOBALS['config']['DATADIR'].'/options.php');
}
-define('myShaarli_version','1.0.0 beta');
+define('myShaarli_version','1.1.0 beta');
define('PHPPREFIX',''); // Suffix to encapsulate data in php code.
// http://server.com/x/shaarli --> /shaarli/
@@ -79,7 +84,7 @@ if($GLOBALS['config']['ENABLE_MARKDOWN'] === TRUE){
include 'inc/Parsedown.php';
}
include "inc/rain.tpl.class.php"; //include Rain TPL
-raintpl::$tpl_dir = "tpl/"; // template directory
+raintpl::$tpl_dir = 'tpl/'.$GLOBALS['config']['THEME'].'/'; // template directory
if (!is_dir('tmp')) { mkdir('tmp',0705); chmod('tmp',0705); }
raintpl::$cache_dir = "tmp/"; // cache directory
@@ -123,14 +128,6 @@ if (empty($GLOBALS['disablejquery'])) $GLOBALS['disablejquery']=false;
if (empty($GLOBALS['privateLinkByDefault'])) $GLOBALS['privateLinkByDefault']=false;
if (empty($GLOBALS['titleLink'])) $GLOBALS['titleLink']='?';
-
-// I really need to rewrite Shaarli with a proper configuation manager.
-
-// Run config screen if first run:
-if (!is_file($GLOBALS['config']['CONFIG_FILE'])) install();
-
-require $GLOBALS['config']['CONFIG_FILE']; // Read login/password hash into $GLOBALS.
-
// a token depending of deployment salt, user password, and the current ip
define('STAY_SIGNED_IN_TOKEN', sha1($GLOBALS['hash'].$_SERVER["REMOTE_ADDR"].$GLOBALS['salt']));
@@ -717,7 +714,7 @@ class pageBuilder
public function renderPage($page)
{
if ($this->tpl===false) $this->initialize(); // Lazy initialization
- $this->tpl->draw($page);
+ $this->tpl->draw($page);
}
}
@@ -2409,9 +2406,9 @@ function processWS()
}
function getAllTheme(){
- $allTheme = glob('inc/styles/*.css');
+ $allTheme = glob('tpl/*', GLOB_ONLYDIR);
foreach ($allTheme as $value) {
- $themes[] = basename($value, '.css');
+ $themes[] = str_replace('tpl/', '', $value);
}
return $themes;
}
diff --git a/shaarli_version.txt b/shaarli_version.txt
index e39822e..bac458a 100644
--- a/shaarli_version.txt
+++ b/shaarli_version.txt
@@ -1 +1 @@
-1.0.0 beta
\ No newline at end of file
+1.1.0 beta
\ No newline at end of file
diff --git a/tpl/addlink.html b/tpl/myShaarli/addlink.html
similarity index 100%
rename from tpl/addlink.html
rename to tpl/myShaarli/addlink.html
diff --git a/tpl/changepassword.html b/tpl/myShaarli/changepassword.html
similarity index 100%
rename from tpl/changepassword.html
rename to tpl/myShaarli/changepassword.html
diff --git a/tpl/changetag.html b/tpl/myShaarli/changetag.html
similarity index 100%
rename from tpl/changetag.html
rename to tpl/myShaarli/changetag.html
diff --git a/tpl/configure.html b/tpl/myShaarli/configure.html
similarity index 100%
rename from tpl/configure.html
rename to tpl/myShaarli/configure.html
diff --git a/tpl/daily.html b/tpl/myShaarli/daily.html
similarity index 100%
rename from tpl/daily.html
rename to tpl/myShaarli/daily.html
diff --git a/tpl/dailyrss.html b/tpl/myShaarli/dailyrss.html
similarity index 100%
rename from tpl/dailyrss.html
rename to tpl/myShaarli/dailyrss.html
diff --git a/tpl/editlink.html b/tpl/myShaarli/editlink.html
similarity index 100%
rename from tpl/editlink.html
rename to tpl/myShaarli/editlink.html
diff --git a/tpl/export.html b/tpl/myShaarli/export.html
similarity index 100%
rename from tpl/export.html
rename to tpl/myShaarli/export.html
diff --git a/tpl/import.html b/tpl/myShaarli/import.html
similarity index 100%
rename from tpl/import.html
rename to tpl/myShaarli/import.html
diff --git a/tpl/includes.html b/tpl/myShaarli/includes.html
similarity index 78%
rename from tpl/includes.html
rename to tpl/myShaarli/includes.html
index 4910329..df05815 100644
--- a/tpl/includes.html
+++ b/tpl/myShaarli/includes.html
@@ -9,7 +9,4 @@
-
-{if condition="is_file('inc/user.css')"}
-
-{/if}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/tpl/install.html b/tpl/myShaarli/install.html
similarity index 100%
rename from tpl/install.html
rename to tpl/myShaarli/install.html
diff --git a/tpl/linklist.html b/tpl/myShaarli/linklist.html
similarity index 100%
rename from tpl/linklist.html
rename to tpl/myShaarli/linklist.html
diff --git a/tpl/linklist.paging.html b/tpl/myShaarli/linklist.paging.html
similarity index 100%
rename from tpl/linklist.paging.html
rename to tpl/myShaarli/linklist.paging.html
diff --git a/tpl/loginform.html b/tpl/myShaarli/loginform.html
similarity index 100%
rename from tpl/loginform.html
rename to tpl/myShaarli/loginform.html
diff --git a/inc/styles/myShaarli.css b/tpl/myShaarli/myShaarli.css
similarity index 100%
rename from inc/styles/myShaarli.css
rename to tpl/myShaarli/myShaarli.css
diff --git a/tpl/page.footer.html b/tpl/myShaarli/page.footer.html
similarity index 100%
rename from tpl/page.footer.html
rename to tpl/myShaarli/page.footer.html
diff --git a/tpl/page.header.html b/tpl/myShaarli/page.header.html
similarity index 100%
rename from tpl/page.header.html
rename to tpl/myShaarli/page.header.html
diff --git a/tpl/page.html b/tpl/myShaarli/page.html
similarity index 100%
rename from tpl/page.html
rename to tpl/myShaarli/page.html
diff --git a/tpl/picwall.html b/tpl/myShaarli/picwall.html
similarity index 100%
rename from tpl/picwall.html
rename to tpl/myShaarli/picwall.html
diff --git a/tpl/picwall2.html b/tpl/myShaarli/picwall2.html
similarity index 100%
rename from tpl/picwall2.html
rename to tpl/myShaarli/picwall2.html
diff --git a/tpl/readme.txt b/tpl/myShaarli/readme.txt
similarity index 100%
rename from tpl/readme.txt
rename to tpl/myShaarli/readme.txt
diff --git a/tpl/tagcloud.html b/tpl/myShaarli/tagcloud.html
similarity index 100%
rename from tpl/tagcloud.html
rename to tpl/myShaarli/tagcloud.html
diff --git a/tpl/tools.html b/tpl/myShaarli/tools.html
similarity index 100%
rename from tpl/tools.html
rename to tpl/myShaarli/tools.html
diff --git a/tpl/myShaarli_Columns/addlink.html b/tpl/myShaarli_Columns/addlink.html
new file mode 100644
index 0000000..71b0202
--- /dev/null
+++ b/tpl/myShaarli_Columns/addlink.html
@@ -0,0 +1,18 @@
+
+
+
+ {include="includes"}
+
+
+
+ {include="page.header"}
+
+
+
+
+ {include="page.footer"}
+
+
\ No newline at end of file
diff --git a/tpl/myShaarli_Columns/changepassword.html b/tpl/myShaarli_Columns/changepassword.html
new file mode 100644
index 0000000..35e427f
--- /dev/null
+++ b/tpl/myShaarli_Columns/changepassword.html
@@ -0,0 +1,26 @@
+
+
+
+ {include="includes"}
+
+
+
+ {include="page.header"}
+
+
+ {include="page.footer"}
+
+
\ No newline at end of file
diff --git a/tpl/myShaarli_Columns/changetag.html b/tpl/myShaarli_Columns/changetag.html
new file mode 100644
index 0000000..a5f7e97
--- /dev/null
+++ b/tpl/myShaarli_Columns/changetag.html
@@ -0,0 +1,67 @@
+
+
+
+ {include="includes"}
+ {if="empty($GLOBALS['disablejquery'])"}
+
+
+ {/if}
+
+
+
+ {include="page.header"}
+
+
+ {include="page.footer"}
+ {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"}
+
+ {/if}
+
+
\ No newline at end of file
diff --git a/inc/styles/colums.css b/tpl/myShaarli_Columns/columns.css
similarity index 100%
rename from inc/styles/colums.css
rename to tpl/myShaarli_Columns/columns.css
diff --git a/tpl/myShaarli_Columns/configure.html b/tpl/myShaarli_Columns/configure.html
new file mode 100644
index 0000000..1178eea
--- /dev/null
+++ b/tpl/myShaarli_Columns/configure.html
@@ -0,0 +1,127 @@
+
+
+
+ {include="includes"}
+
+
+
+ All links of one day in a single page.
+ {if="$previousday"} <Previous day{else}<Previous day{/if}
+ -
+ {if="$nextday"}Next day>{else}Next day>{/if}
+
+{include="page.footer"}
+
+
\ No newline at end of file
diff --git a/tpl/myShaarli_Columns/dailyrss.html b/tpl/myShaarli_Columns/dailyrss.html
new file mode 100644
index 0000000..436e1cd
--- /dev/null
+++ b/tpl/myShaarli_Columns/dailyrss.html
@@ -0,0 +1,8 @@
+{loop="links"}
+
+{$shaarlititle|htmlspecialchars}
+{if="!empty($_GET['source']) && $_GET['source']=='bookmarklet'"}
+{ignore} When called as a popup from bookmarklet, do not display menu. {/ignore}
+{else}
+Home
+{if="isLoggedIn()"}
+LogoutToolsAdd link
+{elseif="$GLOBALS['config']['OPEN_SHAARLI']"}
+ToolsAdd link
+{else}
+Login
+{/if}
+RSS Feed
+ATOM Feed
+Tag cloud
+Picture wall
+Daily
+{/if}
+
\ No newline at end of file
diff --git a/tpl/myShaarli_Columns/page.html b/tpl/myShaarli_Columns/page.html
new file mode 100644
index 0000000..836e1bc
--- /dev/null
+++ b/tpl/myShaarli_Columns/page.html
@@ -0,0 +1,13 @@
+
+
+
+ {include="includes"}
+
+
+
+ {include="page.header"}
+
+ You body goes here...
+ {include="page.footer"}
+
+
\ No newline at end of file
diff --git a/tpl/myShaarli_Columns/picwall.html b/tpl/myShaarli_Columns/picwall.html
new file mode 100644
index 0000000..a2c4a7a
--- /dev/null
+++ b/tpl/myShaarli_Columns/picwall.html
@@ -0,0 +1,31 @@
+
+
+
+ {include="includes"}
+ {if="empty($GLOBALS['disablejquery'])"}
+
+
+
+ {/if}
+
+
+
+
+{include="page.footer"}
+
+
\ No newline at end of file
diff --git a/tpl/myShaarli_Columns/readme.txt b/tpl/myShaarli_Columns/readme.txt
new file mode 100644
index 0000000..b18deae
--- /dev/null
+++ b/tpl/myShaarli_Columns/readme.txt
@@ -0,0 +1,42 @@
+===== Shaarli template organisation =====
+
+Any Shaarli page should conform to this RainTPL template:
+
+-----------------------------------------------------
+
+{include="includes"}
+
+
{include="page.header"}
+ You body goes here...
+ {include="page.footer"}
+
+
+-----------------------------------------------------
+
+If you want to also add something in the page header (in the dark area), do it here:
+
+
+ All links of one day in a single page.
+ {if="$previousday"} <Previous day{else}<Previous day{/if}
+ -
+ {if="$nextday"}Next day>{else}Next day>{/if}
+
+{include="page.footer"}
+
+
\ No newline at end of file
diff --git a/tpl/original/dailyrss.html b/tpl/original/dailyrss.html
new file mode 100644
index 0000000..436e1cd
--- /dev/null
+++ b/tpl/original/dailyrss.html
@@ -0,0 +1,8 @@
+{loop="links"}
+
+{$shaarlititle|htmlspecialchars}
+{if="!empty($_GET['source']) && $_GET['source']=='bookmarklet'"}
+{ignore} When called as a popup from bookmarklet, do not display menu. {/ignore}
+{else}
+Home
+{if="isLoggedIn()"}
+LogoutToolsAdd link
+{elseif="$GLOBALS['config']['OPEN_SHAARLI']"}
+ToolsAdd link
+{else}
+Login
+{/if}
+RSS Feed
+ATOM Feed
+Tag cloud
+Picture wall
+Daily
+{/if}
+
\ No newline at end of file
diff --git a/tpl/original/page.html b/tpl/original/page.html
new file mode 100644
index 0000000..836e1bc
--- /dev/null
+++ b/tpl/original/page.html
@@ -0,0 +1,13 @@
+
+
+
+ {include="includes"}
+
+
+
+ {include="page.header"}
+
+ You body goes here...
+ {include="page.footer"}
+
+
\ No newline at end of file
diff --git a/tpl/original/picwall.html b/tpl/original/picwall.html
new file mode 100644
index 0000000..a2c4a7a
--- /dev/null
+++ b/tpl/original/picwall.html
@@ -0,0 +1,31 @@
+
+
+
+ {include="includes"}
+ {if="empty($GLOBALS['disablejquery'])"}
+
+
+
+ {/if}
+
+
+
+
+{include="page.footer"}
+
+
\ No newline at end of file
diff --git a/tpl/original/readme.txt b/tpl/original/readme.txt
new file mode 100644
index 0000000..b18deae
--- /dev/null
+++ b/tpl/original/readme.txt
@@ -0,0 +1,42 @@
+===== Shaarli template organisation =====
+
+Any Shaarli page should conform to this RainTPL template:
+
+-----------------------------------------------------
+
+{include="includes"}
+
+
{include="page.header"}
+ You body goes here...
+ {include="page.footer"}
+
+
+-----------------------------------------------------
+
+If you want to also add something in the page header (in the dark area), do it here:
+
+