Exemplo n.º 1
0
function focus_setup_metainfo()
{
    global $REX;
    if (!isset($REX['USER'])) {
        return;
    }
    $install_metas = array('med_focuspoint_data' => array('Focuspoint Data', 'med_focuspoint_data', 200, '', 1, '', '', '', ''), 'med_focuspoint_css' => array('Focuspoint CSS', 'med_focuspoint_css', 201, '', 1, '', '', '', ''));
    $db = new rex_sql();
    foreach ($db->getDbArray('SHOW COLUMNS FROM `rex_file` LIKE \'med_focuspoint_%\';') as $column) {
        unset($install_metas[$column['Field']]);
    }
    foreach ($install_metas as $k => $v) {
        $db->setQuery('SELECT `name` FROM `rex_62_params` WHERE `name`=\'' . $k . '\';');
        if ($db->getRows() > 0) {
            // FIELD KNOWN TO METAINFO BUT MISSING IN ARTICLE..
            $db->setQuery('ALTER TABLE `rex_file` ADD `' . $k . '` TEXT NOT NULL;');
            if ($REX['REDAXO']) {
                echo rex_info('Metainfo Feld ' . $k . ' wurde repariert.');
            }
        } else {
            if (!function_exists('a62_add_field')) {
                require_once $REX['INCLUDE_PATH'] . '/addons/metainfo/functions/function_metainfo.inc.php';
            }
            a62_add_field($v[0], $v[1], $v[2], $v[3], $v[4], $v[5], $v[6], $v[7], $v[8]);
            if ($REX['REDAXO']) {
                echo rex_info('Metainfo Feld ' . $k . ' wurde angelegt.');
            }
        }
    }
    rex_file::copy(rex_path::addon("focuspoint", "classes/class.rex_effect_focuspoint_resize.inc.php"), rex_path::addon("image_manager", "classes/effects/class.rex_effect_focuspoint_resize.inc.php"));
}
Exemplo n.º 2
0
 public function testCopyToDir()
 {
     $orig = $this->getPath('file.txt');
     $copyDir = $this->getPath('copy');
     $copyFile = $this->getPath('copy/file.txt');
     $content = 'test';
     rex_file::put($orig, $content);
     rex_dir::create($copyDir);
     $this->assertTrue(rex_file::copy($orig, $copyDir), 'copy() returns true on success');
     $this->assertEquals($content, rex_file::get($copyFile), 'content of new file is the same as of original file');
 }
Exemplo n.º 3
0
 /**
  * Copies a directory
  *
  * @param string $srcdir Path of the source directory
  * @param string $dstdir Path of the destination directory
  * @return boolean TRUE on success, FALSE on failure
  */
 public static function copy($srcdir, $dstdir)
 {
     $srcdir = rtrim($srcdir, DIRECTORY_SEPARATOR);
     $dstdir = rtrim($dstdir, DIRECTORY_SEPARATOR);
     if (!self::create($dstdir)) {
         return false;
     }
     $state = true;
     foreach (rex_finder::factory($srcdir)->recursive() as $srcfilepath => $srcfile) {
         $dstfile = $dstdir . substr($srcfilepath, strlen($srcdir));
         if ($srcfile->isDir()) {
             $state = self::create($dstfile) && $state;
         } else {
             $state = rex_file::copy($srcfilepath, $dstfile) && $state;
         }
     }
     return $state;
 }
