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


PHP tpl_assign函数代码示例

本文整理汇总了PHP中tpl_assign函数的典型用法代码示例。如果您正苦于以下问题:PHP tpl_assign函数的具体用法?PHP tpl_assign怎么用?PHP tpl_assign使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: execute

 /**
  * Execute the script
  *
  * @param void
  * @return boolean
  */
 function execute()
 {
     // ---------------------------------------------------
     //  Check MySQL version
     // ---------------------------------------------------
     $mysql_version = mysql_get_server_info($this->database_connection);
     if ($mysql_version && version_compare($mysql_version, '4.1', '>=')) {
         $constants['DB_CHARSET'] = 'utf8';
         @mysql_query("SET NAMES 'utf8'", $this->database_connection);
         tpl_assign('default_collation', $default_collation = 'collate utf8_unicode_ci');
         tpl_assign('default_charset', $default_charset = 'DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci');
     } else {
         tpl_assign('default_collation', $default_collation = '');
         tpl_assign('default_charset', $default_charset = '');
     }
     // if
     tpl_assign('table_prefix', TABLE_PREFIX);
     // ---------------------------------------------------
     //  Execute migration
     // ---------------------------------------------------
     $total_queries = 0;
     $executed_queries = 0;
     $upgrade_script = tpl_fetch(get_template_path('db_migration/1_0_milanga'));
     if ($this->executeMultipleQueries($upgrade_script, $total_queries, $executed_queries, $this->database_connection)) {
         $this->printMessage("Database schema transformations executed (total queries: {$total_queries})");
     } else {
         $this->printMessage('Failed to execute DB schema transformations. MySQL said: ' . mysql_error(), true);
         return false;
     }
     // if
     $this->printMessage('Feng Office has been upgraded. You are now running Feng Office ' . $this->getVersionTo() . ' Enjoy!');
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:38,代码来源:MilangaUpgradeScript.class.php

示例2: execute

 /**
 * Prepare and process config form
 *
 * @access public
 * @param void
 * @return boolean
 */
 function execute() {
   if(!$this->installer->isExecutedStep(ACI_SYSTEM_CONFIG)) {
     $this->goToStep(ACI_SYSTEM_CONFIG);
   } // if
   
   $installation = new acInstallation(new Output_Html());
   $installation->setDatabaseType((string) trim($this->getFromStorage('database_type')));
   $installation->setDatabaseHost((string) trim($this->getFromStorage('database_host')));
   $installation->setDatabaseUsername((string) trim($this->getFromStorage('database_user')));
   $installation->setDatabasePassword((string) $this->getFromStorage('database_pass'));
   $installation->setDatabaseName((string) trim($this->getFromStorage('database_name')));
   $installation->setTablePrefix((string) trim($this->getFromStorage('database_prefix')));
   $installation->setDatabaseEngine((string) trim($this->getFromStorage('database_engine')));
   $installation->setAbsoluteUrl((string) trim($this->getFromStorage('absolute_url')));
   $installation->setPlugins($this->getFromStorage('plugins'));
   
   
   ob_start();
   if($installation->execute()) {
     $all_ok = true;
     $this->installer->clearStorage(); // lets clear data from session... its a DB pass we are talking about here
   } else {
     $all_ok = false;
   } // if
   
   tpl_assign('all_ok', $all_ok);
   tpl_assign('status_messages', explode("\n", trim(ob_get_clean())));
   
   $this->setContentFromTemplate('finish.php');
   return false;
 } // excute
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:38,代码来源:FinishStep.class.php

示例3: update_category

 /**
  * Show and process config category form
  *
  * @param void
  * @return null
  */
 function update_category()
 {
     $category = ConfigCategories::findById(get_id());
     if (!$category instanceof ConfigCategory) {
         flash_error(lang('config category dnx'));
         $this->redirectToReferer(get_url('administration'));
     }
     // if
     if ($category->isEmpty()) {
         flash_error(lang('config category is empty'));
         $this->redirectToReferer(get_url('administration'));
     }
     // if
     $options = $category->getOptions(false);
     $categories = ConfigCategories::getAll(false);
     tpl_assign('category', $category);
     tpl_assign('options', $options);
     tpl_assign('config_categories', $categories);
     $submitted_values = array_var($_POST, 'options');
     if (is_array($submitted_values)) {
         foreach ($options as $option) {
             $new_value = array_var($submitted_values, $option->getName());
             if (is_null($new_value) || $new_value == $option->getValue()) {
                 continue;
             }
             $option->setValue($new_value);
             $option->save();
         }
         // foreach
         flash_success(lang('success update config category', $category->getDisplayName()));
         $this->redirectTo('administration', 'configuration');
     }
     // if
     $this->setSidebar(get_template_path('update_category_sidebar', 'config'));
 }
开发者ID:469306621,项目名称:Languages,代码行数:41,代码来源:ConfigController.class.php

示例4: advanced_pagination

/**
 * Advanced pagination. Differenced between simple and advanced paginations is that 
 * advanced pagination uses template so its output can be changed in a great number of ways.
 * 
 * All variables are just passed to the template, nothing is done inside the function!
 *
 * @access public
 * @param DataPagination $pagination Pagination object
 * @param string $url_base Base URL in witch we will insert current page number
 * @param string $template Template that will be used. It can be absolute path to existing file
 *   or template name that used with get_template_path will return real template path
 * @param string $page_placeholder Short string inside of $url_base that will be replaced with
 *   current page numer
 * @return null
 */
function advanced_pagination(DataPagination $pagination, $url_base, $template = 'advanced_pagination', $page_placeholder = '#PAGE#')
{
    tpl_assign(array('advanced_pagination_object' => $pagination, 'advanced_pagination_url_base' => $url_base, 'advanced_pagination_page_placeholder' => urlencode($page_placeholder)));
    // tpl_assign
    $template_path = is_file($template) ? $template : get_template_path($template);
    return tpl_fetch($template_path);
}
开发者ID:469306621,项目名称:Languages,代码行数:22,代码来源:pagination.php

示例5: execute

 /**
  * Prepare and process config form
  *
  * @access public
  * @param void
  * @return boolean
  */
 function execute()
 {
     if (!$this->installer->isExecutedStep(INSTALL_SYSTEM_CONFIG)) {
         $this->goToStep(INSTALL_SYSTEM_CONFIG);
     }
     // if
     $installation = new installation(new Output_Html());
     $installation->setDatabaseType((string) trim($this->getFromStorage('database_type')));
     $installation->setDatabaseHost((string) trim($this->getFromStorage('database_host')));
     $installation->setDatabaseUsername((string) trim($this->getFromStorage('database_user')));
     $installation->setDatabasePassword((string) $this->getFromStorage('database_pass'));
     $installation->setDatabaseName((string) trim($this->getFromStorage('database_name')));
     $installation->setTablePrefix((string) trim($this->getFromStorage('database_prefix')));
     ob_start();
     if ($installation->execute()) {
         $all_ok = true;
         $this->installer->clearStorage();
         // lets clear data from session... its a DB pass we are talking about here
         $path = $_SERVER['PHP_SELF'];
         $path = substr($path, 0, strpos($path, 'public'));
     } else {
         $all_ok = false;
         $path = '';
     }
     // if
     tpl_assign('all_ok', $all_ok);
     tpl_assign('relative_url', $path);
     tpl_assign('status_messages', explode("\n", trim(ob_get_clean())));
     $this->setContentFromTemplate('finish.php');
     return false;
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:38,代码来源:FinishStep.class.php

示例6: help_options

 function help_options()
 {
     $show_context_help = user_config_option('show_context_help', 'until_close', logged_user()->getId());
     $show = true;
     if ($show_context_help == 'never') {
         $show = false;
     }
     tpl_assign('show_help', $show);
     ajx_set_panel('help');
     ajx_replace(true);
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:11,代码来源:HelpController.class.php

示例7: read_state

 function read_state()
 {
     $this->setLayout("json");
     $this->setTemplate(get_template_path("json"));
     try {
         $data = self::getState();
         $object = array("success" => true, "data" => json_encode($data));
         tpl_assign("object", $object);
     } catch (Exception $e) {
         $object = array("success" => false, "message" => $e->getMessage());
         tpl_assign("object", $object);
     }
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:13,代码来源:GuiController.class.php

示例8: execute

	/**
	 * Execute the script
	 *
	 * @param void
	 * @return boolean
	 */
	function execute() {
		// ---------------------------------------------------
		//  Check MySQL version
		// ---------------------------------------------------

		$mysql_version = mysql_get_server_info($this->database_connection);
		if($mysql_version && version_compare($mysql_version, '4.1', '>=')) {
			$constants['DB_CHARSET'] = 'utf8';
			@mysql_query("SET NAMES 'utf8'", $this->database_connection);
			tpl_assign('default_collation', $default_collation = 'collate utf8_unicode_ci');
			tpl_assign('default_charset', $default_charset = 'DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci');
		} else {
			tpl_assign('default_collation', $default_collation = '');
			tpl_assign('default_charset', $default_charset = '');
		} // if

		tpl_assign('table_prefix', TABLE_PREFIX);
		if (defined('DB_ENGINE'))
		tpl_assign('engine', DB_ENGINE);
		else
		tpl_assign('engine', 'InnoDB');

		// ---------------------------------------------------
		//  Execute migration
		// ---------------------------------------------------

		$total_queries = 0;
		$executed_queries = 0;
		$installed_version = installed_version();
		if (version_compare($installed_version, "1.1") <= 0) {
			$upgrade_script = tpl_fetch(get_template_path('db_migration/1_2_chinchulin'));
		} else {
			$upgrade_script = "DELETE FROM `".TABLE_PREFIX."config_options` WHERE `name` = 'time_format_use_24';
			UPDATE `".TABLE_PREFIX."config_options` SET `category_name` = 'modules' WHERE `name` = 'enable_email_module';
			ALTER TABLE `".TABLE_PREFIX."mail_contents` ADD COLUMN `content_file_id` VARCHAR(40) NOT NULL default '';
			";
		}
		@unlink("../../language/de_de/._lang.js");
		

		if($this->executeMultipleQueries($upgrade_script, $total_queries, $executed_queries, $this->database_connection)) {
			$this->printMessage("Database schema transformations executed (total queries: $total_queries)");
		} else {
			$this->printMessage('Failed to execute DB schema transformations. MySQL said: ' . mysql_error(), true);
			return false;
		} // if

		$this->printMessage('Feng Office has been upgraded. You are now running Feng Office '.$this->getVersionTo().' Enjoy!');
	} // execute
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:55,代码来源:ChinchulinUpgradeScript.class.php

示例9: render_company_data_tab

function render_company_data_tab($genid, $company, $renderContext, $company_data)
{
    $object = $company;
    if ($company instanceof Contact && !$company->isNew()) {
        $address = $company->getAddress('work');
        $street = "";
        $city = "";
        $state = "";
        $zipcode = "";
        if ($address) {
            $street = $address->getStreet();
            $city = $address->getCity();
            $state = $address->getState();
            $zipcode = $address->getZipCode();
            $country = $address->getCountry();
        }
        $company_data = array('first_name' => $company->getFirstName(), 'timezone' => $company->getTimezone(), 'email' => $company->getEmailAddress(), 'comments' => $company->getCommentsField());
        // array
        // telephone types
        $all_telephone_types = TelephoneTypes::getAllTelephoneTypesInfo();
        tpl_assign('all_telephone_types', $all_telephone_types);
        // address types
        $all_address_types = AddressTypes::getAllAddressTypesInfo();
        tpl_assign('all_address_types', $all_address_types);
        // webpage types
        $all_webpage_types = WebpageTypes::getAllWebpageTypesInfo();
        tpl_assign('all_webpage_types', $all_webpage_types);
        // email types
        $all_email_types = EmailTypes::getAllEmailTypesInfo();
        tpl_assign('all_email_types', $all_email_types);
        $all_phones = ContactTelephones::findAll(array('conditions' => 'contact_id = ' . $company->getId()));
        $company_data['all_phones'] = $all_phones;
        $all_addresses = ContactAddresses::findAll(array('conditions' => 'contact_id = ' . $company->getId()));
        $company_data['all_addresses'] = $all_addresses;
        $all_webpages = ContactWebpages::findAll(array('conditions' => 'contact_id = ' . $company->getId()));
        $company_data['all_webpages'] = $all_webpages;
        $all_emails = $company->getNonMainEmails();
        $company_data['all_emails'] = $all_emails;
    }
    // telephone types
    $all_telephone_types = TelephoneTypes::getAllTelephoneTypesInfo();
    // address types
    $all_address_types = AddressTypes::getAllAddressTypesInfo();
    // webpage types
    $all_webpage_types = WebpageTypes::getAllWebpageTypesInfo();
    // email types
    $all_email_types = EmailTypes::getAllEmailTypesInfo();
    include get_template_path("tabs/company_data", "contact");
}
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:49,代码来源:contact_render_tab_functions.php

示例10: index

    /**
     * Default action
     */
    public function index() {
        try {
            $request = $_REQUEST;
            //Handle action
            $action = $request['m'];
            if (isset($request['args'])) {
                $request['args'] = json_decode($request['args'], 1);
            } else {
                $request['args'] = array();
            }
            if (method_exists($this, $action))
                $response = $this->$action($request);

            tpl_assign('response', $response);
        } catch (Exception $exception) {
            throw $exception;
        }
    }
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:21,代码来源:ApiController.class.php

示例11: project_tag

 /**
  * Show project objects tagged with specific tag
  *
  * @access public
  * @param void
  * @return null
  */
 function project_tag()
 {
     $tag = array_var($_GET, 'tag');
     if (trim($tag) == '') {
         flash_error(lang('tag dnx'));
         $this->redirectTo('project', 'tags');
     }
     // if
     $tagged_objects = active_or_personal_project()->getObjectsByTag($tag);
     $total_tagged_objects = Tags::countObjectsByTag($tag);
     if (is_array($tagged_objects)) {
         foreach ($tagged_objects as $type => $objects) {
             if (is_array($objects)) {
                 $total_tagged_objects += count($objects);
             }
         }
         // foreach
     }
     // if
     tpl_assign('tag', $tag);
     tpl_assign('tagged_objects', $tagged_objects);
     tpl_assign('total_tagged_objects', $total_tagged_objects);
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:30,代码来源:TagController.class.php

示例12: lang

if ($hasComments) {
	tpl_assign("widgetClass", 'dashComments');
	tpl_assign("widgetTitle", lang('latest comments'));
	tpl_assign("widgetTemplate", 'comments');
	$this->includeTemplate(get_template_path('widget', 'dashboard'));
}

if ($showWorkspaceInfo){
	tpl_assign("widgetClass", 'dashInfo');
	tpl_assign("widgetTitle", lang('workspace info'));
	tpl_assign("widgetTemplate", 'dashboard_info');
	$this->includeTemplate(get_template_path('widget', 'dashboard'));
}

if ($hasCharts) {
	tpl_assign("widgetClass", 'dashChart');
	tpl_assign("widgetTitle", lang('charts'));
	tpl_assign("widgetTemplate", 'charts');
	$this->includeTemplate(get_template_path('widget', 'dashboard'));
}?>
</td>
<?php } ?>

</tr></table>
</div>
</div>
<script>
//og.showWsPaths('<?php echo $genid ?>-db');
Ext.QuickTips.init();
</script>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:30,代码来源:index.php

示例13: calendar

 /**
  * Show calendar view milestone page
  *
  * @access public
  * @param void
  * @return null
  */
 function calendar()
 {
     $this->addHelper('textile');
     $project = active_project();
     $id = get_id();
     if (strlen($id) == 0) {
         $id = gmdate('Ym');
     }
     if (preg_match('/^(\\d{4})(\\d{2})$/', $id, $matches)) {
         list(, $year, $month) = $matches;
         tpl_assign('year', $year);
         tpl_assign('month', $month);
     } else {
         flash_error(lang('id missing'));
         $this->redirectToReferer(get_url('milestone'));
     }
     tpl_assign('milestones', $project->getMilestonesByMonth($year, $month));
 }
开发者ID:ukd1,项目名称:Project-Pier,代码行数:25,代码来源:MilestoneController.class.php

示例14: fixConfigFile

 /**
  * This function will configuration file
  *
  * @param void
  * @return null
  */
 function fixConfigFile()
 {
     $this->printMessage('Updating configuration file');
     $constants = array('DB_ADAPTER' => DB_ADAPTER, 'DB_HOST' => DB_HOST, 'DB_USER' => DB_USER, 'DB_PASS' => DB_PASS, 'DB_NAME' => DB_NAME, 'DB_PERSIST' => true, 'TABLE_PREFIX' => TABLE_PREFIX, 'ROOT_URL' => ROOT_URL, 'DEFAULT_LOCALIZATION' => DEFAULT_LOCALIZATION, 'DEBUG' => false, 'PRODUCT_VERSION' => $this->getVersionTo());
     // array
     tpl_assign('config_file_constants', $constants);
     if (file_put_contents(INSTALLATION_PATH . '/config/config.php', tpl_fetch(get_template_path('config_file')))) {
         $this->printMessage('Configuration file updated');
         return true;
     } else {
         $this->printMessage('Failed to update configuration file', true);
         return false;
     }
     // if
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:21,代码来源:OnionUpgradeScript.class.php

示例15: render_project_application_logs

/**
 * Render one project's application logs
 * 
 * This helper will render array of log entries.
 *
 * @param array $project The project.
 * @param array $log_entries An array of entries for this project.
 * @return null
 */
function render_project_application_logs($project, $log_entries)
{
    if (config_option('display_application_logs', true)) {
        tpl_assign('application_logs_project', $project);
        tpl_assign('application_logs_entries', $log_entries);
        return tpl_fetch(get_template_path('render_project_application_logs', 'application'));
    }
    return '';
}
开发者ID:bahmany,项目名称:PythonPurePaperless,代码行数:18,代码来源:application.php


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