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


PHP Filters::isAlnum方法代码示例

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


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

示例1: action_updateproject

 function action_updateproject()
 {
     global $proj, $db, $baseurl;
     if (Post::val('delete_project')) {
         $url = Post::val('move_to') ? CreateURL(array('pm', 'proj' . Post::num('move_to'), 'prefs')) : $baseurl;
         if (Backend::delete_project($proj->id, Post::val('move_to'))) {
             return array(SUBMIT_OK, L('projectdeleted'), $url);
         } else {
             return array(ERROR_INPUT, L('projectnotdeleted'), $url);
         }
     }
     if (!Post::val('project_title')) {
         return array(ERROR_RECOVER, L('emptytitle'));
     }
     $cols = array('project_title', 'theme_style', 'lang_code', 'default_task', 'default_entry', 'intro_message', 'notify_email', 'notify_jabber', 'notify_subject', 'notify_reply', 'feed_description', 'feed_img_url', 'svn_user', 'svn_url', 'svn_password', 'mail_headers');
     $args = array_map('Post_to0', $cols);
     foreach (array('others_view', 'anon_open', 'send_digest', 'anon_view_tasks', 'anon_group', 'comment_closed', 'auto_assign', 'roadmap_field', 'override_user_lang') as $name) {
         $cols[] = $name;
         $args[] = Post::num($name);
     }
     foreach (array('notify_types', 'changelog_reso', 'syntax_plugins') as $name) {
         $cols[] = $name;
         $args[] = implode(' ', (array) Post::val($name));
     }
     // invalidate the cache if necessary
     if (implode(' ', (array) Post::val('syntax_plugins')) != $proj->prefs['syntax_plugins']) {
         $db->execParam('DELETE FROM {cache} WHERE project_id = ?', $proj->id);
     }
     // carefully check the project prefix...
     $prefix = Post::val('project_prefix');
     // already in use?
     $use = $db->x->GetOne('SELECT project_id FROM {projects} WHERE project_prefix = ? AND project_id != ?', null, array($prefix, $proj->id));
     if (Filters::isAlnum($prefix) && $prefix != 'FS' && !$use) {
         $cols[] = 'project_prefix';
         $args[] = $prefix;
     } else {
         return array(ERROR_RECOVER, L('badprefix'));
     }
     $cols[] = 'last_updated';
     $args[] = time();
     $cols[] = 'default_cat_owner';
     $args[] = Flyspray::UserNameToId(Post::val('default_cat_owner'));
     $db->x->autoExecute('{projects}', array_combine($cols, $args), MDB2_AUTOQUERY_UPDATE, sprintf('project_id = %d', $proj->id));
     $db->x->execParam('UPDATE {projects} SET visible_columns = ? WHERE project_id = ?', array(trim(Post::val('visible_columns')), $proj->id));
     return array(SUBMIT_OK, L('projectupdated'));
 }
开发者ID:negram,项目名称:flyspray,代码行数:46,代码来源:pm.php

示例2: chdir

  if(checkbox)
    checkbox.checked = true;
  var hidden = document.getElementById('id_hidden_' + id);
  if(hidden)
    hidden.disabled = false;
  var conf = document.getElementById('id_confirm');
  if(conf)
    conf.disabled = true;
}
</script>
<?php 
// Set current directory to where the language files are
chdir("../lang");
$lang = @$_GET['lang'];
$fail = '';
if (!$lang || !Filters::isAlnum($lang)) {
    $fail .= "Language code not supplied correctly<br/>\n";
}
if (!file_exists('en.php')) {
    $fail .= "The english language file <code>en.php</code> is missing. Make sure this script is run from the same directory as the language files <code>.../flyspray/lang/</code><br/>\n";
}
if ($fail) {
    die($fail . "<b>Usage:</b> <a href='.langedit.php?lang='>.langedit.php?lang=&lt;lang code&gt;</a> where &lt;lang code&gt; should be replaced by your languge, e.g. <b>de</b> for German.");
}
// Read english language file in array $language (assumed to be UTF-8 encoded)
require_once 'en.php';
if (!is_array(@$language)) {
    die("Invalid language file for english");
}
$count = count($language);
// Read the translation file in array $translation (assumed to be UTF-8 encoded)
开发者ID:negram,项目名称:flyspray,代码行数:31,代码来源:.langedit.php