Exemplo n.º 4
0
     $subject = $ep->getSubject();
     $file = rex_plugin::get('be_style', $mypage)->getPath('scss/default.scss');
     array_unshift($subject, $file);
     return $subject;
 }, rex_extension::EARLY);
 if (rex::getUser() && $this->getProperty('compile')) {
     rex_addon::get('be_style')->setProperty('compile', true);
     rex_extension::register('PACKAGES_INCLUDED', function () {
         $compiler = new rex_scss_compiler();
         $compiler->setRootDir($this->getPath('scss/'));
         $compiler->setScssFile($this->getPath('scss/master.scss'));
         // Compile in backend assets dir
         $compiler->setCssFile($this->getPath('assets/css/styles.css'));
         $compiler->compile();
         // Compiled file to copy in frontend assets dir
         rex_file::copy($this->getPath('assets/css/styles.css'), $this->getAssetsPath('css/styles.css'));
     });
 }
 rex_view::addCssFile($this->getAssetsUrl('css/styles.css'));
 rex_view::addJsFile($this->getAssetsUrl('javascripts/redaxo.js'));
 rex_extension::register('PAGE_HEADER', function (rex_extension_point $ep) {
     $icons = [];
     foreach (['57', '60', '72', '76', '114', '120', '144', '152'] as $size) {
         $size = $size . 'x' . $size;
         $icons[] = '<link rel="apple-touch-icon-precomposed" sizes="' . $size . '" href="' . $this->getAssetsUrl('images/apple-touch-icon-' . $size . '.png') . '" />';
     }
     foreach (['16', '32', '96', '128', '196'] as $size) {
         $size = $size . 'x' . $size;
         $icons[] = '<link rel="icon" type="image/png" href="' . $this->getAssetsUrl('images/favicon-' . $size . '.png') . '" sizes="' . $size . '" />';
     }
     $icons[] = '<meta name="msapplication-TileColor" content="#FFFFFF" />';
Exemplo n.º 5
0
<?php

/**
 * Backendstyle Addon.
 *
 * @author jan.kristinus[at]redaxo[dot]de Jan Kristinus
 * @author <a href="http://www.yakamara.de">www.yakamara.de</a>
 * @author markus[dot]staab[at]redaxo[dot]de Markus Staab
 * @author <a href="http://www.redaxo.org">www.redaxo.org</a>
 *
 * @package redaxo5
 */
$files = [$this->getPath('vendor/bootstrap/assets/javascripts/bootstrap.js') => $this->getAssetsPath('javascripts/bootstrap.js'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.eot') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.eot'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.svg') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.svg'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.ttf'), $this->getPath('vendor/bootstrap/assets/fonts/bootstrap/glyphicons-halflings-regular.woff') => $this->getAssetsPath('fonts/bootstrap/glyphicons-halflings-regular.woff'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.eot') => $this->getAssetsPath('fonts/fontawesome-webfont.eot'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.svg') => $this->getAssetsPath('fonts/fontawesome-webfont.svg'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.ttf') => $this->getAssetsPath('fonts/fontawesome-webfont.ttf'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.woff') => $this->getAssetsPath('fonts/fontawesome-webfont.woff'), $this->getPath('vendor/font-awesome/fonts/fontawesome-webfont.woff2') => $this->getAssetsPath('fonts/fontawesome-webfont.woff2'), $this->getPath('vendor/font-awesome/fonts/FontAwesome.otf') => $this->getAssetsPath('fonts/FontAwesome.otf'), $this->getPath('vendor/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js') => $this->getAssetsPath('javascripts/perfect-scrollbar.jquery.min.js'), $this->getPath('vendor/perfect-scrollbar/css/perfect-scrollbar.min.css') => $this->getAssetsPath('css/perfect-scrollbar.min.css')];
foreach ($files as $source => $destination) {
    rex_file::copy($source, $destination);
}
Exemplo n.º 6
0
 public static function copyHtaccess()
 {
     rex_file::copy(rex_path::addon('yrewrite', 'setup/.htaccess'), rex_path::frontend('.htaccess'));
 }
Exemplo n.º 7
0
<?php

/**
 * Backendstyle Addon.
 *
 * @author jan.kristinus[at]redaxo[dot]de Jan Kristinus
 * @author <a href="http://www.yakamara.de">www.yakamara.de</a>
 * @author markus[dot]staab[at]redaxo[dot]de Markus Staab
 * @author <a href="http://www.redaxo.org">www.redaxo.org</a>
 *
 * @package redaxo\be-style
 *
 * @var rex_addon $this
 */
$files = (require __DIR__ . '/vendor_files.php');
foreach ($files as $source => $destination) {
    rex_file::copy($this->getPath($source), $this->getAssetsPath($destination));
}