Welcome Guest, Not a member yet? Register   Sign In
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS
#71

[eluser]Phil Sturgeon[/eluser]
Had a look at the URL helper and modified it in the way TooPixel suggested. I tried a few other solutions but that was the most effective and tidy.

humanize() just uses str_replace. Am I expected to extend every single part of CodeIgniter's core that uses string functions with no encoding support?

This is more than just extending the URL helper, this is a massive overhaul of the CI source code that they should be handling themselves. I would have to add all cyrillic characters to the CI "allowed URI characters", extend Validation and Form_Validation to add new rules, change instances of form validation, etc.
#72

[eluser]sshz[/eluser]
Phil, there are only a few functions in CI that doesn't work with cyrillic letters. With modified url_title() and humanize() I have almost "production" site using Pyrocms, it's completely cyrillic and it's working just fine. validation, chars in URL, news, pages, breadcrumbs, etc all works fine with cyrillic letters without any modification.
#73

[eluser]sshz[/eluser]
[quote author="Too Pixel" date="1241463493"]This is probably neater and should work also with all chars (at least all latin chars) :

Code:
function url_title($str, $separator = 'dash')
    {
        $separator = ($separator == 'underscore') ? '_' : '-';
        $str = strtolower(htmlentities($str, ENT_COMPAT, 'UTF-8'));
        $str = preg_replace('/&(.)(acute|cedil|circ|grave|ring|tilde|uml);/', "$1", $str);
        $str = preg_replace('/([^a-z0-9]+)/', $separator, html_entity_decode($str, ENT_COMPAT, 'UTF-8'));
        $str = trim($str, $separator);
        return $str;
    }
[/quote]

That is neat, but doesn't support non-english characters or at least cyrillic, this makes News module with non-english titles mostly unusable.
#74

[eluser]NightLion[/eluser]
one more little sugestion: a module to manage modules Big Grin
to remove and upload only Big Grin
#75

[eluser]Phil Sturgeon[/eluser]
[quote author="sshz" date="1241468081"]Phil, there are only a few functions in CI that doesn't work with cyrillic letters. With modified url_title() and humanize() I have almost "production" site using Pyrocms, it's completely cyrillic and it's working just fine. validation, chars in URL, news, pages, breadcrumbs, etc all works fine with cyrillic letters without any modification.[/quote]

Ok sshz, so your suggestion would be to extend url_helper and inflection_helper, add those two functions and then what with the rest? Add cyrillic characters to the allowed characters list and extend Validation and Form_validation. That all that needs to be done?

[quote author="NightLion" date="1241472145"]one more little sugestion: a module to manage modules Big Grin
to remove and upload only Big Grin[/quote]

Good call. I planned on including a method of doing this a while back but forgot about it. I could even have install.sql and remove.sql to get them in and out seamlessly. Will add a ticket for v1.0.
#76

[eluser]Phil Sturgeon[/eluser]
Also, would it be better to add new validation rules that allow such characters, or override the current alpha, alpha_dash, etc? I think probably the 1st option.
#77

[eluser]sshz[/eluser]
[quote author="Phil Sturgeon" date="1241533939"]
Ok sshz, so your suggestion would be to extend url_helper and inflection_helper, add those two functions and then what with the rest? Add cyrillic characters to the allowed characters list and extend Validation and Form_validation. That all that needs to be done?
[/quote]
I don't see the reason to extend Validation and Form_validation and adding cyrillic characters to the allowed characters, Pyrocms works with cyrillic just fine with only url_helper and inflection_helper extended, no more modifications needed, at least for now.
#78

[eluser]Phil Sturgeon[/eluser]
Ahh, I tried adding crylic characters to a page slug and that failed. Guess I shouldnt be trying to allow such a silly option. Will keep cyrillic characters to the text and a-z for url, alpha, alpha_dash, etc.
#79

[eluser]sshz[/eluser]
Phil, this is not the best way. Cyrillic slugs in news works fine, there is no alpha_dash validation, only trim, is this not enough?
#80

[eluser]NightLion[/eluser]
Phil, i was thinkink, yesteday i'd pass the pyro to a linux server, to everything works fine i had to set 777 for several paths, and its a suck :S
in the v1.0 in the cms installer, u can put a script to create the sub-images dirs, like products, galleries, and chmod them to 777. its more easy than put pesmissions one by one at FTP :S

hugs from Brazil

hey: if u can, for multiple languages, change the time function to strftime, because in portuguese-brazilian language May it's Maio, then in strftime i just put a "setlocale(LC_TIME, 'pt-br')" and its translated, but with the time function dont :S




Theme © iAndrew 2016 - Forum software by © MyBB