Quantcast

Re: [Tiki-devel] [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[60902] trunk/lib/theme/themelib.php

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Tiki-devel] [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[60902] trunk/lib/theme/themelib.php

Cloutier, Philippe (RESSOURCE EXTERNE)
Hi Jonny,
The question I asked myself was not about themes/mytheme/css or themes/mytheme/myoption/css, but about 'themes/' . $dir_base . $subdir and 'themes/' . $subdir (assuming that $subdir is not empty).
Unfortunately, the question I wrote was the opposite of the question I asked myself; just fixed that in r61279, sorry.

By the way, the number of combination makes this extremely complex without documentation. I believe the right wayTM to fix this lack of clarity would be to link to documentation explaining the structure of themes/ and directory precedence.

On 2017-01-17 05:28, Jonny Bradley wrote:
Hi Chealer++

I think the answer is so that you can override a css or js etc file by putting it in your themes/mytheme/css dir (or themes/mytheme/myoption/css), or just in the "root" themes/css. This is particularly useful for custom.css and custom.js to keep things tidy (imho).

I agree this could do with some caching :)

jb



On 17 Jan 2017, at 01:46, Filipus Klutiero <[hidden email]> wrote:

Thanks luci.
I think this deserves code clarification, so putting the question in the code has the benefit of keeping a discreet TODO there in case no one knows now, but I would be happy to see my question replaced by a clarifying comment, if the code cannot be changed so that the question goes away.
I someone provides an answer via a mailing list, I will integrate it into the code.

On 2017-01-16 08:05, luciash wrote:
Hi chealer,

you do not need to commit questions! ;) Just ask on dev list!

luci


On 16.1.2017 14:02, [hidden email] wrote:
Revision: 60902
           http://sourceforge.net/p/tikiwiki/code/60902
Author:   chealer
Date:     2017-01-16 13:02:50 +0000 (Mon, 16 Jan 2017)
Log Message:
-----------
[REF] get_theme_path(): Consistency question for theming gurus

Modified Paths:
--------------
     trunk/lib/theme/themelib.php

Modified: trunk/lib/theme/themelib.php
===================================================================
--- trunk/lib/theme/themelib.php	2017-01-16 10:47:12 UTC (rev 60901)
+++ trunk/lib/theme/themelib.php	2017-01-16 13:02:50 UTC (rev 60902)
@@ -201,6 +201,7 @@
  			}
  		}

+		// Why does this look in 'themes/' . $dir_base . $subdir and 'themes/' . $subdir if and only if we have no $filename? Chealer 2017-01-16
  		if (empty($filename)) {
  			if (is_dir('themes/' . $dir_base . $theme_base . $option_base . $subdir)) {
  				$path = 'themes/' . $dir_base . $theme_base . $option_base . $subdir;

-- 
Filipus Klutiero
http://www.philippecloutier.com


-- 
Filipus Klutiero
http://www.philippecloutier.com

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Tiki-devel] [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[60902] trunk/lib/theme/themelib.php

Brendan Ferguson
Some way to document it better would be nice. I tried looking at this, and even thought of a way to optimize the code a bit using throw and catch, but I feel as though I cant touch it cause there is no way for me to test it properly afterwards. I just look at those lines and cant figure out under what circumstances they all apply.

Not that its a super high priority on my list... but i like well documented code myself. There is so many things in tiki i just cant touch because of the lack of docblocks. Ive even got the PhpStorm option turned on to give docBlock descriptions of functions on hover and its SUPER helpful when they have been filled out.... Im guessing im preaching to the converted....

Im done now.... just had to get that out.

Brendan

On Mon, Feb 13, 2017 at 8:53 AM, Cloutier, Philippe (RESSOURCE EXTERNE) <[hidden email]> wrote:
Hi Jonny,
The question I asked myself was not about themes/mytheme/css or themes/mytheme/myoption/css, but about 'themes/' . $dir_base . $subdir and 'themes/' . $subdir (assuming that $subdir is not empty).
Unfortunately, the question I wrote was the opposite of the question I asked myself; just fixed that in r61279, sorry.

By the way, the number of combination makes this extremely complex without documentation. I believe the right wayTM to fix this lack of clarity would be to link to documentation explaining the structure of themes/ and directory precedence.

On 2017-01-17 05:28, Jonny Bradley wrote:
Hi Chealer++

I think the answer is so that you can override a css or js etc file by putting it in your themes/mytheme/css dir (or themes/mytheme/myoption/css), or just in the "root" themes/css. This is particularly useful for custom.css and custom.js to keep things tidy (imho).

I agree this could do with some caching :)

jb



On 17 Jan 2017, at 01:46, Filipus Klutiero <[hidden email]> wrote:

Thanks luci.
I think this deserves code clarification, so putting the question in the code has the benefit of keeping a discreet TODO there in case no one knows now, but I would be happy to see my question replaced by a clarifying comment, if the code cannot be changed so that the question goes away.
I someone provides an answer via a mailing list, I will integrate it into the code.

On 2017-01-16 08:05, luciash wrote:
Hi chealer,

you do not need to commit questions! ;) Just ask on dev list!

