当前位置: 首页>>代码示例>>PHP>>正文


PHP Style::getStyle方法代码示例

本文整理汇总了PHP中Style::getStyle方法的典型用法代码示例。如果您正苦于以下问题:PHP Style::getStyle方法的具体用法?PHP Style::getStyle怎么用?PHP Style::getStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Style的用法示例。


在下文中一共展示了Style::getStyle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createStyle

 function createStyle($deck)
 {
     $style = new Style();
     $this->css = $style->getStyle($deck->default_theme);
     $deck_name = $this->sluggify($deck->title);
     $css = ROOT . DS . 'tmp' . DS . $this->root_deck_name . DS . $deck_name . DS . 'default.css';
     if (!file_exists($css)) {
         $fp = fopen($css, "wb");
         fwrite($fp, $this->css['css']);
         fclose($fp);
     } else {
         unlink($css);
         $fp = fopen($css, "wb");
         fwrite($fp, $this->css['css']);
         fclose($fp);
     }
     $this->common_resources[] = $deck_name . DS . 'default.css';
 }
开发者ID:TBoonX,项目名称:SlideWiki,代码行数:18,代码来源:Scorm.php

示例2: toHTML

 function toHTML()
 {
     $deck_id = $_GET['deck_id'];
     $deck = new Deck();
     $deck->createFromID($deck_id);
     $slides = $deck->getSlidesFull();
     $slides_to_string = array();
     $image_local_path = array();
     $image_name = array();
     $image_paths = array();
     $slides_to_string = $this->createSlideString($deck_id);
     foreach ($slides as $slide) {
         $img_pattern = '/\\.\\/upload\\/media\\/images\\/\\d+\\/\\d+\\..../';
         preg_match_all($img_pattern, $slide->content, $matches);
         if (count($matches[0])) {
             foreach ($matches[0] as $img_path) {
                 $image_paths[] = $img_path;
             }
         }
     }
     $html = " \n\t\t<!DOCTYPE html>\n\t\t<!--[if lt IE 7]> <html class=\"no-js ie6\" lang=\"en\"> <![endif]-->\n\t\t<!--[if IE 7]>    <html class=\"no-js ie7\" lang=\"en\"> <![endif]-->\n\t\t<!--[if IE 8]>    <html class=\"no-js ie8\" lang=\"en\"> <![endif]-->\n\t\t<!--[if gt IE 8]><!-->  <html class=\"no-js\" lang=\"en\"> <!--<![endif]-->\n\t\t<head>\n\t\t\t<meta charset=\"utf-8\">\n\t\t\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n\n\t\t\t<title>" . $deck->title . "</title>\n\n\t\t\t<meta name=\"author\" content=" . $deck->owner->username . ">\n\t\t\t<meta name=\"deck_id\" content=" . $deck->deck_id . ">\n\t\t\t<meta name=\"deck_revision_id\" content=" . $deck->id . ">\n\t\t\t<meta name=\"viewport\" content=\"width=1024, user-scalable=no\">\n\n\t\t\t<!-- Core and extension CSS files -->\n\t\t\t<link rel=\"stylesheet\" href=\"deck.js/core/deck.core.css\">\n\t\t\t<link rel=\"stylesheet\" href=\"deck.js/extensions/goto/deck.goto.css\">\n\t\t\t<link rel=\"stylesheet\" href=\"deck.js/extensions/menu/deck.menu.css\">\n\t\t\t<link rel=\"stylesheet\" href=\"deck.js/extensions/navigation/deck.navigation.css\">\n\t\t\t<link rel=\"stylesheet\" href=\"deck.js/extensions/status/deck.status.css\">\n\t\t\t<link rel=\"stylesheet\" href=\"deck.js/extensions/hash/deck.hash.css\">\n\n\t\t\t<!-- Theme CSS files (menu swaps these out) -->\n\t\t\t<link rel=\"stylesheet\" id=\"style-theme-link\" href=\"default_theme/default.css\">\n\t\t\t<link rel=\"stylesheet\" id=\"transition-theme-link\" href=\"deck.js/themes/transition/horizontal-slide.css\">\n\n\t\t\t<!-- Custom CSS just for this page -->\n\t\t\t<link rel=\"stylesheet\" href=\"deck.js/introduction/introduction.css\">\n\t\t\t<link rel=\"stylesheet\" href=\"local.css\">\n\n\t\t\t<script src=\"deck.js/modernizr.custom.js\"></script>\n\t\t\t<script src=\"deck.js/jquery.js\"></script>\n\n\t\t\t<!-- client syntax highlightning -->\n\t\t\t<link   href=\"deck.js/syntax/shThemeDefault.css\" rel=\"stylesheet\" type=\"text/css\" />\n\t\t\t<script src=\"deck.js/syntax/shCore.js\" type=\"text/javascript\"></script>\n\t\t\t<script src=\"deck.js/syntax/shAutoloader.js\" type=\"text/javascript\"></script>\n\t\t\t<script src=\"deck.js/syntax/shBrushTurtle.js\" type=\"text/javascript\"></script>\n\t\t\t<script type=\"text/javascript\" src=\"deck.js/MathJax.js\"></script>\n\n<script type=\"text/javascript\">\n\t\t\tfunction htmlDecode(input){\n\t\t\t\t  var e = document.createElement(\"div\");\n\t\t\t\t  e.innerHTML = input;\n\t\t\t\t  return e.childNodes.length === 0 ? \"\" : e.childNodes[0].nodeValue;\n\t\t\t}\n\t\t\tfunction removeBRs(input){\n\t\t\t\tvar r=input.replace(/<br>/gi,\"\"); \n\t\t\t\tr=r.replace(/<br[0-9a-zA-Z]+>/gi,\"\");\n\t\t\t\treturn r;\n\t\t\t}\n\t\t\t\tSyntaxHighlighter.defaults['toolbar'] = false;\n\t\t\t\tSyntaxHighlighter.all();\n\t\t\t\t</script>\n\t\t\t<script type=\"text/x-mathjax-config\">\n\t\t\t\$(function() {\n\t\t\t  MathJax.Hub.Config({\n\t\t\t\t\tskipStartupTypeset: true,\n\t\t\t\t\textensions: [\"tex2jax.js\"],\n\t\t\t\t\tjax: [\"input/TeX\", \"output/HTML-CSS\"],\n\t\t\t\t\ttex2jax: {\n\t\t\t\t\tinlineMath: [ ['\$','\$'], [\"\\(\",\"\\)\"] ],\n\t\t\t\t\tdisplayMath: [ ['\$\$','\$\$'], [\"\\[\",\"\\]\"] ],\n\t\t\t\t\tprocessEscapes: true\n\t\t\t\t\t},\n\t\t\t\t\t\"HTML-CSS\": { availableFonts: [\"TeX\"] }\n\t\t\t  });\n\t\t\t\t\$.deck('.slide');\n\t\t\t\tMathJax.Hub.Queue([\"Typeset\",MathJax.Hub,'slide-area']);\n\t\t\t\t});\n\t\t\t\t</script>\t\t\t\n\t\t</head>\t\t\n\t\t\n\t\t<body class=\"deck-container\">\n\n\t\t\t<div class=\"theme-menu\">\n\t\t\t\t<h2>Themes</h2>\n\n\t\t\t\t<label for=\"style-themes\">Style:</label>\n\t\t\t\t<select id=\"style-themes\">\n\t\t\t\t\t<option selected value=\"default_theme/default.css\">Default</option>\n\t\t\t\t\t<option value=\"deck.js/themes/style/web-2.0.css\">Web 2.0</option>\n\t\t\t\t\t<option value=\"deck.js/themes/style/swiss.css\">Swiss</option>\n\t\t\t\t\t<option value=\"deck.js/themes/style/neon.css\">Neon</option>\n\t\t\t\t\t<option value=\"\">None</option>\n\t\t\t\t</select>\n\n\t\t\t\t<label for=\"transition-themes\">Transition:</label>\n\t\t\t\t<select id=\"transition-themes\">\n\t\t\t\t\t<option selected value=\"deck.js/themes/transition/horizontal-slide.css\">Horizontal Slide</option>\n\t\t\t\t\t<option value=\"deck.js/themes/transition/vertical-slide.css\">Vertical Slide</option>\n\t\t\t\t\t<option value=\"deck.js/themes/transition/fade.css\">Fade</option>\n\t\t\t\t\t<option value=\"\">None</option>\n\t\t\t\t</select>\n\t\t\t</div>" . $slides_to_string . "</div>\n\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t<a href=\"#\" class=\"deck-prev-link\" title=\"Previous\">&#8592;</a>\n\t\t<a href=\"#\" class=\"deck-next-link\" title=\"Next\">&#8594;</a>\n\n\t\t<p class=\"deck-status\">\n\t\t\t<span class=\"deck-status-current\"></span>\n\t\t\t/\n\t\t\t<span class=\"deck-status-total\"></span>\n\t\t</p>\n\n\t\t<form action=\".\" method=\"get\" class=\"goto-form\">\n\t\t\t<label for=\"goto-slide\">Go to slide:</label>\n\t\t\t<input type=\"number\" name=\"slidenum\" id=\"goto-slide\">\n\t\t\t<input type=\"submit\" value=\"Go\">\n\t\t</form>\n\n\t\t<a href=\".\" title=\"Permalink to this slide\" class=\"deck-permalink\">#</a>\n\n\n\t\t<!-- Deck Core and extensions -->\n\t\t<script src=\"deck.js/core/deck.core.js\"></script>\n\t\t<script src=\"deck.js/extensions/menu/deck.menu.js\"></script>\n\t\t<script src=\"deck.js/extensions/goto/deck.goto.js\"></script>\n\t\t<script src=\"deck.js/extensions/status/deck.status.js\"></script>\n\t\t<script src=\"deck.js/extensions/navigation/deck.navigation.js\"></script>\n\t\t<script src=\"deck.js/extensions/hash/deck.hash.js\"></script>\n\t\t<!-- Specific to this page -->\n\t\t<script src=\"deck.js/introduction/introduction.js\"></script>\n\t\t<!-- Code Mirror -->\n\t\t<link rel=\"stylesheet\" href=\"codemirror/lib/codemirror.css\">\n\t\t<script src=\"codemirror/lib/codemirror.js\"></script>\n\t\t<script src=\"codemirror/mode/javascript/javascript.js\"></script>\n\t\t<script src=\"codemirror/mode/xml/xml.js\"></script>\n\t\t<script src=\"codemirror/mode/htmlmixed/htmlmixed.js\"></script>\n\t\t<script src=\"codemirror/mode/css/css.js\"></script>\n\t\t<script src=\"codemirror/mode/php/php.js\"></script>\n\t\t<script src=\"codemirror/mode/ntriples/ntriples.js\"></script>\n\t\t<script src=\"codemirror/mode/sparql/sparql.js\"></script>\n\t\t<script src=\"codemirror/lib/util/formatting.js\"></script>\n\t\t<!-- Code Mirror for deck.js -->\n\t\t<link rel=\"stylesheet\" href=\"deck.js/extensions/codemirror/deck.codemirror.css\">\n\t\t<script src=\"deck.js/extensions/codemirror/deck.codemirror.js\"></script>\n\t\t</body>\n\t\t</html>";
     $zipName = "archive.zip";
     $libraries_folder = 'deck.js' . DS;
     $createZipFile = new createDirZip();
     $createZipFile->get_files_from_folder(ROOT . DS . 'libraries' . DS . 'frontend' . DS . 'deck.js' . DS, $libraries_folder);
     $fileToZip = "index.html";
     $createZipFile->addFile($html, $fileToZip);
     $fileContents = file_get_contents(ROOT . DS . "libraries" . DS . "frontend" . DS . "MathJax" . DS . "MathJax.js");
     $fileToZip = $libraries_folder . "MathJax.js";
     $createZipFile->addFile($fileContents, $fileToZip);
     $fileContents = file_get_contents(ROOT . DS . "libraries" . DS . "frontend" . DS . "jquery.js");
     $fileToZip = $libraries_folder . "jquery.js";
     $createZipFile->addFile($fileContents, $fileToZip);
     $fileContents = file_get_contents(ROOT . DS . "libraries" . DS . "frontend" . DS . "jquery.min.js");
     $fileToZip = $libraries_folder . "jquery.min.js";
     $createZipFile->addFile($fileContents, $fileToZip);
     $createZipFile->get_files_from_folder(ROOT . DS . 'libraries' . DS . 'frontend' . DS . 'codemirror' . DS, 'codemirror' . DS);
     // adding images
     foreach ($image_paths as $im) {
         $fileContents = file_get_contents($im);
         $fileToZip = split('\\/', $im);
         $fileToZip = $fileToZip[count($fileToZip) - 1];
         $createZipFile->addFile($fileContents, $fileToZip);
     }
     //add default theme
     $style = new Style();
     $tmp = $style->getStyle($deck->default_theme);
     $createZipFile->addFile($tmp['css'], 'default_theme/default.css');
     $date = date('Y-m-d');
     $zipName = $this->sluggify($deck->title) . '_' . $date . "_" . $zipName;
     $fd = fopen($zipName, "wb");
     $out = fwrite($fd, $createZipFile->getZippedfile());
     fclose($fd);
     $createZipFile->forceDownload($zipName);
     @unlink($zipName);
 }
开发者ID:TBoonX,项目名称:SlideWiki,代码行数:56,代码来源:ExportController.php

示例3: testStyle

 public function testStyle()
 {
     $style = new Style('#444444', '#99BB11', 'ellipse', '#0066aa');
     $this->assertEquals('ellipse', $style->getStyle());
 }
开发者ID:potfur,项目名称:statemachine,代码行数:5,代码来源:StyleTest.php


注:本文中的Style::getStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。