Esempio n. 1
0
 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');
     }
 }
Esempio n. 2
0
 /**
  * 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');
 }
Esempio n. 3
0
 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'));
 }
Esempio n. 4
0
    });
});
</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 &raquo; %s'), $string);
}
osc_add_filter('admin_title', 'customPageTitle');
Esempio n. 5
0
 *
 *       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 
Esempio n. 6
0
}
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');
Esempio n. 7
0
<?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');
Esempio n. 8
0
 * 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">
Esempio n. 9
0
<?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');
    ?>
Esempio n. 10
0
        </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');
Esempio n. 11
0
    $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');
Esempio n. 12
0
    $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);
Esempio n. 13
0
    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');
}
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');
}
Esempio n. 15
0
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;
}
<?php

// meta tag robots
osc_add_hook('header', 'pop_nofollow_construct');
pop_add_body_class('contact');
osc_enqueue_script('jquery-validate');
osc_current_web_theme_path('header.php');
?>
<div class="form-container box">
    <div class="header">
        <h1><?php 
_e('Contact us', 'pop');
?>
</h1>
    </div>
    <div class="form-content">
        <ul id="error_list"></ul>
        <form name="contact_form" action="<?php 
echo osc_base_url(true);
?>
" method="post" >
            <input type="hidden" name="page" value="contact" />
            <input type="hidden" name="action" value="contact_post" />
            <div class="control-group">
                <label class="control-label" for="yourName">
                    <?php 
_e('Your name', 'pop');
?>
                    (<?php 
_e('optional', 'pop');
?>
Esempio n. 17
0
            </ul>';
    } else {
        osc_add_admin_submenu_page('plugins', __('Breadcrumbs F.A.Q. / Help', 'breadcrumbs'), osc_route_admin_url('breadcrumbs-admin-help'), 'breadcrumbs_help', 'administrator');
    }
}
if (osc_version() >= 320) {
    /**
     * ADD ROUTES (VERSION 3.2+)
     */
    osc_add_route('breadcrumbs-admin-help', 'breadcrumbs/admin/help', 'breadcrumbs/admin/help', osc_plugin_folder(__FILE__) . 'help.php');
}
function breadcrumbs_help()
{
    if (osc_version() < 320) {
        osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/help.php');
    } else {
        osc_redirect_to(osc_route_admin_url('breadcrumbs-admin-help'));
    }
}
// This is needed in order to be able to activate the plugin
osc_register_plugin(osc_plugin_path(__FILE__), '');
// This is a hack to show a Configure link at plugins table (you could also use some other hook to show a custom option panel)
osc_add_hook(osc_plugin_path(__FILE__) . '_configure', 'breadcrumbs_help');
// 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', '');
// Add the help to the menu
if (osc_version() < 320) {
    osc_add_hook('admin_menu', 'breadcrumbs_admin_menu');
} else {
    osc_add_hook('admin_menu_init', 'breadcrumbs_admin_menu');
}
Esempio n. 18
0
    font-size:14px;
    color: #fefefe;
}
</style>
    <?php 
    }
}
function osc_meta_generator()
{
    echo '<meta name="generator" content="Osclass ' . OSCLASS_VERSION . '" />';
}
osc_add_hook('header', 'osc_show_maintenance');
osc_add_hook('header', 'osc_show_maintenance_css');
osc_add_hook('header', 'osc_meta_generator');
osc_add_hook('header', 'osc_load_scripts', 10);
osc_add_hook('header', 'osc_load_styles', 10);
// register scripts
osc_register_script('jquery', osc_assets_url('js/jquery.min.js'));
osc_register_script('jquery-ui', osc_assets_url('js/jquery-ui.min.js'), 'jquery');
osc_register_script('jquery-json', osc_assets_url('js/jquery.json.js'), 'jquery');
osc_register_script('jquery-treeview', osc_assets_url('js/jquery.treeview.js'), 'jquery');
osc_register_script('jquery-nested', osc_assets_url('js/jquery.ui.nestedSortable.js'), 'jquery');
osc_register_script('jquery-validate', osc_assets_url('js/jquery.validate.min.js'), 'jquery');
osc_register_script('tabber', osc_assets_url('js/tabber-minimized.js'), 'jquery');
osc_register_script('tiny_mce', osc_assets_url('js/tiny_mce/tiny_mce.js'));
osc_register_script('colorpicker', osc_assets_url('js/colorpicker/js/colorpicker.js'));
Plugins::init();
osc_csrfguard_start();
if (!class_exists('PHPMailer')) {
    require_once osc_lib_path() . 'phpmailer/class.phpmailer.php';
}
Esempio n. 19
0
                <?php 
}
?>
                </tbody>
            </table>
            <div id="table-row-actions"></div> <!-- used for table actions -->
        </div>
    </form>
