<?php // no direct access defined('PARENT_FILE') or die('Restricted access'); if ($this->authorize()) { $doc = new HTML_Element(); $sql = "\n\t\tSELECT page_id, page, mdate\n\t\tFROM " . $this->registry->core . "pages\n\t"; $result = $this->registry->db->query($sql); $num_pages = count($result); $menuBar = array('new_page' => '/' . $this->registry->component . '/new'); $this->content .= $num_pages <= $this->registry->settings['pages'] || $this->registry->settings['pages'] == -1 ? $this->makeToolbar($menuBar, 24) : $this->message(array('TYPE' => 'info', 'MESSAGE' => '<h2>You have reach your page limit. To add more pages please contact your administrator.</h2>')); if ($num_pages > 0) { $c = 0; $data = array(); foreach ($result as $row) { $data[$c] = array($row->page, $row->mdate, '<a href="/' . $this->registry->component . '/edit/id-' . $row->page_id . '" style="text-decoration:none;" ><img src="/images/24x24/Edit3.png" class="Tips" title="Edit Page" rel="Click to edit the ' . $row->page . ' page contents" /></a>', '<a href="/' . $this->registry->component . '/delete/id-' . $row->page_id . '" ><img src="/images/24x24/DeleteRed.png" class="Tips" title="Delete Page" rel="Click to delete the ' . $row->page . ' page" /></a>'); $c++; } $header = array('Page Name', 'Last Modified', '', ''); $table = $this->dataTable($data, $header); $this->content .= $doc->appendChild($doc->createElement('div', $table->toHtml(), array('id' => 'tableWrap')))->toHTML(); } else { $this->content .= $doc->appendChild($doc->createElement('h3', 'No Content Yet'))->toHTML(); } //if (isset($params)) $this->content .= $this->message($params); }
} //$tabs = new HTML_Tabs($tab_array, true); $doc = new HTML_Element(); $tabs = $doc->createElement('ul', null, array('id' => $id, 'class' => 'product_tabs')); foreach ($tab_array as $tab) { $class = 'gradient'; $tabTitle = str_replace('attr/', '', $tab); if ($tabTitle == $id) { $class .= ' active'; } $li = $doc->createElement('li', null, array('class' => $class, 'title' => $tabTitle)); $a = $doc->createElement('a', ucwords(str_replace('_', ' ', $tabTitle)), array('href' => '/ushop/products/view-' . $tab)); $li->appendChild($a); $tabs->appendChild($li); } $doc->appendChild($tabs); $this->content .= $doc->toHtml(); $this->content .= '<div id="productsWrap" class="both">' . $data . '</div>'; $products = $this->getResult('product_id, image, category', $ushop->db_name . 'products', array($ushop->db_name . 'product_categories')); /* $ftp = new File_FTP($this->registry); $dir = '/userfiles/'.$this->registry->settings['resolve'].'/products/'; print_rr(realpath($_SERVER['DOCUMENT_ROOT'].'/../')); foreach ($products as $row): $to = $ftp->public_html.$dir.str_replace(' ', '_', $row->category).'/'.$row->image; $from = realpath($_SERVER['DOCUMENT_ROOT'].'/../').$dir.$row->image; if (!is_dir(realpath($_SERVER['DOCUMENT_ROOT'].'/../').$dir.str_replace(' ', '_', $row->category))) $ftp->mkdir($ftp->public_html.$dir.str_replace(' ', '_', $row->category));
<?php // no direct access defined('PARENT_FILE') or die('Restricted access'); if ($this->authorize()) { $doc = new HTML_Element(); $sql = "\n\t\tSELECT blog_id, category_id, page_id\n\t\tFROM " . $this->registry->core . "blog\n\t"; $result = $this->registry->db->query($sql); $num_pages = count($result); $menuBar = array('new_page' => '/content/new'); $this->content .= $num_pages <= $this->registry->settings['pages'] || $this->registry->settings['pages'] == -1 ? $this->makeToolbar($menuBar, 24) : $this->message(array('TYPE' => 'info', 'MESSAGE' => '<h2>You have reach your page limit. To add more pages please contact your administrator.</h2>')); if ($num_pages > 0) { $c = 0; $data = array(); foreach ($result as $row) { $data[$c] = array($row->page, $row->mdate, '<a href="/content/edit/id-' . $row->page_id . '" style="text-decoration:none;" ><img src="/images/24x24/Edit3.png" class="Tips" title="Edit Page" rel="Click to edit the ' . $row->page . ' page contents" /></a>', '<a href="/content/delete/id-' . $row->page_id . '" ><img src="/images/24x24/DeleteRed.png" class="Tips" title="Delete Page" rel="Click to delete the ' . $row->page . ' page" /></a>'); $c++; } $header = array('Page Name', 'Last Modified', '', ''); $table = $this->dataTable($data, $header); $div = $doc->createElement('div', $table->toHtml(), array('id' => 'tableWrap')); $doc->appendChild($div); $this->content .= $doc->toHTML(); } else { $this->content .= '<h3>No Content Yet</h3>'; } }