当前位置: 首页>>代码示例>>PHP>>正文


PHP View::newInstance方法代码示例

本文整理汇总了PHP中View::newInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP View::newInstance方法的具体用法?PHP View::newInstance怎么用?PHP View::newInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在View的用法示例。


在下文中一共展示了View::newInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processData

 private function processData($pages)
 {
     if (!empty($pages)) {
         $prefLocale = osc_current_user_locale();
         foreach ($pages as $aRow) {
             $row = array();
             $content = array();
             if (isset($aRow['locale'][$prefLocale]) && !empty($aRow['locale'][$prefLocale]['s_title'])) {
                 $content = $aRow['locale'][$prefLocale];
             } else {
                 $content = current($aRow['locale']);
             }
             // -- options --
             $options = array();
             View::newInstance()->_exportVariableToView('page', $aRow);
             $options[] = '<a href="' . osc_static_page_url() . '" target="_blank">' . __('View page') . '</a>';
             $options[] = '<a href="' . osc_admin_base_url(true) . '?page=pages&amp;action=edit&amp;id=' . $aRow['pk_i_id'] . '">' . __('Edit') . '</a>';
             if (!$aRow['b_indelible']) {
                 $options[] = '<a onclick="return delete_dialog(\'' . $aRow['pk_i_id'] . '\');" href="' . osc_admin_base_url(true) . '?page=pages&amp;action=delete&amp;id=' . $aRow['pk_i_id'] . '&amp;' . osc_csrf_token_url() . '">' . __('Delete') . '</a>';
             }
             $auxOptions = '<ul>' . PHP_EOL;
             foreach ($options as $actual) {
                 $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
             }
             $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
             $row['bulkactions'] = '<input type="checkbox" name="id[]"" value="' . $aRow['pk_i_id'] . '"" />';
             $row['internal_name'] = $aRow['s_internal_name'] . $actions;
             $row['title'] = $content['s_title'];
             $row['order'] = '<div class="order-box">' . $aRow['i_order'] . ' <img class="up" onclick="order_up(' . $aRow['pk_i_id'] . ');" src="' . osc_current_admin_theme_url('images/arrow_up.png') . '" alt="' . __('Up') . '" title="' . __('Up') . '" />  <img class="down" onclick="order_down(' . $aRow['pk_i_id'] . ');" src="' . osc_current_admin_theme_url('images/arrow_down.png') . '" alt="' . __('Down') . '" title="' . __('Down') . '" /></div>';
             $row = osc_apply_filter('pages_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:mylastof,项目名称:os-class,代码行数:35,代码来源:PagesDataTable.php

示例2: pop_title_404

function pop_title_404($title)
{
    $header_text = __("Sorry but I can't find the page you're looking for", 'pop');
    if (View::newInstance()->_get('pop_404_header_text') != '') {
        $header_text = View::newInstance()->_get('pop_404_header_text');
    }
    return $header_text;
}
开发者ID:oanav,项目名称:closetshare,代码行数:8,代码来源:404.php

示例3: osc_has_static_pages_seo

function osc_has_static_pages_seo()
{
    if (!View::newInstance()->_exists('pages')) {
        View::newInstance()->_exportVariableToView('pages', Page::newInstance()->listAll(false, 0));
    }
    $page = View::newInstance()->_next('pages');
    View::newInstance()->_exportVariableToView('page_meta', json_decode($page['s_meta'], true));
    return $page;
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:9,代码来源:pages.php

示例4: osc_search_pagination

/**
 * Gets the pagination links of search pagination
 *
 * @return string pagination links
 */
function osc_search_pagination()
{
    $params = array();
    if (View::newInstance()->_exists('search_uri')) {
        $params['url'] = osc_base_url() . View::newInstance()->_get('search_uri') . '/{PAGE}';
    }
    $pagination = new Pagination($params);
    return $pagination->doPagination();
}
开发者ID:semul,项目名称:Osclass,代码行数:14,代码来源:hPagination.php

示例5: popular_ads

function popular_ads($interval)
{
    $num_ads = popular_ads_num_ads();
    // SETS HOW MANY POPULAR ADS TO DISPLAY
    $conn = getConnection();
    $item_array = $conn->osc_dbFetchResults("SELECT i.*, l.*, d.*, SUM(s.i_num_views) AS total_views FROM %st_item_stats s\n\tJOIN %st_item i ON s.fk_i_item_id = i.pk_i_id\n\tJOIN %st_item_location l ON s.fk_i_item_id = l.fk_i_item_id\n\tJOIN %st_item_description d ON s.fk_i_item_id = d.fk_i_item_id\n\tWHERE i.dt_pub_date > CURDATE()-INTERVAL %d DAY\n\tAND i.b_enabled = 1 AND i.b_active = 1 AND i.b_spam = 0 AND (i.b_premium = 1 || i.dt_expiration >= CURDATE())\n\tGROUP BY s.fk_i_item_id\n\tORDER BY total_views DESC\n\tLIMIT 0, %d", DB_TABLE_PREFIX, DB_TABLE_PREFIX, DB_TABLE_PREFIX, DB_TABLE_PREFIX, $interval, $num_ads);
    if (count($item_array) > 0) {
        View::newInstance()->_exportVariableToView('customItems', $item_array);
    } else {
        echo __('No listings', 'flatter');
    }
}
开发者ID:abhi143u11,项目名称:ads,代码行数:12,代码来源:index.php

示例6: init

 public function init()
 {
     $data = array_map(function ($v) {
         return array("s_internal_name" => $v["s_internal_name"], "locales" => array_map(function ($k, $v) {
             return array("fk_c_locale_code" => $k, "s_title" => $v["s_title"], "s_excerpt" => "", "s_text" => $v["s_text"]);
         }, array_keys($v["locale"]), array_values($v["locale"])));
     }, $this->model->listAll(true));
     View::newInstance()->_exportVariableToView("datas", json_encode(array("emails" => $data, "footer" => array("locales" => array_map(function ($v) {
         return array("fk_c_locale_code" => $v["pk_c_code"], "s_text" => "");
     }, OSCLocale::newInstance()->listAll()))), JSON_PRETTY_PRINT));
 }
开发者ID:bomvendador,项目名称:soroka_r,代码行数:11,代码来源:Admin.php

示例7: processData

 private function processData($comments)
 {
     if (!empty($comments)) {
         $csrf_token_url = osc_csrf_token_url();
         foreach ($comments as $aRow) {
             $row = array();
             $options = array();
             $options_more = array();
             View::newInstance()->_exportVariableToView('item', Item::newInstance()->findByPrimaryKey($aRow['fk_i_item_id']));
             if ($aRow['b_enabled']) {
                 $options_more[] = '<a href="' . osc_admin_base_url(true) . '?page=comments&amp;action=status&amp;id=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '&amp;value=DISABLE">' . __('Block') . '</a>';
             } else {
                 $options_more[] = '<a href="' . osc_admin_base_url(true) . '?page=comments&amp;action=status&amp;id=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '&amp;value=ENABLE">' . __('Unblock') . '</a>';
             }
             $options_more[] = '<a onclick="return delete_dialog(\'' . $aRow['pk_i_id'] . '\');" href="' . osc_admin_base_url(true) . '?page=comments&amp;action=delete&amp;id=' . $aRow['pk_i_id'] . '" id="dt_link_delete">' . __('Delete') . '</a>';
             $options[] = '<a href="' . osc_admin_base_url(true) . '?page=comments&amp;action=comment_edit&amp;id=' . $aRow['pk_i_id'] . '" id="dt_link_edit">' . __('Edit') . '</a>';
             if ($aRow['b_active']) {
                 $options[] = '<a href="' . osc_admin_base_url(true) . '?page=comments&amp;action=status&amp;id=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '&amp;value=INACTIVE">' . __('Deactivate') . '</a>';
             } else {
                 $options[] = '<a href="' . osc_admin_base_url(true) . '?page=comments&amp;action=status&amp;id=' . $aRow['pk_i_id'] . '&amp;' . $csrf_token_url . '&amp;value=ACTIVE">' . __('Activate') . '</a>';
             }
             // more actions
             $moreOptions = '<li class="show-more">' . PHP_EOL . '<a href="#" class="show-more-trigger">' . __('Show more') . '...</a>' . PHP_EOL . '<ul>' . PHP_EOL;
             foreach ($options_more as $actual) {
                 $moreOptions .= '<li>' . $actual . "</li>" . PHP_EOL;
             }
             $moreOptions .= '</ul>' . PHP_EOL . '</li>' . PHP_EOL;
             // create list of actions
             $auxOptions = '<ul>' . PHP_EOL;
             foreach ($options as $actual) {
                 $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
             }
             $auxOptions .= $moreOptions;
             $auxOptions .= '</ul>' . PHP_EOL;
             $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
             $status = $this->get_row_status($aRow);
             $row['status-border'] = '';
             $row['status'] = $status['text'];
             $row['bulkactions'] = '<input type="checkbox" name="id[]" value="' . $aRow['pk_i_id'] . '" />';
             if (empty($aRow['s_author_name'])) {
                 $user = User::newInstance()->findByPrimaryKey($aRow['fk_i_user_id']);
                 $aRow['s_author_name'] = $user['s_email'];
             }
             $row['author'] = $aRow['s_author_name'] . ' (<a target="_blank" href="' . osc_item_url() . '">' . osc_item_title() . '</a>)' . $actions;
             $row['comment'] = $aRow['s_body'];
             $row['date'] = osc_format_date($aRow['dt_pub_date']);
             $row = osc_apply_filter('comments_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:oanav,项目名称:closetshare,代码行数:52,代码来源:CommentsDataTable.php

示例8: osc_search_pagination

/**
 * Gets the pagination links of search pagination
 *
 * @return string pagination links
 */
function osc_search_pagination()
{
    $params = array();
    if (View::newInstance()->_exists('search_uri')) {
        // CANONICAL URL
        $params['url'] = osc_base_url() . View::newInstance()->_get('search_uri') . '/{PAGE}';
        $params['first_url'] = osc_base_url() . View::newInstance()->_get('search_uri');
    } else {
        $params['first_url'] = osc_update_search_url(array('iPage' => null));
    }
    $pagination = new Pagination($params);
    return $pagination->doPagination();
}
开发者ID:mylastof,项目名称:os-class,代码行数:18,代码来源:hPagination.php

示例9: doModel

 function doModel()
 {
     switch ($this->action) {
         case 'spamNbots':
             // calling the spam and bots view
             $akismet_key = osc_akismet_key();
             $akismet_status = 3;
             if ($akismet_key != '') {
                 require_once osc_lib_path() . 'Akismet.class.php';
                 $akismet_obj = new Akismet(osc_base_url(), $akismet_key);
                 $akismet_status = 2;
                 if ($akismet_obj->isKeyValid()) {
                     $akismet_status = 1;
                 }
             }
             View::newInstance()->_exportVariableToView('akismet_status', $akismet_status);
             $this->doView('settings/spamNbots.php');
             break;
         case 'akismet_post':
             // updating spam and bots option
             osc_csrf_check();
             $updated = 0;
             $akismetKey = Params::getParam('akismetKey');
             $akismetKey = trim($akismetKey);
             $updated = osc_set_preference('akismetKey', $akismetKey);
             if ($akismetKey == '') {
                 osc_add_flash_info_message(_m('Your Akismet key has been cleared'), 'admin');
             } else {
                 osc_add_flash_ok_message(_m('Your Akismet key has been updated'), 'admin');
             }
             $this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=spamNbots');
             break;
         case 'recaptcha_post':
             // updating spam and bots option
             osc_csrf_check();
             $iUpdated = 0;
             $recaptchaPrivKey = Params::getParam('recaptchaPrivKey');
             $recaptchaPrivKey = trim($recaptchaPrivKey);
             $recaptchaPubKey = Params::getParam('recaptchaPubKey');
             $recaptchaPubKey = trim($recaptchaPubKey);
             $iUpdated += osc_set_preference('recaptchaPrivKey', $recaptchaPrivKey);
             $iUpdated += osc_set_preference('recaptchaPubKey', $recaptchaPubKey);
             if ($recaptchaPubKey == '') {
                 osc_add_flash_info_message(_m('Your reCAPTCHA key has been cleared'), 'admin');
             } else {
                 osc_add_flash_ok_message(_m('Your reCAPTCHA key has been updated'), 'admin');
             }
             $this->redirectTo(osc_admin_base_url(true) . '?page=settings&action=spamNbots');
             break;
     }
 }
开发者ID:oanav,项目名称:closetshare,代码行数:51,代码来源:spamnbots.php

示例10: payment_pro_recurring_buttons

function payment_pro_recurring_buttons($subscription, $extra = null)
{
    $services = View::newInstance()->_get('_payment_pro_services');
    if (is_array($services)) {
        foreach ($services as $service => $file) {
            $payment = Payment::newInstance($service);
            if ($payment) {
                $payment->recurringButton($subscription, $extra);
            }
        }
    } else {
        _e('No method of payment is available', 'payment_pro');
    }
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:14,代码来源:functions.php

示例11: category_select

 public static function category_select($categories = null, $item = null, $default_item = null, $parent_selectable = false)
 {
     // Did user select a specific category to post in?
     $catId = Params::getParam('catId');
     if (Session::newInstance()->_getForm('catId') != "") {
         $catId = Session::newInstance()->_getForm('catId');
     }
     if ($categories == null) {
         if (View::newInstance()->_exists('categories')) {
             $categories = View::newInstance()->_get('categories');
         } else {
             $categories = osc_get_categories();
         }
     }
     if ($item == null) {
         $item = osc_item();
     }
     echo '<select name="catId" id="catId">';
     if (isset($default_item)) {
         echo '<option value="">' . $default_item . '</option>';
     } else {
         echo '<option value="">' . __('Select a category') . '</option>';
     }
     if (count($categories) == 1) {
         $parent_selectable = 1;
     }
     foreach ($categories as $c) {
         if (!osc_selectable_parent_categories() && !$parent_selectable) {
             echo '<optgroup label="' . $c['s_name'] . '">';
             if (isset($c['categories']) && is_array($c['categories'])) {
                 ItemForm::subcategory_select($c['categories'], $item, $default_item, 1);
             }
         } else {
             $selected = isset($item["fk_i_category_id"]) && $item["fk_i_category_id"] == $c['pk_i_id'] || isset($catId) && $catId == $c['pk_i_id'];
             echo '<option value="' . $c['pk_i_id'] . '"' . ($selected ? 'selected="selected"' : '') . '>' . $c['s_name'] . '</option>';
             if (isset($c['categories']) && is_array($c['categories'])) {
                 ItemForm::subcategory_select($c['categories'], $item, $default_item, 1);
             }
         }
     }
     echo '</select>';
     return true;
 }
开发者ID:randomecho,项目名称:OSClass,代码行数:43,代码来源:Item.form.class.php

示例12: toArrayFormat

 private function toArrayFormat()
 {
     $this->result['iTotalRecords'] = $this->total;
     $this->result['iTotalDisplayRecords'] = $this->total_filtered;
     $this->result['iDisplayLength'] = $this->_get['iDisplayLength'];
     $this->result['aaData'] = array();
     if (count($this->pages) == 0) {
         return;
     }
     $prefLocale = osc_current_user_locale();
     $count = 0;
     foreach ($this->pages as $aRow) {
         $row = array();
         $content = array();
         if (isset($aRow['locale'][$prefLocale]) && !empty($aRow['locale'][$prefLocale]['s_title'])) {
             $content = $aRow['locale'][$prefLocale];
         } else {
             $content = current($aRow['locale']);
         }
         // -- options --
         $options = array();
         View::newInstance()->_exportVariableToView('page', $aRow);
         $options[] = '<a href="' . osc_static_page_url() . '" target="_blank">' . __('View page') . '</a>';
         $options[] = '<a href="' . osc_admin_base_url(true) . '?page=pages&amp;action=edit&amp;id=' . $aRow['pk_i_id'] . '">' . __('Edit') . '</a>';
         if (!$aRow['b_indelible']) {
             $options[] = '<a onclick="return delete_dialog(\'' . $aRow['pk_i_id'] . '\');" href="' . osc_admin_base_url(true) . '?page=pages&amp;action=delete&amp;id=' . $aRow['pk_i_id'] . '">' . __('Delete') . '</a>';
         }
         $auxOptions = '<ul>' . PHP_EOL;
         foreach ($options as $actual) {
             $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
         }
         $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
         $row[] = '<input type="checkbox" name="id[]"" value="' . $aRow['pk_i_id'] . '"" />';
         $row[] = $aRow['s_internal_name'] . $actions;
         $row[] = $content['s_title'];
         $row[] = '<div class="order-box">' . $aRow['i_order'] . ' <img class="up" onclick="order_up(' . $aRow['pk_i_id'] . ');" src="' . osc_current_admin_theme_url('images/arrow_up.png') . '" alt="' . __('Up') . '" title="' . __('Up') . '" />  <img class="down" onclick="order_down(' . $aRow['pk_i_id'] . ');" src="' . osc_current_admin_theme_url('images/arrow_down.png') . '" alt="' . __('Down') . '" title="' . __('Down') . '" /></div>';
         $this->result['aaData'][] = $row;
     }
 }
开发者ID:semul,项目名称:Osclass,代码行数:39,代码来源:pages_processing.php

示例13: voting_star

                    <img title="<?php 
    echo $tooltip;
    ?>
" src="<?php 
    voting_star(4, $avg_vote);
    ?>
">
                    <img title="<?php 
    echo $tooltip;
    ?>
" src="<?php 
    voting_star(5, $avg_vote);
    ?>
">
                    <span style="position:relative; top:-5px;padding-right: 4px; padding-left: 4px; margin-bottom: 3px;"><?php 
    echo $total;
    ?>
 <?php 
    _e('votes', 'voting');
    ?>
</span>
                </p>
            </div>
        </li>
    <?php 
    $count++;
    View::newInstance()->_erase('user');
}
?>
    </ul>
</div>
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:set_results_user.php

示例14: osc_admin_base_url

            <h1>
                <a href="<?php 
echo View::newInstance()->_get('login_admin_url');
?>
" title="<?php 
echo View::newInstance()->_get('login_admin_title');
?>
">
                    <img src="<?php 
echo View::newInstance()->_get('login_admin_image');
?>
" border="0" title="<?php 
echo View::newInstance()->_get('login_admin_title');
?>
" alt="<?php 
echo View::newInstance()->_get('login_admin_title');
?>
" />
                </a>
            </h1>
            <?php 
osc_show_flash_message('admin');
?>
            <form name="loginform" id="loginform" action="<?php 
echo osc_admin_base_url(true);
?>
" method="post">
                <input type="hidden" name="page" value="login" />
                <input type="hidden" name="action" value="login_post" />
                <p>
                    <label for="user_login">
开发者ID:mylastof,项目名称:os-class,代码行数:31,代码来源:login.php

示例15: osc_get_current_user_locale

/**
 * Gets current locale object
 *
 * @return array
 */
function osc_get_current_user_locale()
{
    $locale = OSCLocale::newInstance()->findByPrimaryKey(osc_current_user_locale());
    View::newInstance()->_exportVariableToView('locale', $locale);
    return $locale;
}
开发者ID:mylastof,项目名称:os-class,代码行数:11,代码来源:hLocale.php


注:本文中的View::newInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。