Yes, all seems correct, I have double checked the yml tabs to space, all is right. Here is my gallery.yml file content:
form_setup:
picture:
class: TextBoxNothing incredible here, but does not work…
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
February 13, 2008 3:25pm
Subscribe [27]#196 / Mar 25, 2008 1:44pm
Yes, all seems correct, I have double checked the yml tabs to space, all is right. Here is my gallery.yml file content:
form_setup:
picture:
class: TextBoxNothing incredible here, but does not work…
#197 / Mar 25, 2008 1:45pm
Ok jTaby, but in your video tutorial you don’t create a controller nowhere ! I was just trying imitating your tutorial.
#198 / Mar 25, 2008 1:47pm
well, if you want it to be automated, you would write controller_name: CRUD which is pre-written for you 😊
#199 / Mar 25, 2008 1:51pm
Ok, I figured out now, I have a double problem in fact. First, that the use of controller_name: CRUD is not in your video tutorial, second, my PHP editor was converting spaces to tabs automatically on save without asking me… using windows notepad is working fine now, thanks for answers ! (And I add it’s a real wonderfull tool that you have done here jTaby !)
#200 / Mar 25, 2008 2:40pm
Question #1:
I must have misery on me… I now try to upload a picture but the generated HTML that comes out looks very strange and leads to display bugs in the listing html tables (overview). Like I told before, I am using the latest CI from SVN. here is the generated code:
<td><a href="http://localhost/codex/backend.php/?c=crud&m=manage&t=gallery&a=edit&id=1" title="m-element-text"><a href="http://localhost/codex/upload/pamela_10_thumb.jpgHUsxWR8Qt6VEP30BWniYvkqeeO0ToQBitypography_img_src_end ">http://localhost/codex/upload/pamela_10_thumb.jpgHUsxWR8Qt6VEP30BWniYvkqeeO0ToQBitypography_img_src_end </a></div>...umb.jpg"></div>">m-element-text">http://localhost/codex/upload/pamela_10_thumb.jpg</div>...umb.jpg"></div></a></td>
// Here is the yml content:
db_table: gallery
controller_name: CRUD
page_header: Gallery Management
form_setup:
picture:
class: Image
params:
make_thumbnail: true
height:100
width:100
url_path: upload/
upload_path: ./upload/Question #2:
About image upload and resize, how should I make a crop of the image if I would like to ? Let’s say I want to upload and resize, and create a cropped thumbnail.
Question #3:
Let’s say in a real world application I would like to do a member profile management system. I will then have a list in overview of the members, then I will click to edit each member, but let’s say when I click to edit I want to have tabs to edit their photos, to edit their personal datas, to edit whatever.
The question is: How would you manage that with Codex ?
Sorry for all that questions, I test Codex to look how it is suitable for me in the real life.
#201 / Mar 25, 2008 3:50pm
Answer #1: Ah, you found a bug :(....Here’s what’s happening: codex takes the first element in your table, and turns it into a link to edit. However, sometimes the text is too long, and it makes your table look ugly, so if your output is too long, then codex will cut it in the middle and put ... in the middle. The problem is that it’s taking html output, encoding it as a link, and truncating it.
I’ll fix it soon
Answer #2: As of now, you can only make a thumbnail by resizing, i’ll add more Image Manipulation options in the next release.
Answer #3: You would make your own codex_form_view.php in application/view/templates/default/
#202 / Mar 25, 2008 4:10pm
Ok, thanks jTaby for the quick answers, I will try to use Codex on a next project.
Just one more question: now that you are busy a lot, how do you plan the future of Codex ? Do you have also a Roadmap for next releases ?
#203 / Mar 25, 2008 4:12pm
I’m actually looking for people to help me out. I’m drafting a “What’s left before 2.0” document, and I already have a couple of people helping me, but I’m just going through a rough patch in school right now (it’s the last month of the semester and everything is piling up), but I’ll be spending a lot of time on codex again soon.
#204 / Mar 25, 2008 4:13pm
Cool to ear so. If I can help in something you are welcome to ask me, my skills are more on the design side, like Photoshop, xHTML and CSS.
#205 / Mar 26, 2008 1:25am
Any Idea to make Dependent DbDropDown ?
Basically I already edited the DbDropDown from this Codex and now I can use it if you need a dbdropdown with username session.
Here’s the code :
function prepForDisplay($value){
$CI = &get;_instance();
$CI->db->select($this->field);
$CI->db->where($this->primary_key,$value);
$CI->db->where($this->user,$CI->codexsession->userdata('user_name'));
$query = $CI->db->get($this->table);
$result = $query->result_array();
if(count($result) == 0)
return '';
else
return $result[0][$this->field];
}
function getList(){
$CI = &get;_instance();
$value = $this->value;
if(!isset($CI->db)) $CI->load->database();
if (isset($this->add_link)) {
if (!isset($this->user)) $filter='';
else $filter=" WHERE ".$this->primary_key."=$value and ".$this->user."='".$CI->codexsession->userdata('user_name')."'";
}
else $filter=" WHERE ".$this->user."='".$CI->codexsession->userdata('user_name')."'";
$html = "<option value =\"\"></option>";
$field = $this->params['field'];
$table = $this->params['table'];
$result = $CI->db->query("SELECT ".$this->primary_key.",$field FROM $table ".$filter);
foreach($result->result_array() as $row){
if($row[$this->primary_key] == $this->value)
$html .= "<option value=\"".$row[$this->primary_key]."\" selected>".$row[$field]."</option>\n";
else
$html .= "<option value=\"".$row[$this->primary_key]."\">".$row[$field]."</option>\n";
}
return $html;
}
}I’ve add this Code : $CI->db->where($this->user,$CI->codexsession->userdata(‘user_name’)); in function prepForDisplay to make the dbdropdown support user session.
And this code :
$value = $this->value;
if (isset($this->add_link)) {
if (!isset($this->user)) $filter='';
else $filter=" WHERE ".$this->primary_key."=$value and ".$this->user."='".$CI->codexsession->userdata('user_name')."'";
}
else $filter=” WHERE “.$this->user.”=’”.$CI->codexsession->userdata(‘user_name’).”’”;
$result = $CI->db->query(“SELECT “.$this->primary_key.”,$field FROM $table “.$filter);
in function getList to make list support user session.
Any Idea to make simplify this code ?
I really need Dependent DbDropDown 😊
#206 / Mar 26, 2008 2:43am
so it’s working, and you’re looking for tips to simplify the code?
#207 / Mar 26, 2008 6:12am
Perhaps anyone will make a Project to build a Forum maybe ?
#208 / Mar 26, 2008 10:03am
i was contemplating that…it wouldn’t be hard really.
#209 / Mar 26, 2008 12:51pm
Hello jtaby, this is my first post on this forum. I am a php noob and I am working on my first CI app. Your CodeExtinguisher app is awesome! congratulations thus far!
I wish I could offer to help, but mostly I am learning. I may be able to comment on what’s missing from a noobs point of view 😉
Anyway just wanted to say thanks,
#210 / Mar 26, 2008 12:56pm
jTaby, i think we need a trac for Codex. What do you think?