本文整理汇总了PHP中w2PgetSysVal函数的典型用法代码示例。如果您正苦于以下问题:PHP w2PgetSysVal函数的具体用法?PHP w2PgetSysVal怎么用?PHP w2PgetSysVal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了w2PgetSysVal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* parse file for indexing
* @todo convert to using the FileSystem methods
*/
public function index(CFile $file)
{
/* Workaround for indexing large files:
** Based on the value defined in config data,
** files with file_size greater than specified limit
** are not indexed for searching.
** Negative value :<=> no filesize limit
*/
$index_max_file_size = w2PgetConfig('index_max_file_size', 0);
if ($file->file_size > 0 && ($index_max_file_size < 0 || (int) $file->file_size <= $index_max_file_size * 1024)) {
// get the parser application
$parser = w2PgetConfig('parser_' . $file->file_type);
if (!$parser) {
$parser = w2PgetConfig('parser_default');
}
if (!$parser) {
return false;
}
// buffer the file
$file->_filepath = W2P_BASE_DIR . '/files/' . $file->file_project . '/' . $file->file_real_filename;
if (file_exists($file->_filepath)) {
$fp = fopen($file->_filepath, 'rb');
$x = fread($fp, $file->file_size);
fclose($fp);
$ignore = w2PgetSysVal('FileIndexIgnoreWords');
$ignore = $ignore['FileIndexIgnoreWords'];
$ignore = explode(',', $ignore);
$x = strtolower($x);
$x = preg_replace("/[^A-Za-z0-9 ]/", "", $x);
foreach ($ignore as $ignoreWord) {
$x = str_replace(" {$ignoreWord} ", ' ', $x);
}
$x = str_replace(' ', ' ', $x);
$words = explode(' ', $x);
foreach ($words as $index => $word) {
if ('' == trim($word)) {
continue;
}
$q = $this->query;
$q->addTable('files_index');
$q->addInsert('file_id', $file->file_id);
$q->addInsert('word', $word);
$q->addInsert('word_placement', $index);
$q->exec();
$q->clear();
}
} else {
//TODO: if the file doesn't exist.. should we delete the db record?
}
}
$file->file_indexed = 1;
$file->store();
return count($words);
}
示例2: showAddress
public function showAddress($name, $object)
{
$countries = w2PgetSysVal('GlobalCountries');
$output = '<div style="margin-left: 11em;">';
$output .= '<a href="http://maps.google.com/maps?q=' . $object->{$name . '_address1'} . '+' . $object->{$name . '_address2'} . '+' . $object->{$name . '_city'} . '+' . $object->{$name . '_state'} . '+' . $object->{$name . '_zip'} . '+' . $object->{$name . '_country'} . '" target="_blank">';
$output .= '<img src="' . w2PfindImage('googlemaps.gif') . '" class="right" alt="Find It on Google" />';
$output .= '</a>';
$output .= $object->{$name . '_address1'} . ($object->{$name . '_address2'} ? '<br />' . $object->{$name . '_address2'} : '') . ($object->{$name . '_city'} ? '<br />' . $object->{$name . '_city'} : '') . ($object->{$name . '_state'} ? ' ' . $object->{$name . '_state'} : '') . ($object->{$name . '_zip'} ? ', ' . $object->{$name . '_zip'} : '') . ($object->{$name . '_country'} ? '<br />' . $countries[$object->{$name . '_country'}] : '');
$output .= '</div>';
echo $output;
}
示例3: typeSelect
/**
* @deprecated
*/
public function typeSelect()
{
trigger_error("CResource->typeSelect() has been deprecated in v3.0 and will be removed in v4.0. Please use w2PgetSysVal('ResourceTypes') instead.", E_USER_NOTICE);
$typelist = w2PgetSysVal('ResourceTypes');
if (!count($typelist)) {
include W2P_BASE_DIR . '/modules/resources/setup.php';
$setup = new SResource();
$setup->upgrade('1.0.1');
$typelist = w2PgetSysVal('ResourceTypes');
}
return $typelist;
}
示例4: _fetchCustomRecordTypes
public function _fetchCustomRecordTypes()
{
switch ($this->custom_record_type) {
case 'TaskCustomFields':
$field_types = 'TaskType';
break;
case 'CompanyCustomFields':
$field_types = 'CompanyType';
break;
}
$this->custom_record_types = w2PgetSysVal($field_types);
}
示例5: license
LICENSE
=====================================
The Dayplanner module was built by Klaus Buecher and is released here
under modified BSD license (see GNU.org).
Uses jquery, jqueryui and fullcalendar. Please see their separate licences.
*
Copyright (c) 2013/2014 Klaus Buecher (Opto)
No warranty whatsoever is given - use at your own risk. See index.php
*
*/
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
global $this_day, $prev_day, $next_day, $first_time, $last_time, $company_id, $event_filter, $event_filter_list, $AppUI;
// load the event types
$types = w2PgetSysVal('EventType');
$links = array();
$df = $AppUI->getPref('SHDATEFORMAT');
$perms =& $AppUI->acl();
$user_id = $AppUI->user_id;
$other_users = false;
$no_modify = false;
if (canView('admin')) {
$other_users = true;
if (($show_uid = w2PgetParam($_REQUEST, 'show_user_events', 0)) != 0) {
$user_id = $show_uid;
$no_modify = true;
$AppUI->setState('event_user_id', $user_id);
}
}
class CTask_ex extends CTask
示例6: w2PgetParam
if (isset($_GET['pin'])) {
$pin = (int) w2PgetParam($_GET, 'pin', 0);
$msg = '';
// load the record data
if ($pin) {
$msg = CTask::pinUserTask($AppUI->user_id, $task_id);
} else {
$msg = CTask::unpinUserTask($AppUI->user_id, $task_id);
}
if (!$msg) {
$AppUI->setMsg($msg, UI_MSG_ERROR, true);
}
$AppUI->redirect('', -1);
}
$durnTypes = w2PgetSysVal('TaskDurationType');
$taskPriority = w2PgetSysVal('TaskPriority');
$task_project = (int) w2PgetParam($_GET, 'task_project', null);
$task_sort_item1 = w2PgetParam($_GET, 'task_sort_item1', '');
$task_sort_type1 = w2PgetParam($_GET, 'task_sort_type1', '');
$task_sort_item2 = w2PgetParam($_GET, 'task_sort_item2', '');
$task_sort_type2 = w2PgetParam($_GET, 'task_sort_type2', '');
$task_sort_order1 = (int) w2PgetParam($_GET, 'task_sort_order1', 0);
$task_sort_order2 = (int) w2PgetParam($_GET, 'task_sort_order2', 0);
if (isset($_POST['show_task_options'])) {
$AppUI->setState('TaskListShowIncomplete', w2PgetParam($_POST, 'show_incomplete', 0));
}
$showIncomplete = $AppUI->getState('TaskListShowIncomplete', 0);
$project = new CProject();
$allowedProjects = $project->getAllowedSQL($AppUI->user_id, 'p.project_id');
$where_list = count($allowedProjects) ? implode(' AND ', $allowedProjects) : '';
$working_hours = $w2Pconfig['daily_working_hours'] ? $w2Pconfig['daily_working_hours'] : 8;
示例7: w2PgetSysVal
$AppUI->redirect('m=public&a=access_denied');
}
$perms =& $AppUI->acl();
$countries = w2PgetSysVal('GlobalCountries');
// retrieve any state parameters
$searchString = w2PgetParam($_GET, 'search_string', '');
if ($searchString != '') {
$AppUI->setState('ContIdxWhere', $searchString);
}
$where = $AppUI->getState('ContIdxWhere') ? $AppUI->getState('ContIdxWhere') : '%';
$orderby = 'contact_first_name';
$search_map = array($orderby, 'contact_first_name', 'contact_last_name');
// optional fields shown in the list (could be modified to allow brief and verbose, etc)
$showfields = array('contact_address1' => 'contact_address1', 'contact_address2' => 'contact_address2', 'contact_city' => 'contact_city', 'contact_state' => 'contact_state', 'contact_zip' => 'contact_zip', 'contact_country' => 'contact_country', 'contact_company' => 'contact_company', 'company_name' => 'company_name', 'dept_name' => 'dept_name', 'contact_phone' => 'contact_phone', 'contact_email' => 'contact_email', 'contact_job' => 'contact_job');
$contactMethods = array('phone_alt', 'phone_mobile', 'phone_fax');
$methodLabels = w2PgetSysVal('ContactMethods');
// assemble the sql statement
$rows = CContact::searchContacts($AppUI, $where);
$carr[] = array();
$carrWidth = 4;
$carrHeight = 4;
$rn = count($rows);
$t = ceil($rn / $carrWidth);
if ($rn < $carrWidth * $carrHeight) {
$i = 0;
for ($y = 0; $y < $carrWidth; $y++) {
$x = 0;
while ($x < $carrHeight && isset($rows[$i]) && ($row = $rows[$i])) {
$carr[$y][] = $row;
$x++;
$i++;
示例8: foreach
$titleBlock->addCrumb('?m=system', 'system admin');
$titleBlock->addCrumb('?m=system&a=addeditpref', 'default user preferences');
$titleBlock->show();
// prepare the automated form fields based on db system configuration data
$output = null;
$last_group = '';
foreach ($rs as $c) {
$tooltip = $AppUI->_($c['config_name'] . '_tooltip');
// extraparse the checkboxes and the select lists
$extra = '';
$value = '';
switch ($c['config_type']) {
case 'select':
// Build the select list.
if ($c['config_name'] == 'system_timezone') {
$timezones = w2PgetSysVal('Timezones');
$entry = arraySelect($timezones, 'w2Pcfg[system_timezone]', 'class=text size=1', w2PgetConfig('system_timezone'), true);
} else {
$entry = '<select class="text" name="w2Pcfg[' . $c['config_name'] . ']">';
// Find the detail relating to this entry.
$children = $w2Pcfg->getChildren($c['config_id']);
foreach ($children as $child) {
$entry .= '<option value="' . $child['config_list_name'] . '"';
if ($child['config_list_name'] == $c['config_value']) {
$entry .= ' selected="selected"';
}
$entry .= '>' . $AppUI->_($child['config_list_name'] . '_item_title') . '</option>';
}
$entry .= '</select>';
}
break;
示例9: indexStrings
public function indexStrings()
{
global $AppUI, $w2Pconfig;
$nwords_indexed = 0;
/* Workaround for indexing large files:
** Based on the value defined in config data,
** files with file_size greater than specified limit
** are not indexed for searching.
** Negative value :<=> no filesize limit
*/
$index_max_file_size = w2PgetConfig('index_max_file_size', 0);
if ($index_max_file_size < 0 || $obj->file_size <= $index_max_file_size * 1024) {
// get the parser application
$parser = $w2Pconfig['parser_' . $this->file_type];
if (!$parser) {
$parser = $w2Pconfig['parser_default'];
}
if (!$parser) {
return false;
}
// buffer the file
$this->_filepath = W2P_BASE_DIR . '/files/' . $this->file_project . '/' . $this->file_real_filename;
$fp = fopen($this->_filepath, 'rb');
$x = fread($fp, $this->file_size);
fclose($fp);
// parse it
$parser = $parser . ' ' . $this->_filepath;
$pos = strpos($parser, '/pdf');
if (false !== $pos) {
$x = `{$parser} -`;
} else {
$x = `{$parser}`;
}
// if nothing, return
if (strlen($x) < 1) {
return 0;
}
// remove punctuation and parse the strings
$x = str_replace(array('.', ',', '!', '@', '(', ')'), ' ', $x);
$warr = explode(' ', $x);
$wordarr = array();
$nwords = count($warr);
for ($x = 0; $x < $nwords; $x++) {
$newword = $warr[$x];
if (!preg_match('[[:punct:]]', $newword) && mb_strlen(mb_trim($newword)) > 2 && !preg_match('[[:digit:]]', $newword)) {
$wordarr[$newword] = $x;
}
}
// filter out common strings
$ignore = w2PgetSysVal('FileIndexIgnoreWords');
$ignore = str_replace(' ,', ',', $ignore);
$ignore = str_replace(', ', ',', $ignore);
$ignore = explode(',', $ignore);
foreach ($ignore as $w) {
unset($wordarr[$w]);
}
$nwords_indexed = count($wordarr);
// insert the strings into the table
while (list($key, $val) = each($wordarr)) {
$q = new DBQuery();
$q->addTable('files_index');
$q->addReplace('file_id', $this->file_id);
$q->addReplace('word', $key);
$q->addReplace('word_placement', $val);
$q->exec();
$q->clear();
}
}
return $nwords_indexed;
}
示例10: die
<?php
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
$tab = $AppUI->processIntState('ResourceTypeTab', $_GET, 'tab', 0);
$obj = new CResource();
$perms =& $AppUI->acl();
$canEdit = canEdit('resources');
$titleBlock = new w2p_Theme_TitleBlock('Resources', 'icon.png', $m);
if ($canEdit) {
$titleBlock->addButton('new resource', '?m=resources&a=addedit');
}
$titleBlock->show();
$resource_types = w2PgetSysVal('ResourceTypes');
$tabBox = new CTabBox('?m=resources', W2P_BASE_DIR . '/modules/resources/', $tab);
if ($tabBox->isTabbed()) {
array_unshift($resource_types, $AppUI->_('All Resources', UI_OUTPUT_RAW));
}
foreach ($resource_types as $resource_type) {
$tabBox->add('vw_resources', $resource_type);
}
$tabBox->show();
示例11: w2PgetParam
$AppUI->setState('CompIdxOrderDir', $orderdir);
}
$orderby = $AppUI->getState('CompIdxOrderBy') ? $AppUI->getState('CompIdxOrderBy') : 'company_name';
$orderdir = $AppUI->getState('CompIdxOrderDir') ? $AppUI->getState('CompIdxOrderDir') : 'asc';
$owner_filter_id = $AppUI->processIntState('owner_filter_id', $_POST, 'owner_filter_id', 0);
$search_string = w2PgetParam($_POST, 'search_string', '');
$search_string = w2PformSafe($search_string, true);
$company = new CCompany();
$canCreate = $company->canCreate();
$perms =& $AppUI->acl();
$baseArray = array(0 => $AppUI->_('All', UI_OUTPUT_RAW));
$allowedArray = $perms->getPermittedUsers('companies');
$owner_list = is_array($allowedArray) ? $baseArray + $allowedArray : $baseArray;
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Companies', 'icon.png', $m);
$titleBlock->addSearchCell($search_string);
$titleBlock->addFilterCell('Owner', 'owner_filter_id', $owner_list, $owner_filter_id);
if ($canCreate) {
$titleBlock->addButton('new company', '?m=companies&a=addedit');
}
$titleBlock->show();
// load the company types
$companyTypes = w2PgetSysVal('CompanyType');
$tabBox = new CTabBox('?m=companies', W2P_BASE_DIR . '/modules/companies/', $tab);
if ($tabBox->isTabbed()) {
array_unshift($companyTypes, $AppUI->_('All Companies', UI_OUTPUT_RAW));
}
foreach ($companyTypes as $type_name) {
$tabBox->add('vw_companies', $type_name);
}
$tabBox->show();
示例12: array
<input type="checkbox" name="show_empty_date" id="show_empty_date" onclick="document.form_buttons.submit()" <?php
echo $showEmptyDate ? 'checked="checked"' : '';
?>
/>
</td>
<td nowrap="nowrap">
<label for="show_empty_date"><?php
echo $AppUI->_('Empty Dates');
?>
</label>
</td>
</tr>
<tr>
<td colspan = "12" align="right">
<?php
$types = array('' => '(Task Type Filter)') + w2PgetSysVal('TaskType');
echo arraySelect($types, 'task_type', 'class="text" onchange="document.form_buttons.submit()"', $task_type, true);
?>
</td>
</tr>
</table>
</form>
<form name="form" method="post" action="index.php?<?php
echo "m={$m}&a={$a}&date={$date}";
?>
" accept-charset="utf-8">
<table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl">
<tr>
<th width="10"> </th>
<th width="10"><?php
echo $AppUI->_('Pin');
示例13: CTask
$canAddProject = $canRead;
if (!$canRead) {
$AppUI->redirect('m=public&a=access_denied');
}
$task = new CTask();
$tasks = $task->getAllowedRecords($AppUI->user_id, 'task_id,task_name', 'task_name', null, $extra);
$tasks = arrayMerge(array('0' => $AppUI->_('(None)', UI_OUTPUT_RAW)), $tasks);
$canViewTasks = canView('tasks');
$canAddTasks = canAdd('tasks');
$canEditTasks = canEdit('tasks');
$canDeleteTasks = canDelete('tasks');
// get ProjectPriority from sysvals
$projectPriority = w2PgetSysVal('ProjectPriority');
$projectPriorityColor = w2PgetSysVal('ProjectPriorityColor');
$pstatus = w2PgetSysVal('ProjectStatus');
$ptype = w2PgetSysVal('ProjectType');
$priorities = w2Pgetsysval('TaskPriority');
$types = w2Pgetsysval('TaskType');
$project = new CProject();
// load the record data
$project->loadFull($AppUI, $project_id);
$obj = $project;
if (!$project) {
$AppUI->setMsg('Project');
$AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
$AppUI->redirect();
} else {
$AppUI->savePlace();
}
global $w2Pconfig;
$task = new CTask();
示例14: die
<?php
/* $Id: vw_usr.php 1595 2011-01-17 07:37:10Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/tags/version2.4/modules/admin/vw_usr.php $ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
$utypes = w2PgetSysVal('UserType');
?>
<table cellpadding="2" cellspacing="1" border="0" width="100%" class="tbl">
<tr>
<th>
</th>
<?php
if (w2PgetParam($_REQUEST, 'tab', 0) == 0) {
?>
<th width="125">
<?php
echo $AppUI->_('Login History');
?>
</th>
<?php
}
$fieldList = array('user_username', 'contact_last_name', 'user_type', 'company_name', 'dept_name');
$fieldNames = array('Login Name', 'Real Name', 'Type', 'Company', 'Department');
foreach ($fieldNames as $index => $name) {
?>
<th nowrap="nowrap">
<a href="?m=admin&orderby=<?php
echo $fieldList[$index];
?>
示例15: die
<?php
/* $Id: projects.class.php 2024 2011-08-08 04:38:24Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/tags/version2.4/modules/projects/projects.class.php $ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
/**
* @package web2Project
* @subpackage modules
* @version $Revision: 2024 $
*/
// project statii
$pstatus = w2PgetSysVal('ProjectStatus');
$ptype = w2PgetSysVal('ProjectType');
$ppriority_name = w2PgetSysVal('ProjectPriority');
$ppriority_color = w2PgetSysVal('ProjectPriorityColor');
$priority = array();
foreach ($ppriority_name as $key => $val) {
$priority[$key]['name'] = $val;
}
foreach ($ppriority_color as $key => $val) {
$priority[$key]['color'] = $val;
}
/*
// kept for reference
$priority = array(
-1 => array(
'name' => 'low',
'color' => '#E5F7FF'
),
0 => array(