Moodle
  1. Moodle
  2. MDL-21477

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.8
    • Component/s: Libraries
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      26587

      Description

      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();
      }
      }

        Activity

        Hide
        Dan Poltawski added a comment -

        Thanks Anthony, i've fixed this in CVS by removing the dependency on the files/index.php print_cell function.

        Show
        Dan Poltawski added a comment - Thanks Anthony, i've fixed this in CVS by removing the dependency on the files/index.php print_cell function.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: