/**
  * Return the last modified file
  *
  * @return string $lastModified, last modified file
  */
 public function getLastModifiedFile() {
     $files = new JavaScriptLoader();
     $files->addNameSpaceFiles();
     $filesArray = $files->getAllFiles();
     $mod = array();
     foreach($this->files as $file) {
         $mod[] =  filemtime($file);
     }
     uasort($mod, 'cmp');
     $lastModified = end($mod);
     return $lastModified;
 }
 /**
  * Construct
  * @param IComponentContainer parent
  * @param string name
  */
 public function __construct(IComponentContainer $parent = null, $name = null)
 {
     parent::__construct($parent, $name);
     $this->tempUri = Environment::getVariable("baseUri") . "webtemp";
     $this->tempPath = WWW_DIR . "/webtemp";
     $this->sourcePath = WWW_DIR . "/texyla/";
     $this->addFiles(array("js/texyla.js", "js/selection.js", "js/texy.js", "js/buttons.js", "js/dom.js", "js/view.js", "js/ajaxupload.js", "languages/cs.js", "languages/sk.js", "languages/en.js", "plugins/keys/keys.js", "plugins/window/window.js", "plugins/resizableTextarea/resizableTextarea.js", "plugins/img/img.js", "plugins/table/table.js", "plugins/link/link.js", "plugins/emoticon/emoticon.js", "plugins/symbol/symbol.js", "plugins/files/files.js", "plugins/color/color.js", "plugins/textTransform/textTransform.js", "plugins/youtube/youtube.js"));
     $this->filters[] = "JSMin::minify";
 }
Example #3
0
            $cmd = 'show';
        }
    }
}
if ($is_viewAllowed || $is_postAllowed) {
    //notification commands should be handled by ajax calls
    if ('exNotify' == $cmd) {
        request_topic_notification($topicId, claro_get_current_user_id());
        $cmd = 'show';
    } elseif ('exdoNotNotify' == $cmd) {
        cancel_topic_notification($topicId, claro_get_current_user_id());
        $cmd = 'show';
    }
}
//load required js and css files
JavaScriptLoader::getInstance()->load('forum');
CssLoader::getInstance()->load('clfrm', 'screen');
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure to delete %name ?');
JavascriptLanguage::getInstance()->addLangVar('Do you really want to sign your contribution ?');
JavascriptLoader::getInstance()->load('forum');
// Prepare display
$out = '';
// Command list
$cmdList = array();
$nameTools = get_lang('Forums');
$pagetype = !empty($editMode) ? $editMode : 'viewtopic';
// The title is put in the $out var at the end of this script
if (claro_is_allowed_to_edit() && $topicId) {
    $out .= '<div style="float: right;">' . "\n" . '<img src=' . get_icon_url('html') . '" alt="" /> <a href="' . claro_htmlspecialchars(Url::Contextualize('export.php?type=HTML&topic=' . $topicId)) . '" target="_blank">' . get_lang('Export to HTML') . '</a>' . "\n" . '<img src="' . get_icon_url('mime/pdf') . '" alt="" /> <a href="' . claro_htmlspecialchars(Url::Contextualize('export.php?type=PDF&topic=' . $topicId)) . '" target="_blank">' . get_lang('Export to PDF') . '</a>' . "\n" . '</div>';
}
Example #4
0
 protected function createComponentJs($name)
 {
     $theme = Environment::getVariable('theme');
     $js = new JavaScriptLoader($this, $name);
     $js->setModule('admin');
     $js->tempUri = Environment::getVariable("baseUri") . "js/admin";
     $js->tempPath = WWW_DIR . "/js/admin";
     $js->sourcePath = APP_DIR . $this->pathToTheme . "/js";
     $filter = new VariablesFilter();
     $session_conf = Environment::getVariable('session');
     $filter->setVariable("session_expiration", $session_conf['expiration']);
     $filter->setVariable("login_url", $this->link(':Admin:Login:Json'));
     $js->filters[] = array($filter, "apply");
     //$js->filters[] = array($this, "packJs");
     //$js->joinFiles = Environment::isProduction();
     $js->joinFiles = true;
     return $js;
 }
Example #5
0
        $lastModified = $ccCache->getLastModifiedFile();
        $cacheCreated = $ccCache->getCurrentCacheStamp();

        if($lastModified > $cacheCreated OR $cacheCreated == '') {
            if($cacheCreated == '') {
                $cacheCreated = $lastModified;
            }
            $ccCache->createCache($lastModified, $cacheCreated);
        }
        $dir = array_diff(scandir(sfConfig::get('sf_cache_dir') . '/javaScriptCache'), Array());
        
        echo ' <script type="text/javascript" src="/djs/cache/'.substr($dir[count($dir)-1],0,-11).'.js"></script>' . "\n";
    }
    else { // caching is off
        echo '<script type="text/javascript" src="/djs/namespace/main.js"></script>';
        $files = new JavaScriptLoader();
        $jsFiles = $files->getAllFiles();
        foreach($jsFiles['djs'] as $singeFile) {
            echo '<script type="text/javascript" src="'.substr($singeFile,0,-11).'.js"></script>' . "\n";
        }
    }
?>

<input type="hidden" id="version_id" value="<?php echo $version_id?>">
<input type="hidden" id="workflow_id" value="<?php echo $workflow_id?>">
<input type="hidden" id="window" value="<?php echo $window?>">
<?php
    if($theTheme != 'DEFAULT') {
        echo '<link rel="stylesheet" type="text/css" media="screen" href="/themes/'.$theTheme.'" />';
    }
 ?>