hasDependencies() static public method

Dependency check.
static public hasDependencies ( ) : boolean
return boolean
コード例 #1
0
 /**
  * Returns a filtered array of tabs that we should be loading.
  * @returns array
  */
 static function getTabs()
 {
     $tabs = array('global' => '\\Pressbooks\\Modules\\ThemeOptions\\GlobalOptions', 'web' => '\\Pressbooks\\Modules\\ThemeOptions\\WebOptions', 'pdf' => '\\Pressbooks\\Modules\\ThemeOptions\\PDFOptions', 'mpdf' => '\\Pressbooks\\Modules\\ThemeOptions\\MPDFOptions', 'ebook' => '\\Pressbooks\\Modules\\ThemeOptions\\EbookOptions');
     if (!\Pressbooks\Modules\Export\Prince\Pdf::hasDependencies()) {
         unset($tabs['pdf']);
     }
     if (!\Pressbooks\Modules\Export\Mpdf\Pdf::hasDependencies()) {
         unset($tabs['mpdf']);
     }
     return apply_filters('pressbooks_theme_options_tabs', $tabs);
 }
コード例 #2
0
ファイル: export.php プロジェクト: pressbooks/pressbooks
$export_delete_url = wp_nonce_url(get_admin_url(get_current_blog_id(), '/admin.php?page=pb_export'), 'pb-delete-export');
$export_delete_all_url = wp_nonce_url(get_admin_url(get_current_blog_id(), '/admin.php?page=pb_export'), 'pb-delete-all-exports');
$download_url_prefix = get_admin_url(get_current_blog_id(), '/admin.php?page=pb_export&download_export_file=');
$timezone_string = get_blog_option(1, 'timezone_string');
$date_format = get_blog_option(1, 'date_format', 'F j, Y');
$time_format = get_blog_option(1, 'time_format', 'g:i a');
if ($timezone_string) {
    date_default_timezone_set($timezone_string);
} else {
    date_default_timezone_set('America/Montreal');
}
// -------------------------------------------------------------------------------------------------------------------
// Warnings and errors
// -------------------------------------------------------------------------------------------------------------------
$dependency_errors = array();
if (false == \Pressbooks\Modules\Export\Prince\Pdf::hasDependencies()) {
    $prince = false;
    $dependency_errors['pdf'] = 'PDF';
} else {
    $prince = true;
}
if (false == \Pressbooks\Modules\Export\Epub\Epub201::hasDependencies()) {
    $epub = false;
    $dependency_errors['epub'] = 'EPUB';
} else {
    $epub = true;
}
if (false == \Pressbooks\Modules\Export\Mobi\Kindlegen::hasDependencies()) {
    $mobi = false;
    $dependency_errors['mobi'] = 'MOBI';
} else {