Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Nedeľa, 29. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  "Refresh" button

phpMyEdit Features     "Refresh" button
Odoslať novú tému   Odpovedať na tému    
 
gimbus109     Založený: 31.07.2004   Príspevky: 6   Bydlisko: poland
Príspevok Zaslal: 2004-09-03 16:02
Návrat hore  Odpovedať s citátom     

Hello!
I've made a little modification to phpMyEdit.class.php v1.147. Mayby it will be useful for somebody...
The goal was to have an opportunity to refresh the contents of a grid on a screen while using frames. Clicking "refresh" browser button drives an application to the initial state (or you have to use some session variables etc). With this patch I can refresh only the contents of the desired frame and some alements (links, buttons etc) manually added to the template are displayed correctly after refresh. It could be useful for example when some actions performed by the user in one frame makes changes to the contents displayed in the other frame

Here is a bit modified code of the htmlSubmit function:
Kód:

   function htmlSubmit($name, $label, $css_class_name, $js_validation = true, $disabled = false, $js_submit = false) /* {{{ */
   {
      // Note that <input disabled> isn't valid HTML, but most browsers support it
      $markdisabled = $disabled ? ' disabled' : '';
      $ret = '<input'.$markdisabled.' type="submit" class="'.$css_class_name
         .'" name="'.ltrim($markdisabled).$name
         .'" value="'.(isset($this->labels[$label]) ? $this->labels[$label] : $label);
      if ($js_submit) {
         if ($js_validation) {
             $ret .= '" onClick="return phpMyEdit_form_control(this.form);';
         }
         else {
             $ret .= '" onClick="return this.form.submit();';
         }
      }
      $ret .= '">';
      return $ret;
   } /* }}} */


And one line added to the display_list_table_buttons function:
Kód:


   function display_list_table_buttons($total_recs, $position) /* {{{ */
.......
      if ($this->add_enabled()) {
         echo $this->htmlSubmit('operation', 'Add', $this->getCSSclass('add', $position), false, false), '&nbsp;';
      }
// <!-- added
      echo $this->htmlSubmit('navop', 'Refresh', $this->getCSSclass('add', $position), false, false, true), '&nbsp;';
// added --!>
      if ($this->nav_buttons()) {
         if ($this->view_enabled()) {
            echo $this->htmlSubmit('operation', 'View', $this->getCSSclass('view', $position), false, !$total_recs), '&nbsp;';

It seems it works OK, but maybe I've missed something.
Pawel

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov