Updating for some older toolboxes.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 19 Apr 2017 18:31:07 +0000 (14:31 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 19 Apr 2017 18:31:07 +0000 (14:31 -0400)
When toolbox had an intro field.

controllers/ToolboxImport.php

index 573b4eb..26b57da 100644 (file)
                     if ( $this->_options['navigation_name_in_content'] ) {
                         $page['pageContent'] .= '<h2>'.$page['category'].'</h2>';
                     } else {
-                        $page['title'] .= $page['category'];
+                        $page['title'] = $page['category'];
+                        if ( isset( $page['intro'] ) ) {
+                            $page['pageContent'] .= '<h2>'.$page['intro'].'</h2>';
+                        }
                     }
                     ++$iterator;
                     if ($page['image']) {
                             if ( $this->_options['navigation_name_in_content'] ) {
                                 $page['pageContent'] .= '<h2>'.$paragraph['title'].'</h2>';
                             } else {
-                                $page['title'] = $paragraph['title'];
+                                if ($this->_options['toolbox_page_table'] == 'pages') {
+                                    $page['title'] = $paragraph['title'];
+                                }
                             }
                         }
                         if (isset($paragraph['image']) && $paragraph['image']) {
                 $stmt = $this->_dbh->query($sql);
                 while ($row = $stmt->fetch()) {
                     echo '<pre>' . print_r($row, true) . '</pre>';
-                    $filePath  = (isset($this->_options['site_uses_ht_images']) && $this->_options['site_uses_ht_images'])
+                    $filePath  = (isset($this->_options['site_uses_ht_images']) && $this->_options['site_uses_ht_images'] ||
+                        preg_match( '%uploads$%', $this->_options['toolbox_files_url'] ))
                         ? $this->_options['toolbox_files_url']
                         : $this->_options['toolbox_image_url'] . '/_ORIGINAL_/';
                     echo '<pre>$filePath: ' . print_r( $filePath, true ) . '</pre>';