本文整理汇总了PHP中ucf函数的典型用法代码示例。如果您正苦于以下问题:PHP ucf函数的具体用法?PHP ucf怎么用?PHP ucf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ucf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!isAdmin())
{
$stderr = ucf(i18n("not enough rights to set initial metadata"));
return true;
}
if (empty($args))
{
$stdout = "Usage: maddinit [class name] [metadata name] [value]\n";
$stdout .= "Example: maddinit file_folder view thumbnail";
}
else
{
list($class_name, $name, $value) = splitArgs($args);
$return = setInitialMetadata($class_name, $name, $value);
if ($return === true)
$stdout = "Updated metadata successfully";
else
$stderr = $return;
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:28,代码来源:maddinit.php
示例2: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!empty($args))
{
switch ($this->stage)
{
case 1:
if (!login($this->username, $args))
{
$stderr = ucf(i18n("login failed")).". ".ucf(i18n("please try again"));
}
else
{
$system->triggerEventIntern("login", array());
//$response->addScript("window.location.reload()");
$user = new mUser();
$user->setByUsername($this->username);
$stdout = $user->name." ".i18n("logged in successfully");
}
$this->stage = 0;
return true;
}
$this->username = $args;
$stdout = ucf(i18n("password:"));
$this->stage = 1;
$system->addJSScript("document.getElementById('cmdline').type='password';");
return false;
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:34,代码来源:login.php
示例3: getName
function getName($raw = false)
{
if ($raw)
return $this->name;
return ucf(str_replace("_", " ", $this->name));
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:7,代码来源:class.mvar.php
示例4: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
logout();
$system->triggerEventIntern("logout", array());
$stdout = ucf(i18n("logout successfull"));
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:8,代码来源:logout.php
示例5: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!empty($args))
{
$path = $args;
if ($path{0} != "/")
$path = $_SESSION['murrix']['path']."/$path";
$node_id = getNode($path);
if ($node_id > 0)
{
$stderr = ucf(i18n("object already exists"));
return true;
}
$parent = new mObject(getNode($_SESSION['murrix']['path']));
if (!(isAdmin() || $parent->hasRight("create")))
{
$stderr = ucf(i18n("not enough rights to create folder"));
return true;
}
$object = new mObject();
$object->setClassName("folder");
$object->loadVars();
$object->name = basename($path);
$object->language = $_SESSION['murrix']['language'];
$object->rights = $parent->getMeta("initial_rights", "rwcrwc---");
$object->group_id = $parent->getMeta("initial_group", $parent->getGroupId());
if (!$object->save())
{
$stderr = "Operation unsuccessfull.\n";
$stderr .= "Error output:\n";
$stderr .= $object->getLastError();
return true;
}
clearNodeFileCache($parent->getNodeId());
$object->linkWithNode($parent->getNodeId());
$stdout = ucf(i18n("created folder successfully"));
}
else
{
$stdout = "Usage: oadd [name]\n";
$stdout .= "Example: oadd newfolder";
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:54,代码来源:oadd.php
示例6: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
$object = new mObject(getNode($_SESSION['murrix']['path']));
$links = $object->getLinks();
if ($args == "-l")
{
$stdout .= "total ".count($links)."\n";
if (count($links) > 0)
{
$stdout .= "<table cellspacing=\"0\">";
$stdout .= "<tr class=\"table_title\">";
$stdout .= "<td>Id</td>";
$stdout .= "<td>Type</td>";
$stdout .= "<td>Remote node</td>";
$stdout .= "<td>Remote node is on...</td>";
$stdout .= "</tr>";
foreach ($links as $link)
{
if ($link['remote_id'] <= 0)
$remote = ucf(i18n("unknown"));
else
{
$remote_obj = new mObject($link['remote_id']);
$remote = cmd(img(geticon($remote_obj->getIcon()))." ".$remote_obj->getName(), "exec=show&node_id=".$remote_obj->getNodeId());
}
$stdout .= "<tr>";
$stdout .= "<td>".$link['id']."</td>";
$stdout .= "<td>".$link['type']."</td>";
$stdout .= "<td>".$remote."</td>";
$stdout .= "<td>".ucf(i18n($link['direction']))."</td>";
$stdout .= "</tr>";
}
$stdout .= "</table>";
}
}
else
{
foreach ($links as $link)
{
if ($link['remote_id'] > 0)
{
$remote_obj = new mObject($link['remote_id']);
$stdout .= cmd($remote_obj->getName(), "exec=show&node_id=".$remote_obj->getNodeId())." ";
}
}
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:51,代码来源:llist.php
示例7: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!isAdmin())
{
$stderr = ucf(i18n("not enough rights to add user to group"));
return true;
}
if (empty($args))
{
$stdout = "Usage: gadduser [group] [username]\n";
$stdout .= "Example: gadduser admins admin";
}
else
{
list($groupname, $username) = explode(" ", $args);
$user = new mUser();
$user->setByUsername($username);
if ($user->id <= 0)
{
$stderr = ucf(i18n("no user named"))." $username ".i18n("found");
return true;
}
$group = new mGroup();
$group->setByName($groupname);
if ($group->id <= 0)
{
$stderr = ucf(i18n("no group named"))." $groupname ".i18n("found");
return true;
}
$user_groups = $user->getGroups();
if (in_array($groupname, $user_groups))
{
$stderr = $username." ".i18n("is already a member of")." $groupname";
return true;
}
$user->groups .= " $groupname";
$user->save();
$stdout = ucf(i18n("added"))." $username ".i18n("to")." $groupname";
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:50,代码来源:gadduser.php
示例8: draw
function draw(&$system, $args)
{
$node_id = $this->getNodeId($args);
$data = "";
if ($node_id > 0)
{
$object = new mObject($node_id);
$data = compiletpl("scripts/versions", array(), $object);
}
else
$data = compiletpl("message", array("titel"=>ucf(i18n("error")), "message"=>ucf(i18n("the specified path is invalid"))));
$system->setZoneData($this->zone, utf8e($data));
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:15,代码来源:script.php
示例9: setOwnerOnObjectsRecursive
function setOwnerOnObjectsRecursive(&$object, &$stdout, &$stderr, $rights)
{
if (!(isAdmin() || $object->hasRight("write")))
$stderr .= ucf(i18n("not enough rights to change ownership on"))." ".$object->getPathInTree()."\n";
if ($object->grantRight($rights))
$stdout .= "";//ucf(i18n("changed ownership successfully on"))." ".$object->getPathInTree()."\n";
else
$stderr .= ucf(i18n("failed to change ownership on"))." ".$object->getPathInTree()."\n";
$children = fetch("FETCH node WHERE link:node_top='".$object->getNodeId()."' AND link:type='sub' NODESORTBY property:version SORTBY property:name");
for ($n = 0; $n < count($children); $n++)
$this->setOwnerOnObjectsRecursive($children[$n], $stdout, $stderr, $rights);
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:15,代码来源:grant.php
示例10: execute
function execute(&$system, $args)
{
if (!is_array($this->actionHandlers))
$this->actionHandlers = array();
if (in_array($args['action'], $this->actionHandlers))
{
$actionHandler = "action".ucf($args['action']);
$this->$actionHandler($system, $args);
return;
}
$this->draw($system, $args);
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:15,代码来源:class.script.php
示例11: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!isAdmin())
{
$stderr = ucf(i18n("not enough rights to delete group"));
return true;
}
switch ($this->stage)
{
case 1:
if (empty($args) || strtolower($args) == "y" || strtolower($args) == "yes")
{
$result = delGroup($this->name);
if ($result === true)
$stdout = ucf(i18n("removed group successfully"));
else
$stdout = $result;
$this->stage = 0;
return true;
}
$stdout = ucf(i18n("aborted by user"));
$this->stage = 0;
return true;
}
if (empty($args))
{
$stdout = "Usage: gdel [username]\n";
$stdout .= "Example: gdel admin";
return true;
}
else
{
$this->name = $args;
$stdout = ucf(i18n("are you sure you want to delete this group"))." (Y/n)?";
$this->stage = 1;
}
return false;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:45,代码来源:gdel.php
示例12: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!empty($args))
{
$object = new mObject(getNode($_SESSION['murrix']['path']));
if (!$object->hasRight("write"))
{
$stderr = ucf(i18n("not enough rights"));
return true;
}
$links = $object->getLinks();
$link_matched = false;
foreach ($links as $link)
{
if ($link['id'] == $args)
{
$link_matched = $link;
break;
}
}
if ($matched === false)
{
$stderr = ucf(i18n("unknown link specified"));
return true;
}
$object->deleteLink($args);
clearNodeFileCache($object->getNodeId());
clearNodeFileCache($link_matched['remote_id']);
$_SESSION['murrix']['path'] = $object->getPathInTree();
$system->TriggerEventIntern($response, "newlocation", array());
$stdout = ucf(i18n("removed link successfully"));
}
else
{
$stdout = "Usage: ldel [linkid]\n";
$stdout .= "Example: ldel 1";
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:45,代码来源:ldel.php
示例13: setSetting
function setSetting($name, $value, $theme = "")
{
clearSettingsCache();
$table = new mTable("settings");
if (empty($theme))
$theme = $_SESSION['murrix']['theme'];
$settings = $table->get("`name`='$name' AND (`theme`='any' OR `theme`='$theme')");
if (count($settings) > 0)
{
$settings[0]['value'] = $value;
if (empty($value))
{
if (!$table->remove($settings[0]['id']))
return $table->error;
else
return true;
}
else
{
if (!$table->update($settings[0]['id'], $settings[0]))
return $table->error;
else
return true;
}
}
else if (!empty($value))
{
$setting = array("name" => $name, "value" => $value, "theme" => $theme);
if (!$table->insert($setting))
return $table->error;
else
return true;
}
return ucf(i18n("no such setting"));
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:42,代码来源:settings.php
示例14: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!empty($args))
{
list($rights, $path) = explode(" ", $args, 2);
if ($path{0} != "/")
$path = $_SESSION['murrix']['path']."/$path";
$node_id = getNode($path);
if ($node_id <= 0)
{
$stderr = ucf(i18n("no such path"));
return true;
}
else
$object = new mObject($node_id);
if (!(isAdmin() || $object->hasRight("write")))
{
$stderr = ucf(i18n("not enough rights to change rights"));
return true;
}
$object->setRights($rights);
if ($object->saveCurrent())
$stdout = ucf(i18n("changed rights successfully"));
else
$stderr = ucf(i18n("failed to change rights"));
}
else
{
$stdout = "Usage: chmod [rightstring] [path]\n";
$stdout .= "Example: chmod rwcrwcrwc /root";
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:40,代码来源:chmod.php
示例15: setInitialMetadata
function setInitialMetadata($class_name, $name, $value)
{
$table = new mTable("initial_meta");
$meta = $table->get("`class_name`='$class_name' AND `name`='$name'");
if (count($meta) > 0)
{
if (empty($value))
{
if (!$table->remove($meta[0]['id']))
return $table->error;
else
return true;
}
else
{
if (!$table->update($meta[0]['id'], array($name => $value)))
return $table->error;
else
return true;
}
}
else if (!empty($name))
{
if (empty($value))
return ucf(i18n("empty value, nothing set"));
$meta = array("class_name" => $class_name, "name" => $name, "value" => $value);
if (!$table->insert($meta))
return $table->error;
else
return true;
}
return ucf(i18n("empty name is forbidden"));
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:38,代码来源:class.php
示例16: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!empty($args))
{
$path = $args;
if ($path{0} != "/")
$path = $_SESSION['murrix']['path']."/$path";
$node_id = getNode($path);
if ($node_id <= 0)
{
$stderr = ucf(i18n("no such path"));
return true;
}
else
$object = new mObject($node_id);
if (!(isAdmin() || $object->hasRight("write")))
{
$stderr = ucf(i18n("not enough rights to delete"));
return true;
}
clearNodeFileCache($object->getNodeId());
$object->deleteNode();
$stdout = ucf(i18n("deleted node successfully"));
}
else
{
$stdout = "Usage: odel [name]\n";
$stdout .= "Example: odel oldfolder";
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:37,代码来源:odel.php
示例17: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!empty($args))
{
$args_split = splitArgs($args);
if (count($args_split) >= 2)
{
$name = $args_split[0];
$value = $args_split[1];
if (isset($args_split[2]))
$theme = $args_split[2];
if (!isAdmin())
{
$stderr = ucf(i18n("not enough rights"));
return true;
}
$result = setSetting($name, $value, $theme);
if ($result === true)
$stdout = ucf(i18n("setting set successfully"));
else
$stdout = $result;
}
}
else
{
$stdout = "Usage: sset [settingname] [value]\n";
$stdout .= "Example: sset TITLE \"Murrix title\"";
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:36,代码来源:sset.php
示例18: ucf
$alternatives = $object->getVarValue("alternatives");
for ($n = 0; $n < count($alternatives); $n++)
{
?>
<div class="alternative">
<input class="input_radio" type="radio" name="answer" value="<?php
echo $n;
?>
">
<?php
echo $alternatives[$n];
?>
</div>
<?
}
?>
<input class="submit" id="submitButton" type="submit" value="<?php
echo ucf(i18n("submit"));
?>
"/>
</div>
</form>
<?
}
?>
</div>
</div>
<?
}
?>
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:31,代码来源:poll_view.php
示例19: exec
function exec($args, $stdin, &$stdout, &$stderr, &$system)
{
if (!isAdmin())
{
$stderr = ucf(i18n("not enough rights to create group"));
return true;
}
switch ($this->stage)
{
case 1:
$this->name = $args;
$stdout = "$args\n";
$stdout .= ucf(i18n("enter description:"));
$this->stage = 2;
return false;
case 2:
$this->description = $args;
$stdout = "$args\n".ucf(i18n("create home"))." (Y/n)?";
$this->stage = 3;
return false;
case 3:
$this->create_home = (empty($args) || strtolower($args) == "y" || strtolower($args) == "yes");
if ($this->create_home)
$stdout = "yes\n";
else
$stdout = "no\n";
$stdout .= ucf(i18n("are you sure you want to create this group"))." (Y/n)?";
$this->stage = 4;
return false;
case 4:
if (empty($args) || strtolower($args) == "y" || strtolower($args) == "yes")
{
$result = createGroup($this->name, $this->description, $this->create_home);
if (is_numeric($result))
{
$stdout = ucf(i18n("created new group successfully"));
$this->stage = 0;
return true;
}
$stderr = $result;
$this->stage = 0;
return true;
}
$stdout = ucf(i18n("aborted by user"));
$this->stage = 0;
return true;
}
if (empty($args))
{
$stdout = ucf(i18n("enter name:"));
$this->stage = 1;
}
else
{
$this->name = $args;
$stdout .= ucf(i18n("enter description:"));
$this->stage = 2;
}
return false;
}
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:70,代码来源:gadd.php
示例20: compiletpl
<?
echo compiletpl("scripts/show/tabs", array("view"=>"delete"), $object);
echo compiletpl("title/big", array("left"=>img(geticon($object->getIcon()))." ".$object->getName()), $object);
?>
<div class="main">
<center>
<?php
echo "<span style=\"font-weight: bold; font-size: 16px;\">" . ucf(i18n("are you sure you want to delete")) . " \"" . $object->getName() . "\"?</span>";
?>
<br/>
<table class="invisible" width="50%">
<tr>
<td align="center">
<?php
echo cmd(img(geticon("yes", 32)) . "<br/>" . ucf(i18n("yes")), "exec=delete&action=delete&node_id=" . $object->getNodeId());
?>
</td>
<td align="center">
<?php
echo cmd(img(geticon("no", 32)) . "<br/>" . ucf(i18n("no")), "exec=show&node_id=" . $object->getNodeId());
?>
</td>
</tr>
</table>
</center>
</div>
开发者ID:BackupTheBerlios,项目名称:murrix-svn,代码行数:26,代码来源:delete.php
注:本文中的ucf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论