Changeset 50
- Timestamp:
- 07/18/07 01:06:54 (18 months ago)
- Location:
- trunk/app
- Files:
-
- 1 added
- 21 modified
-
controllers/entries_controller.php (modified) (1 diff)
-
controllers/glossaries_controller.php (modified) (2 diffs)
-
controllers/podcasts_controller.php (modified) (2 diffs)
-
controllers/users_controller.php (modified) (3 diffs)
-
controllers/webquests_controller.php (modified) (3 diffs)
-
views/elements/menu_b.thtml (modified) (1 diff)
-
views/entries/rss.thtml (modified) (1 diff)
-
views/events/calendar.thtml (modified) (1 diff)
-
views/helpers/gags.php (modified) (1 diff)
-
views/helpers/oth_auth.php (modified) (1 diff)
-
views/layouts/admin.thtml (modified) (1 diff)
-
views/layouts/rss.thtml (modified) (1 diff)
-
views/layouts/rubyx.thtml (modified) (1 diff)
-
views/podcasts/admin_add.thtml (modified) (2 diffs)
-
views/users/alumni.thtml (modified) (1 diff)
-
views/users/blog.thtml (modified) (1 diff)
-
views/users/karanet.thtml (modified) (1 diff)
-
views/users/parents.thtml (modified) (1 diff)
-
views/webquests/admin_add.thtml (modified) (3 diffs)
-
views/webquests/admin_listing.thtml (modified) (1 diff)
-
webroot/css/styles.css (modified) (1 diff)
-
webroot/img/static/construction.jpg (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/entries_controller.php
r45 r50 26 26 27 27 public function rss($user_id) 28 { 28 { 29 $this->Entry->unbindModel(array('hasMany'=>array('Comment'))); 30 29 31 $this->layout = 'rss'; 30 32 31 $conditions = array("Entry.status"=>1, "Entry.user_id"=>$user_id);33 $conditions = array("Entry.status"=>1, "Entry.user_id"=>$user_id); 32 34 33 $fields = array("id", "title", "body", "created", "subject_id", "user_id");35 $fields = array("Entry.id", "Entry.title", "Entry.created", "Entry.body", "Entry.subject_id", "Entry.user_id", "User.username"); 34 36 35 $ data = $this->Entry->findAll($conditions, $fields, "Entry.created", 10, false, 2);37 $order = 'Entry.id DESC'; 36 38 37 $this->set('data', $data); 39 $limit = 20; 40 41 $this->set('data', $this->Entry->findAll($conditions, $fields, $order, $limit)); 38 42 39 43 } -
trunk/app/controllers/glossaries_controller.php
r31 r50 24 24 } 25 25 26 public function listing($catfaq_id)26 public function admin_listing($catfaq_id) 27 27 { 28 28 $this->pageTitle = 'FAQs'; … … 48 48 } 49 49 50 public function edit($id = null)51 { 50 public function admin_edit($id = null) 51 { 52 52 $this->layout = 'admin'; 53 53 54 if (empty($this->data ))55 { 54 if (empty($this->data["Glossary"])) 55 { 56 56 $this->Glossary->id = $id; 57 57 58 $this->data = $this->Glossary->read(); 58 59 } 59 60 else 60 61 { 62 $this->Sanitize = new Sanitize; 63 64 $this->Sanitize->cleanArray($this->data["Glossary"]); //Hopefully this is enough 65 61 66 if ($this->Glossary->save($this->data['Glossary'])) 62 67 { 63 $this-> flash('Your faq has been updated.','/faqs/listing/'.$this->data['Glossary']['catfaq_id']);68 $this->msgFlash('Glossary has been updated.','/admin/glossaries/listing/'.$this->data['Glossary']['catfaq_id']); 64 69 } 65 70 } 66 71 } 67 72 68 public function ad d($catfaq_id)73 public function admin_add($catfaq_id) 69 74 { 70 71 $this->layout = 'admin'; 75 $this->layout = 'admin'; 72 76 73 77 $this->set('catfaq_id', $catfaq_id); 74 78 75 // adds new classroom to database 76 if (!empty($this->params['data'])) 79 if (!empty($this->data["Glossary"])) 77 80 { 78 //$this->Sanitize = new Sanitize;81 $this->Sanitize = new Sanitize; 79 82 80 //$this->Sanitize->cleanArray($this->params['data']); //Hopefully this is enough83 $this->Sanitize->cleanArray($this->data["Glossary"]); //Hopefully this is enough 81 84 82 if ($this->Glossary->save($this-> params['data']))85 if ($this->Glossary->save($this->data["Glossary"])) 83 86 { 84 //$this->set('data', $this->Catfaq->index()); 85 $this->flash('Your Question has been saved.','/faqs/listing/'.$catfaq_id); 86 87 //$this->render('todo', 'ajax'); 87 $this->msgFlash('Your Question has been saved.','/admin/glossaries/listing/'.$catfaq_id); 88 88 } 89 89 } 90 90 } 91 public function delete($id, $catfaq_id) 91 92 public function admin_delete($id, $catfaq_id) 92 93 { 93 94 $this->Glossary->del($id); 94 $this-> flash('The Q/A with id: '.$id.' has been deleted.', '/faqs/listing/'.$catfaq_id);95 $this->msgFlash('Glossary has been deleted.', '/admin/glossaries/listing/'.$catfaq_id); 95 96 } 96 97 } -
trunk/app/controllers/podcasts_controller.php
r44 r50 60 60 } 61 61 62 public function all($username=null, $entry_id=null) { 62 public function all($username=null, $entry_id=null) 63 { 64 $this->layout = 'portal'; 65 63 66 $this->pageTitle = $username . '\'s Podcast'; 64 67 … … 85 88 $this->set('data', $this->Podcast->findAll($conditions, $fields, $order, $limit, null, true)); 86 89 87 $this->set('subjects', $this->Portal->cms()); // Using Portal component 88 89 $this->set('randomQuote', $this->Portal->quote()); // quote footer 90 $this->set('Element', $this->Portal->statics()); // Using Portal component 90 91 } 91 92 -
trunk/app/controllers/users_controller.php
r45 r50 313 313 $this->set('Element', $this->Portal->statics()); // Using Portal component 314 314 315 316 317 315 if (isset($this->data)) 318 { 316 { 319 317 $auth_num = $this->othAuth->login($this->data['User']); 320 318 … … 347 345 } 348 346 349 public function insert() { 347 public function insert() 348 { 350 349 351 350 $this->layout = 'ajax'; … … 384 383 } 385 384 386 if (strpos($this->data['User']['passwd'], ' ')) // nos spaces385 if (strpos($this->data['User']['passwd'], ' ')) // pwd too short 387 386 { 388 387 $message['username_spaces'] = "Your password should not contain spaces"; -
trunk/app/controllers/webquests_controller.php
r31 r50 7 7 //loadModel('User'); 8 8 9 uses('sanitize'); 10 9 11 class WebquestsController extends AppController { 10 12 11 13 public $helpers = array('Ajax', 'Form', 'Fck'); 14 15 public $components = array('Security', 'Mypagination'); 12 16 13 17 public function view($username=null, $entry_id=null) … … 41 45 } 42 46 43 public function listing()47 public function admin_listing() 44 48 { 45 49 $this->pageTitle = $this->othAuth->user('username') . '\'s Webquests'; … … 52 56 $limit = 12; 53 57 54 $this->set('data', $this->Webquest->findAll($conditions, $fields, $order, $limit , null, 1));58 $this->set('data', $this->Webquest->findAll($conditions, $fields, $order, $limit)); 55 59 } 56 60 57 public function add() 58 { 61 public function admin_add() 62 { 63 64 $this->layout = 'admin'; 65 // adds new blog entries 66 if ( !empty($this->data["Webquest"]) ) 67 { 68 $this->Sanitize = new Sanitize; 69 70 $this->Sanitize->cleanArray($this->data["Webquest"]); //Hopefully this is enough 71 72 if ($this->Webquest->save($this->data["Webquest"])) 73 { 74 $this->msgFlash('Webquest has been registered', '/admin/webquests/listing'); 75 } 76 else 77 { 78 $this->msgFlash('Database error!', '/admin/webquests/listing'); 79 } 80 } 81 } 82 83 public function admin_delete($id, $catfaq_id) 84 { 85 $this->Webquest->del($id); 59 86 60 $this->layout = 'admin'; 61 // adds new blog entries 62 if ( empty($this->params['data']) ) 63 { 64 65 $conditions = array("Webquest.user_id" => $this->othAuth->user('id')); 66 67 $fields = array("id", "title", "introduction", "conclusion", "created"); 68 69 $data = $this->Webquest->findAll($conditions, $fields, null, null, null, false); 70 71 $this->set('data', $data); 72 73 //$this->render(); 74 } 75 else 76 { 77 78 //$this->Sanitize = new Sanitize; 79 80 //$this->Sanitize->cleanArray($this->params['data']); //Hopefully this is enough 81 82 83 if ($this->Webquest->save($this->params['data'])) 84 { 85 $this->flash('Your entry have been registered', '/webquests/listing'); 86 } else { 87 $this->flash('Database error!', '/webquests/listing'); 88 } 89 } 87 $this->msgFlash('Webquest has been deleted.', '/admin/webquests/listing/'); 90 88 } 91 89 } -
trunk/app/views/elements/menu_b.thtml
r41 r50 4 4 <a class="nav" href="/users/directory/" title="Directory">Directory</a> 5 5 <a class="nav" href="/newsletters/subscribe/" title="Newsletter">Newsletters</a> 6 <a class="nav" href="/events/ view/" title="Coming soon">Events Calendar</a>6 <a class="nav" href="/events/calendar/" title="Coming soon">Events Calendar</a> 7 7 </div> -
trunk/app/views/entries/rss.thtml
r1 r50 4 4 <link><?php echo $_SERVER['SERVER_NAME'] ?></link> 5 5 <description>edublog</description> 6 <language> <?php echo $data[0]["User"]["lang"] ?></language>6 <language>en</language> 7 7 8 8 <?php 9 //entries 10 //die(var_dump($data[0]["User"]["Entry"])); 9 /// die(var_dump($data)); 11 10 12 foreach ($data[0]["User"]["Entry"] as $val) { // entries 11 foreach ($data as $v) 12 { 13 13 14 foreach ($val as $key=>$v) { // each entry 15 16 $body = substr($v['body'],0,300) . "..."; 14 $body = substr($v["Entry"]['body'],0,300) . "..."; 17 15 ?> 18 16 <item> 19 <title><?php echo $v[ 'title']; ?></title>20 <link><?php echo $_SERVER['SERVER_NAME'] ?>/ entries/show/<?php echo $v['user_id']; ?>/<?php echo $v['id'] ?></link>21 <comments><?php echo $_SERVER['SERVER_NAME'] ?>/ entries/show/<?php echo $v['user_id']; ?>/<?php echo $v['id'] ?></comments>17 <title><?php echo $v["Entry"]['title']; ?></title> 18 <link><?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></link> 19 <comments><?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></comments> 22 20 <description><![CDATA['<?php echo $body ?>']]></description> 23 <pubDate><?php echo $v[ 'created'] ?></pubDate>24 <creator><?php echo $v[ 'created'] ?></creator>25 <category><?php echo $v[ 'category_id']; ?></category>26 <guid><?php echo $_SERVER['SERVER_NAME'] ?>/ entries/show/<?php echo $v['user_id']; ?>/<?php echo $v['id'] ?></guid>21 <pubDate><?php echo $v["Entry"]['created'] ?></pubDate> 22 <creator><?php echo $v["Entry"]['created'] ?></creator> 23 <category><?php echo $v["Entry"]['subject_id']; ?></category> 24 <guid><?php echo $_SERVER['SERVER_NAME'] ?>/users/entry/<?php echo $v["User"]['username']; ?>/<?php echo $v["Entry"]['id'] ?></guid> 27 25 </item> 28 <?php } }?>26 <?php } ?> 29 27 30 28 </channel> -
trunk/app/views/events/calendar.thtml
r49 r50 1 2 <div id ="calendar">3 1 4 2 <?php 5 6 echo "<b>".$dts['Month']."</b>";3 echo '<div id="lloquer"><'.$dts['Month'].'></div>'; 4 echo '<div id="calendar">'; 7 5 echo $dts['Display']; 8 9 6 ?> 10 7 </div> -
trunk/app/views/helpers/gags.php
r45 r50 40 40 } 41 41 42 public function setImages() { 42 public function setImages() 43 { 43 44 $img = '<p style="text-align:right;width:150px;float:right">'; 44 45 $img .= $this->Html->link($this->Html->image('admin/myimages.jpg', array("alt"=>"My Images", "title"=>"My Images")), '#', 45 46 array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, null,false); 46 47 $img .= '</p>'; 47 return $img; 48 } 49 48 return $img; 49 } 50 51 public function construction() 52 { 53 return '<p align="center">' . $this->Html->image('static/construction.jpg', array("alt"=>"Under construction", "title"=>"Under construction")) . '</p>'; 54 } 55 50 56 } -
trunk/app/views/helpers/oth_auth.php
r1 r50 149 149 150 150 } 151 ?> 151 ?> -
trunk/app/views/layouts/admin.thtml
r45 r50 12 12 <!-- Jaws.com.mx Style and CSS --> 13 13 <div id="header"> 14 <div style="position:absolute;top:15px;left:800px"> 15 <?php 16 $o = str_replace('/', '-', $_SERVER['REQUEST_URI']); 17 18 $path = '/admin/helps/display/' . $o; 19 20 $t="javascript:window.open('".$path."', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=400')"; 21 22 echo $html->link($html->image('admin/help.gif', array("alt"=>"Help", "title"=>"Help", "class"=>"helping")), 23 '#header', 24 array("onclick"=>$t), 25 null, false); 26 ?> 27 </div> 14 28 <h1><a href="/admin/entries/start">Karamelo: Control Panel</a></h1> 15 29 <p>e-Learning platform</p> 30 <!--help image --> 16 31 </div> 17 32 -
trunk/app/views/layouts/rss.thtml
r1 r50 1 <?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"; ?> 2 <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" 3 "http://my.netscape.com/publish/formats/rss-0.91.dtd"> 4 5 <?php echo $content_for_layout; ?> 1 <?php header("Content-type: text/xml"); echo '<?xml version="1.0" encoding="UTF-8" ?>'; echo $content_for_layout; ?> -
trunk/app/views/layouts/rubyx.thtml
r44 r50 76 76 <a href="/lessons/portfolio/<?php echo $blog[0]["User"]["id"] ?>">Portfolio<span class="tab-l"></span><span class="tab-r"></span></a></li> 77 77 78 <?php echo ($url == 'users/abou') ? '<li id="active">' : '<li>'; ?> 78 <?php echo ($url == 'users/abou') ? '<li id="active">' : '<li>'; ?> 79 79 <a href="/users/about/<?php echo $blog[0]["User"]["id"] ?>">About Me<span class="tab-l"></span><span class="tab-r"></span></a></li> 80 80 81 <?php echo ($url == 'messages/c') ? '<li id="active">' : '<li>'; ?> 82 <a href="/messages/message/<?php echo $blog[0]["User"]["id"] ?>">Contact<span class="tab-l"></span><span class="tab-r"></span></a></li> 81 <?php echo ($url == 'messages/c') ? '<li id="active">' : '<li>'; ?> 82 <a href="/messages/message/<?php echo $blog[0]["User"]["id"] ?>">Contact<span class="tab-l"></span><span class="tab-r"></span></a></li> 83 83 84 </ul> 84 85 <hr class="noscreen" /> -
trunk/app/views/podcasts/admin_add.thtml
r47 r50 1 <? =$javascript->link('myfunctions'); ?>1 <?php echo $javascript->link('myfunctions'); ?> 2 2 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?> 3 3 <?php echo $html->addCrumb('Podcasts', '/admin/podcasts/listing'); ?> … … 43 43 <br /><br /> 44 44 </p> 45 46 <p> 45 <p> 47 46 <?php echo $form->labelTag('Podcast/title', 'Title:' );?><br /> 48 47 <?php echo $html->input('Podcast/title', array("size" => 25, "maxlength" => 50, "class"=>"formas")); ?> 49 48 <br /><br /> 50 </p>51 <p>49 </p> 50 <p> 52 51 <?php echo $form->labelTag('Podcast/description', 'Description:' );?><br /> 53 52 <?php echo $html->textarea('Podcast/description', array("rows"=>10, "cols"=>40)) ?> -
trunk/app/views/users/alumni.thtml
r1 r50 4 4 <h1>Alumni</h1> 5 5 <table class="main_table"> 6 7 6 <tr> <td colspan="2"> 8 <h1><?php echo $cover[0]['Cover']['title']; ?></h1> 9 <?php echo $cover[0]['Cover']['body']; ?> 10 </td></tr> 11 12 <tr> <td> Arriving</td> <td>Studying</td></tr> 13 <tr><td> </td> <td> </td></tr> 14 15 <tr><td> Having fun </td> <td> Support</td></tr> 16 <tr><td> </td> <td> </td></tr> 7 <?php echo $gags->construction(); ?> 8 </td></tr> 17 9 </table> -
trunk/app/views/users/blog.thtml
r42 r50 13 13 echo '<p><a class="pl" href="/users/entry/'.$val["User"]["username"].'/'.$val['Entry']['id'].'">'.$pl.'</a></p>'; 14 14 15 echo '<hr />';16 17 15 if ( $val['Entry']['discution'] == 1) //is the comments in this entry actived and is an individual entry? 18 16 { 19 if ( !$othAuth->sessionValid() ) // if user logged, anchor to textarea 20 { 21 echo "<div id=\"comments\">Comments:<br />"; 22 } 23 else 24 { 25 echo "<div id=\"comments\">Comments:<a href=\"#new_comment\">>></a><br />"; 26 } 27 28 $k = 1; 29 30 foreach ($data[0]['Comment'] as $val) 31 { 32 echo '<p>' . $k++ . '.-' . $val['comment'] . '<br />'; 33 echo '<b>Comment by ' . $html->link($val["User"]["username"], '/users/about/'.$val["User"]["username"]) . '</b> <span class="small">'. $val['created'] . '</span></p>'; 34 35 36 //echo $val["User"]["username"]; 37 } 38 echo "</div><div>"; 39 40 echo $html->formTag('/comments/add/','post', array("onsubmit"=>"return validatecode()")); 41 ?> 42 43 <fieldset> 44 <legend>New Comment</legend> 45 <?php 46 echo $html->hiddenTag('Comment/user_id', $othAuth->user('id')); 47 echo $html->hiddenTag('Comment/entry_id', $val['Entry']['id']); 48 echo $html->hiddenTag('Comment/username', $val['User']['username']); 49 ?> 50 <p> 51 <?php echo $form->labelTag('Comment/comment', 'Message:' );?><br /> 52 <?php echo $html->textarea('Comment/comment', array("rows" => 10, "cols" => 50)); ?> 53 <?php echo $html->tagErrorMsg('Comment/comment', 'A comment is required.'); ?> 54 </p> 55 <br /> 56 <?php echo $html->submit('Send') ?> 57 </fieldset> 58 </form> 59 <?php 60 echo "</div>"; 61 } 17 echo '<p>' . $html->link('Add comment '. count($val['Comment']), '/users/entry/'.$val["User"]["username"].'/'.$val['Entry']['id']) . '</p>'; 18 } 19 echo '<hr />'; 62 20 } 63 21 ?> -
trunk/app/views/users/karanet.thtml
r1 r50 6 6 <tr> <td colspan="2"> 7 7 KaraNet© is an educative world wide elements network, an educative element are also known as <i>EDI</i>. You can create your owns EDIs and share it around the world puting in the KaraNet, also you can get and use an EDI created by another teacher on other zone of the world. 8 <br /> 9 <?php echo $gags->construction(); ?> 8 10 </td></tr> 9 11 -
trunk/app/views/users/parents.thtml
r1 r50 6 6 7 7 <tr><td colspan="2"> 8 9 <h2>Parents. Stay informed:</h2> 10 <h4><?php echo $cover[0]['Cover']['title']; ?></h4> 11 <?php echo $cover[0]['Cover']['body']; ?> 12 </td></tr> 13 14 15 <tr><td id="tit_dyk">Calendar</td> <td id="tit_poll">College Parents Association</td></tr> 16 17 <tr><td style="padding:3px;width:300px;vertical-align:top;"> 18 19 </td> 20 <td style="padding:3px;width:300px;vertical-align:top;"> 21 Activities 22 23 </tr> 24 <tr><td colspan="2"> 25 26 <div style="background-color:#e2dfdf;padding:8px"> 27 28 <?php echo $html->formTag('/messages/question/', 'post', array("onsubmit"=>"return validatesearch();")); ?> 29 <fieldset> 30 <legend>Ask a Question:</legend> 31 <?php echo $html->input('Message/terms', array("size" => 30, "value" => "My Question", "maxlength" => 90, 32 "onblur" => "if(this.value=='') this.value='My Question';\" onfocus=\"if(this.value=='My Question') this.value='';\"")); ?> 33 <br /><br /> 34 <?php echo $html->submit('Send'); ?> 35 </fieldset> 36 </form> 37 </div> 8 <h2>Parents. Stay informed:</h2> 9 <?php echo $gags->construction(); ?> 38 10 </td></tr> 39 11 -
trunk/app/views/webquests/admin_add.thtml
r18 r50 4 4 <div class="spaced"> 5 5 6 <?php echo $html->addCrumb('Control Tools', '/ entries/index'); ?>7 <?php echo $html->addCrumb('Webquest', '/ webquests/listing'); ?>6 <?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?> 7 <?php echo $html->addCrumb('Webquest', '/admin/webquests/listing'); ?> 8 8 <?php echo $html->getCrumbs(' / '); ?> 9 9 10 <!--help image --> 11 <p style="text-align:right;"> 12 <?php echo $html->link($html->image('admin/help.gif', array("alt"=>"Help", "title"=>"Help")), '#', array("onclick"=>"javascript:window.open('/helpers/webquests', 'blank', 'toolbar=no, scrollbars=yes,width=400,height=300')"), null, false) ?> 13 </p> 14 15 <?php echo $html->formTag('/webquests/add/','post', array("onsubmit"=>"return validateEntry()")); ?> 10
