Drake CMS Official Forums - read-only archive

You are reading the Drake CMS Official Forums archive, available for historical purposes only.

Drake CMS has been rebranded into Lanius CMS, visit the new Lanius CMS Official Forums if you need support about Lanius CMS or Drake CMS -> Lanius CMS migration.



Home page Add-ons related > Simple ShoppingCart component/modules... Permanent link to this page
 
 << Start < Prev 1 2 3 4 Next > End >>
Author Message:
catasoft
Re: Simple ShoppingCart component/modules...
13 July 2007 05:17
Anonymous Yes there is a naming convention.
I think this should be made very clear in the developer manuals (the naming convention for language files- one might think: "heck, if i specify the file in the config file, Drake should find it wink).

My language files were named with the actual language name inside the filename. I removed that and it worked.

Now the component works, i'll have to customize it.

Unfortunately i couldn't get the latest revision, i've never done that. I installed rapidSVN but it downloaded a bunch of folders. Two of them (marc and saba) seem the largest, but i would say too large (one has over 3000 files blink)

Isn't that a little too much for a "lite" CMS? smile
Is trunk the folder i'm looking for? smile
Ok, i'll be back with more after more testing smile
Take care
 
catasoft
Re: Simple ShoppingCart component/modules...
13 July 2007 06:21
Anonymous I got the svn latest.
Used the drake sources from the trunk folder.
This version has new issues:
  • [li]com_simplecart_orderform- gets installed ok (with the additions from my previous messages concerning languages)

  • [li]ro language file is not installed, no folders created under lang and no errors thrown

  • [li]when i go to install/uninst components, com_simplecart_orderform is not shown (installed column is blank)

  • [li]i cannot create a hidden menu item, because com_simplecart_orderform is now shown in the component list to choose from

So... new issues sparkled sadI think i'll use the stable release for now.
What do u think?
 
legolas558
Re: Simple ShoppingCart component/modules...
13 July 2007 08:30
Anonymous Quote:
i'm afraid i have to contradict you: if you only specify the components inside the <i18n> tags, but not use the path (inside the .zip package) lang/en/components, and lang/ro/components, it will not work (doesn't know where to get the files from) and will give Fileystem errors...
Could you please see if this is correct and maybe make it clearer in the component xml Documentation what this "components" folder refers to (source/destination/both).

If the "ro" language files folder does not exist the "ro" localization files will not be copied...it's normal. It refers to both, but source is under the root path while destination is under lang/xx/

