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


PHP Site::get_profile方法代码示例

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


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

示例1: array

}
# / ACCESS allowed/denied
###########################
# / PERMISSIONS CHECK
####################################
######### GO ON WITH REAL WORK
#################
# STEP2: SAVE DATA
if ($op2 && !$site->fdat['refresh']) {
    $form_error = array();
    verify_form_token();
    ##############
    # SAVE GROUP TAB
    if ($site->fdat['tab'] == 'group') {
        ################## GET profile
        $profile_def = $site->get_profile(array("id" => $site->fdat['profile_id']));
        ################## CHECK & CHANGE profile values (required, date formats, arrays, etc)
        $sql_field_values = check_profile_values(array("profile_def" => &$profile_def, "skip_fields" => "group_id,name,parent_group_id"));
        #printr($sql_field_values);
        ############ NEW OR COPY
        if ($op == 'new' || $op == 'copy') {
            $parent_id = $site->fdat['group_id'];
            $sql = $site->db->prepare("INSERT INTO groups (profile_id, name, parent_group_id, auth_type " . (count($update_fields) ? ',' . join(",", array_keys($sql_field_values)) : '') . ") VALUES (?,?,?,? " . (count($update_fields) ? ",'" . join("','", array_values($sql_field_values)) . "'" : "") . " )", $site->fdat['profile_id'] ? $site->fdat['profile_id'] : 0, trim($site->fdat['name']) == '' ? 'undefined' : $site->fdat['name'], $site->fdat['parent_group_id'], $site->fdat['auth_type']);
            #print $sql;
            $sth = new SQL($sql);
            $site->debug->msg($sth->debug->get_msgs());
            $site->fdat['group_id'] = $sth->insert_id;
            ########################
            # INSERT PERMISSIONS
            # lisame uuele grupile t�pselt samad �igused nagu on tema parent grupil:
            # leia k�ik parenti �igused userite/gruppide kohta:
开发者ID:sauruscms,项目名称:Saurus-CMS-Community-Edition,代码行数:31,代码来源:edit_group.php

示例2: SQL

    $sql = $site->db->prepare("UPDATE object_profiles SET data=? WHERE profile_id=?", $update_data, $site->fdat['profile_id']);
    $sth = new SQL($sql);
    $site->debug->msg($sth->debug->get_msgs());
    $site->fdat['profile_id'] = $site->fdat['profile_id'];
}
# / MOVE UP/DOWN
##################
##################
# SYNC with real TABLE in database
if ($site->fdat['op'] == "sync" && is_numeric($site->fdat['profile_id'])) {
    $tbl_fields = array();
    $system_fields = array();
    $existing_fields = array();
    $missing_fields = array();
    ## Get existing profile
    $prof_row = $site->get_profile(array(id => $site->fdat['profile_id']));
    $existing_data = unserialize($prof_row['data']);
    if (sizeof($existing_data) > 0 && is_array($existing_data)) {
        $existing_fields = array_keys($existing_data);
    }
    # if fields found
    if ($prof_row['source_table']) {
        # get table fields
        $tbl_fields = split(",", $site->db->get_fields(array(tabel => $prof_row['source_table'])));
        # get system_fields - fields that doesn't have to be visible to user after sync operation
        if ($prof_row['source_table'] == 'users') {
            $system_fields = array('user_id', 'group_id', 'email', 'is_predefined', 'profile_id', 'username', 'password', 'firstname', 'lastname', 'image', 'created_date', 'session_id', 'last_access_time', 'is_locked', 'pass_expires', 'autologin_ip', 'last_ip');
        } elseif ($prof_row['source_table'] == 'groups') {
            $system_fields = array('group_id', 'name', 'parent_group_id', 'is_predefined', 'auth_type', 'auth_params', 'profile_id');
        } elseif ($prof_row['source_table'] == 'obj_dokument') {
            $system_fields = array('fail', 'size', 'tyyp', 'objekt_id', 'mime_tyyp', 'sisu_blob', 'profile_id', 'repl_last_modified', 'download_type');
开发者ID:sauruscms,项目名称:Saurus-CMS-Community-Edition,代码行数:31,代码来源:profiles.php

示例3: unserialize

</head>
<body onLoad="this.focus();">


<!-- Scrollable area -->
<div id=listing class="scms_scroll_div">

<?	if($form_def['profile_id']){ ?>

<table width="100%"  border="0" cellspacing="3" cellpadding="0" class="scms_table">
<tr class="scms_pane_header">
<td colspan=2><?=$form_def['name']?></td>
</tr>

<?		# get profile
		$profile_def = $site->get_profile(array("id"=>$form_def['profile_id'])); 
		$profile_fields = unserialize($profile_def['data']);	# profile_fields is now array of ALL fields, indexes are fieldnames

		###################
		# print profile fields rows
		print_profile_fields(array(
			'profile_fields' => $profile_fields,
			'field_values' => $objekt->all,
		));
?>
	</table>
<?	}
	### error: no profile id
	else {
		echo "Error! no profile found";
	}
开发者ID:riho,项目名称:Saurus-CMS-Community-Edition,代码行数:31,代码来源:forms.php

示例4: strtolower

	return !$drop_denied;

}


###############################
# PROFILE: Save profile name & close

if($site->fdat['op2'] == 'save_profile_name' || $site->fdat['op2'] == 'saveclose_profile_name') {
	if($site->fdat['profile_name']) {

		$site->fdat['profile_name'] = strtolower($site->fdat['profile_name']); // #2743
		$site->fdat['source_table'] = strtolower($site->fdat['source_table']); // #2743
		
		###### check if profile name exists
		$check_profile_def = $site->get_profile(array("name"=>$site->fdat['profile_name'])); 
		## if not found OR itself found, go on with saving
		if(($check_profile_def['name'] != $site->fdat['profile_name']) || $check_profile_def['profile_id'] == $site->fdat['pid']) {

		##### if is_default is set to "1" then set all other profiles (with same type) to "is_default => 0".
		if($site->fdat['is_default'] == 1){
			$sql = $site->db->prepare("UPDATE object_profiles SET is_default=? WHERE source_table=?",0,$site->fdat['source_table']);
			$sth = new SQL($sql);		
		}
		
		if($op=='new') {

			## New
			if($site->fdat['source_table'] == 'obj_asset')
				// create default content
				$data = 'a:1:{s:8:"pealkiri";a:9:{s:4:"name";s:8:"pealkiri";s:4:"type";s:4:"TEXT";s:13:"source_object";s:0:"";s:13:"default_value";s:0:"";s:7:"db_type";s:7:"varchar";s:11:"is_required";i:0;s:9:"is_active";i:0;s:13:"is_predefined";i:1;s:10:"is_general";i:1;}}';
开发者ID:riho,项目名称:Saurus-CMS-Community-Edition,代码行数:31,代码来源:edit_profile.php


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