Exemple #1
0
 protected function _view(&$iaView, $invoiceId)
 {
     iaBreadcrumb::add(iaLanguage::get('view'), IA_SELF);
     $invoice = $this->getHelper()->getById($invoiceId);
     if (!$invoice) {
         return iaView::errorPage(iaView::ERROR_NOT_FOUND);
     }
     $iaView->assign('invoice', $invoice);
     $iaView->assign('items', $this->getHelper()->getItemsByInvoiceId($invoiceId));
     $iaView->display('invoice-view');
 }
 protected function _indexPage(&$iaView)
 {
     $settings = $this->_getSettings();
     if (in_array($settings['target'], array(iaAcl::USER, iaAcl::GROUP))) {
         if (iaAcl::USER == $settings['target']) {
             iaBreadcrumb::add(iaLanguage::get('members'), IA_ADMIN_URL . 'members/');
             $iaView->title(iaLanguage::getf('permissions_members', array('member' => '"' . $settings['item']['fullname'] . '"')));
         } else {
             iaBreadcrumb::add(iaLanguage::get('usergroups'), IA_ADMIN_URL . 'usergroups/');
             $iaView->title(iaLanguage::getf('permissions_usergroups', array('usergroup' => '"' . iaLanguage::get('usergroup_' . $settings['item']['name']) . '"')));
         }
         $userPermissions = $this->getHelper()->getPermissions($settings['id'], $settings['group']);
         $custom = array('user' => $settings['user'], 'group' => $settings['group'], 'perms' => $userPermissions);
         $actionCode = 'admin_access--read';
         list($object, ) = explode(iaAcl::DELIMITER, $actionCode);
         $adminAccess = array('title' => iaLanguage::get($actionCode, $actionCode), 'modified' => isset($userPermissions[$this->getHelper()->encodeAction($object, iaCore::ACTION_READ, '0')][$settings['action']]), 'default' => $this->_objects[$actionCode], 'access' => (int) $this->getHelper()->checkAccess($object, null, 0, 0, $custom));
         $iaView->assign('adminAccess', $adminAccess);
         $iaView->assign('pageGroupTitles', $this->_iaDb->keyvalue(array('id', 'title'), null, 'admin_pages_groups'));
         $iaView->assign('permissions', $this->_getPermissionsInfo($settings, $userPermissions, $custom));
     } else {
         $this->_list($iaView);
     }
 }
