]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/dispy/theme.php
small code formatting correction
[friendica.git] / view / theme / dispy / theme.php
index ee8698cc08ff1b7daf4646c4cd20d832bc9d0e84..a3b6b7f6eabd0c68370fffff65a6e75501b2a2e2 100644 (file)
@@ -2,21 +2,29 @@
 
 /*
  * Name: Dispy
- * Description: <p style="white-space:pre;">            Dispy: Light, Spartan, Sleek, and Functional<br />            Dispy Dark: Dark, Spartan, Sleek, and Functional</p>
- * Version: 1.2
+ * Description: Dispy family (light, dark): Sleek and Functional Themes 
+ * Version: 1.2.1
  * Author: Simon <http://simon.kisikew.org/>
  * Maintainer: Simon <http://simon.kisikew.org/>
  * Screenshot: <a href="screenshot.jpg">Screenshot</a>
  */
 
-$a = get_app();
-$a->theme_info = array(
-    'family' => 'dispy',
-       'version' => '1.2'
-);
+/* If you borrow any of these functions, make sure to
+ * RENAME your functions, otherwise both themes get conflicts,
+ * and the friendica instance will get HTTP 500 errors.
+ * To paraphrase Mike: "Might wish to wrap
+ * function_name with "if(! function_exists('function_name')) ... "
+ * or rename to prefix1_function_name (prefix2_function_name), etc.
+ */
 
 function dispy_init(&$a) {
 
+       $a->theme_info = array(
+               'family' => 'dispy',
+               'version' => '1.2.2'
+       );
+       set_template_engine($a, 'smarty3');
+
     /** @purpose set some theme defaults
     */
     $cssFile = null;
@@ -44,7 +52,7 @@ function dispy_init(&$a) {
        <script type="text/javascript">
        $(document).ready(function() {
                // Select all links with lightbox class
-               $("a.lightbox").fancybox();
+               $("a.lightbox").colorbox({maxHeight:"90%"});
 
        $('.group-edit-icon').hover(
                        function() {
@@ -165,7 +173,7 @@ EOT;
         $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
     }
 
-       js_in_foot();
+       _js_in_foot();
 }
 
 function dispy_community_info() {
@@ -175,17 +183,19 @@ function dispy_community_info() {
        $url = $a->get_baseurl($ssl_state);
        $aside['$url'] = $url;
 
-       $tpl = file_get_contents(dirname(__file__) . '/communityhome.tpl');
+       $tpl = get_markup_template('communityhome.tpl');
        return $a->page['aside_bottom'] = replace_macros($tpl, $aside);
 }
 
-function js_in_foot() {
-       /** @purpose insert stuff in bottom of page
-        */
-       $a = get_app();
-       $baseurl = $a->get_baseurl($ssl_state);
-       $bottom['$baseurl'] = $baseurl;
-       $tpl = file_get_contents(dirname(__file__) . '/bottom.tpl');
+if(! function_exists('_js_in_foot')) {
+       function _js_in_foot() {
+               /** @purpose insert stuff in bottom of page
+               */
+               $a = get_app();
+               $baseurl = $a->get_baseurl($ssl_state);
+               $bottom['$baseurl'] = $baseurl;
+               $tpl = get_markup_template('bottom.tpl');
 
-       return $a->page['bottom'] = replace_macros($tpl, $bottom);
+               return $a->page['bottom'] = replace_macros($tpl, $bottom);
+       }
 }