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


PHP ucf函数代码示例

本文整理汇总了PHP中ucf函数的典型用法代码示例。如果您正苦于以下问题:PHP ucf函数的具体用法?PHP ucf怎么用?PHP ucf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ucf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()))."&nbsp;".$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


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