CodeIgniter Forums
CodeExtinguisher Release Candidate 11 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: CodeExtinguisher Release Candidate 11 (/showthread.php?tid=7249)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20


CodeExtinguisher Release Candidate 11 - El Forum - 04-20-2008

[eluser]minimal design[/eluser]
Just wanted to confirm that changing the textarea plugin to:
Code:
function prepForDB($value){
        return $value;
    }
did the trick Smile

I have yet another question though..., I tried to figure it out on my own for a while but I'm missing something. I want to have a "URI" field in my form to make it easier to manage clean URIs on my site.

I made a new plugin file and I'm using something like that:
Code:
function prepForDB($value){
        return url_title($value);
    }

for the field, which works great... but is there an easy way to make the $value default to the content of another field (the "title" field in that case...) so that I don't have to fill in the URI field manually when I post something new...

Thanks for all the help so far! Smile


CodeExtinguisher Release Candidate 11 - El Forum - 04-20-2008

[eluser]Majd Taby[/eluser]
minimal design,

Code:
$_POST['title']

Or the less hackish

Code:
$CI = &get;_instance();
$CI->input->post('title');



CodeExtinguisher Release Candidate 11 - El Forum - 04-20-2008

[eluser]Majd Taby[/eluser]
tylderdurden, That error is printed when you try to submit a form that wasn't created for you in a fresh page request. This blocks CSRF attacks, but it means you can't use the back button since it doesn't re-create the permission.


CodeExtinguisher Release Candidate 11 - El Forum - 04-20-2008

[eluser]minimal design[/eluser]
That's like light speed support! Smile Thanks...

so that's how I got it setup now, slightly more portable, I made the source of the uri field a parameter, and also there's a typo in your answer , so just in case someone's readin it and trying to get it working, that's what I got and it seems to do the trick

Code:
function prepForDB($value){
        $CI = &get;_instance();
        $this->field = $this->params['field'];        
        if ($value == "") {
            $value = $CI->input->post($this->field);
        }
        return url_title($value);
    }

I still don't really get when you need to use $CI = &get;_instance(); Gotta find the explanation in the docs, I'm not clear on it and sometimes (like this time) I get stuck because of it...

Thanks again!\

EDIT: that was not a typo... the forum system adds a ";" after the get in "&get;_instance();"... weird...


CodeExtinguisher Release Candidate 11 - El Forum - 04-20-2008

[eluser]Majd Taby[/eluser]
you never use $CI = &get;_instance();...it's not valid php syntax..but the forum adds it in...don't know why...


CodeExtinguisher Release Candidate 11 - El Forum - 04-20-2008

[eluser]minimal design[/eluser]
yeah, I just updated my post at the same time you replied... that extra ";" is weird... Anyway, thanks!


CodeExtinguisher Release Candidate 11 - El Forum - 04-20-2008

[eluser]nmac[/eluser]
Hi Jtaby,
just wanted to say thanks for a great contribution to CI. I am still exploring Codex, but so far, this is great stuff.

Was there any reason for dropping the tiny_mce editor plugin? Or perhaps it's in SVN, I havent checked yet, but will do.
Regardless, I managed with little effort to adjust the editor.php file on the site to work with 11.2. Also, I've edited (hacked) codextemplates.php to add a new variable for body tag attributes, as for my purposes, it was needed. I found that very easy to do.
You have much of the page layout needs covered already, but this one helped me out, so for what its worth:
In codex/app.../libraries/codextemplates.php
Line 11, after var $head

Code:
var $bodyattr = "";

Then line 80 or so, add a new function:

Code:
function setBodyAttributes($new_val){
        $this->bodyattr = $new_val;
    }

and finally, edit function _getHTML, replacing line with the body tag:
Code:
<body $this->bodyattr>

keep up the good work!

nmac. ;-)


CodeExtinguisher Release Candidate 11 - El Forum - 04-20-2008

[eluser]Majd Taby[/eluser]
thanks nmac, i'll add your suggestion.

As for TinyMCE, it wasn't stable, it was way too big (compared to codex), and it was just a pain...i plan on releasing plugins for all the editors when the new site is launched.


CodeExtinguisher Release Candidate 11 - El Forum - 04-20-2008

[eluser]Majd Taby[/eluser]
Here is a _very_ rough, and _very_ quick screencast to preview the upcoming revamped Permissions system

First i create a new record with some permissions setup, then I test them, then I update the permissions and again test them.

http://www-personal.umich.edu/~mabdelah/ScreenFlow.mov


CodeExtinguisher Release Candidate 11 - El Forum - 04-21-2008

[eluser]hugslife[/eluser]
i've been struggling with the url behavior... namely the query strings; i've enabled them in both the codex/config/config.php and application/config/config.php however they do not work. for example, choosing "Widgets" from the menu creates:
Code:
http://www.website.com/backend.php/?c=crud&m=index&t=widgets
which results in "no input file specified". however if i rewrite the url as
Code:
http://www.website.com/backend.php/widgets
everything is gravy. also, the "user registration" menu item defaults to the /controller/action way of building url but all other menu items are query strings. thank you for your help