*
 * date created 2004/8/15
 * @author spider <*****@*****.**>
 * @package yellowpages
 * @subpackage functions
 */
/**
 * Initialize
 */
global $gContent;
require_once YELLOWPAGES_PKG_PATH . 'YellowPages.php';
require_once LIBERTY_PKG_PATH . 'lookup_content_inc.php';
// if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up.
if (empty($gContent) || !is_object($gContent) || !$gContent->isValid()) {
    // if yellowpages_id supplied, use that
    if (!empty($_REQUEST['yellowpages_id']) && is_numeric($_REQUEST['yellowpages_id'])) {
        $gContent = new YellowPages($_REQUEST['yellowpages_id']);
        // if content_id supplied, use that
    } elseif (!empty($_REQUEST['content_id']) && is_numeric($_REQUEST['content_id'])) {
        $gContent = new YellowPages(NULL, $_REQUEST['content_id']);
        // otherwise create new object
    } else {
        $gContent = new YellowPages();
    }
    //handle legacy forms that use plain 'yellowpages' form variable name
    // TODO not sure what this does - wolff_borg
    if (empty($gContent->mYellowPagesId) && empty($gContent->mContentId)) {
    }
    $gContent->load();
    $gBitSmarty->assign_by_ref("gContent", $gContent);
}
<?php

// $Header$
// Copyright (c) 2005 bitweaver YellowPages
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
if (isset($_REQUEST["yellowpagesset"]) && isset($_REQUEST["homeYellowPages"])) {
    $gBitSystem->storePreference("home_yellowpages", $_REQUEST["homeYellowPages"]);
    $gBitSmarty->assign('home_yellowpages', $_REQUEST["homeYellowPages"]);
}
require_once YELLOWPAGES_PKG_PATH . 'YellowPages.php';
$formYellowPagesLists = array("yellowpages_list_yellowpages_id" => array('label' => 'Id', 'note' => 'Display the yellowpages id.'), "yellowpages_list_title" => array('label' => 'Title', 'note' => 'Display the title.'), "yellowpages_list_city" => array('label' => 'City', 'note' => 'Display the region.'), "yellowpages_list_region" => array('label' => 'State or Province', 'note' => 'Display the state or province.'), "yellowpages_list_country" => array('label' => 'Country', 'note' => 'Display the country.'));
$gBitSmarty->assign('formYellowPagesLists', $formYellowPagesLists);
$processForm = set_tab();
if ($processForm) {
    $yellowpagesToggles = array_merge($formYellowPagesLists);
    foreach ($yellowpagesToggles as $item => $data) {
        simple_set_toggle($item);
    }
}
$yellowpage = new YellowPages();
$yellowpages = $yellowpage->getList($_REQUEST);
$gBitSmarty->assign_by_ref('yellowpages', $yellowpages['data']);
*/
if (isset($_REQUEST["submit_mult"]) && isset($_REQUEST["checked"]) && $_REQUEST["submit_mult"] == "remove_yellowpagess") {
    // Now check permissions to remove the selected yellowpagess
    $gBitSystem->verifyPermission('p_remove_yellowpages');
    if (!empty($_REQUEST['cancel'])) {
        // user cancelled - just continue on, doing nothing
    } elseif (empty($_REQUEST['confirm'])) {
        $formHash['delete'] = TRUE;
        $formHash['submit_mult'] = 'remove_yellowpages';
        foreach ($_REQUEST["checked"] as $del) {
            $formHash['input'][] = '<input type="hidden" name="checked[]" value="' . $del . '"/>';
        }
        $gBitSystem->confirmDialog($formHash, array('warning' => 'Are you sure you want to delete ' . count($_REQUEST["checked"]) . ' yellowpages?', 'error' => 'This cannot be undone!'));
    } else {
        foreach ($_REQUEST["checked"] as $deleteId) {
            $tmpPage = new YellowPages($deleteId);
            if (!$tmpPage->load() || !$tmpPage->expunge()) {
                array_merge($errors, array_values($tmpPage->mErrors));
            }
        }
        if (!empty($errors)) {
            $gBitSmarty->assign_by_ref('errors', $errors);
        }
    }
}
$yellowpages = new YellowPages();
$listyellowpagess = $yellowpages->getList($_REQUEST);
$gBitSmarty->assign_by_ref('control', $_REQUEST["control"]);
$gBitSmarty->assign_by_ref('list', $listyellowpagess["data"]);
// Display the template
$gBitSystem->display('bitpackage:yellowpages/list_yellowpages.tpl', tra('YellowPages'), array('display_mode' => 'list'));