コード例 #1
0
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Or read it online: http://www.gnu.org/licenses/licenses.html#GPL
#
#-------------------------------------------------------------------------
#END_LICENSE
cge_headers::output_headers();
$config = \CmsApp::get_instance()->GetConfig();
if ($config['debug']) {
    return;
}
$pretty_html = \cge_param::get_bool($config, 'cge_prettyhtml', false);
$min_html = \cge_param::get_bool($config, 'cge_minhtml', false);
if (!$pretty_html && !$min_html) {
    return;
}
// do nothin
$in = $params['content'];
if (strpos('</body>', $in) === FALSE) {
    $in = str_replace('</html>', '</body></html>', $in);
}
$the_head_parm = -1;
$the_body_parm = -1;
if ($pretty_html) {
    $the_head_parm = 1;
    $the_body_parm = 4;
}
$page_top = $page_bottom = $page_middle = $head_section = $body_section = null;
コード例 #2
0
 /**
  * @ignore
  */
 public function generate_ga()
 {
     // generate analytics stuff
     $property_id = \cge_param::get_string($this->_config, 'cghm_ga_propertyid');
     if (!$property_id) {
         return;
     }
     $linkdomains = \cge_param::get_string($this->_config, 'cghm_ga_linkdomains');
     if ($linkdomains) {
         $linkdomains = $this->str_to_array($linkdomains);
     }
     $subdomains = \cge_param::get_bool($this->_config, 'cghm_ga_subdomains');
     $domain = \cge_param::get_string($this->_config, 'cghm_ga_domain');
     if ($subdomains && !$domain) {
         $sysconfig = \cms_config::get_instance();
         $url = new \cms_url($sysconfig['root_url']);
         $domain = $url->get_host();
     }
     $tpl = $this->CreateSmartyTemplate('google_analytics.tpl');
     $tpl->assign('content_obj', \cms_utils::get_current_content());
     $tpl->assign('config', $this->_config);
     $tpl->assign('domain', $domain);
     if (count($linkdomains)) {
         $tpl->assign('linkdomains', $linkdomains);
     }
     return $tpl->fetch();
 }
コード例 #3
0
<?php

if (!isset($gCms)) {
    exit;
}
$start = strtotime(\cge_param::get_string($_REQUEST, 'start'));
$end = strtotime(\cge_param::get_string($_REQUEST, 'end'));
$showchildren = (int) cge_param::get_bool($params, 'showchildren', 0);
$category_str = cge_param::get_string($params, 'category');
$keyword = trim(cge_param::get_string($params, 'keyword'));
$when = strtolower(trim(cge_param::get_string($params, 'when', 'any')));
$limit = cge_param::get_int($params, 'limit', 1000);
// 1000 is more than enough.
$detailpage = (int) cge_param::get_int($params, 'detailpage', $returnid);
if ($detailpage < 1) {
    $detailpage = $returnid;
}
$eventtemplate = cge_param::get_string($params, 'eventtemplate');
$editpage = cge_param::get_string($params, 'editpage');
$editeventtemplate = cge_param::get_string($params, 'editeventtemplate');
// resolve the categories.
$categories = array();
if ($category_str) {
    $cat_map = array();
    $tmp = \CGCalendar\category::get_categories();
    foreach ($tmp as $one) {
        $cat_map[$one['category_name']] = (int) $one['category_id'];
    }
    $list = explode(',', $category_str);
    foreach ($list as $one) {
        $one = trim($one);
コード例 #4
0
 public static function cgcss_add($params, $content, $smarty, $repeat)
 {
     if ($content == '') {
         return;
     }
     $depends = cge_utils::get_param($params, 'depends');
     $nominify = cge_param::get_bool($params, 'nominify');
     \CGExtensions\jsloader\jsloader::add_css($content, $depends, $nominify);
 }