Changeset 50

Show
Ignore:
Timestamp:
07/18/07 01:06:54 (18 months ago)
Author:
aarkerio
Message:

Helps added

Location:
trunk/app
Files:
1 added
21 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/entries_controller.php

    r45 r50  
    2626    
    2727   public function rss($user_id) 
    28    { 
     28   {    
     29       $this->Entry->unbindModel(array('hasMany'=>array('Comment'))); 
     30        
    2931       $this->layout    = 'rss'; 
    3032        
    31        $conditions = array("Entry.status"=>1, "Entry.user_id"=>$user_id); 
     33       $conditions      = array("Entry.status"=>1, "Entry.user_id"=>$user_id); 
    3234        
    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"); 
    3436        
    35        $data = $this->Entry->findAll($conditions, $fields, "Entry.created", 10, false, 2); 
     37       $order           = 'Entry.id DESC'; 
    3638        
    37        $this->set('data', $data); 
     39       $limit           = 20; 
     40        
     41       $this->set('data', $this->Entry->findAll($conditions, $fields, $order, $limit)); 
    3842        
    3943   } 
  • trunk/app/controllers/glossaries_controller.php

    r31 r50  
    2424    } 
    2525     
    26  public function listing($catfaq_id) 
     26 public function admin_listing($catfaq_id) 
    2727    { 
    2828        $this->pageTitle = 'FAQs'; 
     
    4848    } 
    4949    
    50  public function edit($id = null) 
    51  { 
     50 public function admin_edit($id = null) 
     51 {   
    5252    $this->layout = 'admin'; 
    5353     
    54     if (empty($this->data)) 
    55     { 
     54    if (empty($this->data["Glossary"])) 
     55    {    
    5656        $this->Glossary->id = $id; 
     57         
    5758        $this->data = $this->Glossary->read(); 
    5859    } 
    5960    else 
    6061    { 
     62        $this->Sanitize = new Sanitize; 
     63         
     64        $this->Sanitize->cleanArray($this->data["Glossary"]); //Hopefully this is enough 
     65         
    6166        if ($this->Glossary->save($this->data['Glossary'])) 
    6267        { 
    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']); 
    6469        } 
    6570    } 
    6671} 
    6772 
    68  public function add($catfaq_id) 
     73 public function admin_add($catfaq_id) 
    6974 { 
    70      
    71      $this->layout = 'admin'; 
     75    $this->layout = 'admin'; 
    7276     
    7377    $this->set('catfaq_id', $catfaq_id); 
    7478     
    75     // adds new classroom to database 
    76       if (!empty($this->params['data'])) 
     79      if (!empty($this->data["Glossary"])) 
    7780      { 
    78         //$this->Sanitize = new Sanitize; 
     81        $this->Sanitize = new Sanitize; 
    7982         
    80         //$this->Sanitize->cleanArray($this->params['data']); //Hopefully this is enough 
     83        $this->Sanitize->cleanArray($this->data["Glossary"]); //Hopefully this is enough 
    8184         
    82         if ($this->Glossary->save($this->params['data'])) 
     85        if ($this->Glossary->save($this->data["Glossary"])) 
    8386        { 
    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); 
    8888        } 
    8989     } 
    9090   } 
    91  public function delete($id, $catfaq_id) 
     91    
     92 public function admin_delete($id, $catfaq_id) 
    9293 { 
    9394    $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); 
    9596 } 
    9697} 
  • trunk/app/controllers/podcasts_controller.php

    r44 r50  
    6060    } 
    6161   
    62   public function all($username=null, $entry_id=null) {    
     62  public function all($username=null, $entry_id=null)  
     63  {      
     64        $this->layout    = 'portal'; 
     65         
    6366        $this->pageTitle = $username . '\'s Podcast'; 
    6467         
     
    8588        $this->set('data', $this->Podcast->findAll($conditions, $fields, $order, $limit, null, true));  
    8689         
    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 
    9091    } 
    9192     
  • trunk/app/controllers/users_controller.php

    r45 r50  
    313313       $this->set('Element', $this->Portal->statics()); // Using Portal component 
    314314        
    315         
    316         
    317315       if (isset($this->data)) 
    318        {  
     316       {   
    319317          $auth_num = $this->othAuth->login($this->data['User']); 
    320318           
     
    347345   } 
    348346    
    349    public function insert() { 
     347   public function insert()  
     348   { 
    350349     
    351350    $this->layout = 'ajax'; 
     
    384383    } 
    385384     
    386     if (strpos($this->data['User']['passwd'], ' '))  // nos spaces 
     385    if (strpos($this->data['User']['passwd'], ' '))  // pwd too short 
    387386    { 
    388387       $message['username_spaces'] = "Your password should not contain spaces"; 
  • trunk/app/controllers/webquests_controller.php

    r31 r50  
    77//loadModel('User'); 
    88 
     9uses('sanitize'); 
     10 
    911class WebquestsController extends AppController { 
    1012    
    1113   public $helpers     = array('Ajax', 'Form', 'Fck'); 
     14    
     15   public $components  = array('Security', 'Mypagination'); 
    1216    
    1317   public function view($username=null, $entry_id=null) 
     
    4145    } 
    4246     
    43     public function listing() 
     47    public function admin_listing() 
    4448    {    
    4549        $this->pageTitle = $this->othAuth->user('username') . '\'s Webquests'; 
     
    5256        $limit        = 12; 
    5357         
    54         $this->set('data', $this->Webquest->findAll($conditions, $fields, $order, $limit, null, 1));  
     58        $this->set('data', $this->Webquest->findAll($conditions, $fields, $order, $limit));  
    5559    } 
    5660     
    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); 
    5986     
    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/'); 
    9088  } 
    9189} 
  • trunk/app/views/elements/menu_b.thtml

    r41 r50  
    44   <a class="nav" href="/users/directory/" title="Directory">Directory</a> 
    55   <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> 
    77</div> 
  • trunk/app/views/entries/rss.thtml

    r1 r50  
    44   <link><?php echo $_SERVER['SERVER_NAME'] ?></link> 
    55   <description>edublog</description> 
    6    <language><?php echo $data[0]["User"]["lang"] ?></language> 
     6   <language>en</language> 
    77 
    88<?php 
    9 //entries 
    10 //die(var_dump($data[0]["User"]["Entry"]));  
     9/// die(var_dump($data));  
    1110 
    12 foreach ($data[0]["User"]["Entry"] as $val) {  // entries  
     11foreach ($data as $v)  
     12 
    1313     
    14     foreach ($val as $key=>$v) {  // each entry 
    15      
    16     $body   = substr($v['body'],0,300) . "..."; 
     14    $body   = substr($v["Entry"]['body'],0,300) . "..."; 
    1715?> 
    1816 <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> 
    2220         <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> 
    2725    </item> 
    28 <?php } ?>  
     26<?php } ?>  
    2927 
    3028</channel> 
  • trunk/app/views/events/calendar.thtml

    r49 r50  
    1  
    2 <div id ="calendar"> 
    31 
    42<?php 
    5  
    6 echo "&lt;b&gt;".$dts['Month']."&lt;/b&gt;"; 
     3echo '<div id="lloquer">&lt;'.$dts['Month'].'&gt;</div>'; 
     4echo '<div id="calendar">'; 
    75echo $dts['Display']; 
    8  
    96?> 
    107</div> 
  • trunk/app/views/helpers/gags.php

    r45 r50  
    4040   } 
    4141    
    42    public function setImages() { 
     42  public function setImages()  
     43  { 
    4344      $img  = '<p style="text-align:right;width:150px;float:right">'; 
    4445      $img .= $this->Html->link($this->Html->image('admin/myimages.jpg', array("alt"=>"My Images", "title"=>"My Images")), '#',  
    4546              array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, null,false); 
    4647      $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  
    5056} 
  • trunk/app/views/helpers/oth_auth.php

    r1 r50  
    149149 
    150150} 
    151 ?>  
     151?> 
  • trunk/app/views/layouts/admin.thtml

    r45 r50  
    1212<!-- Jaws.com.mx Style and CSS --> 
    1313  <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> 
    1428     <h1><a href="/admin/entries/start">Karamelo: Control Panel</a></h1> 
    1529     <p>e-Learning platform</p> 
     30     <!--help image --> 
    1631  </div> 
    1732 
  • 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  
    7676                    <a href="/lessons/portfolio/<?php echo $blog[0]["User"]["id"] ?>">Portfolio<span class="tab-l"></span><span class="tab-r"></span></a></li>  
    7777                      
    78                     <?php echo ($url == 'users/abou') ? '<li id="active">' : '<li>'; ?>  
     78                    <?php echo ($url == 'users/abou') ? '<li id="active">' : '<li>'; ?> 
    7979                    <a href="/users/about/<?php echo $blog[0]["User"]["id"] ?>">About Me<span class="tab-l"></span><span class="tab-r"></span></a></li>  
    8080                          
    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 
    8384                </ul>  
    8485                <hr class="noscreen" />  
  • trunk/app/views/podcasts/admin_add.thtml

    r47 r50  
    1 <?= $javascript->link('myfunctions'); ?> 
     1<?php echo $javascript->link('myfunctions'); ?> 
    22<?php echo $html->addCrumb('Control Tools', '/admin/entries/start'); ?>  
    33<?php echo $html->addCrumb('Podcasts', '/admin/podcasts/listing'); ?>  
     
    4343<br /><br /> 
    4444</p> 
    45   
    46   <p> 
     45 <p> 
    4746     <?php echo $form->labelTag('Podcast/title', 'Title:' );?><br /> 
    4847     <?php echo $html->input('Podcast/title', array("size" => 25, "maxlength" => 50, "class"=>"formas")); ?> 
    4948     <br /><br /> 
    50   </p> 
    51   <p> 
     49</p> 
     50<p> 
    5251    <?php echo $form->labelTag('Podcast/description', 'Description:' );?><br /> 
    5352    <?php echo $html->textarea('Podcast/description', array("rows"=>10, "cols"=>40)) ?> 
  • trunk/app/views/users/alumni.thtml

    r1 r50  
    44<h1>Alumni</h1> 
    55<table class="main_table"> 
    6  
    76  <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> 
    179</table> 
  • trunk/app/views/users/blog.thtml

    r42 r50  
    1313    echo '<p><a class="pl" href="/users/entry/'.$val["User"]["username"].'/'.$val['Entry']['id'].'">'.$pl.'</a></p>'; 
    1414     
    15     echo '<hr />'; 
    16      
    1715    if ( $val['Entry']['discution'] == 1)  //is the comments in this entry actived and is an individual entry? 
    1816    { 
    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\">&gt;&gt;</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 />'; 
    6220} 
    6321?> 
  • trunk/app/views/users/karanet.thtml

    r1 r50  
    66<tr> <td colspan="2"> 
    77KaraNet&copy; 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(); ?> 
    810</td></tr> 
    911 
  • trunk/app/views/users/parents.thtml

    r1 r50  
    66 
    77<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(); ?> 
    3810</td></tr> 
    3911 
  • trunk/app/views/webquests/admin_add.thtml

    r18 r50  
    44<div class="spaced"> 
    55 
    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'); ?>  
    88<?php echo $html->getCrumbs(' / '); ?> 
    99 
    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