);
$fieldNames = array(
+ array(
+ 'name' => 'navigation_name_in_content',
+ 'label' => 'Place the navigation title into page content',
+ 'type' => 'checkbox'
+ ),
array(
'name' => 'site_url',
'label' => 'Site URL',
case 'text':
$callback = 'glmwpimporterRenderText';
break;
+ case 'checkbox':
+ $callback = 'glmwpimporterRenderCheckbox';
+ break;
default:
return false;
break;
include $this->path . 'views/text.php';
}
+ public function glmwpimporterRenderCheckbox($fieldName) {
+ static $options;
+ if (!$options) {
+ $options = get_option(GLM_WP_IMPORT_SETTINGS);
+ }
+ include $this->path . 'views/checkbox.php';
+ }
+
public function glmwpimporter_settings_section_callback()
{
echo __('Database Options', 'wordpress');
private function _displayFile2($file, $filename)
{
- $fileUrl =$this->_options['site_url'] . 'uploads/' . $file;
+ $fileUrl =$this->_options['site_url'] . '/uploads/' . $file;
$fileName = ($filename) ? $filename : $file;
return "\n".'<a href="'.$fileUrl.'">'.$fileName.'</a>';
}
$fileStmt = $this->_dbh->prepare($fileSql);
}
$data = $this->_dbh->query($pageSql)->fetchAll();
- //echo '<pre>' . print_r($data, true) . '</pre>';
- //exit;
foreach ($data as &$page) {
$page['srcs'] = array();
$paraStmt->bindParam(':page', $page['id'], PDO::PARAM_INT);
$paraStmt->execute();
$paragraphs = $paraStmt->fetchAll();
- //echo '<pre>' . print_r($paragraphs, true) . '</pre>';
- //exit;
$primaryAlign = 'right';
$secondaryAlign = 'right';
$alternateImg = false;
$page['pageContent'] = '';
$iterator = 1;
if ($this->_options['toolbox_page_table'] == 'bus_category') {
- $page['pageContent'] .= '<h1>'.$page['category'].'</h1>';
+ if ( $this->_options['navigation_name_in_content'] ) {
+ $page['pageContent'] .= '<h1>'.$page['category'].'</h1>';
+ } else {
+ $page['title'] .= $page['category'];
+ }
++$iterator;
if ($page['image']) {
- //$page['images'][] = $page['image'];
$page['pageContent'] .= $this->_displayImage($page, $primaryAlign);
}
$page['pageContent'] .= $page['description'];
switch ($iterator) {
case 1:
if (isset($paragraph['title']) && $paragraph['title']) {
- $page['pageContent'] .= '<h1>'.$paragraph['title'].'</h1>';
+ if ( $this->_options['navigation_name_in_content'] ) {
+ $page['pageContent'] .= '<h1>'.$paragraph['title'].'</h1>';
+ } else {
+ $page['title'] = $paragraph['title'];
+ }
}
if (isset($paragraph['image']) && $paragraph['image']) {
- //$page['images'][] = $paragraph['image'];
$page['pageContent'] .= $this->_displayImage($paragraph, $primaryAlign);
}
break;
$page['pageContent'] .= '<h2>'.$paragraph['title'].'</h2>';
}
if (isset($paragraph['image']) && $paragraph['image']) {
- //$page['images'][] = $paragraph['image'];
$page['pageContent'] .= $this->_displayImage($paragraph, $secondaryAlign);
}
break;
$align = $secondaryAlign;
}
if (isset($paragraph['image']) && $paragraph['image']) {
- //$page['images'][] = $paragraph['image'];
$page['pageContent'] .= $this->_displayImage($paragraph, $align);
}
break;
}
++$iterator;
}
- //echo '<pre>Files: ' . print_r($page['files'], true) . '</pre>';
}
return $data;
}
if ($page['parent']) {
}
- $pageName = (isset($page['navigation_name']))
- ? $page['navigation_name']
- : $page['category'];
+ if ( $page['title'] ) {
+ $pageName = $page['title'];
+ } else if ( $page['navigation_name'] ) {
+ $pageName = $page['navigation_name'];
+ } else {
+ $pageName = $page['category'];
+ }
// if you don't find the parent page id then use the default given or 0
$parent = isset($this->_post[$page['parent']])
? $this->_post[$page['parent']]
$sql = "
SELECT *
FROM {$this->_options['ckeditor_schema']}.{$this->_options['ckeditor_images_table']}";
-
+
$sql .= " LIMIT $limit OFFSET $offset";
$stmt = $this->_dbh->query($sql);