Hey guys,
I'm working on a basic component to upload CSV files for Joomla 1.0.
The idea as far as I understand Joomla component creation is to have a csv.php that calls for a function in csv.html.php that displays the upload form. This is working fine. However, the validation code I created requires a separated php file, let's call it validate.csv.php. But if I mention this file in the action="" part of the form field in csv.html.php Joomla does not recognize the file as a valid "MOS" and goes 403.
So, I'm wondering. Anyone knows what would be the best solution here? Should I put the validation code in csv.php? If so, how would I call it from csv.html.php? I'm fairly new to OOP and knowing when or how to call classes is still a bit of a mystery to me.
My idea is: show an upload form in the admin zone, where content is validated and then sent to the database. It works well as a stand-alone PHP project, but now I need to convert it to work in Joomla as a component. Ideally, I should have started right away coding it as a component and not as a normal PHP project, but I'm not yet capable of doing this.
Some sort of guidance at this stage is very welcome.
Understanding how to better communicate with other files in a component
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Re: Understanding how to better communicate with other files in a component
I can't help you with the coding for 1.0.x because I have not coded for that version. I don't see myself going that route at the moment either, since 1.5 component development seems to be pretty easy to pick up.
I am interested in your csv upload routine.
I am interested in your csv upload routine.
http://springhillalumni.org • Springhill High School Alumni Association
Re: Understanding how to better communicate with other files in a component
Yeah, thanks for you no-reply, Opie.
Component development in 1.5 and 1.0 seems pretty similar with a few differences on how to call certain classes. It's the whole API as a whole that is intimidating to a novice.
Anyway, I managed to go around the issue. Basically, I do a
if(isset($_POST['upload'])
which verifies if the , which is called "upload" was pressed, and then and only then do the verification code.
The problem is that it's all happening in csv.html.php. From what I understand the Joomla API this should be happening in csv.php instead, but I do not know how to send the output there. The csv.html.php should only serve to output HTML and not to do complex PHP functions.
No matter. It's not elegant, but it's working.
Component development in 1.5 and 1.0 seems pretty similar with a few differences on how to call certain classes. It's the whole API as a whole that is intimidating to a novice.
Anyway, I managed to go around the issue. Basically, I do a
if(isset($_POST['upload'])
which verifies if the , which is called "upload" was pressed, and then and only then do the verification code.
The problem is that it's all happening in csv.html.php. From what I understand the Joomla API this should be happening in csv.php instead, but I do not know how to send the output there. The csv.html.php should only serve to output HTML and not to do complex PHP functions.
No matter. It's not elegant, but it's working.
Re: Understanding how to better communicate with other files in a component

http://springhillalumni.org • Springhill High School Alumni Association