示例3: tpl_draw_cell

function tpl_draw_cell($task, $colname, $format = "<td class='%s %s'>%s</td>")
{
    global $fs, $proj, $page;
    $indexes = array('id' => 'task_id', 'project' => 'project_title', 'summary' => 'item_summary', 'dateopened' => 'date_opened', 'openedby' => 'opened_by_real_name', 'closedby' => 'closed_by_real_name', 'changedby' => 'last_changed_by_real_name', 'assignedto' => 'assigned_to_name', 'lastedit' => 'last_changed_time', 'comments' => 'comment_count', 'votes' => 'vote_count', 'attachments' => 'attachment_count', 'dateclosed' => 'date_closed', 'projectlevelid' => 'prefix_id', 'progress' => '', 'state' => '', 'private' => 'mark_private');
    //must be an array , must contain elements and be alphanumeric (permitted  "_")
    if (!is_array($task) || empty($task) || preg_match('![^A-Za-z0-9_]!', $colname)) {
        //run away..
        return '';
    }
    switch ($colname) {
        case 'id':
            $value = tpl_tasklink($task, $task['task_id']);
            break;
        case 'projectlevelid':
            $value = tpl_tasklink($task, $task['project_prefix'] . '#' . $task['prefix_id']);
            break;
        case 'summary':
            $value = tpl_tasklink($task, utf8_substr($task['item_summary'], 0, 55), false, array(), array('state', 'age', 'percent_complete'));
            if (utf8_strlen($task['item_summary']) > 55) {
                $value .= '...';
            }
            break;
        case 'lastedit':
        case 'dateopened':
        case 'dateclosed':
            $value = formatDate($task[$indexes[$colname]]);
            break;
        case 'progress':
            $value = '<div class="taskpercent"><div style="width:' . $task['percent_complete'] . '%"> </div></div>';
            break;
        case 'assignedto':
            $value = Filters::noXSS($task[$indexes[$colname]]);
            if ($task['num_assigned'] > 1) {
                $value .= ', +' . ($task['num_assigned'] - 1);
            }
            break;
        case 'state':
            if ($task['is_closed']) {
                $value = L('closed');
            } elseif ($task['closed_by']) {
                $value = L('reopened');
            } else {
                $value = L('open');
            }
            break;
        case 'private':
            $value = $task[$indexes[$colname]] ? L('yes') : L('no');
            break;
        default:
            if (isset($indexes[$colname])) {
                $value = $task[$indexes[$colname]];
            } elseif (isset($task[$colname . '_name'])) {
                $value = $task[$colname . '_name'];
            } else {
                if (isset($proj->fields[$colname])) {
                    $value = $proj->fields[$colname]->view($task, array(), true);
                } else {
                    $value = $task[$colname];
                }
            }
            $value = Filters::noXSS($value);
            break;
    }
    $wsvalue = str_replace(' ', '', $value);
    return sprintf($format, 'task_' . $colname, Filters::isAlnum($wsvalue) ? $colname . '_' . $wsvalue : '', $value);
}
开发者ID:heptalium,项目名称:flyspray,代码行数:66,代码来源:index.php

示例4: isAlnum

 function isAlnum($key)
 {
     return Filters::isAlnum(Post::val($key));
 }
开发者ID:negram,项目名称:flyspray,代码行数:4,代码来源:class.gpc.php

示例5: GetColumnNames

/**
 * GetColumnNames
 *
 * @param mixed $table
 * @param mixed $alt
 * @param mixed $prefix
 * @access public
 * @return void
 */
function GetColumnNames($table, $alt, $prefix)
{
    global $conf, $db;
    if (strcasecmp($conf['database']['dbtype'], 'pgsql') || !Filters::isAlnum($prefix)) {
        return $alt;
    }
    $db->loadModule('Manager');
    $col_names = $db->manager->listTableFields($table);
    return implode(', ', array_map(create_function('$x', 'return "' . $prefix . '.' . '" . $x;'), $col_names));
}
开发者ID:negram,项目名称:flyspray,代码行数:19,代码来源:class.database.php


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