本文整理汇总了PHP中osc_add_hook函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_add_hook函数的具体用法?PHP osc_add_hook怎么用?PHP osc_add_hook使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_add_hook函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: item_success_admin_title
function item_success_admin_title()
{
if (Params::getParam('file') == 'item_success/admin/settings.php') {
osc_add_hook('custom_plugin_title', 'item_success_admin_page_header');
osc_add_hook('admin_title', 'item_success_admin_page_title');
}
}
示例2: add_menus
/**
* Add toolbar menus and add menus running hook add_admin_toolbar_menus
*/
function add_menus()
{
// User related, aligned right.
osc_add_hook('add_admin_toolbar_menus', 'osc_admin_toolbar_menu', 0);
osc_add_hook('add_admin_toolbar_menus', 'osc_admin_toolbar_comments', 0);
osc_add_hook('add_admin_toolbar_menus', 'osc_admin_toolbar_spam', 0);
osc_add_hook('add_admin_toolbar_menus', 'osc_admin_toolbar_update_themes', 0);
osc_add_hook('add_admin_toolbar_menus', 'osc_admin_toolbar_update_plugins', 0);
osc_add_hook('add_admin_toolbar_menus', 'osc_admin_toolbar_logout', 0);
osc_run_hook('add_admin_toolbar_menus');
}
示例3: actions
public function actions()
{
osc_register_plugin(osc_plugin_path(__FILE__), array('DLN_Classified', 'install'));
// Add admin menu
//$helper_premium = $this->get_helper( 'DLN_Helper_Premium' );
//osc_add_hook('admin_menu_init', array( $helper_premium, 'init_admin_menu' ) );
// Add google map drag n drop
$helper_google = $this->get_helper('DLN_Helper_Google');
osc_add_hook('user_form', array($helper_google, 'load_google_map'));
osc_add_hook('user_edit_completed', array($helper_google, 'insert_google_map'));
// For users premium
$helper_premium = $this->get_helper('DLN_Helper_Premium');
osc_add_hook('admin_users_table', array($helper_premium, 'admin_users_table'));
osc_add_filter('users_processing_row', array($helper_premium, 'users_processing_row'));
osc_add_hook('after_admin_html', array($helper_premium, 'users_html_modal'));
}
示例4: osc_add_hook
});
});
</script>
<?php
}
osc_add_hook('admin_header', 'customHead', 10);
function render_offset()
{
return 'row-offset';
}
function addHelp()
{
echo '<p>' . __("Modify the options that allow your users to publish comments on your site's listings.") . '</p>';
}
osc_add_hook('help_box', 'addHelp');
osc_add_hook('admin_page_header', 'customPageHeader');
function customPageHeader()
{
?>
<h1><?php
_e('Settings');
?>
<a href="#" class="btn ico ico-32 ico-help float-right"></a>
</h1>
<?php
}
function customPageTitle($string)
{
return sprintf(__('Comment Settings » %s'), $string);
}
osc_add_filter('admin_title', 'customPageTitle');
示例5: osc_add_hook
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// meta tag robots
osc_add_hook('header', 'osclasswizards_nofollow_construct');
osclasswizards_add_body_class('error not-found');
osc_current_web_theme_path('header.php');
?>
<div class="page-not-found">
<div class="flashmessage-404 page_error">
<div class="title">
<h1>
<?php
_e("Sorry but I can't find the page you're looking for", OSCLASSWIZARDS_THEME_FOLDER);
?>
</h1>
</div>
<h3>
<?php
示例6: google_analytics_call_after_uninstall
}
function google_analytics_call_after_uninstall()
{
Preference::newInstance()->delete(array("s_section" => "plugin-google_analytics", "s_name" => "google_analytics_id"));
}
function google_analytics_admin()
{
osc_admin_render_plugin('google_analytics/admin.php');
}
// HELPER
function osc_google_analytics_id()
{
return osc_get_preference('google_analytics_id', 'plugin-google_analytics');
}
/**
* This function is called every time the page footer is being rendered
*/
function google_analytics_footer()
{
if (osc_google_analytics_id() != '') {
$id = osc_google_analytics_id();
require osc_plugins_path() . 'google_analytics/footer.php';
}
}
// This is needed in order to be able to activate the plugin
osc_register_plugin(osc_plugin_path(__FILE__), 'google_analytics_call_after_install');
// This is a hack to show a Uninstall link at plugins table (you could also use some other hook to show a custom option panel)
osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'google_analytics_call_after_uninstall');
osc_add_hook(osc_plugin_path(__FILE__) . "_configure", 'google_analytics_admin');
osc_add_hook('footer', 'google_analytics_footer');
示例7: osc_add_hook
<?php
/*
* Osclass – software for creating and publishing online classified
* advertising platforms
*
* Copyright (C) 2014 OSCLASS
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// meta tag robots
osc_add_hook('header', 'osclassclsx_nofollow_construct');
osc_current_web_theme_path('item-post.php');
示例8: addHelp
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function addHelp()
{
echo '<p>' . __('Browse and download available Osclass plugins, from a constantly-updated selection. After downloading a plugin, you have to install it and configure it to get it up and running.') . '</p>';
}
osc_add_hook('help_box', 'addHelp');
osc_current_admin_theme_path('market/header.php');
$title = __get('title');
$section = __get('section');
$array = __get('array');
$pagination = __get('pagination');
$sort = __get('sort');
$url_premium = __get('url_premium');
$url_all = __get('url_all');
$aFeatured = __get('aFeatured');
$colors = array_merge(gradienColors(), array_merge(gradienColors(), gradienColors()));
$categories = __get('market_categories');
$categories = isset($categories[$section]) ? $categories[$section] : array();
if ($section == 'plugins' || $section == 'themes') {
?>
<div class="grid-market">
示例9: osc_add_hook
<?php
// meta tag robots
osc_add_hook('header', 'flatter_nofollow_construct');
osc_enqueue_script('tabber');
osc_enqueue_style('tabs', osc_current_web_theme_url('css/tabs.css'));
flatter_add_body_class('item item-post');
$action = 'item_add_post';
$edit = false;
if (Params::getParam('action') == 'item_edit') {
$action = 'item_edit_post';
$edit = true;
}
osc_enqueue_script('jquery-validate');
osc_current_web_theme_path('header.php');
if (osc_get_preference('location_input', 'flatter_theme') == '1') {
ItemForm::location_javascript();
} else {
ItemForm::location_javascript_new();
}
?>
<div class="itempost">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12 page-title">
<h2><?php
if ($edit) {
?>
<?php
_e('Edit your listing', 'flatter');
?>
示例10: cookie_menu
</script>
<?php
}
function cookie_menu()
{
osc_admin_menu_plugins('Cookies settings', osc_route_admin_url('cookie-conf'), 'cookie-conf');
}
function cookie_install()
{
osc_set_preference('analytics_msg', 'We use cookies, just to track visits to our website, we store no personal details.', 'cookie', 'STRING');
osc_set_preference('non_analytics_msg', 'We use cookies on this website, you can <a href="{{cookiePolicyLink}}" title="read about our cookies">read about them here</a>. To use the website as intended please...', 'cookie', 'STRING');
osc_set_preference('analytics_id', '', 'cookie', 'STRING');
osc_set_preference('policy_link', osc_base_url(), 'cookie', 'STRING');
osc_set_preference('what_are_link', 'http://www.allaboutcookies.org/', 'cookie', 'STRING');
osc_set_preference('domain', '', 'cookie', 'STRING');
osc_set_preference('accept', 1, 'cookie', 'BOOLEAN');
osc_set_preference('decline', 1, 'cookie', 'BOOLEAN');
osc_set_preference('reset', 0, 'cookie', 'BOOLEAN');
}
function cookie_uninstall()
{
Preference::newInstance()->delete(array('s_section' => 'cookie'));
}
osc_add_route('cookie-conf', 'cookie/conf', 'cookie/conf', osc_plugin_folder(__FILE__) . 'admin/conf.php');
osc_register_plugin(osc_plugin_path(__FILE__), 'cookie_install');
osc_add_hook(osc_plugin_path(__FILE__) . "_uninstall", 'cookie_uninstall');
if (OC_ADMIN != 1) {
osc_add_hook('header', 'cookie_load', 10);
}
osc_add_hook('admin_menu_init', 'cookie_menu');
示例11: osc_item_delete_url
$delete_url = osc_item_delete_url($item['s_secret'], $item['pk_i_id']);
$all = '';
if (isset($item['locale'])) {
foreach ($item['locale'] as $locale => $data) {
$locale_name = OSCLocale::newInstance()->listWhere("pk_c_code = '" . $locale . "'");
$all .= '<br/>';
if (isset($locale_name[0]) && isset($locale_name[0]['s_name'])) {
$all .= __('Language') . ': ' . $locale_name[0]['s_name'] . '<br/>';
} else {
$all .= __('Language') . ': ' . $locale . '<br/>';
}
$all .= __('Title') . ': ' . $data['s_title'] . '<br/>';
$all .= __('Description') . ': ' . $data['s_description'] . '<br/>';
$all .= '<br/>';
}
} else {
$all .= __('Title') . ': ' . $item['s_title'] . '<br/>';
$all .= __('Description') . ': ' . $item['s_description'] . '<br/>';
}
// Format activation URL
$validation_url = osc_item_activate_url($item['s_secret'], $item['pk_i_id']);
$words = array();
$words[] = array('{ITEM_DESCRIPTION_ALL_LANGUAGES}', '{ITEM_DESCRIPTION}', '{ITEM_COUNTRY}', '{ITEM_PRICE}', '{ITEM_REGION}', '{ITEM_CITY}', '{ITEM_ID}', '{USER_NAME}', '{USER_EMAIL}', '{WEB_URL}', '{ITEM_TITLE}', '{ITEM_URL}', '{WEB_TITLE}', '{VALIDATION_LINK}', '{VALIDATION_URL}', '{EDIT_LINK}', '{EDIT_URL}', '{DELETE_LINK}', '{DELETE_URL}');
$words[] = array($all, $item['s_description'], $item['s_country'], osc_prepare_price($item['s_price']), $item['s_region'], $item['s_city'], $item['pk_i_id'], $item['s_contact_name'], $item['s_contact_email'], '<a href="' . osc_base_url() . '" >' . osc_base_url() . '</a>', $item['s_title'], $item_url, osc_page_title(), '<a href="' . $validation_url . '" >' . $validation_url . '</a>', $validation_url, '<a href="' . $edit_url . '">' . $edit_url . '</a>', $edit_url, '<a href="' . $delete_url . '">' . $delete_url . '</a>', $delete_url);
$title = osc_mailBeauty(osc_apply_filter('email_title', osc_apply_filter('email_item_validation_non_register_user_title', $content['s_title'])), $words);
$body = osc_mailBeauty(osc_apply_filter('email_description', osc_apply_filter('email_item_validation_non_register_user_description', $content['s_text'])), $words);
$emailParams = array('subject' => $title, 'to' => $item['s_contact_email'], 'to_name' => $item['s_contact_name'], 'body' => $body, 'alt_body' => $body);
osc_sendMail($emailParams);
}
osc_add_hook('hook_email_item_validation_non_register_user', 'fn_email_item_validation_non_register_user');
示例12: osc_get_category
$aCategory = osc_get_category('id', $category_id);
$parentCategory = osc_get_category('id', $aCategory['fk_i_parent_id']);
return $parentCategory['s_name'];
}
function get_parent_subcategories($category_id)
{
$subcategory = array();
View::newInstance()->_exportVariableToView('category', osc_get_category('id', $category_id));
osc_goto_first_category();
while (osc_has_subcategories()) {
$sc = array('name' => osc_category_name(), 'url' => osc_search_category_url());
array_push($subcategory, $sc);
}
return $subcategory;
}
osc_add_hook('after_login', 'userlogin');
function userlogin()
{
osc_redirect_to(osc_user_dashboard_url());
}
function execute_paypal_auth($url, $postdata, $credentials)
{
$header = array('Accept : application/json', 'Accept-language : en_US');
$username = $credentials['username'];
$password = $credentials['password'];
$cred = $username . ":" . $password;
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_USERPWD, $cred);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
示例13: osc_google_maps_header
osc_google_maps_header();
require 'map.php';
}
// HELPER
function osc_google_maps_header()
{
echo '<script src="https://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>';
echo '<style>#itemMap img { max-width: 140em; } </style>';
}
function insert_geo_location($item)
{
$itemId = $item['pk_i_id'];
$aItem = Item::newInstance()->findByPrimaryKey($itemId);
$sAddress = isset($aItem['s_address']) ? $aItem['s_address'] : '';
$sCity = isset($aItem['s_city']) ? $aItem['s_city'] : '';
$sRegion = isset($aItem['s_region']) ? $aItem['s_region'] : '';
$sCountry = isset($aItem['s_country']) ? $aItem['s_country'] : '';
$address = sprintf('%s, %s, %s, %s', $sAddress, $sCity, $sRegion, $sCountry);
$response = osc_file_get_contents(sprintf('https://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false', urlencode($address)));
$jsonResponse = json_decode($response);
if (isset($jsonResponse->results[0]->geometry->location) && count($jsonResponse->results[0]->geometry->location) > 0) {
$location = $jsonResponse->results[0]->geometry->location;
$lat = $location->lat;
$lng = $location->lng;
ItemLocation::newInstance()->update(array('d_coord_lat' => $lat, 'd_coord_long' => $lng), array('fk_i_item_id' => $itemId));
}
}
osc_add_hook('location', 'google_maps_location');
osc_add_hook('posted_item', 'insert_geo_location');
osc_add_hook('edited_item', 'insert_geo_location');
示例14: generate_link
}
function generate_link($title, $href, $rel)
{
if ($rel == 1) {
$follow = ' rel="nofollow" ';
} else {
$follow = ' ';
}
$text = '<a href="' . $href . '" title = "' . $title . '" target="_blank"' . $follow . '>' . $title . '</a>';
return isset($text) ? $text : '';
}
function SeoFooterLinks()
{
$text = '';
foreach (osc_has_links_seo() as $links) {
if ($links['seo_footer'] == 1) {
if ($text != '') {
$text .= ' | ';
}
$text .= generate_link($links['seo_title'], $links['seo_href'], $links['seo_rel']);
}
}
echo '<div id="footer-links" style="float:left;width:100%;clear:both;">' . $text . '</div>';
}
if (strpos($myPlugin[2], 'All') == false && !osc_is_admin_user_logged_in()) {
header('Location:' . osc_base_url());
}
// Add links to footer if enabled
if (osc_get_preference('allSeo_links_footer', 'plugin-all_in_one') == 1) {
osc_add_hook('footer', 'SeoFooterLinks');
}
示例15: osc_check_languages_update
function osc_check_languages_update($force = false)
{
$total = getPreference('languages_update_count');
if ($force) {
return _osc_check_languages_update();
} else {
if (time() - osc_languages_last_version_check() > 24 * 3600) {
osc_add_hook('admin_footer', 'check_languages_admin_footer');
}
}
return $total;
}