コード例 #1
0
ファイル: site.php プロジェクト: BackupTheBerlios/phphoto-svn
            if ($htmlize) {
                $val = htmlspecialchars($val);
            }
            $r = Config::set($name, $val);
            if (PEAR::isError($r)) {
                throw new Exception2(_INTERNAL_ERROR, $r->getMessage());
            }
        }
        $pane = new HTML_MessagePane("upd", _ADMIN_SETTINGS_UPDATED, "", "a_ok_pane", "a_ok_pane_hdr");
        $pane->show();
    } catch (Exception2 $e) {
        $pane = new HTML_MessagePane("upd", $e->getMessage(), $e->getDescription(), "a_fail_pane", "a_fail_pane_hdr");
        $pane->show();
    }
}
$form = new HTML_AdminForm("site_form", _ADMIN_SETTINGS_FOR_GROUP . _ADMIN_SITE_CONFIGURATION, $session->addSID("site.php"));
$pane = new HTML_AdminFormPane("p1", _ADMIN_NAMES_AND_ADDRESSES);
$field = new HTML_TextField("site_title", _ADMIN_SITE_NAME_T, _ADMIN_SITE_NAME_D, 50, Config::get("site_title", _ADMIN_SITE_NAME_DEF));
$pane->addField($field);
$field = new HTML_TextField("site_url", _ADMIN_SITE_URL_T, _ADMIN_SITE_URL_D, 50, Config::get("site_url", _ADMIN_SITE_URL_DEF));
$pane->addField($field);
$form->addPane($pane);
$pane = new HTML_AdminFormPane("p3", _ADMIN_SESSION_AND_COOKIES);
preg_match("/^(http:\\/\\/)?([^\\/]+)/i", Config::get("site_url", _ADMIN_SITE_URL_DEF), $matches);
$def_domain = $matches[2];
$field = new HTML_TextField("cookie_domain", _ADMIN_COOKIE_DOMAIN_T, _ADMIN_COOKIE_DOMAIN_D, 50, Config::get("cookie_domain", $def_domain));
$pane->addField($field);
$field = new HTML_TextField("cookie_name", _ADMIN_COOKIE_NAME_T, _ADMIN_COOKIE_NAME_D, 50, Config::get("cookie_name", "phph"));
$pane->addField($field);
$field = new HTML_TextField("cookie_path", _ADMIN_COOKIE_PATH_T, _ADMIN_COOKIE_PATH_D, 50, Config::get("cookie_path", "/"));
$pane->addField($field);
コード例 #2
0
        $user->user_activated = time();
        $r = $user->insert();
        if (PEAR::isError($r)) {
            throw new Exception2(_INTERNAL_ERROR, $r->getMessage());
        }
        if (!empty($ref)) {
            header("Location: " . $ref);
        }
        $pane = new HTML_MessagePane("upd", _ADMIN_USER_ADDED, "", "a_ok_pane", "a_ok_pane_hdr");
        $pane->show();
    } catch (Exception2 $e) {
        $pane = new HTML_MessagePane("upd", $e->getMessage(), $e->getDescription(), "a_fail_pane", "a_fail_pane_hdr");
        $pane->show();
    }
}
$form = new HTML_AdminForm("add_user_form", _ADMIN_ADD_NEW_USER, $session->addSID("add_user.php"));
$form->addHidden("ref", urlencode($ref));
$pane = new HTML_AdminFormPane("p1", _ADMIN_NEW_USER_DATA);
$field = new HTML_TextField("user_login", _ADMIN_USER_LOGIN_T, _ADMIN_USER_LOGIN_D, 50, $user_login);
$pane->addField($field);
$field = new HTML_TextField("user_pass1", _ADMIN_USER_PASSWORD_T, _ADMIN_USER_PASSWORD_D, 50, $user_pass1, true);
$pane->addField($field);
$field = new HTML_TextField("user_pass2", _ADMIN_REENTER_USER_PASSWORD_T, _ADMIN_REENTER_USER_PASSWORD_D, 50, "", true);
$pane->addField($field);
$field = new HTML_TextField("user_email", _ADMIN_USER_EMAIL_T, _ADMIN_USER_EMAIL_D, 50, $user_email);
$pane->addField($field);
$form->addPane($pane);
$form->_submit = _ADMIN_ADD_USER;
$form->show();
?>
コード例 #3
0
<?php 
if (!empty($_POST['submit'])) {
    try {
        $comment->update($_POST['comment_title'], $_POST['comment_text']);
        if (!empty($ref)) {
            header("Location: " . $ref);
        }
        $pane = new HTML_MessagePane("upd", $action == "add" ? _ADMIN_GROUP_CREATED : _ADMIN_GROUP_UPDATED, "", "a_ok_pane", "a_ok_pane_hdr");
        $pane->show();
    } catch (Exception2 $e) {
        $pane = new HTML_MessagePane("upd", $e->getMessage(), $e->getDescription(), "a_fail_pane", "a_fail_pane_hdr");
        $pane->show();
    }
}
$form = new HTML_AdminForm("edit_comment_form", "Edycja komentarza", $session->addSID("edit_comment.php"));
$form->addHidden("ref", $ref);
$form->addHidden("cmid", $cmid);
$pane = new HTML_AdminFormPane("p1", "Komentarz");
$field = new HTML_TextField("comment_title", "Tytu³", "", 50, $comment_title);
$pane->addField($field);
$field = new HTML_MemoField("comment_text", "Tre¶æ", "", $comment_text, 5, 50);
$pane->addField($field);
$form->addPane($pane);
$form->_submit = "Zapisz";
$form->show();
?>