Quote:
if my component has a language file that is not part of the main install (meaning there's no ro folder under lang) again: FileSystem error):
Quote:
Failed to move file ::/private/temp/com_simplecart_orderform.zip_ext/com_simplecart_o rderform/lang/ro/components/simplecart_orderform.romanian.php to ::/lang/ro/components/simplecart_orderform.romanian.php

This is because the language folders are not created.

After i created the "components" folder under lang/ro, i worked smoothly.

I'm not sure if this is he correct behavior... maybe folders should be created? If in the future a language will be added but meanwhile modules still have their multilanuage files here...

I am not sure that you might want language files for a language that is not installed! Anyway, this is the current behaviour...we might discuss about alternatives in another topic smile
Quote:
Even after correct install, language files present under corresponding folders etc, i get this exception:
Quote:
c:\easyphp\www\drake_papyrus\components\com_simplecart_orderform\simplecart_orderform.php(16): E8 Use of undefined constant _CONTACT_TITLE - assumed '_CONTACT_TITLE'

The language file is (for now) copied from the contact component, like the entire order_form component to say the truth. Yet, it says it can;t be found.

My conclusion: the right files are not included as lanuage for this component.

Is there any naming convention???

I'll be back with more smile

Yes, there is a naming convention: you must use the component name in the filename
 
legolas558
Re: Simple ShoppingCart component/modules...
13 July 2007 08:32
Anonymous Quote:

Unfortunately i couldn't get the latest revision, i've never done that. I installed rapidSVN but it downloaded a bunch of folders. Two of them (marc and saba) seem the largest, but i would say too large (one has over 3000 files blink)

Isn't that a little too much for a "lite" CMS? smile
Is trunk the folder i'm looking for? smile


It is always the trunk folder when you look into repositories smile
 
legolas558
Re: Simple ShoppingCart component/modules...
13 July 2007 08:39
Anonymous Quote:

ro language file is not installed, no folders created under lang and no errors thrown

This is OK, since the "ro" language folder did not exist

Quote:

when i go to install/uninst components, com_simplecart_orderform is not shown (installed column is blank)

Did you also check in the second page?
Quote:
i cannot create a hidden menu item, because com_simplecart_orderform is now shown in the component list to choose from

Do you mean that it is not shown? Please try with the latest revision and tell me

Quote:

I think i'll use the stable release for now.
What do u think?


0.4.5 is going live...I'd better like if you could help me to fix it sad
 
catasoft
Re: Simple ShoppingCart component/modules...
13 July 2007 09:03
Anonymous Quote:
Did you also check in the second page?

Yes i did dizzy
Quote:
Do you mean that it is not shown? Please try with the latest revision and tell me

Yes, unfortunately this was with the latest revision.

Quote:
0.4.5 is going live...I'd better like if you could help me to fix it sad

With pleasure, i'll indicate everything i see.
For instance, contact form .Javascript breaks on this expression (it is never executed and mail script is never called- task=post):
Code:
!email_regex.test(emailForm.contact_email.value)


I replaced it with my function:
Code:
function checkEmail(addr){
var email=/^[A-Za-z0-9][\w-.]*[A-Za-z0-9]*@[A-Za-z0-9]*([\w-.]*[A-Za- z0-9]\.)+([A-Za-z]){2,4}$/i;
return(email.test(addr));
}

Now it works smile
I'm very close to finish line, i created an admin component after all to be like a center of command.

By the way, $d->Redir("") doesn't redirect to previous page (if called from admin component), i had to call
$d->Redir($_SERVER['HTTP_REFERER']);

When is 0.4.5 going live?
Will there be a nice patch? Cause otherwise i work in vain dizzy
 
catasoft
Re: Simple ShoppingCart component/modules...
13 July 2007 09:17
Anonymous I just tried to install the romanian language:
  • [li]in current release, it fails (if ro is created under lang, it sait FileSystemError. If i delete it, it is created but then FileSystemError for subFolders, so there's nothing i can do here, there's definetly a problem with the folder/subfolder creation, and i had this during component install too sad:( sad

  • [li]in latest svn trunk: it works :(

What can i do now?
I can't install the language :(, and if i use the latest svn i can't create component instances in the hidden menu. So, me lost again sad
By the way, i even had to create an admin component. Isn't there a way to just use installed components? Or create a component called "Component instances" (which manages component instances) instead of that hidden menu. It's not elegant nor clear with the hidden menu...
 
catasoft
Re: Simple ShoppingCart component/modules...
13 July 2007 09:23
Anonymous Ok, apparently copying files in the lang folder made it work. So Drake DOES read folders and updates the admin interface sometimes...

THEN why doesn't it see templates also?
If i copy a template in the templates folder, it is not seen, but if i copy a language it is dicovered and displayed...

This is not a very uniform behavior and it gets users confused dizzy
Now let's see if this language is actually used (i selected it from global config->Language but front end still displays in english, even though i translated some of the strings to Romanian, so for now it is not used).
 
legolas558
Re: Simple ShoppingCart component/modules...
13 July 2007 09:35
Anonymous Quote:

Quote:
Did you also check in the second page?

Yes i did dizzy

It should be fixed now

Quote:

Quote:
Do you mean that it is not shown? Please try with the latest revision and tell me

Yes, unfortunately this was with the latest revision.

As said in the previous post, should be fixed now (revision 3920)

Quote:

Quote:
0.4.5 is going live...I'd better like if you could help me to fix it sad

With pleasure, i'll indicate everything i see.
For instance, contact form .Javascript breaks on this expression (it is never executed and mail script is never called- task=post):
Code:
!email_regex.test(emailForm.contact_email.value)


I replaced it with my function:
Code:
function checkEmail(addr){
var email=/^[A-Za-z0-9][\w-.]*[A-Za-z0-9]*@[A-Za-z0-9]*([\w-.]*[A-Za- z0-9]\.)+([A-Za-z]){2,4}$/i;
return(email.test(addr));
}

Now it works smile

Are you using the latest SVN version?

Quote:

I'm very close to finish line, i created an admin component after all to be like a center of command.


Great! cheerful
Quote:

By the way, $d->Redir("") doesn't redirect to previous page (if called from admin component), i had to call
$d->Redir($_SERVER['HTTP_REFERER']);


Try with $d->Redir($my->PreviousPage());

The best approach would be to send in the POST request the item id to redirect to

Quote:

When is 0.4.5 going live?

Before tomorrow!

Quote:

Will there be a nice patch? Cause otherwise i work in vain dizzy

There are always patches, we are backward compatible since v0.2!!!!
 
legolas558
Re: Simple ShoppingCart component/modules...
13 July 2007 09:40
Anonymous Quote:

I just tried to install the romanian language:
in current release, it fails (if ro is created under lang, it sait FileSystemError. If i delete it, it is created but then FileSystemError for subFolders, so there's nothing i can do here, there's definetly a problem with the folder/subfolder creation, and i had this during component install too sad:( sad

You cannot create language files for romanian simply creating an empty "ro" folder. You'd better read the rest of the documentation (e.g. about language files etc.). You have to use the Drake CMS facilities to create a new language, e.g. the admin backend com_language component (language manager)

Quote:

What can i do now?
I can't install the language :(, and if i use the latest svn i can't create component instances in the hidden menu. So, me lost again sad

What do you mean by "latest"? Did you try with revision 3920?

Quote:

By the way, i even had to create an admin component.


???

Quote:

Isn't there a way to just use installed components? Or create a component called "Component instances" (which manages component instances) instead of that hidden menu. It's not elegant nor clear with the hidden menu...


It is not a matter of elegancy...and not a matter of the hidden menu only: if you active a component, it should have a menu item. So you should place it into the mainmenu or some other menu (this is the current design - which might be discussed elsewhere if we want smile); if you choose to place it into the hiddenmenu, it is because of some bad design on your side, it's not a Drake CMS issue because the correct way would be to have a visible menu item for the component smileThe hiddenmenu is a sort of hack
 
legolas558
Re: Simple ShoppingCart component/modules...
13 July 2007 09:44
Anonymous Quote:

Ok, apparently copying files in the lang folder made it work.


That's because you went from Paris to Berlin passing through New York angry
Any chance you will try the admin backend language manager? wink
Quote:

So Drake DOES read folders and updates the admin interface sometimes...


It does when it is necessary

Quote:

THEN why doesn't it see templates also?
If i copy a template in the templates folder, it is not seen, but if i copy a language it is dicovered and displayed...

This is not a very uniform behavior and it gets users confused dizzy

angrythat's because you are copying non-Drake CMS templates, I bet.

Quote:

Now let's see if this language is actually used (i selected it from global config->Language but front end still displays in english, even though i translated some of the strings to Romanian, so for now it is not used).


As explained in the FAQs, you should change your own language to see another language. Go edit your user and you'll see

A hardcore trip into Drake CMS we're having laughing
 
catasoft
Re: Simple ShoppingCart component/modules...
13 July 2007 09:55
Anonymous Quote:

You cannot create language files for romanian simply creating an empty "ro" folder. You'd better read the rest of the documentation (e.g. about language files etc.). You have to use the Drake CMS facilities to create a new language, e.g. the admin backend com_language component (language manager)

You really must think i'm stupid or something... sad Of course i didn't, but i copied English fully, edited the xml and common.php and the language was seen ok...
I know there are guidlines to follow, but i just want the darn thing to work. For me, to create a new language is much easier to start for instance from english and translate all define's. As long as it stays UTF-8, i don't see why it wouldn't work :ermm:

Quote:
What do you mean by "latest"? Did you try with revision 3920?

No, i can't get it from work, all ports are blockd. I meant the one from 6 hours ago (3917). I see u've been busi blush
Quote:
It is not a matter of elegancy...and not a matter of the hidden menu only: if you active a component, it should have a menu item. So you should place it into the mainmenu or some other menu (this is the current design - which might be discussed elsewhere if we want smile); if you choose to place it into the hiddenmenu, it is because of some bad design on your side, it's not a Drake CMS issue because the correct way would be to have a visible menu item for the component smileThe hiddenmenu is a sort of hack


I don't want/need menu items. My current project is the perfect example: it is a back-end logic component (it just receives input and redirects, like a controller). Why would i MUST create a menu for that?

Anyway, maybe my project is sort of an exception, this is why i keep bumping into strange aspects...

And... elegance is an aspect in all experienced programmer's code smile(clean code and logical clear intuitive solutions are all part of the meaning). I'm not talking 'bout my code, just in general (:d)
 
catasoft
Re: Simple ShoppingCart component/modules...
13 July 2007 10:05
Anonymous Quote:
Any chance you will try the admin backend language manager? ;)

That's what i tried but in my revision it didn't work... r3917 was ok.

Quote:
:angry: that's because you are copying non-Drake CMS templates, I bet.
u think? whistling
laughing
Quote:
As explained in the FAQs, you should change your own language to see another language. Go edit your user and you'll see

Aha, it worked blush
I was logged in as admin while working on it.
If i'm not logged in i assume it will work smileThanks smile
P.S. I'll get the latest revision once i get home and play with it smile
 
catasoft
Re: Simple ShoppingCart component/modules...
13 July 2007 10:39
Anonymous I was using the language component and i must say it makes translating Drake (almost) a pleasure smile
BUT when i went to visit the front end:

Quote:
==Server==
Drake v0.4.4 Beta rev.3866
Server: Apache/1.3.33 (Win32) PHP/4.3.10
PHP version: 4.3.10
Protocol: HTTP/1.1
OS: Windows NT INFCATA 5.1 build 2600
Database: gladius
Subsite: no

==Client==
User agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
Accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-language: en-us,en;q=0.5
User lang: ro

=Debug backtrace=

::/index.php(30): include(string[+25] = "::/includes/main_content.php")
::/includes/main_content.php(29): include(string[+22] = "::/includes/component.php")
::/includes/component.php(22): require(string[+38] = "::/components/com_frontpage/frontpage.php")
::/components/com_frontpage/frontpage.php(8): frontpage()
::/components/com_frontpage/frontpage.html.php(53): showcontent(integer = 3, string[9] = "frontpage", string[1] = "1", array[19])
::/includes/content.php(162): dateformat(integer = 1184065399)
::/classes/drake.php(66): lc_strftime(string[12] = "%A, %d %B %Y", integer = 1184065399)
::/includes/i18n/time.php(77): lc_enc(string[20] = "mar�i, 10 iulie 2007")
::/includes/i18n/utf8.php(37): mb_convert_encoding(string[20] = "mar�i, 10 iulie 2007", string[5] = "UTF-8", string[6] = "CP1250")
c:\easyphp\www\drake_papyrus\includes\i18n\utf8.php(37): E2 mb_convert_encoding(): Illegal character encoding specified

The strings with errors aren't in the language files, they are provided by the OS i guess.

Have u ever seen this one be4? dizzy
 
legolas558
Re: Simple ShoppingCart component/modules...
13 July 2007 10:42
Anonymous Quote:

Quote:

You cannot create language files for romanian simply creating an empty "ro" folder. You'd better read the rest of the documentation (e.g. about language files etc.). You have to use the Drake CMS facilities to create a new language, e.g. the admin backend com_language component (language manager)

You really must think i'm stupid or something... sad

I am sure that you are not stupid, but...communication is a form of art, and we are pretty failing here, sorry sad(English is not our mother language) Sometimes I have to guess the bits of information that are not expressed (for example, you did not state how you created the language files, so I had to induce that)

Quote:

Of course i didn't, but i copied English fully, edited the xml and common.php and the language was seen ok...

WHY did you not use the language component? sadThat adds to confusion...

Quote:

I know there are guidlines to follow, but i just want the darn thing to work. For me, to create a new language is much easier to start for instance from english and translate all define's. As long as it stays UTF-8, i don't see why it wouldn't work :ermm:

Ok, it will never work.
Simply because neither I remember all the small bits of things to keep in mind while manual editing; that's why the component is suggested to be used. If you use manual editing, at some point there will be some weird bug and we will not be able to understand where it comes from sadSorry but I am telling this to you because it already happened so many times..

Anyway, copying the "en" folder should have worked (afaik)

Quote:

Quote:
What do you mean by "latest"? Did you try with revision 3920?

No, i can't get it from work, all ports are blockd. I meant the one from 6 hours ago (3917). I see u've been busi blush

Ok, so get that one from the Developers Area, it gets refreshed every two hours

Quote:

Quote:
It is not a matter of elegancy...and not a matter of the hidden menu only: if you active a component, it should have a menu item. So you should place it into the mainmenu or some other menu (this is the current design - which might be discussed elsewhere if we want smile); if you choose to place it into the hiddenmenu, it is because of some bad design on your side, it's not a Drake CMS issue because the correct way would be to have a visible menu item for the component smileThe hiddenmenu is a sort of hack


I don't want/need menu items. My current project is the perfect example: it is a back-end logic component (it just receives input and redirects, like a controller). Why would i MUST create a menu for that?


Good question. I will answer second the current Drake CMS logic, which is something that we can eventually improve of course.

You must create a menu item (which is the component instance) because so you will set the correct access level for that component instance. There is such mechanism because if you will want to disable the component, you will not need to remove the folder.

Quote:

Anyway, maybe my project is sort of an exception, this is why i keep bumping into strange aspects...


I think that you are not bumping into very strange aspects..some areas are quite unexplored. As far as you keep "on track" with the CMS logic, there will be no problem (neither now or in future!)

Quote:

And... elegance is an aspect in all experienced programmer's code smile(clean code and logical clear intuitive solutions are all part of the meaning). I'm not talking 'bout my code, just in general (:d)


I cannot judge my own code, however talking about the CMS logic I believe that the Drake CMS logic is much clearer and ordered than the Limbo CMS logic from which we started from. A lot of re-design has been done, things are not more complex but simply undocumented: sometimes you get into errors because you think you are dealing with Limbo CMS, and that's not! The core is 100% changed.

There is still room for improvements, I know, but we have to make them in the correct way; so please don't think that I state "it is this way and so will remain". I am stating "it is this way for these reasons, how can we correctly improve this?"
 
legolas558
Re: Simple ShoppingCart component/modules...
13 July 2007 10:57
Anonymous Quote:

I was using the language component and i must say it makes translating Drake (almost) a pleasure smile
BUT when i went to visit the front end:

[...]

Have u ever seen this one be4? dizzy


This error happened because your system uses CP1250 as the default encoding, and PHP's mb_convert_encoding() does not have tables for it. Nobody had ever reported this.

Please try with the latest revision (also from the developers area), this bug should be fixed now.
 
catasoft
Re: Simple ShoppingCart component/modules...
13 July 2007 11:07
Anonymous Great smile
My components/module/drabot are almost complete.
Soon i'll experiment with the online revision, and try to get everything to work there.

Oh, another small issue: when backing up database it also saves module/component info. BUT if i restore it in a new install, module/component/drabot files -of course- are not present (physically).

Even the new revision DIDN'T LET ME UNINSTALL THE MODULES (which are'n there). I just wanted to clean the DataBase before reinstalling the components in the new clean install.

I'll try to see if anything has changed. If not, from ground zero smile
 
legolas558
Re: Simple ShoppingCart component/modules...
13 July 2007 11:14
Anonymous Quote:

Great smile
My components/module/drabot are almost complete.
Soon i'll experiment with the online revision, and try to get everything to work there.


Good! smile
Quote:

Oh, another small issue: when backing up database it also saves module/component info. BUT if i restore it in a new install, module/component/drabot files -of course- are not present (physically).

Even the new revision DIDN'T LET ME UNINSTALL THE MODULES (which are'n there). I just wanted to clean the DataBase before reinstalling the components in the new clean install.


The "dead" database entries cannot removed because the entry would not be really removed. The XML file contains processing instructions for the uninstall operation (see doc components.htm), if the XML file (which is a physical file) is not present, it is not possible to uninstall the entry because it would only remove the database entry while the rest (for example, specific database tables) would still be there. So you have to restore a database in the exact same physical configuration which generated it, and this is a necessary thing in my opinion (otherwise infinite problems would raise).

You are still trying to "make the darn thing work", are you? smileWell this thing has no hacks inside it, it works the way it works and only that way. Having only 1 way to work, the best, is in my opinion clearer than having "shortcuts" or "hacks" to have it work

Quote:

I'll try to see if anything has changed. If not, from ground zero smile


As far as you follow the documentation (which always talks about the "standards" we use in Drake CMS), you will never have to start from ground zero smile
 
legolas558
Re: Simple ShoppingCart component/modules...
13 July 2007 11:19
Anonymous Quote:

Quote:
Any chance you will try the admin backend language manager? ;)

That's what i tried but in my revision it didn't work... r3917 was ok.


Nothing changed about the language manager...and the bug you reported here should have happened also with r3917, was not?

Quote:

Quote:
:angry: that's because you are copying non-Drake CMS templates, I bet.
u think? whistling
laughing

Templates from other CMSes have to be adapted.

Quote:

Quote:
As explained in the FAQs, you should change your own language to see another language. Go edit your user and you'll see

Aha, it worked blush
I was logged in as admin while working on it.
If i'm not logged in i assume it will work smileThanks smile

No problem smileWhen you are not logged in the browser language tells Drake CMS what language to pick. Otherwise (when you are logged in) you can temporarily change the language clicking a flag of mod_lang (if that module is present and shown), or even permanently modify the language from the admin backend users management area or from the frontend "Edit user details" page. This was explained in the FAQ
 
catasoft
Re: Simple ShoppingCart component/modules...
13 July 2007 11:33
Anonymous I just got r3921, installed everything, everything works fine. But when tried to run the site with the new language, the same CP1250 problem occurs...

How can that be? Wasn't it fixed? Or did you just fix it (meaning later than r3921, which is the online version of the moment)

Code:
::/index.php(30): include(string[+25] = "::/includes/main_content.php")
::/includes/main_content.php(34): include(string[+22] = "::/includes/component.php")
::/includes/component.php(22): require(string[+38] = "::/components/com_frontpage/frontpage.php")
::/components/com_frontpage/frontpage.php(8): frontpage()
::/components/com_frontpage/frontpage.html.php(53): showcontent(integer = 3, string[9] = "frontpage", string[1] = "1", array[19])
::/includes/content.php(162): dateformat(integer = 1184065399)
::/classes/drake.php(65): lc_strftime(string[12] = "%A, %d %B %Y", integer = 1184065399)
::/includes/i18n/time.php(77): lc_enc(string[20] = "mar�i, 10 iulie 2007")
::/includes/i18n/utf8.php(41): mb_convert_encoding(string[20] = "mar�i, 10 iulie 2007", string[5] = "UTF-8", string[6] = "CP1250")
c:\easyphp\www\drake_papyrus_new\includes\i18n\utf8.php(41): E2 mb_convert_encoding(): Illegal character encoding specified
 
Top << Start < Prev 1 2 3 4 Next > End >>