Page 1 of 1

property for variables!!

Posted: Sun Jan 23, 2005 7:48 pm
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

Re: property for variables!!

Posted: Sun Jan 23, 2005 8:07 pm
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

Posted: Sun Jan 23, 2005 8:56 pm
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

Posted: Mon Jan 24, 2005 9:43 am
by garvinhicking
Can't you specify that direction via a CSS variable/attribute?

Regards,
Garvin

Posted: Mon Jan 24, 2005 10:24 am
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

Posted: Mon Jan 24, 2005 10:28 am
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

Posted: Mon Jan 24, 2005 11:07 am
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

Posted: Mon Jan 24, 2005 11:46 am
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

Posted: Mon Jan 24, 2005 11:58 am
by oxygenws
:o wow.... too fast :D
thanks for your fast support :D

im waiting for snapshot :)