</div>
<?php 
function showingResults()
{
    $aData = __get("aData");
    echo '<ul class="showing-results"><li><span>' . osc_pagination_showing((Params::getParam('iPage') - 1) * $aData['iDisplayLength'] + 1, (Params::getParam('iPage') - 1) * $aData['iDisplayLength'] + count($aData['aRows']), $aData['iTotalDisplayRecords'], $aData['iTotalRecords']) . '</span></li></ul>';
}
osc_add_hook('before_show_pagination_admin', 'showingResults');
osc_show_pagination_admin($aData);
?>
<form id="dialog-ban-delete" method="get" action="<?php 
echo osc_admin_base_url(true);
?>
" class="has-form-actions hide" title="<?php 
echo osc_esc_html(__('Delete rule'));
?>
">
    <input type="hidden" name="page" value="users" />
    <input type="hidden" name="action" value="delete_ban_rule" />
    <input type="hidden" name="id[]" value="" />
    <div class="form-horizontal">
        <div class="form-row">
            <?php 
function pop_init_config()
{
    // block send_friend, send_friend_post
    if (Params::getParam('action') == 'send_friend' || Params::getParam('action') == 'send_friend_post') {
        pop_redirect_404();
    }
    if (Params::getParam('action') == 'pub_profile') {
        Params::setParam('itemsPerPage', osc_default_results_per_page_at_search());
    }
    if (!osc_rewrite_enabled()) {
        if (Params::getParam('page') == 'search' && Params::getParam('hook') == 'load_more_listing') {
            // no stdio at search page, only via ajax
            osc_add_hook('after_search', 'pop_echo_pop_print_listing_card');
        }
    }
}
Esempio n. 21
0
                        action: 'test_mail_template',
                        email:  $('input[name="test_email"]:visible').val(),
                        title:  $('input[name*="s_title"]:visible').val(),
                        body: tinyMCE.get(idTinymce).getContent({format : 'html'})
                    },
                    function(data) {
                        alert(data.html);
                    }, 'json');
                    return false;
                });
            });

        </script>
        <?php 
}
osc_add_hook('admin_header', 'customHead', 10);
function customPageTitle($string)
{
    return sprintf(__('Edit email template &raquo; %s'), $string);
}
osc_add_filter('admin_title', 'customPageTitle');
$email = __get("email");
$aEmailVars = EmailVariables::newInstance()->getVariables($email);
$locales = OSCLocale::newInstance()->listAllEnabled();
osc_current_admin_theme_path('parts/header.php');
?>

<div class="grid-row no-bottom-margin">
    <div class="row-wrapper">
        <h2 class="render-title"><?php 