Exemple #3
0
 protected function _setBreadcrumb()
 {
     if (self::REQUEST_HTML != $this->getRequestType()) {
         return;
     }
     $this->iaCore->factory('breadcrumb');
     if (iaBreadcrumb::total() > 0 || $this->isHomepage() && empty($this->iaCore->requestPath)) {
         return;
     }
     iaCore::ACCESS_FRONT == $this->iaCore->getAccessType() ? iaBreadcrumb::root($this->iaCore->get('bc_home'), IA_URL) : iaBreadcrumb::root(iaLanguage::get('dashboard'), IA_ADMIN_URL);
     $pluginName = $this->get('extras');
     switch ($this->iaCore->getAccessType()) {
         case iaCore::ACCESS_FRONT:
             $parents = array();
             $iaPage = $this->iaCore->factory('page', iaCore::FRONT);
             $iaPage->getParents($this->get('parent'), $parents);
             if ($parents) {
                 iaBreadcrumb::addChain($parents);
             } elseif ($pluginName && 'package' == $this->get('type') && $pluginName . '_home' != $this->name()) {
                 if ($this->iaCore->get('default_package') != $pluginName) {
                     iaBreadcrumb::add(iaLanguage::get($pluginName), IA_PACKAGE_URL);
                 }
             }
             if ($url = $iaPage->getUrlByName($this->name())) {
                 iaBreadcrumb::toEnd(iaLanguage::get('page_title_' . $this->name(), $this->name()), $url);
             }
             break;
         case iaCore::ACCESS_ADMIN:
             $iaPage = $this->iaCore->factory('page', iaCore::ADMIN);
             if ($pluginName) {
                 if ('package' == $this->get('type')) {
                     $title = iaLanguage::get($pluginName . '_package');
                     $url = IA_ADMIN_URL . $pluginName . IA_URL_DELIMITER;
                     $pluginName . '_stats' != $this->name() ? iaBreadcrumb::add($title, $url) : iaBreadcrumb::replaceEnd($title, $url);
                 }
             }
             $url = $iaPage->getUrlByName($this->name());
             iaBreadcrumb::add($this->get('title', $this->name()), $url);
             if (in_array($this->get('action'), array(iaCore::ACTION_ADD, iaCore::ACTION_EDIT))) {
                 iaBreadcrumb::toEnd(iaLanguage::get($this->get('action')), IA_SELF);
             }
     }
 }
    if (!isset($out)) {
        $iaView->assign_all($iaAlbum->gridActions($_GET));
    }
}
// process html page actions
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    $iaArtist = $iaCore->factoryPackage('artist', IA_CURRENT_PACKAGE, iaCore::ADMIN);
    // init classes
    $iaFields = iaCore::fields();
    switch ($pageAction) {
        default:
            $iaView->grid('_IA_URL_packages/lyrics/js/admin/albums');
            break;
        case 'edit':
        case 'add':
            iaBreadcrumb::add(iaLanguage::get('albums'), IA_ADMIN_URL . 'lyrics/albums/');
            // these fields are system and used in system template
            $item = array('status' => 'active', 'account_username' => $_SESSION['user']['username'], 'featured' => true);
            if ('edit' == $pageAction) {
                $item = $iaAlbum->getById((int) $_GET['id']);
                if (empty($item)) {
                    iaView::errorPage(iaView::ERROR_NOT_FOUND);
                }
            }
            $fields = iaField::getAllFields(true, '', 'albums');
            if (isset($_POST['save'])) {
                $error = false;
                $errorFields = array();
                $messages = array();
                iaCore::util();
                if ($fields) {
Exemple #5
0
 private function _setGroup(&$iaView, array $groupData)
 {
     $iaItem = $this->_iaCore->factory('item');
     if ($this->_type) {
         $entity = 'user' == $this->_type ? $this->_iaCore->factory('users')->getInfo($this->_typeId) : $this->_iaDb->row(array('name'), iaDb::convertIds($this->_typeId), iaUsers::getUsergroupsTable());
         if (!$entity) {
             return iaView::errorPage(iaView::ERROR_NOT_FOUND);
         }
         $title = 'user' == $this->_type ? $entity['fullname'] : iaLanguage::get('usergroup_' . $entity['name']);
         $title = iaLanguage::getf('custom_configuration_title', array('settings' => $groupData['title'], 'title' => $title, 'type' => strtolower(iaLanguage::get('user' == $this->_type ? 'member' : 'usergroup'))));
     } else {
         $title = $groupData['title'];
     }
     $iaView->title($title);
     if ($groupData['extras']) {
         $iaPage = $this->_iaCore->factory('page', iaCore::ADMIN);
         $activeMenu = $groupData['name'];
         if ($groupData['extras'] == $this->_iaCore->get('tmpl')) {
             // template configuration options
             $page = $iaPage->getByName('templates');
             $iaView->set('group', $page['group']);
             $iaView->set('active_config', $groupData['name']);
             iaBreadcrumb::add($page['title'], IA_ADMIN_URL . $page['alias']);
         } elseif ($pluginPage = $this->_iaDb->row(array('alias', 'group'), iaDb::printf("`name` = ':name' OR `name` = ':name_stats'", array('name' => $groupData['extras'])), iaPage::getAdminTable())) {
             // it is a package
             $iaView->set('group', $pluginPage['group']);
             $iaView->set('active_config', $groupData['name']);
             $activeMenu = null;
             iaBreadcrumb::insert($groupData['title'], IA_ADMIN_URL . $pluginPage['alias'], iaBreadcrumb::POSITION_FIRST);
         } elseif ($iaItem->isExtrasExist($groupData['extras'], iaItem::TYPE_PLUGIN)) {
             // plugin with no admin pages
             $iaView->set('group', 5);
             $iaView->set('active_config', $groupData['extras']);
         }
     } else {
         $activeMenu = 'configuration_' . $groupData['name'];
         iaBreadcrumb::toEnd($groupData['title'], IA_SELF);
     }
     $iaView->set('active_menu', $activeMenu);
 }
Exemple #6
0
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Subrion is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Subrion. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 * @link http://www.subrion.org/
 *
 ******************************************************************************/
if (iaView::REQUEST_JSON == $iaView->getRequestType()) {
    return iaView::errorPage(iaView::ERROR_NOT_FOUND);
}
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    iaBreadcrumb::add(iaLanguage::get('main_page'), IA_URL);
    $redirectUrl = IA_URL;
    if (isset($_SESSION['redir'])) {
        $iaView->assign('redir', $_SESSION['redir']);
        $redirectUrl = $_SESSION['redir']['url'];
        unset($_SESSION['redir']);
    }
    $iaView->disableLayout();
    $iaView->assign('redirect_url', $redirectUrl);
    $iaView->title($iaCore->get('site'));
}
Exemple #7
0
             $affected = $iaDb->update(array('id' => $transaction['id'], 'gateway' => $gate), null, array('date' => iaDb::FUNCTION_NOW), iaTransaction::getTable());
             $iaCore->factory('invoice')->updateAddress($transaction['id'], $_POST['invaddr']);
             // include pre form send files
             $paymentGatewayHandler = IA_PLUGINS . $gate . IA_DS . 'includes' . IA_DS . 'pre-processing' . iaSystem::EXECUTABLE_FILE_EXT;
             if (file_exists($paymentGatewayHandler)) {
                 include $paymentGatewayHandler;
             }
             if (!empty($gateways[$gate])) {
                 $data = array('caption' => 'Redirect to ' . $gate . '', 'msg' => 'You will be redirected to ' . $gate . '', 'form' => $gateways[$gate]);
                 $iaView->assign('redir', $data);
                 $tplFile = 'redirect-gateway';
                 $iaView->disableLayout();
             }
         }
     }
     iaBreadcrumb::add(iaLanguage::get('page_title_member_funds'), $iaCore->factory('page', iaCore::FRONT)->getUrlByName('member_funds'));
 } elseif (!empty($transaction['gateway']) && 'completed' == $action) {
     $gate = $transaction['gateway'];
     if (isset($gateways[$gate])) {
         $temp_transaction = $transaction;
         $transaction = array();
         // include post form send files
         $paymentGatewayHandler = IA_PLUGINS . $gate . IA_DS . 'includes' . IA_DS . 'post-processing' . iaSystem::EXECUTABLE_FILE_EXT;
         if (file_exists($paymentGatewayHandler)) {
             // set to true if custom transaction handling needed
             $replaceHandler = false;
             $iaCore->startHook('phpPayBeforeIncludePostGate', array('gateway' => $gate));
             include $paymentGatewayHandler;
             $iaCore->startHook('phpPayAfterIncludePostGate', array('gateway' => $gate));
             // print transaction information
             if (INTELLI_DEBUG) {
Exemple #8
0
        case iaCore::ACTION_EDIT:
            $output = $iaAd->gridUpdate($_POST);
            break;
        case iaCore::ACTION_DELETE:
            $output = $iaAd->gridDelete($_POST);
    }
    $iaView->assign($output);
}
// process html page actions
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    // display grid
    if (iaCore::ACTION_READ == $pageAction) {
        $iaView->grid('_IA_URL_packages/affiliates/js/admin/ads');
    } else {
        $baseUrl = IA_ADMIN_URL . 'affiliates/ads/';
        iaBreadcrumb::add(iaLanguage::get('ads'), $baseUrl);
        $ad = array('status' => iaCore::STATUS_ACTIVE);
        if (iaCore::ACTION_EDIT == $pageAction) {
            if (!isset($_GET['id'])) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
            $ad = $iaAd->getById((int) $_GET['id']);
            if (empty($ad)) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
        }
        // define fields class
        $iaFields = iaCore::fields();
        // process mandatory hook
        $iaCore->startHook('editItemSetSystemDefaults', array('item' => &$ad));
        if (isset($_POST['save'])) {
        case iaCore::ACTION_EDIT:
            $output = $iaCommission->gridUpdate($_POST);
            break;
        case iaCore::ACTION_DELETE:
            $output = $iaCommission->gridDelete($_POST);
    }
    $iaView->assign($output);
}
// process html page actions
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    // display grid
    if (iaCore::ACTION_READ == $pageAction) {
        $iaView->grid('_IA_URL_packages/affiliates/js/admin/commissions');
    } else {
        $baseUrl = IA_ADMIN_URL . 'affiliates/commissions/';
        iaBreadcrumb::add(iaLanguage::get('commissions'), $baseUrl);
        $commission = array('status' => iaCore::STATUS_ACTIVE, 'sale_date' => date('Y-m-d'), 'sale_amount' => 0, 'payout_amount' => 0);
        if (iaCore::ACTION_EDIT == $pageAction) {
            if (!isset($_GET['id'])) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
            $commission = $iaCommission->getById((int) $_GET['id']);
            if (empty($commission)) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
            $commission['member'] = $commission['member_id'] ? $iaDb->one('`username`', "`id` = {$commission['member_id']}", iaUsers::getTable()) : 0;
        }
        // define fields class
        $iaFields = iaCore::fields();
        // process mandatory hook
        $iaCore->startHook('editItemSetSystemDefaults', array('item' => &$commission));
Exemple #10
0
            // get account info
            if ($lyric['member_id'] > 0) {
                $author = $iaDb->row('*', "`id`='{$lyric['member_id']}'", iaUsers::getTable());
                $iaView->assign('author', $author);
            }
            // get artist information
            $iaArtist = $iaCore->factoryPackage('artist', IA_CURRENT_PACKAGE);
            $artist = $iaArtist->getArtist($lyric['id_artist']);
            $iaView->assign('artist', $artist);
            // get album information
            $iaAlbum = $iaCore->factoryPackage('album', IA_CURRENT_PACKAGE);
            $album = $iaAlbum->getAlbum($lyric['id_album']);
            $iaView->assign('album', $album);
            // count views
            $iaLyric->incrementViewsCounter($lyric['id']);
            // breadcrumb formation
            iaBreadcrumb::add(_t('artists'), 'artists/');
            iaBreadcrumb::add($artist['title'], $iaCore->iaSmarty->ia_url(array('type' => 'url', 'item' => $iaArtist->getItemName(), 'data' => $artist)));
            iaBreadcrumb::add($album['title'], $iaCore->iaSmarty->ia_url(array('type' => 'url', 'item' => $iaAlbum->getItemName(), 'data' => $album)));
            // set meta keywords and description
            $iaView->set('description', isset($lyric['meta_description']) ? $lyric['meta_description'] : '');
            $iaView->set('keywords', isset($lyric['meta_keywords']) ? $lyric['meta_keywords'] : '');
            $iaView->title($lyric['title']);
            $iaView->display('lyricview');
            break;
        case 'lyrics_home':
            // display index file
            $iaView->display();
            break;
    }
}
Exemple #11
0
 private function _setGroup(&$iaView, &$iaItem, array $groupData)
 {
     $iaView->title($groupData['title']);
     if ($groupData['extras']) {
         $iaPage = $this->_iaCore->factory('page', iaCore::ADMIN);
         $activeMenu = $groupData['name'];
         if ($groupData['extras'] == $this->_iaCore->get('tmpl')) {
             // template configuration options
             $page = $iaPage->getByName('templates');
             $iaView->set('group', $page['group']);
             $iaView->set('active_config', $groupData['name']);
             iaBreadcrumb::add($page['title'], IA_ADMIN_URL . $page['alias']);
         } elseif ($pluginPage = $this->_iaDb->row(array('alias', 'group'), iaDb::printf("`name` = ':name' OR `name` = ':name_stats'", array('name' => $groupData['extras'])), iaPage::getAdminTable())) {
             // it is a package
             $iaView->set('group', $pluginPage['group']);
             $iaView->set('active_config', $groupData['name']);
             $activeMenu = null;
             iaBreadcrumb::insert($groupData['title'], IA_ADMIN_URL . $pluginPage['alias'], iaBreadcrumb::POSITION_FIRST);
         } elseif ($iaItem->isExtrasExist($groupData['extras'], iaItem::TYPE_PLUGIN)) {
             // plugin with no admin pages
             $iaView->set('group', 5);
             $iaView->set('active_config', $groupData['extras']);
         }
     } else {
         $activeMenu = 'configuration_' . $groupData['name'];
         iaBreadcrumb::toEnd($groupData['title'], IA_SELF);
     }
     $iaView->set('active_menu', $activeMenu);
 }
     $iaView->assign('genre', $genre);
     // increment views counter
     $iaGenre->incrementViewsCounter($genre['id']);
     // get artists by genre
     $iaArtist = $iaCore->factoryPackage('artist', IA_CURRENT_PACKAGE);
     $artists = $iaArtist->getArtistsByGenre($genre['id']);
     if ($artists) {
         // update favorites icon
         $artists = $iaItem->updateItemsFavorites($artists, $iaArtist->getItemName());
         // filter fields
         $fields = iaField::filterFields($artists, $iaArtist->getItemName());
         $iaView->assign('fields', $fields);
     }
     $iaView->assign('artists', $artists);
     // breadcrumb formation
     iaBreadcrumb::add(_t('genres'), $iaCore->packagesData['lyrics']['url'] . 'genres/');
     iaBreadcrumb::replaceEnd($genre['title'], '');
     // set meta keywords and description
     $iaView->set('description', $genre['meta_description']);
     $iaView->set('keywords', $genre['meta_keywords']);
     $iaView->title($genre['title']);
     $iaView->display('genreview');
     break;
 case 'genres':
     $per_page = $iaCore->get('lyrics_per_page', 10);
     $page = isset($_GET['page']) && 1 < $_GET['page'] ? (int) $_GET['page'] : 1;
     $start = ($page - 1) * $per_page;
     $where = false;
     // gets current page and defines start position
     $num_index = 20;
     $page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
            $start = ($page - 1) * $per_page;
            $search_alphas = iaUtil::getLetters();
            $alpha = isset($iaCore->requestPath[0]) && in_array($iaCore->requestPath[0], $search_alphas) ? $iaCore->requestPath[0] : false;
            $cause = $alpha ? '0-9' == $alpha ? "(`title` REGEXP '^[0-9]') AND " : "(`title` LIKE '{$alpha}%') AND " : '';
            $iaView->assign('search_alphas', $search_alphas);
            $iaView->assign('alpha', $alpha);
            $iaArtist->where = $cause . "`status`='active' ORDER BY `title` ASC ";
            $artists = $iaArtist->getArtists(false, $start, $per_page);
            $total_artists = $iaArtist->count;
            if ($artists) {
                $iaItem = $iaCore->factory('item');
                $artists = $iaItem->updateItemsFavorites($artists, $iaArtist->getItemName());
                // filter fields
                $fields = iaField::filterFields($artists, 'artists');
                $iaView->assign('fields', $fields);
            }
            $iaView->assign('artists', $artists);
            $iaView->assign('aTotal', $total_artists);
            $iaView->assign('aItemsPerPage', $per_page);
            if ($alpha) {
                iaBreadcrumb::add(_t('artists'), IA_PACKAGE_URL . 'artists/');
                iaBreadcrumb::replaceEnd($alpha, '');
                $iaView->assign('aTemplate', IA_URL . 'artists/' . $alpha . '/?page={page}');
            } else {
                $iaView->assign('aTemplate', IA_URL . 'artists/?page={page}');
            }
            break;
        default:
            break;
    }
}
        case iaCore::ACTION_EDIT:
            $output = $iaProduct->gridUpdate($_POST);
            break;
        case iaCore::ACTION_DELETE:
            $output = $iaProduct->gridDelete($_POST);
    }
    $iaView->assign($output);
}
// process html page actions
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    // display grid
    if (iaCore::ACTION_READ == $pageAction) {
        $iaView->grid('_IA_URL_packages/affiliates/js/admin/products');
    } else {
        $baseUrl = IA_ADMIN_URL . $iaProduct->getModuleUrl();
        iaBreadcrumb::add(iaLanguage::get('products'), $baseUrl);
        if (iaCore::ACTION_EDIT == $pageAction) {
            if (!isset($_GET['id'])) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
            $listingData = $iaProduct->getById((int) $_GET['id']);
            if (empty($listingData)) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
        } else {
            $listingData = array('member_id' => iaUsers::getIdentity()->id, 'date_added' => date(iaDb::DATETIME_SHORT_FORMAT), 'status' => iaCore::STATUS_ACTIVE);
        }
        // define fields class
        $iaField = $iaCore->factory('field');
        // process mandatory hook
        $iaCore->startHook('editItemSetSystemDefaults', array('item' => &$listingData));
        case iaCore::ACTION_EDIT:
            $output = $iaBanner->gridUpdate($_POST);
            break;
        case iaCore::ACTION_DELETE:
            $output = $iaBanner->gridDelete($_POST);
    }
    $iaView->assign($output);
}
// process html page actions
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    // display grid
    if (iaCore::ACTION_READ == $pageAction) {
        $iaView->grid('_IA_URL_packages/affiliates/js/admin/banners');
    } else {
        $baseUrl = IA_ADMIN_URL . $iaBanner->getModuleUrl();
        iaBreadcrumb::add(iaLanguage::get('banners'), $baseUrl);
        if (iaCore::ACTION_EDIT == $pageAction) {
            if (!isset($_GET['id'])) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
            $listingData = $iaBanner->getById((int) $_GET['id']);
            if (empty($listingData)) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
        } else {
            $listingData = array('member_id' => iaUsers::getIdentity()->id, 'date_added' => date(iaDb::DATETIME_SHORT_FORMAT), 'status' => iaCore::STATUS_ACTIVE);
        }
        // define fields class
        $iaField = $iaCore->factory('field');
        // process mandatory hook
        $iaCore->startHook('editItemSetSystemDefaults', array('item' => &$listingData));
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    $iaGenre = $iaCore->factoryPackage('genre', IA_CURRENT_PACKAGE, iaCore::ADMIN);
    $genres = $iaGenre->getGenres("t1.`status` = 'active'");
    $iaView->assign('genres', $genres);
    // init classes
    $iaField = $iaCore->factory('field');
    $error = false;
    $errorFields = array();
    $messages = array();
    switch ($pageAction) {
        default:
            $iaView->grid('_IA_URL_packages/lyrics/js/admin/artists');
            break;
        case 'edit':
        case 'add':
            iaBreadcrumb::add(iaLanguage::get('artists'), IA_ADMIN_URL . 'lyrics/artists/');
            if ('edit' == $pageAction) {
                $item = $iaArtist->getById((int) $_GET['id']);
                if (empty($item)) {
                    iaView::errorPage(iaView::ERROR_NOT_FOUND);
                }
            } elseif ('add' == $pageAction) {
                // these fields are system and used in system template
                $item = array('status' => 'active', 'account_username' => $_SESSION['user']['username'], 'featured' => false);
            }
            $fields = iaField::getAllFields(true, '', 'artists');
            if (isset($_POST['save'])) {
                iaCore::util();
                if ($fields) {
                    list($data, $error, $messages, $errorFields) = iaField::parsePost($fields, $item, true);
                }