function _initialise()
 {
     global $dirfonts, $dirimg, $mainframe;
     // used by mathpublisher
     if (!isset($this->regex)) {
         // include the phpMathPublisher code
         $dirmp = get_plugin_dir();
         $dirimg = $dirmp . "img";
         $dirfonts = $dirmp . "fonts";
         $this->mp_inc_file = $dirmp . "mathpublisher.php";
         if (file_exists($this->mp_inc_file)) {
             include_once $this->mp_inc_file;
             if (file_exists($dirimg . DS . "README") && file_exists($dirfonts . DS . "FreeSerif.ttf")) {
                 $this->config_ok = 1;
             }
         }
         $tag = self::_tag;
         $alternativetag = $this->params->def('alternativetag', '');
         if ($alternativetag != '') {
             $tag = '(' . $tag . '|' . $alternativetag . ')';
         } else {
             $tag = '(' . $tag . ')';
         }
         $this->regex = "#{" . $tag . "(?:\\s| )*(.*?)}([\\s\\S]*?){/\\1}#s";
     }
     return $this->regex;
 }
Example #2
0
/**
 * Validate a plugin filename
 *
 * Checks that the file exists and {@link validate_file() is valid file}. If
 * it either condition is not met, returns false and adds an error to the
 * {@see MessageHandler} stack.
 *
 * @since 1.0
 *
 * @param $filename Path to plugin
 * @return bool True if file exists and is valid, otherwise an exception will be thrown
 */
function validate_plugin($filename)
{
    switch (validate_file($filename)) {
        case 1:
        case 2:
            throw new Exception(_r('Invalid plugin path.'), Errors::get_code('admin.plugins.invalid_path'));
            break;
        default:
            if (file_exists(get_plugin_dir() . $filename)) {
                return true;
            } else {
                throw new Exception(_r('Plugin file was not found.'), Errors::get_code('admin.plugins.not_found'));
            }
    }
    return false;
}
Example #3
0
					<th scope="col"><?php 
_e('Status');
?>
</th>
					<th scope="col"><?php 
_e('Action');
?>
</th>
				</tr>
			</thead>
			<tbody>