<?php 
HTML::endBODY();
HTML::endHTML();
コード例 #4
0
    while ($res->fetchInto($row)) {
        if ($cid != $row['category_id']) {
            $name = "";
            if ($level > 0) {
                for ($i = 0; $i < $level; $i++) {
                    $name .= "---";
                }
                $name .= " ";
            }
            $name .= $row['category_name'];
            $field->addOption($row['category_id'], $name);
            fill_category_tree($field, $row['category_id'], $level + 1);
        }
    }
}
$form = new HTML_AdminForm("edit_category_form", $action == "add" ? _ADMIN_ADD_NEW_CATEGORY : _ADMIN_EDIT_CATEGORY, $session->addSID("edit_category.php"));
$form->addHidden("ref", $ref);
$form->addHidden("cid", $cid);
$form->addHidden("action", $action);
$pane = new HTML_AdminFormPane("p1", $action == "add" ? _ADMIN_NEW_CATEGORY : htmlspecialchars($category_name));
$field = new HTML_TextField("category_name", _ADMIN_CATEGORY_NAME_T, _ADMIN_CATEGORY_NAME_D, 50, $category_name);
$pane->addField($field);
$field = new HTML_MemoField("category_description", _ADMIN_CATEGORY_DESCRIPTION_T, _ADMIN_CATEGORY_DESCRIPTION_D, $category_description, 5, 50);
$pane->addField($field);
$field = new HTML_SelectField("category_parent", _ADMIN_CATEGORY_PARENT_T, _ADMIN_CATEGORY_PARENT_D, 10, $category_parent);
$field->addOption(0, _ADMIN_MAIN_CATEGORY);
fill_category_tree($field, null, 1);
$pane->addField($field);
$form->addPane($pane);
$form->_submit = $action == "add" ? _ADMIN_ADD_CATEGORY : _ADMIN_SAVE;
$form->show();
コード例 #5
0
            if ($_POST[$perm] == 1) {
                $q = $db->prepare("INSERT INTO phph_permissions (permission, {$field}) VALUES (?, ?)");
                $db->execute($q, array($perm, $id));
            }
        }
        if (!empty($ref)) {
            header("Location: " . $ref);
        }
        $pane = new HTML_MessagePane("upd", _ADMIN_PERMISSIONS_UPDATED, "", "a_ok_pane", "a_ok_pane_hdr");
        $pane->show();
    } catch (Exception2 $e) {
        $pane = new HTML_MessagePane("upd", $e->getMessage(), $e->getDescription(), "a_fail_pane", "a_fail_pane_hdr");
        $pane->show();
    }
}
$form = new HTML_AdminForm("permissions_form", _ADMIN_EDIT_USER, $session->addSID("perms.php"));
if (!empty($uid)) {
    $form->addHidden("uid", $uid);
} elseif (!empty($gid)) {
    $form->addHidden("gid", $gid);
}
$form->addHidden("ref", $ref);
function add_perm($pane, $name, $title, $desc)
{
    global $permissions;
    $field = new HTML_SelectField($name, $title, $desc, 0, isset($permissions[$name]) ? 1 : 0);
    $field->addOption(1, _YES);
    $field->addOption(0, _NO);
    $pane->addField($field);
}
$pane = new HTML_AdminFormPane("p1", _ADMIN_GENERAL);
コード例 #6
0
<?php } ?>
</div>
</div>
<?php
			}
		} else {
?>
<div class="a_comment">Brak komentarzy.</div>
<?php
		}
	}
}



$form = new HTML_AdminForm("edit_photo_form", "Edycja zdjêcia", $session->addSID("edit_photo.php"));
$form->addHidden("ref", $ref);
$form->addHidden("pid", $pid);
$form->addHidden("action", "edit");

$pane = new Pane_Preview($photo);
$form->addPane($pane);

$pane = new HTML_AdminFormPane("p1", "Dane zdjêcia");
$field = new HTML_TextField("photo_title", "Tytu³", "", 50, $photo_title);
$pane->addField($field);
$field = new HTML_MemoField("photo_description", "Opis", "", $photo_description, 5, 50);
$pane->addField($field);

$field = new HTML_SelectField("photo_cids[]", "Kategorie", "Wybierz jedn± lub wiêcej kategorii", 10, $photo_cids);
$field->_multiselect = true;
コード例 #7
0
</a>
	<?php 
            }
            ?>
				</td>
			</tr>
<?php 
        }
    }
}
$block = new HTML_Block("group_users", $dbo->group_name);
$block->_expanded = true;
$gusers = new Pane_GroupUsers(0, 20);
$block->addPane($gusers);
$block->show();
echo "<br />";
if (Permissions::checkPermAndLevelVal('add_group_members', $dbo->group_level)) {
    $addform = new HTML_AdminForm("add_user_to_group", _ADMIN_ADD_MEMBER, $session->addSID("group_users.php?gid={$gid}"));
    $addform->addHidden("action", "add");
    $addform->addHidden("gid", $gid);
    $addform->_expanded = $action == "add";
    $pane = new HTML_AdminFormPane("autg", "");
    $field = new HTML_TextField("user_login", _ADMIN_USER_T, _ADMIN_USER_D, "", $user_login);
    $pane->addField($field);
    $addform->addPane($pane);
    $addform->_submit = _ADMIN_ADD_MEMBER;
    $addform->show();
}
HTML::endBODY();
HTML::endHTML();
ini_restore('include_path');