Beispiel #1
0
        $resp->append('body', $dialog)->showModal($dialog->id);
        break;
    case 'update_icons':
        require_login('admin');
        $icons = \shgysk8zer0\Core\resources\Parser::parseFile('icons.json');
        $found = array_filter(array_unique($icons->icons), 'file_exists');
        if (count($found) === count($icons->icons)) {
            if (SVG_symbols($icons->icons, $icons->output)) {
                $resp->notify('Success!', "Icons have been saved to {$icons->output}");
            } else {
                $resp->notify('We have a problem :(', 'Was unable to update combined SVG due to an error parsing or saving the file', 'images/octicons/svg/bug.svg');
            }
        } else {
            $resp->notify('We have a problem :(', 'Some icons are missing. Check your browser\'s log', 'images/octicons/svg/bug.svg')->log(['Icons' => $icons, 'Found' => $found, 'Missing' => array_diff($icons->icons, $found)]);
        }
        break;
    case 'concatenate_js':
        require_login('admin');
        $scripts = array_map('current', get_dev_scripts());
        if (concatenate_scripts($scripts)) {
            $resp->notify('Success!', 'JavaScript files were concatenated');
        } else {
            $resp->notify('We have a problem :(', 'JavaScript files were not concatenated', 'images/octicons/svg/bug.svg');
        }
        break;
    case 'test':
        require_login('admin');
        $resp->notify('Edit Me', 'I am on line ' . __LINE__ . ' in ' . __FILE__);
        break;
}
exit($resp);
Beispiel #2
0
<?php 
}
if (isset($head->publisher)) {
    ?>
<link rel="publisher" href="https://plus.google.com/<?php 
    echo $head->publisher;
    ?>
"><?php 
}
if (BROWSER === 'IE') {
    ?>
<script type="text/javascript" src="scripts/std-js/polyfills.js"></script>
<?php 
}
if (localhost()) {
    foreach (get_dev_scripts() as $script) {
        echo call_user_func_array('mk_script_tag', $script) . PHP_EOL;
    }
    unset($script);
} else {
    ?>
	<script type="<?php 
    echo BROWSER === 'Firefox' ? 'application/javascript;version=1.8' : 'application/javascript';
    ?>
" src="scripts/combined.js" async></script>
<?php 
}
if (!localhost() and isset($head->google_analytics_code) and !DNT()) {
    define('GA', $head->google_analytics_code);
    ?>
	<script type="application/javascript" src="scripts/std-js/analytics.js" async defer></script>