Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-21477

moodlelib.php unzip_show_status() calls undefined function print_cell()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.9.8
    • 1.9.7
    • Libraries
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE
    • Easy

      tal error: Call to undefined function print_cell() in /fs2/www/html/ajf425/moodle/lib/moodlelib.php on line 7775

      I've fixed the code locally as follows

      function unzip_show_status($list, $removepath, $removepath2) {
      //This function shows the results of the unzip execution
      //depending of the value of the $CFG->zip, results will be
      //text or an array of files.

      global $CFG;

      if (empty($CFG->unzip)) { // Use built-in php-based zip function
      $strname = get_string("name");
      $strsize = get_string("size");
      $strmodified = get_string("modified");
      $strstatus = get_string("status");
      echo "<table width=\"640\">";
      echo "<tr><th class=\"header\" scope=\"col\">$strname</th>";
      echo "<th class=\"header\" align=\"right\" scope=\"col\">$strsize</th>";
      echo "<th class=\"header\" align=\"right\" scope=\"col\">$strmodified</th>";
      echo "<th class=\"header\" align=\"right\" scope=\"col\">$strstatus</th></tr>";
      foreach ($list as $item) {
      echo "<tr>";
      $item['filename'] = str_replace(cleardoubleslashes($removepath).'/', "", $item['filename']);
      $item['filename'] = str_replace(cleardoubleslashes($removepath2).'/', "", $item['filename']);
      //print_cell("left", s(clean_param($item['filename'], PARAM_PATH)));
      echo '<td align="left">'.s(clean_param($item['filename'], PARAM_PATH)).'</td>';

      if (! $item['folder'])

      { //print_cell("right", display_size($item['size'])); echo '<td align="right">'.display_size($item['size']).'</td>'; }

      else

      { echo "<td> </td>"; }

      $filedate = userdate($item['mtime'], get_string("strftimedatetime"));
      //print_cell("right", $filedate);
      //print_cell("right", $item['status']);
      echo '<td align="right">'.$filedate.'</td>';
      echo '<td align="right">'.$item['status'].'</td>';
      echo "</tr>";
      }
      echo "</table>";

      } else { // Use external zip program
      print_simple_box_start("center");
      echo "<pre>";
      foreach ($list as $item)

      { $item = str_replace(cleardoubleslashes($removepath.'/'), '', $item); $item = str_replace(cleardoubleslashes($removepath2.'/'), '', $item); echo s($item).'<br />'; }

      echo "</pre>";
      print_simple_box_end();
      }
      }

            poltawski Dan Poltawski
            anthonyforth Anthony Forth (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.