Update code for files
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 8 Nov 2016 15:23:43 +0000 (10:23 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 8 Nov 2016 15:23:43 +0000 (10:23 -0500)
This now will get files within the page content.

controllers/ToolboxImport.php

index 43e5d6d..db2929a 100644 (file)
         {
             $this->_connect();
             $WHERE = $this->_getWhereSql();
+            $WHERE = " WHERE id = 10";
             $pageSql = "
               SELECT *
                 FROM {$this->_options['toolbox_schema']}.{$this->_options['toolbox_page_table']}
                 $WHERE
             ORDER BY parent,pos";
+            $pageSql .= " LIMIT 1 OFFSET 0";
+            echo '<pre>$pageSql: ' . print_r( $pageSql, true ) . '</pre>';
             //$pageSql .= ($limit) ? " LIMIT $limit OFFSET $offset" : '';
             $pageData = $this->_dbh->query($pageSql)->fetchAll(PDO::FETCH_ASSOC);
             if ($this->_options['toolbox_page_table'] == 'pages') {
                     $fileStmt->execute();
                     while ($file = $fileStmt->fetch()) {
                         echo '<pre>$file: ' . print_r($file, true) . '</pre>';
-                        if ($this->_options['toolbox_files_table'] == 'pages') {
+                        if ($this->_options['toolbox_files_table'] == 'files') {
                             $page['pageContent'] .= $this->_displayFile($file);
                         } else {
                             if ($file['file']) {