當前位置: 首頁>>代碼示例>>PHP>>正文


PHP theme::save方法代碼示例

本文整理匯總了PHP中theme::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP theme::save方法的具體用法?PHP theme::save怎麽用?PHP theme::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在theme的用法示例。


在下文中一共展示了theme::save方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addThemeAction

 /**
  * Add a theme to the site
  * @param string $thememodule
  * @param string $name
  * @param string $template
  * @param string $patterntype
  * @param string $url
  * @return false 
  */
 protected function addThemeAction($thememodule, $name, $patterntype, $template, $url = '')
 {
     $name = \tools::sanitizeTechString($name);
     if (!is_dir(PROFILE_PATH . $thememodule . '/themes/' . $name)) {
         \tools::createDirectory(PROFILE_PATH . $thememodule . '/themes/' . $name, 0777);
         if ($patterntype === 'template' && !empty($template)) {
             list($oldModule, $oldName) = explode(';', $template);
             $theme = array();
             foreach (\app::$devices as $device) {
                 $theme[$device['name']] = \theme::get($oldModule, $oldName, $device['name']);
                 $theme[$device['name']]->setModule($thememodule);
                 $theme[$device['name']]->setName($name);
                 $theme[$device['name']]->onMove('theme', $thememodule, $name, $device['name'], TRUE);
             }
             if (is_dir('modules/' . $thememodule . '/themes/' . $oldName . '/')) {
                 \tools::copy_dir('modules/' . $thememodule . '/themes/' . $oldName . '/', PROFILE_PATH . $thememodule . '/themes/' . $name . '/');
             } else {
                 \tools::copy_dir(PROFILE_PATH . $thememodule . '/themes/' . $oldName . '/', PROFILE_PATH . $thememodule . '/themes/' . $name . '/');
             }
             foreach (\app::$devices as $device) {
                 $theme[$device['name']]->save();
             }
         } else {
             $theme = new \theme('container', $name, $thememodule);
             $theme->save();
         }
         /* Set theme in preview mode */
         setcookie('THEMEMODULE', $thememodule, time() + 60 * 60 * 24 * 30, '/');
         setcookie('THEME', $name, time() + 60 * 60 * 24 * 30, '/');
         $return = array('eval' => 'top.window.location.reload()', 'notification' => t('The Theme has been created'), 'notificationType' => 'positive');
     } else {
         $return = array('notification' => t('The Theme has not been created, theme already exists'), 'notificationType' => 'negative');
     }
     return $this->returnResult($return);
 }
開發者ID:saitinet,項目名稱:parsimony,代碼行數:44,代碼來源:module.php

示例2: get

 /**
  * Serialize and Save this theme object
  * @param string $module
  * @param string $name
  */
 public static function get($module, $name)
 {
     $file = stream_resolve_include_path($module . '/themes/' . $name . '/theme.' . \app::$config['dev']['serialization']);
     if ($file) {
         return \tools::unserialize(substr($file, 0, -4));
     } else {
         $theme = new theme('container', $name, $module);
         $theme->save();
         return $theme;
     }
 }
開發者ID:saitinet,項目名稱:parsimony,代碼行數:16,代碼來源:theme.php


注:本文中的theme::save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。