_e('Edit email template');
Esempio n. 22
0
require_once LIB_PATH . 'osclass/functions.php';
define('__OSC_LOADED__', true);
Plugins::init();
// init Rewrite class only iif it's the frontend
if (!OC_ADMIN) {
    Rewrite::newInstance()->init();
}
// Moved from BaseModel, since we need some session magic on index.php ;)
Session::newInstance()->session_start();
if (osc_timezone() != '') {
    date_default_timezone_set(osc_timezone());
}
function osc_show_maintenance()
{
    if (defined('__OSC_MAINTENANCE__')) {
        ?>
        <div id="maintenance" name="maintenance">
             <?php 
        _e("The website is currently under maintenance mode");
        ?>
        </div>
    <?php 
    }
}
function osc_meta_generator()
{
    echo '<meta name="generator" content="OSClass ' . OSCLASS_VERSION . '" />';
}
osc_add_hook("header", "osc_show_maintenance");
osc_add_hook("header", "osc_meta_generator");
/* file end: ./oc-load.php */
Esempio n. 23
0
function butler_init_pageHeader()
{
    $_r = Params::getParam('route');
    switch ($_r) {
        case 'butler-admin-conf':
        case 'butler-admin-stats':
            osc_remove_hook('admin_page_header', 'customPageHeader');
            osc_add_hook('admin_page_header', 'butler_PageHeader');
            break;
        default:
            break;
    }
}
Esempio n. 24
0
 function doModel()
 {
     parent::doModel();
     //specific things for this class
     switch ($this->action) {
         case 'bulk_actions':
             osc_csrf_check();
             $id = Params::getParam('id');
             if ($id) {
                 switch (Params::getParam('bulk_actions')) {
                     case 'delete_all':
                         $this->itemCommentManager->delete(array(DB_CUSTOM_COND => 'pk_i_id IN (' . implode(', ', $id) . ')'));
                         foreach ($id as $_id) {
                             $iUpdated = $this->itemCommentManager->delete(array('pk_i_id' => $_id));
                             osc_add_hook("delete_comment", $_id);
                         }
                         osc_add_flash_ok_message(_m('The comments have been deleted'), 'admin');
                         break;
                     case 'activate_all':
                         foreach ($id as $_id) {
                             $iUpdated = $this->itemCommentManager->update(array('b_active' => 1), array('pk_i_id' => $_id));
                             if ($iUpdated) {
                                 $this->sendCommentActivated($_id);
                             }
                             osc_add_hook("activate_comment", $_id);
                         }
                         osc_add_flash_ok_message(_m('The comments have been approved'), 'admin');
                         break;
                     case 'deactivate_all':
                         foreach ($id as $_id) {
                             $this->itemCommentManager->update(array('b_active' => 0), array('pk_i_id' => $_id));
                             osc_add_hook("deactivate_comment", $_id);
                         }
                         osc_add_flash_ok_message(_m('The comments have been disapproved'), 'admin');
                         break;
                     case 'enable_all':
                         foreach ($id as $_id) {
                             $iUpdated = $this->itemCommentManager->update(array('b_enabled' => 1), array('pk_i_id' => $_id));
                             if ($iUpdated) {
                                 $this->sendCommentActivated($_id);
                             }
                             osc_add_hook("enable_comment", $_id);
                         }
                         osc_add_flash_ok_message(_m('The comments have been unblocked'), 'admin');
                         break;
                     case 'disable_all':
                         foreach ($id as $_id) {
                             $this->itemCommentManager->update(array('b_enabled' => 0), array('pk_i_id' => $_id));
                             osc_add_hook("disable_comment", $_id);
                         }
                         osc_add_flash_ok_message(_m('The comments have been blocked'), 'admin');
                         break;
                     default:
                         if (Params::getParam("bulk_actions") != "") {
                             osc_run_hook("item_bulk_" . Params::getParam("bulk_actions"), Params::getParam('id'));
                         }
                         break;
                 }
             }
             $this->redirectTo(osc_admin_base_url(true) . "?page=comments");
             break;
         case 'status':
             osc_csrf_check();
             $id = Params::getParam('id');
             $value = Params::getParam('value');
             if (!$id) {
                 return false;
             }
             $id = (int) $id;
             if (!is_numeric($id)) {
                 return false;
             }
             if (!in_array($value, array('ACTIVE', 'INACTIVE', 'ENABLE', 'DISABLE'))) {
                 return false;
             }
             if ($value == 'ACTIVE') {
                 $iUpdated = $this->itemCommentManager->update(array('b_active' => 1), array('pk_i_id' => $id));
                 if ($iUpdated) {
                     $this->sendCommentActivated($id);
                 }
                 osc_add_hook("activate_comment", $id);
                 osc_add_flash_ok_message(_m('The comment has been approved'), 'admin');
             } else {
                 if ($value == 'INACTIVE') {
                     $iUpdated = $this->itemCommentManager->update(array('b_active' => 0), array('pk_i_id' => $id));
                     osc_add_hook("deactivate_comment", $id);
                     osc_add_flash_ok_message(_m('The comment has been disapproved'), 'admin');
                 } else {
                     if ($value == 'ENABLE') {
                         $iUpdated = $this->itemCommentManager->update(array('b_enabled' => 1), array('pk_i_id' => $id));
                         osc_add_hook("enable_comment", $id);
                         osc_add_flash_ok_message(_m('The comment has been enabled'), 'admin');
                     } else {
                         if ($value == 'DISABLE') {
                             $iUpdated = $this->itemCommentManager->update(array('b_enabled' => 0), array('pk_i_id' => $id));
                             osc_add_hook("disable_comment", $id);
                             osc_add_flash_ok_message(_m('The comment has been disabled'), 'admin');
                         }
                     }
                 }
             }
             $this->redirectTo(osc_admin_base_url(true) . "?page=comments");
             break;
         case 'comment_edit':
             $comment = ItemComment::newInstance()->findByPrimaryKey(Params::getParam('id'));
             $this->_exportVariableToView('comment', $comment);
             $this->doView('comments/frm.php');
             break;
         case 'comment_edit_post':
             osc_csrf_check();
             $msg = '';
             if (!osc_validate_email(Params::getParam('authorEmail'), true)) {
                 $msg .= _m('Email is not correct') . "<br/>";
             }
             if (!osc_validate_text(Params::getParam('body'), 1, true)) {
                 $msg .= _m('Comment is required') . "<br/>";
             }
             if ($msg != '') {
                 osc_add_flash_error_message($msg, 'admin');
                 $this->redirectTo(osc_admin_base_url(true) . "?page=comments&action=comment_edit&id=" . Params::getParam('id'));
             }
             $this->itemCommentManager->update(array('s_title' => Params::getParam('title'), 's_body' => Params::getParam('body'), 's_author_name' => Params::getParam('authorName'), 's_author_email' => Params::getParam('authorEmail')), array('pk_i_id' => Params::getParam('id')));
             osc_run_hook('edit_comment', Params::getParam('id'));
             osc_add_flash_ok_message(_m('Great! We just updated your comment'), 'admin');
             $this->redirectTo(osc_admin_base_url(true) . "?page=comments");
             break;
         case 'delete':
             osc_csrf_check();
             $this->itemCommentManager->deleteByPrimaryKey(Params::getParam('id'));
             osc_add_flash_ok_message(_m('The comment has been deleted'), 'admin');
             osc_run_hook('delete_comment', Params::getParam('id'));
             $this->redirectTo(osc_admin_base_url(true) . "?page=comments");
             break;
         default:
             require_once osc_lib_path() . "osclass/classes/datatables/CommentsDataTable.php";
             // set default iDisplayLength
             if (Params::getParam('iDisplayLength') != '') {
                 Cookie::newInstance()->push('listing_iDisplayLength', Params::getParam('iDisplayLength'));
                 Cookie::newInstance()->set();
             } else {
                 // set a default value if it's set in the cookie
                 if (Cookie::newInstance()->get_value('listing_iDisplayLength') != '') {
                     Params::setParam('iDisplayLength', Cookie::newInstance()->get_value('listing_iDisplayLength'));
                 } else {
                     Params::setParam('iDisplayLength', 10);
                 }
             }
             $this->_exportVariableToView('iDisplayLength', Params::getParam('iDisplayLength'));
             // Table header order by related
             if (Params::getParam('sort') == '') {
                 Params::setParam('sort', 'date');
             }
             if (Params::getParam('direction') == '') {
                 Params::setParam('direction', 'desc');
             }
             $page = (int) Params::getParam('iPage');
             if ($page == 0) {
                 $page = 1;
             }
             Params::setParam('iPage', $page);
             $params = Params::getParamsAsArray();
             $commentsDataTable = new CommentsDataTable();
             $commentsDataTable->table($params);
             $aData = $commentsDataTable->getData();
             if (count($aData['aRows']) == 0 && $page != 1) {
                 $total = (int) $aData['iTotalDisplayRecords'];
                 $maxPage = ceil($total / (int) $aData['iDisplayLength']);
                 $url = osc_admin_base_url(true) . '?' . Params::getServerParam('QUERY_STRING', false, false);
                 if ($maxPage == 0) {
                     $url = preg_replace('/&iPage=(\\d)+/', '&iPage=1', $url);
                     $this->redirectTo($url);
                 }
                 if ($page > 1) {
                     $url = preg_replace('/&iPage=(\\d)+/', '&iPage=' . $maxPage, $url);
                     $this->redirectTo($url);
                 }
             }
             $this->_exportVariableToView('aData', $aData);
             $this->_exportVariableToView('aRawRows', $commentsDataTable->rawRows());
             $bulk_options = array(array('value' => '', 'data-dialog-content' => '', 'label' => __('Bulk actions')), array('value' => 'delete_all', 'data-dialog-content' => sprintf(__('Are you sure you want to %s the selected comments?'), strtolower(__('Delete'))), 'label' => __('Delete')), array('value' => 'activate_all', 'data-dialog-content' => sprintf(__('Are you sure you want to %s the selected comments?'), strtolower(__('Activate'))), 'label' => __('Activate')), array('value' => 'deactivate_all', 'data-dialog-content' => sprintf(__('Are you sure you want to %s the selected comments?'), strtolower(__('Deactivate'))), 'label' => __('Deactivate')), array('value' => 'disable_all', 'data-dialog-content' => sprintf(__('Are you sure you want to %s the selected comments?'), strtolower(__('Block'))), 'label' => __('Block')), array('value' => 'enable_all', 'data-dialog-content' => sprintf(__('Are you sure you want to %s the selected comments?'), strtolower(__('Unblock'))), 'label' => __('Unblock')));
             $bulk_options = osc_apply_filter("comment_bulk_filter", $bulk_options);
             $this->_exportVariableToView('bulk_options', $bulk_options);
             $this->doView('comments/index.php');
             break;
     }
 }