luci


On 16.1.2017 14:02, [hidden email] wrote:
Revision: 60902
           http://sourceforge.net/p/tikiwiki/code/60902
Author:   chealer
Date:     2017-01-16 13:02:50 +0000 (Mon, 16 Jan 2017)
Log Message:
-----------
[REF] get_theme_path(): Consistency question for theming gurus

Modified Paths:
--------------
     trunk/lib/theme/themelib.php

Modified: trunk/lib/theme/themelib.php
===================================================================
--- trunk/lib/theme/themelib.php	2017-01-16 10:47:12 UTC (rev 60901)
+++ trunk/lib/theme/themelib.php	2017-01-16 13:02:50 UTC (rev 60902)
@@ -201,6 +201,7 @@
  			}
  		}

+		// Why does this look in 'themes/' . $dir_base . $subdir and 'themes/' . $subdir if and only if we have no $filename? Chealer 2017-01-16
  		if (empty($filename)) {
  			if (is_dir('themes/' . $dir_base . $theme_base . $option_base . $subdir)) {
  				$path = 'themes/' . $dir_base . $theme_base . $option_base . $subdir;

-- 
Filipus Klutiero
http://www.philippecloutier.com


-- 
Filipus Klutiero
http://www.philippecloutier.com

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Tiki-devel] [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[60902] trunk/lib/theme/themelib.php

Jonny Bradley-4
Hi all

Yes i agree, some docs and unit test are needed, sorry, no time today - maybe next week?

The basic principle is (should be) that option overrides theme, which overrides base, and custom can override everything.

Oh, and multitikis can have their own themes and options (and custom) to make things worse ;)

jb



> On 13 Feb 2017, at 02:51, Brendan Ferguson <[hidden email]> wrote:
>
> Some way to document it better would be nice. I tried looking at this, and even thought of a way to optimize the code a bit using throw and catch, but I feel as though I cant touch it cause there is no way for me to test it properly afterwards. I just look at those lines and cant figure out under what circumstances they all apply.
>
> Not that its a super high priority on my list... but i like well documented code myself. There is so many things in tiki i just cant touch because of the lack of docblocks. Ive even got the PhpStorm option turned on to give docBlock descriptions of functions on hover and its SUPER helpful when they have been filled out.... Im guessing im preaching to the converted....
>
> Im done now.... just had to get that out.
>
> Brendan
>
>> On Mon, Feb 13, 2017 at 8:53 AM, Cloutier, Philippe (RESSOURCE EXTERNE) <[hidden email]> wrote:
>> Hi Jonny,
>> The question I asked myself was not about themes/mytheme/css or themes/mytheme/myoption/css, but about 'themes/' . $dir_base . $subdir and 'themes/' . $subdir (assuming that $subdir is not empty).
>> Unfortunately, the question I wrote was the opposite of the question I asked myself; just fixed that in r61279, sorry.
>>
>> By the way, the number of combination makes this extremely complex without documentation. I believe the right wayTM to fix this lack of clarity would be to link to documentation explaining the structure of themes/ and directory precedence.
>>
>> On 2017-01-17 05:28, Jonny Bradley wrote:
>>> Hi Chealer++
>>>
>>> I think the answer is so that you can override a css or js etc file by putting it in your themes/mytheme/css dir (or themes/mytheme/myoption/css), or just in the "root" themes/css. This is particularly useful for custom.css and custom.js to keep things tidy (imho).
>>>
>>> I agree this could do with some caching :)
>>>
>>> jb
>>>
>>>
>>>
>>>
>>>> On 17 Jan 2017, at 01:46, Filipus Klutiero <[hidden email]
>>>> > wrote:
>>>>
>>>> Thanks luci.
>>>> I think this deserves code clarification, so putting the question in the code has the benefit of keeping a discreet TODO there in case no one knows now, but I would be happy to see my question replaced by a clarifying comment, if the code cannot be changed so that the question goes away.
>>>> I someone provides an answer via a mailing list, I will integrate it into the code.
>>>>
>>>> On 2017-01-16 08:05, luciash wrote:
>>>>
>>>>> Hi chealer,
>>>>>
>>>>> you do not need to commit questions! ;) Just ask on dev list!
>>>>>
>>>>> luci
>>>>>
>>>>>
>>>>> On 16.1.2017 14:02,
>>>>> [hidden email]
>>>>>  wrote:
>>>>>
>>>>>> Revision: 60902
>>>>>>            
>>>>>> http://sourceforge.net/p/tikiwiki/code/60902
>>>>>>
>>>>>> Author:   chealer
>>>>>> Date:     2017-01-16 13:02:50 +0000 (Mon, 16 Jan 2017)
>>>>>> Log Message:
>>>>>> -----------
>>>>>> [REF] get_theme_path(): Consistency question for theming gurus
>>>>>>
>>>>>> Modified Paths:
>>>>>> --------------
>>>>>>      trunk/lib/theme/themelib.php
>>>>>>
>>>>>> Modified: trunk/lib/theme/themelib.php
>>>>>> ==============================
>>>>>> ==============================
>>>>>> =======
>>>>>> --- trunk/lib/theme/themelib.php 2017-01-16 10:47:12 UTC (rev 60901)
>>>>>> +++ trunk/lib/theme/themelib.php 2017-01-16 13:02:50 UTC (rev 60902)
>>>>>> @@ -201,6 +201,7 @@
>>>>>>   }
>>>>>>   }
>>>>>>
>>>>>> + // Why does this look in 'themes/' . $dir_base . $subdir and 'themes/' . $subdir if and only if we have no $filename? Chealer 2017-01-16
>>>>>>   if (empty($filename)) {
>>>>>>   if (is_dir('themes/' . $dir_base . $theme_base . $option_base . $subdir)) {
>>>>>>   $path = 'themes/' . $dir_base . $theme_base . $option_base . $subdir;
>>>>>>
>>>>>>
>>>>  
>>>> --
>>>> Filipus Klutiero
>>>>
>>>> http://www.philippecloutier.com
>>>>
>>>>
>>>>
>>
>> --
>> Filipus Klutiero
>>
>> http://www.philippecloutier.com
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> TikiWiki-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
> TikiWiki-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Tiki-devel] [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[60902] trunk/lib/theme/themelib.php

gezzzan
you can read about the design here:


maybe it can help to figure out all the possible combinations themelib should handle

cheers,
gezza


From: Jonny Bradley <[hidden email]>
To: Tiki developers <[hidden email]>
Sent: Monday, February 13, 2017 11:18 AM
Subject: Re: [Tiki-devel] [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[60902] trunk/lib/theme/themelib.php

Hi all

Yes i agree, some docs and unit test are needed, sorry, no time today - maybe next week?

The basic principle is (should be) that option overrides theme, which overrides base, and custom can override everything.

Oh, and multitikis can have their own themes and options (and custom) to make things worse ;)

jb



> On 13 Feb 2017, at 02:51, Brendan Ferguson <[hidden email]> wrote:
>
> Some way to document it better would be nice. I tried looking at this, and even thought of a way to optimize the code a bit using throw and catch, but I feel as though I cant touch it cause there is no way for me to test it properly afterwards. I just look at those lines and cant figure out under what circumstances they all apply.
>
> Not that its a super high priority on my list... but i like well documented code myself. There is so many things in tiki i just cant touch because of the lack of docblocks. Ive even got the PhpStorm option turned on to give docBlock descriptions of functions on hover and its SUPER helpful when they have been filled out.... Im guessing im preaching to the converted....
>
> Im done now.... just had to get that out.
>
> Brendan
>
>> On Mon, Feb 13, 2017 at 8:53 AM, Cloutier, Philippe (RESSOURCE EXTERNE) <[hidden email]> wrote:
>> Hi Jonny,
>> The question I asked myself was not about themes/mytheme/css or themes/mytheme/myoption/css, but about 'themes/' . $dir_base . $subdir and 'themes/' . $subdir (assuming that $subdir is not empty).
>> Unfortunately, the question I wrote was the opposite of the question I asked myself; just fixed that in r61279, sorry.
>>
>> By the way, the number of combination makes this extremely complex without documentation. I believe the right wayTM to fix this lack of clarity would be to link to documentation explaining the structure of themes/ and directory precedence.
>>
>> On 2017-01-17 05:28, Jonny Bradley wrote:
>>> Hi Chealer++
>>>
>>> I think the answer is so that you can override a css or js etc file by putting it in your themes/mytheme/css dir (or themes/mytheme/myoption/css), or just in the "root" themes/css. This is particularly useful for custom.css and custom.js to keep things tidy (imho).
>>>
>>> I agree this could do with some caching :)
>>>
>>> jb
>>>
>>>
>>>
>>>
>>>> On 17 Jan 2017, at 01:46, Filipus Klutiero <[hidden email]
>>>> > wrote:
>>>>
>>>> Thanks luci.
>>>> I think this deserves code clarification, so putting the question in the code has the benefit of keeping a discreet TODO there in case no one knows now, but I would be happy to see my question replaced by a clarifying comment, if the code cannot be changed so that the question goes away.
>>>> I someone provides an answer via a mailing list, I will integrate it into the code.
>>>>
>>>> On 2017-01-16 08:05, luciash wrote:
>>>>
>>>>> Hi chealer,
>>>>>
>>>>> you do not need to commit questions! ;) Just ask on dev list!
>>>>>
>>>>> luci
>>>>>
>>>>>
>>>>> On 16.1.2017 14:02,
>>>>> [hidden email]
>>>>>  wrote:
>>>>>
>>>>>> Revision: 60902
>>>>>>           
>>>>>> http://sourceforge.net/p/tikiwiki/code/60902
>>>>>>
>>>>>> Author:  chealer
>>>>>> Date:    2017-01-16 13:02:50 +0000 (Mon, 16 Jan 2017)
>>>>>> Log Message:
>>>>>> -----------
>>>>>> [REF] get_theme_path(): Consistency question for theming gurus
>>>>>>
>>>>>> Modified Paths:
>>>>>> --------------
>>>>>>      trunk/lib/theme/themelib.php
>>>>>>
>>>>>> Modified: trunk/lib/theme/themelib.php
>>>>>> ==============================
>>>>>> ==============================
>>>>>> =======
>>>>>> --- trunk/lib/theme/themelib.php    2017-01-16 10:47:12 UTC (rev 60901)
>>>>>> +++ trunk/lib/theme/themelib.php    2017-01-16 13:02:50 UTC (rev 60902)
>>>>>> @@ -201,6 +201,7 @@
>>>>>>              }
>>>>>>          }
>>>>>>
>>>>>> +        // Why does this look in 'themes/' . $dir_base . $subdir and 'themes/' . $subdir if and only if we have no $filename? Chealer 2017-01-16
>>>>>>          if (empty($filename)) {
>>>>>>              if (is_dir('themes/' . $dir_base . $theme_base . $option_base . $subdir)) {
>>>>>>                  $path = 'themes/' . $dir_base . $theme_base . $option_base . $subdir;
>>>>>>
>>>>>>
>>>> 
>>>> --
>>>> Filipus Klutiero
>>>>
>>>> http://www.philippecloutier.com
>>>>
>>>>
>>>>
>>
>> --
>> Filipus Klutiero
>>
>> http://www.philippecloutier.com
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> TikiWiki-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel

>>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
> TikiWiki-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
Loading...