<?php 
foreach (lilina_plugins_list(get_plugin_dir()) as $plugin) {
    global $current_plugins;
    $plugin_meta = plugins_meta($plugin);
    $plugin_file = str_replace(get_plugin_dir(), '', $plugin);
    ?>
				<tr>
					<td><?php 
    echo $plugin_meta->name;
    ?>
</td>
					<td><?php 
    echo $plugin_meta->version;
    ?>
</td>
					<td><?php 
    echo $plugin_meta->description;
    ?>
</td>
					<td><?php 
/**
 * Validate a plugin filename
 *
 * Checks that the file exists and {@link validate_file() is valid file}. If
 * it either condition is not met, returns false and adds an error to the
 * {@see MessageHandler} stack.
 *
 * @since 1.0
 *
 * @param $filename Path to plugin
 * @return bool True if file exists and is valid, else false
 */
function validate_plugin($filename)
{
    switch (validate_file($filename)) {
        case 1:
        case 2:
            MessageHandler::add_error(_r('Invalid plugin path.'));
            break;
        default:
            if (file_exists(get_plugin_dir() . $filename)) {
                return true;
            } else {
                MessageHandler::add_error(_r('Plugin file was not found.'));
            }
    }
    return false;
}
Example #5
0
<?php

debug_backtrace() || die("Direct access not permitted.");
?>

<?php 
// error_reporting(0);
require_once 'main/init.php';
$user_type = user_type();
if ($user_type == 'admin' || $user_type == 'official') {
    require_once 'main/main.php';
} elseif ($user_type == 'teacher') {
    require_once 'main/teachers/main.php';
} elseif ($user_type == 'principal') {
    require_once 'main/teachers/main.php';
} elseif ($user_type == 'student') {
    require_once 'main/students/main.php';
} elseif ($user_type == 'parent') {
    require_once 'main/parents/main.php';
}
//adding css
add_css([get_plugin_dir() . '/css/style.css', get_plugin_dir() . '/css/datepicker.css']);
//adding js into header
add_js_header(get_plugin_dir() . '/js/functions.js');
//adding js into footer
add_js_footer([get_plugin_dir() . '/js/script.js', get_plugin_dir() . '/js/datepicker.js']);
Example #6
0
    }
}
if (!function_exists('get_plugin_dir')) {
    /**
     * Returns the dir path for the plugin
     *
     * @return string
     */
    function get_plugin_dir()
    {
        $dir_path = plugin_dir_path(__FILE__);
        return $dir_path;
    }
}
if (is_admin()) {
    $dir_path = get_plugin_dir();
    //Only for wordpress.org members
    if (strpos($dir_path, 'wp-smushit') !== false) {
        require_once WP_SMUSH_DIR . 'extras/free-dashboard/module.php';
        // Register the current plugin.
        do_action('wdev-register-plugin', plugin_basename(__FILE__), 'WP Smush', '/plugins/wp-smushit/', __('Get Fast', 'wp-smushit'), 'Smush');
        // The rating message contains 2 variables: user-name, plugin-name
        add_filter('wdev-rating-message-' . plugin_basename(__FILE__), 'wp_smush_rating_message');
        // The email message contains 1 variable: plugin-name
        add_filter('wdev-email-message-' . plugin_basename(__FILE__), 'wp_smush_email_message');
    } elseif (strpos($dir_path, 'wp-smush-pro') !== false) {
        //Only for WPMU DEV Members
        require_once WP_SMUSH_DIR . 'extras/dash-notice/wpmudev-dash-notification.php';
        //register items for the dashboard plugin
        global $wpmudev_notices;
        $wpmudev_notices[] = array('id' => 912164, 'name' => 'WP Smush Pro', 'screens' => array('upload', 'media_page_wp-smush-bulk'));
        /**
         * Show Update info in admin Notice
         *
         */
        function smush_updated()
        {
            //@todo: Update Smush Update Notice for next release
            //Make sure to not display this message for next release
            $plugin_data = get_plugin_data(WP_SMUSH_DIR . 'wp-smush.php', false, false);
            $version = !empty($plugin_data['Version']) ? $plugin_data['Version'] : '';
            //If Versions Do not match
            if (empty($version) || $version != WP_SMUSH_VERSION) {
                return true;
            }
            //Do not display it for other users
            if (!is_super_admin() || !current_user_can('manage_options')) {
                return true;
            }
            //If dismissed, Delete the option on Plugin Activation, For alter releases
            if (1 == get_site_option('wp-smush-hide_update_info')) {
                return true;
            }
            //Get Plugin dir, Return if it's WP Smush Pro installation
            $dir_path = get_plugin_dir();
            if (!empty($dir_path) && strpos($dir_path, 'wp-smush-pro') !== false) {
                return true;
            }
            //Do not show for new installations
            $install_type = get_site_option('wp-smush-install-type', false);
            if (!$install_type || 'new' == $install_type) {
                return true;
            }
            //Do not display the notice on Bulk Smush Screen
            global $current_screen;
            if (!empty($current_screen->base) && ('media_page_wp-smush-bulk' == $current_screen->base || 'gallery_page_wp-smush-nextgen-bulk' == $current_screen->base)) {
                return true;
            }
            //Handles the dismiss action
            $js_url = WP_SMUSH_URL . 'assets/js/notice.js';
            $upgrade_url = add_query_arg(array('utm_source' => 'Smush-Free', 'utm_medium' => 'Banner', 'utm_campaign' => 'now-with-resizing'), $this->upgrade_url);
            $settings_link = '<a href="' . admin_url('upload.php?page=wp-smush-bulk#wp-smush-settings-box') . '" title="' . esc_html__("Settings", "wp-smushit") . '">';
            $upgrade_link = '<a href="' . esc_url($upgrade_url) . '" title="' . esc_html__("WP Smush Pro", "wp-smushit") . '">';
            ?>
			<div class="notice notice-info is-dismissible wp-smush-update-info">
				<p><?php 
            printf(esc_html__("Woohoo! Your latest Smush update %s allows you to %sauto resize%s all your images, how cool is that! %sFind out more here >>%s", 'wp-smushit'), WP_SMUSH_VERSION, $settings_link, '</a>', $upgrade_link, '</a>');
            ?>
</p>
			</div>

			<script src="<?php 
            echo esc_url($js_url) . '?v=' . WP_SMUSH_VERSION;
            ?>
"></script><?php 
        }
Example #8
0
                            <div class="col-md-8">
                                <input type="file" name="add-teacher-image" class="file-pos"
                                id="photo" accept="image/*">
                            </div>
                        </div>
                        <button type="submit" class="btn btn-full form-control"
                        name="addNewTeacher">Add new teacher</button>
                    </form>
                </div>
                </div>    <!--add new data --END-->
                <div class="tab-pane download-csv" id="CSV">
                    <div class="download-csv">
                        <h4>Download a blank CSV file and add teacher's data</h4>
                        <div align="center">
                            <a href="<?php 
echo get_plugin_dir() . '/blank_csv/blank_teacher_field.csv';
?>
">
                                <button type="button" class="btn btn-success">Download Blank CSV</button>
                            </a>
                        </div>
                    </div>
                    <div class="upload-csv">
                        <form role="form" enctype="multipart/form-data" method="post">
                            <h4>Choose a CSV file to upload</h4>
                            <div align="center"><input type="file" name="teacher-csv"
                                accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
                                <div align="center"><input type="submit" name="addTeacherCSV"
                                class="btn btn-outline btn-success" value="Upload CSV"></div>
                            </form>
                        </div>
Example #9
0
if (isset($_POST['addNewStudent'])) {
    $config = ['table' => 'vor_admin', 'where' => ['username' => $_POST['student_username']]];
    if ($schoolManagement->is_row_exists($config)) {
        echo '<script>userNameExists()</script>';
    } else {
        //students
        $image_path = get_plugin_dir() . '/images/students/';
        $config = ['action' => 'add', 'type' => 'student', 'file' => $_FILES['add-student-image'], 'username' => $_POST['student_username'], 'table' => 'scl_students', 'extension' => pathinfo($_FILES['add-student-image']['name'])['extension']];
        $_POST['full_name'] = $_POST['student_full_name'];
        $_POST['username'] = $_POST['student_username'];
        $_POST['password'] = $_POST['student_username'];
        $_POST['email'] = $_POST['student_email'];
        $_POST['parent_username'] = $_POST['parent_username'];
        $schoolManagement->setStudentData($_POST)->sendProfileData($config)->setUserDataField($_POST, $config)->createUser();
        //parents
        $image_path = get_plugin_dir() . '/images/parents/';
        $config = ['action' => 'add', 'type' => 'parent', 'file' => $_FILES['add-parent-image'], 'username' => $_POST['parent_username'], 'table' => 'scl_parents', 'extension' => pathinfo($_FILES['add-parent-image']['name'])['extension']];
        $_POST['full_name'] = $_POST['parent_full_name'];
        $_POST['username'] = $_POST['parent_username'];
        $_POST['password'] = $_POST['parent_username'];
        $_POST['email'] = $_POST['parent_email'];
        $_POST['child_username'] = $_POST['student_username'];
        $schoolManagement->setParentData($_POST)->sendProfileData($config)->setUserDataField($_POST, $config)->createUser();
        if ($schoolManagement->status) {
            echo '<script>profileaAdded()</script>';
            // echo "<meta http-equiv='refresh' content='1;url='>";
        } else {
            echo '<script>error()</script>';
        }
    }
}
Example #10
0
<?php

require_once get_plugin_dir() . '/lib/School_management.php';
require_once get_plugin_dir() . '/lib/Image_resize.php';
require_once get_plugin_dir() . '/lib/Parse_csv.php';
$schoolManagement = new SchoolManagement();
        /**
         * Show Update info in admin Notice
         *
         */
        function smush_updated()
        {
            //@todo: Update Smush Update Notice for next release
            //Make sure to not display this message for next release
            $plugin_data = get_plugin_data(WP_SMUSH_DIR . 'wp-smush.php', false, false);
            $version = !empty($plugin_data['Version']) ? $plugin_data['Version'] : '';
            //If Versions Do not match
            if (empty($version) || $version != WP_SMUSH_VERSION) {
                return true;
            }
            //Do not display it for other users
            if (!is_super_admin() || !current_user_can('manage_options')) {
                return true;
            }
            //If dismissed, Delete the option on Plugin Activation, For alter releases
            if (1 == get_site_option('wp-smush-hide_update_info')) {
                return true;
            }
            //Get Plugin dir, Return if it's WP Smush Pro installation
            $dir_path = get_plugin_dir();
            if (!empty($dir_path) && strpos($dir_path, 'wp-smush-pro') !== false) {
                return true;
            }
            //Do not display the notice on Bulk Smush Screen
            global $current_screen;
            if (!empty($current_screen->base) && ('media_page_wp-smush-bulk' == $current_screen->base || 'gallery_page_wp-smush-nextgen-bulk' == $current_screen->base || 'settings_page_wp-smush-network' == $current_screen->base)) {
                return true;
            }
            //Handles the dismiss action
            $js_url = WP_SMUSH_URL . 'assets/js/notice.js';
            $upgrade_url = add_query_arg(array('utm_source' => 'Smush-Free', 'utm_medium' => 'Banner', 'utm_campaign' => 'now-with-async'), $this->upgrade_url);
            $settings_link = is_multisite() ? network_admin_url('settings.php?page=wp-smush') : admin_url('upload.php?page=wp-smush-bulk');
            $settings_link = '<a href="' . $settings_link . '" title="' . esc_html__("Review your setting now.", "wp-smushit") . '">';
            $upgrade_link = '<a href="' . esc_url($upgrade_url) . '" title="' . esc_html__("WP Smush Pro", "wp-smushit") . '">';
            $message_s = sprintf(esc_html__("Welcome to the newest version of WP Smush! Auto-smushing on upload is lightning fast now that we handle all the smushing asynchronously.", 'wp-smushit'), WP_SMUSH_VERSION, '<strong>', '</strong>');
            //Message for network admin
            $message_s .= is_multisite() ? sprintf(esc_html__(" And as a multisite user, you can manage %sSmush settings%s globally across all sites!", 'wp-smushit'), $settings_link, '</a>') : '';
            //Upgrade link for free users
            $message_s .= !$this->validate_install() ? sprintf(esc_html__(" %sFind out more here >>%s", "wp-smushit"), $upgrade_link, '</a>') : '';
            ?>
			<div class="notice notice-info is-dismissible wp-smush-update-info">
				<p><?php 
            echo $message_s;
            ?>
</p>
			</div>

			<script src="<?php 
            echo esc_url($js_url) . '?v=' . WP_SMUSH_VERSION;
            ?>
"></script><?php 
        }