]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/smoothly/theme.php
Merge pull request #549 from fermionic/20121222-use-smarty-template-engine
[friendica.git] / view / theme / smoothly / theme.php
index 95cc9bd73c2ede9a85aa25626d654c66a6bd2eee..3dff381b220487aa97cab4c04ded90c94844251d 100644 (file)
@@ -2,20 +2,24 @@
 
 /*
  * Name: Smoothly
- * Description: Theme opzimized for Tablets
- * Version: 0.4
+ * Description: Like coffee with milk. Theme works fine with iPad[2].
+ * Version: Version 0.11.14-2
  * Author: Alex <https://friendica.pixelbits.de/profile/alex>
  * Maintainer: Alex <https://friendica.pixelbits.de/profile/alex>
- * Screenshot: <a href="screenshot.jpg">Screenshot</a>
+ * Screenshot: <a href="screenshot.png">Screenshot</a>
  */
 
-$a->theme_info = array(
-  'extends' => 'smoothly',
-);
+$a = get_app();
+$a->theme_info = array();
+$a->theme['template_engine'] = 'smarty3';
+
 function smoothly_init(&$a) {
+       $cssFile = null;
+       $ssl_state = null;
+       $baseurl = $a->get_baseurl($ssl_state);
 $a->page['htmlhead'] .= <<< EOT
-<script>
 
+<script>
 function insertFormatting(comment,BBcode,id) {
        
                var tmpStr = $("#comment-edit-text-" + id).val();
@@ -52,9 +56,10 @@ function cmtBbOpen(id) {
 function cmtBbClose(comment, id) {
        $(".comment-edit-bb-" + id).hide();
 }
-
 $(document).ready(function() {
 
+$('html').click(function() { $("#nav-notifications-menu" ).hide(); });
+
 $('.group-edit-icon').hover(
        function() {
                $(this).addClass('icon'); $(this).removeClass('iconspacer');},
@@ -92,28 +97,28 @@ $('.savedsearchterm').hover(
 
 });
 
-
 </script>
 EOT;
-// get resize configuration
 
-$resize=false;
-$site_resize = get_config('smoothly', 'resize' );
-if(local_user()) $resize = get_pconfig(local_user(), 'smoothly', 'resize' );
-
-if ($resize===false) $resize=$site_resize;
-if ($resize===false) $resize=0;
+       /** custom css **/
+       if (!is_null($cssFile)) {
+        $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
+       }
 
-if (intval($resize) > 0) {
-//load jquery.ae.image.resize.js
-$imageresizeJS = $a->get_baseurl($ssl_state)."/view/theme/smoothly/js/jquery.ae.image.resize.js";
-$a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $imageresizeJS);
-$a->page['htmlhead'] .= '
-<script>
+_js_in_foot();
 
- $(function() {
-       $(".wall-item-content  img").aeImageResize({height: '.$resize.', width: '.$resize.'});
-  });
-</script>';}
 }
 
+if(! function_exists('_js_in_foot')) {
+       function _js_in_foot() {
+               /** @purpose insert stuff in bottom of page
+               */
+               $a = get_app();
+               $ssl_state = null;
+               $baseurl = $a->get_baseurl($ssl_state);
+               $bottom['$baseurl'] = $baseurl;
+               $tpl = file_get_contents(dirname(__file__) . '/bottom.tpl');
+
+               return $a->page['bottom'] = replace_macros($tpl, $bottom);
+       }
+}