Latest News: (loading..)
Harald Ponce de Leon

Template Engine Functionality Proposal

71 posts in this topic

Hi Laurent..

 

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,

Share this post


Link to post
Share on other sites

ok, in this case, what for this code ?

  $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'];
    }
  }

Share this post


Link to post
Share on other sites

Hi Laurent..

 

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,

Share this post


Link to post
Share on other sites

I must admit that I fail to see logic in your template engine.

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

Share this post


Link to post
Share on other sites

Hi Laurent..

 

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,

Share this post


Link to post
Share on other sites

Hi Laurent..

 

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,

Share this post


Link to post
Share on other sites

yes, but in the last email, you wrote :

This is an initial commit that still needs to be worked on and also to

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 :

 

That's where your KendoUI template should exist:

 

Custom/Site/Admin/Template/KendoUI

 

 

(w00t) :x :'(

Edited by foxp2

Share this post


Link to post
Share on other sites

Hi Laurent..

 

Sorry that I did not specify the namespace o:)

 

Add-Ons must use the Custom namespace and not make any modifications to the Core namespace.

 

Kind regards,

Share this post


Link to post
Share on other sites

Sorry that I did not specify the namespace o:)

 

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

Share this post


Link to post
Share on other sites

Hi Laurent..

 

Sorry that I did not specify the namespace o:)

 

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,

Share this post


Link to post
Share on other sites

Hi Laurent..

 

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,

Share this post


Link to post
Share on other sites

in this case, rename it AddOn folder ... :-

IMO, Custom folder was for modified Core classes, and not to get all add-on Application.

Share this post


Link to post
Share on other sites

Yes, that is what the Custom namespace is for. Anything not part of core (from our releases) must go in the Custom namespace.

if I'm not mistaken, i think @@harald sometimes you confused some ppl when you used the term "folder" and "namespace" about Custom...

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?

Share this post


Link to post
Share on other sites

Hi Harald,

 

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

Share this post


Link to post
Share on other sites

Hi Fred..

 

if I'm not mistaken, i think @@harald sometimes you confused some ppl when you used the term "folder" and "namespace" about Custom...

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.

 

The folder structure follows the namespace structure, so when the Custom namespace is being referred to it means:

 

Folder: osCommerce/OM/Custom

Namespace: osCommerce\OM\Custom

 

and when the Core namespace is being referred to it means:

 

Folder: osCommerce/OM/Core

Namespace: osCommerce\OM\Core

 

The Custom namespace is there for any kind of customizations including overriding core classes and introducing new classes (for add-ons).

 

An AddOns namespace can be introduced in the future when add-ons can be managed via the Dashboard (one click installations and updates).

 

Kind regards,

Share this post


Link to post
Share on other sites

Hi Fred..

 

Sorry !!!!

Clean the cache, Clean the cache and clean the cache ...

 

What cache are you referring to?

 

Kind regards,

Share this post


Link to post
Share on other sites

Too much Fred ... Lol

 

Hi Harald,

I am referring to the osCommerce/OM/Work/Cache

After cleaning this, all is ok !

Sorry for the disturb.

Fred II

Share this post


Link to post
Share on other sites

There is no problem, but when I put my add-on in the custom folder without cleaning the cache I doesn't appear in the Admin.

Why it is not possible that the cache troubleshooting this situation ?

Share this post


Link to post
Share on other sites

This is an add-on made to work with professional customers. :ph34r:

It is close to be ready ... :-

Share this post


Link to post
Share on other sites

Hi Fred..

 

Looking forward to seeing it in action! I'll look into the cache issue as soon as it's available.

 

Kind regards,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now