GeoGebraTube Blog
Developer blog with latest items on top.
2010-03-29
Judit: After Florian's suggestion I rewrote the pagination and ordering mechanism to use the next link format: ".../category/#ID#/page/#PAGE#/order/#ORDER#/#ASC/DESC#", where #ORDER# is a string ('date', 'modified', 'title'). I get a new idea for the design too, for which I recreated a new arow image, and made some technical change.
Then I started to set ".../category/#ID#" to default link for categories. (In the bootstrap the long link route named as 'category' and the new, default link named 'category_default'.)
Earlier, in the pagination.phtml I was using the next definition of links, for example:
$this->url(array('page' => $this->next))
It was enough to modify the new value of the page. But if we are on the "default" page: ".../category/#ID#", these links are show to the same (".../category/#ID#") page again, so the pagination-buttons are not work. So I have had to modify these links like this:
$this->url(array('page' => $this->next), 'category') which is the longer link, but then instead of value of id, I can see only the next in the link: ":id". For example: ".../category/:id/page/2/order".
So, in this case I have had to add to the url() function the value of id, and the values of ordering too. In the documentations of Zend Framework I could't find any way to pass a variable to the pagination.phtml template. I tried to resolve this some different way, unsuccessfuly. Finally I looked at the source of the paginatinControl() (in Zend_View_Helper_PaginationControl class), and I found the resolution: there is a fourth parameter of this function (of which haven't spoke in the other documentations looked by me), where I can pass the variable. So I could finish the pagination. I rewrote the link showing to the category overview page too.
2010-03-19
Judit: I completed the pagination with ordering, at first it used POST to store page-data, but later I throwed away using POST. Currently we can use this link: /category/id/1/1/1 (the numbers: id, page, order by which field. and there is an optional parameter on the end: asc or desc) I added "first" and "last" links to the pagination.
2010-03-12
Judit: I have extended the category overview page: modified the layout of materials (there are in two columns, in a fixed order), and made a pagination mechanism. We can use the next url: ".../category/id/##/page/##".
2010-03-08
Judit: I finished the ticket #49 with the thumbnails updating. Additionally I made the next changes in the source: The users can edit a material without uploading a new file.
I improved the using of bbcode in Internet Explorer, but there was two matter, which I wasn't able to fix: using of ctrl+b, ctrl+i in IE (when I press a ctrl+b or ctrl+i, the IE give me a new window about managing of favorites. I modified the function, which checks the keypress, it returns with false, but this improvement works only in FF. I tried to use .preventDefault() method too. I can't find on the web any other solution for this yet.), and setting the position of cursor (in IE too), after we inserted a "[startag][endtag]" string.
I implemented some checking of syntax of textarea's value, this source improves the text, so there will not been redundant bbcodes in this, and there will every start-tag is closed, and conversely.
2010-02-23
Judit: After Florian looked at my solution of ticket #37, he asked me to make some improvement and completions. I made these, except the keyboard shurtcuts (ctr+b, ctrl+i) in IE.
I tried to install and use the IE in different ways:
I tried to install wine and ie4linux, but there were problems about it, and it seemed to me, that I can install only the 6.0 or earlier version of IE on this way, so I gave up.
I tried use MoVeS portable in pendrive. I installed the Zend Framework to the pendrive, and I was using it on an another pc. When I looked at the GeoGebraTube page in a browser a got the next error-message:
Fatal error: Call to undefined method Zend_View_Helper_Placeholder_Container_Standalone::append() in E:\WebServ\www\proj\ggbtube\library\GeoGebra\View\Helper\Breadcrumb.php on line 16
I searched for the append() function in the Zend_View_Helper_Placeholder_Container_Standalone class, and in its parents, and couldn't find. So, I wrote pro tempore this function (in the Zend_View_Helper_Placeholder_Container_Standalone class). So, the thumbnail navigation does not work on this system, but I should have done my current task. But it was very slow, so I searched for a different way:
I tried to run windows in Virtual Box. I braked off when I was installing the apache and php: The apache freezed. I searched for the reason of this error long time, but haven't found. Then I tried to use the pendrive with MoWeS on this Virtual Box, and I realised, it's freezing too. So the reason of freesing have not because the installing of php and apache was wrong. Maybe the installation of these is correct, but I don't know yet, why don't works.
I resolved the the ticket #49, except the preview images.
2010-02-15
Judit: The last week I started resolving to make some basic styling capabilities (ticket #37) to comments and material descriptions.
I read some jQuery documentation, and at first I have no idea, how can I resolve this task using jQuery. I searched for some example on the web. I found solutions only for IE and FF. I was spending much time to searching any platform independent solution in jQuery, but I have no found. I looked at for example the source of CKEditor too, but the jQuery source of this editor was unreadable for me.
At first into the phtml files I have wrote only id-s and classes. The other codes are generated by js file. But as realised for me, the relative path of the images are different in the two pages (.../en/material/create and .../en/material/show/id/46#comments). So I wrote the path of images into the form.phtml, and the show.phtml directly.
I must do some testing in IE yet.
2010-02-09
Judit: I finished to resolve the listing all materials of a category.
I rewrite the saveform() method, currently it uses stdClass for the material's data instead of an array, because the breadcrumb navigation hasn't worked earlier while editing or after an error occured, if I was using an array for material's data. But in the CategoryController.php the $this->view->materials has stayed an array, because the PartialLoop needs an array.
I made the links to "category/id/##".
2010-02-05
Judit: I finished the work on getting back the posted data to the input fields when an error occures after posting in the form of material's creating.
In addition the language input became a predefined select list and its values are stored and displayed too.
The processing of the submitted data at the editing and at the creating of material is very similar, so I created a new function in the MaterialController class named saveform(). This function validates the datas of creating and editing material, reads submitted fields and checks if the datas are correct. Upon recieving any invalid input, the function returns the field values to the form, and this will display the error messsage (this calls the var_dump($errors) function) too. Accordingly if the filling of form is incorrect, this function returns with false and if it is correct: the function returns with an array, including the next values: title, description, type, age, array and string of categories, language, type, file, upload.
So saving the form's datas do work now at the editing of materials too. At the same time editing of materials can be saved from now.
I began to create the lists of all materials of a category. I created a controller, a view and a model for this, but it doesn't work as I expected. Now I'm trying to solve this error:
"Fatal error: Class 'CategoryModel' not found in ...application/controllers/CategoryController.php on line 9"
At the same time the CategoryModel.php is in the ...application/models/ folder, and I don't understand yet why this model hasn't been found.
Another thing, of which I must look after is that, how I can use the link in this syntax: 'category/id/##'. Currently I use this: 'category/index/id/##'.
2010-01-25
judit: I began to work on getting back the posted data to the input fields when an error occured after posting in the form of material's creating. I commented out temporarily in the MaterialController.php some rows under "the move files to material folder", because this detail of source not work properly yet, and I don't know create a new material without commenting.
In first step, I want to modify the array created by categoryMultiselect() function (in CategoryMutliselect class). For this I must understand, how can I get in this class the $select_category array which sented by the form.
2010-01-21
judit: I improved my first solution, I rebuilt it by logic of Zend Framework (it don't use a model directly in a view). And the database operations (inserting, reading) are working now too.
The basic steps were:
- I created a CategoryMultiselect.php file (in library/GeoGebra/view/helper/) which makes an array containing all category_id-s, titles and a third parameter: is selected the category or not.
- I created a categoryMultiselect.phtml file (in the application/views/scripts/material/ folder) file in which a PartialLoop helper.
- Into the form.phtml I wrote this: $this->partialLoop('material/categoryMultiselect.phtml', $this->categoryMultiselect())
2010-01-13
judit: I setted a subdomain on my computer for the GeoGebraTube, and it seems, that the site works well now.
In the first version I used the Zend_Form_Element_Multiselect for the visualising of the the categories' multiple selecting.
I commited my first version of the categories' multiple selecting. As later I got to know, my solution wasn't worked by the logic of Zend Framework yet.
2010-01-06
judit: I created the database with importing database.sql, and look at it.
By Florian's instructions about my task, it realised for me, that my installation of GeoGebraTube's prototype is wrong. I couldn't found the form, on which I have had to work. The links, and css are wasn't working on my computer. I started to search the reason of the error. I made sure of that the .phtml files are works well on my computer (it setted in the apache properly). I compared the source with other Zend Framework projects to see the working Zend Framework's, and search documentation about it's using of css. I realised then, that not works the .htaccess neither. I tried to set it (I was editing the /etc/apache2/sites-enabled/default file, I changed the next texts: "AllowOverride None" -> "AllowOverride All", and wrote to consol: a2enmod rewrite... Except these I modify some file, but the others weren't usefully.) After the configuring .htaccess the appearance of site wasn't good yet.
2010-01-04
judit: For the development of GeoGebraTube, in first step I started to become acquainted with using Zend Framework in based.
I installed the prototype of GeoGebraTube at my local server, and looked into the source. As it turned out later, the installation of the prototype wasn't perfect. The file paths are not working on my system, and not find the program the css files too. The database isn't created.
I read the dokumentation on http://geogebra.uni.lu/trac/wiki/GeoGebraTube .