function votingmenu()
{
    ?>
<style>
    .ico-voting_plugin {
        background-image: url('<?php 
    echo osc_base_url();
    ?>
oc-content/plugins/<?php 
    echo osc_plugin_folder(__FILE__);
    ?>
img/split.png') !important;
        background-position:0px -48px;
    }
    .ico-voting_plugin:hover,
    .current .ico-voting_plugin{
        background-position:0px -0px;
    }

    body.compact .ico-voting_plugin{
        background-position:-48px -48px;
    }
    body.compact .ico-voting_plugin:hover,
    body.compact .current .ico-voting_plugin{
        background-position:-48px 0px;
    }
</style>
    <?php 
}
osc_add_hook('admin_page_header', 'votingmenu', 9);
Esempio n. 26
0
        $section = Rewrite::newInstance()->get_section();
        if ($location == 'user' && ($section == 'profile' || $section == 'change_password' || $section == 'change_email')) {
            return true;
        }
        return false;
    }
}
if (!function_exists('twitter_admin_menu')) {
    function twitter_admin_menu()
    {
        echo '<h3><a href="#">' . __('Twitter theme', 'twitter') . '</a></h3>
            <ul>
                <li><a href="' . osc_admin_render_theme_url('oc-content/themes/twitter/admin/admin_settings.php') . '">&raquo; ' . __('Settings theme', 'twitter') . '</a></li>
            </ul>';
    }
    osc_add_hook('admin_menu', 'twitter_admin_menu');
}
if (!function_exists('osc_item_category_url')) {
    function osc_item_category_url($category_id)
    {
        View::newInstance()->_erase('subcategories');
        View::newInstance()->_erase('categories');
        View::newInstance()->_exportVariableToView('category', Category::newInstance()->findByPrimaryKey($category_id));
        $url = osc_search_category_url();
        View::newInstance()->_erase('category');
        return $url;
    }
}
if (!function_exists('meta_title')) {
    function meta_title()
    {
Esempio n. 27
0
 *     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('user user-profile');
osc_add_hook('before-main', 'sidebar');
function sidebar()
{
    osc_current_web_theme_path('user-sidebar.php');
}
osc_add_filter('meta_title_filter', 'custom_meta_title');
function custom_meta_title($data)
{
    return __('Update account', OSCLASSWIZARDS_THEME_FOLDER);
}
osc_current_web_theme_path('header.php');
$osc_user = osc_user();
?>

<div class="row">
  <?php 
Esempio n. 28
0
        <script type="text/javascript">
            $(document).ready(function() {
                $.getJSON(
                    '<?php 
        echo osc_admin_base_url(true);
        ?>
?page=ajax&action=check_version',
                    {},
                    function(data){}
                );
            });
        </script>
        <?php 
    }
}
osc_add_hook('admin_footer', 'check_version_admin_footer');
function check_languages_admin_footer()
{
    ?>
    <script type="text/javascript">
        $(document).ready(function() {
            $.getJSON(
                '<?php 
    echo osc_admin_base_url(true);
    ?>
?page=ajax&action=check_languages',
                {},
                function(data){}
            );
        });
    </script>
Esempio n. 29
0
/*
 *      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', 'bender_nofollow_construct');
bender_add_body_class('page');
osc_current_web_theme_path('header.php');
?>
<h1><?php 
echo osc_static_page_title();
?>
</h1>
<?php 
echo osc_static_page_text();
osc_current_web_theme_path('footer.php');
Esempio n. 30
0
        $js = "<script>\n                          \$(document).ready(function () {\n                              \$('#logo').html('" . $html . "');\n                          });\n                      </script>";
        if (file_exists(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
            echo $js;
        }
    }
    osc_add_hook("header", "add_logo_header");
}
if (!function_exists('modern_admin_menu')) {
    function modern_admin_menu()
    {
        echo '<h3><a href="#">' . __('Modern theme', 'modern') . '</a></h3>
            <ul>
                <li><a href="' . osc_admin_render_theme_url('oc-content/themes/modern/admin/admin_settings.php') . '">&raquo; ' . __('Settings theme', 'modern') . '</a></li>
            </ul>';
    }
    osc_add_hook('admin_menu', 'modern_admin_menu');
}
if (!function_exists('meta_title')) {
    function meta_title()
    {
        $location = Rewrite::newInstance()->get_location();
        $section = Rewrite::newInstance()->get_section();
        switch ($location) {
            case 'item':
                switch ($section) {
                    case 'item_add':
                        $text = __('Publish an item', 'modern') . ' - ' . osc_page_title();
                        break;
                    case 'item_edit':
                        $text = __('Edit your item', 'modern') . ' - ' . osc_page_title();
                        break;