property for variables!!

Creating and modifying plugins.
Post Reply
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

property for variables!!

Post by oxygenws »

(oops, what a bad subject!!!)

we have some variable type in plugins, like select, boolean and ...
your program change them with some HTML codes.

NOW, i want to change some property of that html tags.

for example:
the default tag for string is: <input type=text name=fieldname>
i want to ADD a new property to it...
like: <input type=text name=fieldname property=value>

note that i want to add that to ONLY THIS plugin :>

best regards, omid
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: property for variables!!

Post by garvinhicking »

Hm. Why do you need this?

Anyways, you can emit ANY input tag, or stuff using the 'content' type (there where you enter 'boolean' or 'select' usually. The contents of what you put into the 'default' property will emitted there.

So use this:

Code: Select all

                $propbag->add('type',        'content');
                $propbag->add('default', '<input type="serendipity[plugin][yourinputfielname]" value="value" property="property" />');
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

Thanks :)

this related to what i said before..... RTL texts :>
when i changed BODY to be RTL, all fields work RTL, i must specify ONE field to works LTR ;)

Regards, omid
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Can't you specify that direction via a CSS variable/attribute?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

sure, i can.
but is there any separated "class" property for EACH text field??
i want only this field affect with that direction.

regards, omid
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

You could just style:

Code: Select all

input {
  direction: rtl;
}
or something like that? We could create a new constant 'direction' for each language, which we could use in admin/style.css as:

direct: {DIRECTION}

so we could implement that into our default stylesheet without you having to create a new template set if someone wants to use RTL languages.

Was that what you meant?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

We could create a new constant 'direction' for each language
nice :)
Was that what you meant?
not exactly :oops:

we have a lot of text field in the stage....
some of them like Title should be RTL
but some of them like HomepageURL should be LTR!!
i want to change ONLY one of my text fields to LTR :)

got it??

if you want i can upload a sample for you :D

regards, omid
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi oxygenws!
we have a lot of text field in the stage....
some of them like Title should be RTL
but some of them like HomepageURL should be LTR!!
i want to change ONLY one of my text fields to LTR :)
Okay. I just committed to CVS:

* templates/default/admin/style.css will set 'direction: {LANG_DIRECTION}' to the Body Element.
* Added CSS classes 'direction_ltr' and 'direction_rtl' for assigning to special elements
* Added 'lang_direction' plugin bag value to contain the direction for the configuration of a plugin element.

So you can now define LANG_CHARSET in your language file, and use this for plugins:

Code: Select all

                $propbag->add('type', 'boolean');
                $propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_BODYCLONE);
                $propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_BODYCLONE_DESC);
                $propbag->add('default', true);
                $propbag->add('lang_direction', 'ltr');
The default direction if not set is always the direction of the Language file.

It should be contained in the snapshot which will be created later today.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

:o wow.... too fast :D
thanks for your fast support :D

im waiting for snapshot :)
Post Reply