Template Engine Functionality Proposal
#21 ONLINE
Posted 10 March 2012 - 07:06 PM
I will look into it on Sunday.
Kind regards,
#22 ONLINE
Posted 11 March 2012 - 01:55 PM
Does the following commit help you move forward?
https://github.com/haraldpdl/oscommerce/commit/c89f8ad3ee0dadd61ad5aaaf3d19a241c3a66504
Kind regards,
#23
Posted 11 March 2012 - 03:33 PM
i get an issue :
Quote
Edited by foxp2, 11 March 2012 - 03:46 PM.
#24
Posted 11 March 2012 - 03:51 PM
i confirm, it works like a charm.
thanks for your help.
Kind regards,
#25
Posted 12 March 2012 - 02:04 PM
there are problems with your template engine ...
before this new structure, to customize a core source file was very easy.
example (for Dashboard) : https://github.com/foxp2/French-Rebellion-Project/tree/master/osCommerce/OM/Custom/Site/Admin/Application/Dashboard
but if i change protected $_default_template in \osCommerce\OM\Core\Site\Admin\Template.php with 'Sail', your template engine doesn't work (normal, Custom Core File having priority in accordance with loading)
now, if i move my Custom/Site/Admin -> Custom/Site/Admin/Template/kendo/ ... only \osCommerce\OM\Custom\Site\Admin\Template\kendo\Application\Dashboard\pages\main.php ...
what you think about it ?
have you really tested your framework in differents scenarios ?
Perhaps you could clarify that for me.
Thanks.
Kind regards.
#26 ONLINE
Posted 12 March 2012 - 03:46 PM
It would be perfect if the Custom classes could extend the Core classes however this is not possible so Custom classes are called in preference over Core classes.
I don't know why you have a custom Admin\Controller and still want to make changes to the core version? Why not apply those changes to the custom version?
What doesn't work when you change $_default_template? Can you provide example code of what you are referring to?
Kind regards,
#27
Posted 12 March 2012 - 04:39 PM
$OSCOM_DL = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/Template');
$OSCOM_DL->setIncludeFiles(false);
$OSCOM_DL->setIncludeDirectories(true);
foreach ( $OSCOM_DL->getFiles() as $file ) {
if ( !in_array($file['name'], $templates) ) {
$templates[] = $file['name'];
}
}
#28 ONLINE
Posted 12 March 2012 - 04:57 PM
That's where your KendoUI template should exist:
Custom/Site/Admin/Template/KendoUI
I see in your github repo it's at:
Core/Site/Admin/Template/kendo
Can you move this to the custom namespace?
Kind regards,
#29
Posted 12 March 2012 - 05:16 PM
for me , Core/Site/Admin/Template/kendo is only for HTML Views. (i've just changed base.html to call kendo UI lib)
I work in the same namespace in my osCommerce / OM / Custom / Site / Admin.
Edited by foxp2, 12 March 2012 - 05:19 PM.
#30 ONLINE
Posted 12 March 2012 - 05:18 PM
The KendoUI template should not be in the Core namespace. Try moving it to the Custom namespace. All of your changes should be in the Custom namespace.
Kind regards,
#32 ONLINE
Posted 12 March 2012 - 05:36 PM
Sail is the default template and is part of the core framework
Try moving all of your changes to the Custom namespace and see the possibilities of extending the framework without the need to edit 1 line in the Core namespace.
Beautiful, or not?
The classes in the Custom namespace must still be defined in the Core namespace, eg:
File: osCommerce/OM/Custom/Site/Admin/Template/KendoUI/Controller.php:
namespace osCommerce\OM\Core\Site\Admin\Template\KendoUI;
not:
namespace osCommerce\OM\Custom\Site\Admin\Template\KendoUI;
This is described here:
https://github.com/foxp2/French-Rebellion-Project/blob/master/osCommerce/OM/Custom/README
Kind regards,
#33
Posted 12 March 2012 - 05:49 PM
Quote
be cleaned up. If you create the following:
Site/Admin/Template/KendoUI/Content/base.html (wrapper)
Site/Admin/Template/KendoUI/Application/Login/pages/main.html
Site/Admin/Template/KendoUI/Application/Configuration/pages/*
You will then be able to implement a KendoUI template as an add-on
that does not duplicate any PHP code from the core.
and now, i read :
Quote
Custom/Site/Admin/Template/KendoUI
Edited by foxp2, 12 March 2012 - 05:50 PM.
#34 ONLINE
Posted 12 March 2012 - 05:55 PM
Sorry that I did not specify the namespace
Add-Ons must use the Custom namespace and not make any modifications to the Core namespace.
Kind regards,
#35
Posted 12 March 2012 - 06:06 PM
Harald Ponce de Leon, on 12 March 2012 - 05:55 PM, said:
Add-Ons must use the Custom namespace and not make any modifications to the Core namespace.
in my language, we have an idiomatic expression : "essuyer les plâtres" ...
I do not have any idea how to translate this expression correctly
may be :
I feel as though I was being put through a dry run... ?
Harald : I have never said that my work will become an add-on. It's just a POC.
Edited by foxp2, 12 March 2012 - 06:18 PM.
#36
Posted 15 March 2012 - 10:17 AM
Harald Ponce de Leon, on 12 March 2012 - 05:55 PM, said:
Sorry that I did not specify the namespace
Add-Ons must use the Custom namespace and not make any modifications to the Core namespace.
Kind regards,
Hi Harald,
if an add-on creates a new Application, is it really necessary being in the Custom folder ?
Kind regards,
#37 ONLINE
Posted 15 March 2012 - 10:18 AM
Yes, that is what the Custom namespace is for. Anything not part of core (from our releases) must go in the Custom namespace.
Kind regards,
#38
Posted 15 March 2012 - 10:22 AM
IMO, Custom folder was for modified Core classes, and not to get all add-on Application.
#39
Posted 16 March 2012 - 08:59 AM
Harald Ponce de Leon, on 15 March 2012 - 10:18 AM, said:
The "custom" namespace don't exist at all. Maybe peoples need to understand that "custom" folder is just here for overwrite some classes or app (if they need) or to developpe their own application other than a shop... like a forum, cms... around the oscom framework.
Is it correct?
#40
Posted 19 March 2012 - 04:34 PM
I work on an application and when the file is in /OM/Core/Site/Admin all is ok
But when I put it in /OM/Custom/Site/Admin I can't see it in the Admin.
Did I miss something ??
Regards, Fred
Edited by Foayiid, 19 March 2012 - 04:35 PM.









