本文整理汇总了PHP中JString::ucfirst方法的典型用法代码示例。如果您正苦于以下问题:PHP JString::ucfirst方法的具体用法?PHP JString::ucfirst怎么用?PHP JString::ucfirst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JString
的用法示例。
在下文中一共展示了JString::ucfirst方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptions
protected function getOptions()
{
$options = parent::getOptions();
$paths = array();
$paths[] = JPATH_ADMINISTRATOR . '/components/com_dpfields/models/types';
if ($this->element['component']) {
$paths[] = JPATH_ADMINISTRATOR . '/components/' . $this->element['component'] . '/models/types';
}
foreach ($paths as $path) {
if (!JFolder::exists($path)) {
continue;
}
// Looping trough the types
foreach (JFolder::files($path, 'php', true, true) as $filePath) {
$name = str_replace('.php', '', basename($filePath));
if ($name == 'base') {
continue;
}
$label = 'COM_DPFIELDS_TYPE_' . strtoupper($name);
if (!JFactory::getLanguage()->hasKey($label)) {
$label = JString::ucfirst($name);
}
$options[] = JHtml::_('select.option', $name, JText::_($label));
}
}
return $options;
}
示例2: pluginAjax
/**
* Ajax action called from element
* 11/07/2011 - I've updated things so that any plugin ajax call uses 'view=plugin' rather than controller=plugin
* this means that the controller used is now plugin.php and not plugin.raw.php
*
* @return null
*/
public function pluginAjax()
{
$app = JFactory::getApplication();
$input = $app->input;
$plugin = $input->get('plugin', '');
$method = $input->get('method', '');
$group = $input->get('g', 'element');
$pluginManager = FabrikWorker::getPluginManager();
try {
// First lets try the fabrik plugin manager - needed when loading namespaced plugins
$pluginManager->loadPlugIn($plugin, $group);
} catch (Exception $e) {
if (!JPluginHelper::importPlugin('fabrik_' . $group, $plugin)) {
$o = new stdClass();
$o->err = 'unable to import plugin fabrik_' . $group . ' ' . $plugin;
echo json_encode($o);
return;
}
}
if (substr($method, 0, 2) !== 'on') {
$method = 'on' . JString::ucfirst($method);
}
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger($method);
}
示例3: pluginAjax
/**
* Ajax action called from element
* 11/07/2011 - I've updated things so that any plugin ajax call uses 'view=plugin' rather than controller=plugin
* this means that the controller used is now plugin.php and not plugin.raw.php
*
* @return null
*/
public function pluginAjax()
{
$app = JFactory::getApplication();
$input = $app->input;
$plugin = $input->get('plugin', '');
$method = $input->get('method', '');
$group = $input->get('g', 'element');
/**
* $$$ hugh - playing around trying to fix a viz AJAX issue, figured we might need
* to set up the dispatcher first and pass it to importPlugin, which doesn't hurt, but
* didn't fix the issue. But leaving these two lines, as I think this might be necessary
* at some point, to get the methods into the dispatcher?
*
* $dispatcher = JDispatcher::getInstance();
* if (!JPluginHelper::importPlugin('fabrik_'.$group, $plugin, true, $dispatcher))
*/
if (!JPluginHelper::importPlugin('fabrik_' . $group, $plugin)) {
$o = new stdClass();
$o->err = 'unable to import plugin fabrik_' . $group . ' ' . $plugin;
echo json_encode($o);
return;
}
if (substr($method, 0, 2) !== 'on') {
$method = 'on' . JString::ucfirst($method);
}
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger($method);
}
示例4: addAutoLoadViews
function addAutoLoadViews($baseFolders, $format, $prefix = 'Xipt')
{
foreach (JFolder::folders($baseFolders) as $folder) {
//e.g. XiController + Product
$className = JString::ucfirst($prefix) . JString::ucfirst('View') . JString::ucfirst($folder);
$fileName = JString::strtolower("view.{$format}.php");
JLoader::register($className, $baseFolders . DS . $folder . DS . $fileName);
}
}
示例5: __construct
/**
* constructor
*
* @access protected
* @param string The event handler
*/
function __construct($eventHandlerName)
{
$eventListenerClassName = 'ARK' . JString::ucfirst($eventHandlerName) . 'ControllerListener';
if (class_exists($eventListenerClassName)) {
$this->_eventHandler = new $eventListenerClassName($this);
} else {
ARKHelper::error('No Event listener ' . $eventListenerClassName . ' class found.');
}
}
示例6: buildTypes
function buildTypes($value, $what)
{
$allValues = array();
$callFunc = '_build' . JString::ucfirst($what);
if (!method_exists(new XiptHelperProfiletypes(), $callFunc)) {
XiptError::assert(0);
}
return XiptHelperProfiletypes::$callFunc($value);
}
示例7: store
public function store($updateNulls = false)
{
if (empty($this->value) && !empty($this->title)) {
$this->value = JString::strtolower(JString::str_ireplace(' ', '', $this->title));
}
if (empty($this->title) && !empty($this->value)) {
$this->title = JString::ucfirst($this->value);
}
return parent::store($updateNulls);
}
示例8: getInstance
public static function getInstance()
{
$suffix = JString::stristr(XiptHelperJomsocial::get_js_version(), 2.0) ? "Js20" : "Js18";
$classname = "XiptFieldsTemplates" . JString::ucfirst($suffix);
if (class_exists($classname, true) === false) {
XiptError::raiseError(__CLASS__ . '.' . __LINE__, XiptText::_("{$className} : CLASS_NOT_FOUND"));
return false;
}
$instance = new $classname();
return $instance;
}
示例9: load
/**
* Load the object and the video provider as well
*/
public function load($oid = null)
{
if (parent::load($oid)) {
// @todo: make sure loading is done ok
$providerName = JString::strtolower($this->type);
$libraryPath = COMMUNITY_COM_PATH . DS . 'libraries' . DS . 'videos' . DS . $providerName . '.php';
require_once $libraryPath;
$className = 'CTableVideo' . JString::ucfirst($providerName);
$this->_provider = new $className($this->_db);
return true;
}
return false;
}
示例10: findAll
/**
* Loads in element's published validation objects
*
* @return PlgFabrik_Validationrule[] Validation objects
*/
public function findAll()
{
if (isset($this->validations)) {
return $this->validations;
}
$params = $this->elementModel->getParams();
$validations = (array) $params->get('validations', 'array');
$usedPlugins = (array) FArrayHelper::getValue($validations, 'plugin', array());
$published = FArrayHelper::getValue($validations, 'plugin_published', array());
$showIcon = FArrayHelper::getValue($validations, 'show_icon', array());
$mustValidate = FArrayHelper::getValue($validations, 'must_validate', array());
$validateIn = FArrayHelper::getValue($validations, 'validate_in', array());
$validationOn = FArrayHelper::getValue($validations, 'validation_on', array());
$mustValidate = FArrayHelper::getValue($validations, 'must_validate', array());
$pluginManager = FabrikWorker::getPluginManager();
$pluginManager->getPlugInGroup('validationrule');
$c = 0;
$this->validations = array();
$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin('fabrik_validationrule');
$i = 0;
foreach ($usedPlugins as $usedPlugin) {
if ($usedPlugin !== '') {
$isPublished = FArrayHelper::getValue($published, $i, true);
if ($isPublished) {
$class = 'PlgFabrik_Validationrule' . JString::ucfirst($usedPlugin);
$conf = array();
$conf['name'] = JString::strtolower($usedPlugin);
$conf['type'] = JString::strtolower('fabrik_Validationrule');
/** @var PlgFabrik_Validationrule $plugIn */
$plugIn = new $class($dispatcher, $conf);
JPluginHelper::getPlugin('fabrik_validationrule', $usedPlugin);
$plugIn->elementModel = $this->elementModel;
$this->validations[] = $plugIn;
// Set params relative to plugin render order
$plugIn->setParams($params, $i);
$plugIn->getParams()->set('show_icon', FArrayHelper::getValue($showIcon, $i, true));
$plugIn->getParams()->set('validate_in', FArrayHelper::getValue($validateIn, $i, 'both'));
$plugIn->getParams()->set('validation_on', FArrayHelper::getValue($validationOn, $i, 'both'));
$plugIn->getParams()->set('must_validate', FArrayHelper::getValue($mustValidate, $i, '0'));
$plugIn->js();
$c++;
}
}
$i++;
}
return $this->validations;
}
示例11: pluginAjax
/**
* Means that any method in Fabrik 2, e.e. 'ajax_upload' should
* now be changed to 'onAjax_upload'
* ajax action called from element
*
* 11/07/2011 - ive updated things so that any plugin ajax call uses 'view=plugin' rather than controller=plugin
* this means that the controller used is now plugin.php and not plugin.raw.php
*
* @return null
*/
public function pluginAjax()
{
$plugin = JRequest::getVar('plugin', '');
$method = JRequest::getVar('method', '');
$group = JRequest::getVar('g', 'element');
if (!JPluginHelper::importPlugin('fabrik_' . $group, $plugin)) {
$o = new stdClass();
$o->err = 'unable to import plugin fabrik_' . $group . ' ' . $plugin;
echo json_encode($o);
return;
}
$dispatcher = JDispatcher::getInstance();
if (substr($method, 0, 2) !== 'on') {
$method = 'on' . JString::ucfirst($method);
}
$dispatcher->trigger($method);
}
示例12: getidvideo
function getidvideo($providerName, $videoLink){
$libraryPath = JPATH_COMPONENT . DS . 'libraries' . DS . 'videos' . DS . $providerName . '.php';
jimport('joomla.filesystem.file');
if (!JFile::exists($libraryPath)){
$redirect = JRoute::_('index.php?option=com_awdwall&&view=awdwall', false);
$message = JText::_('Video Provider is not supported');
$mainframe->redirect($redirect , $message, 'error');
}
$db =& JFactory::getDBO();
require_once($libraryPath);
$className = 'TableVideo' . JString::ucfirst($providerName);
$videoObj = new $className($db);
$videoObj->init($videoLink);
return $videoObj;
}
示例13: pluginAjax
/**
* Means that any method in Fabrik 2, e.e. 'ajax_upload' should
* now be changed to 'onAjax_upload'
* ajax action called from element
*
* 11/07/2011 - I've updated things so that any plugin ajax call uses 'view=plugin' rather than controller=plugin
* this means that the controller used is now plugin.php and not plugin.raw.php
*
* @return null
*/
public function pluginAjax()
{
$app = JFactory::getApplication();
$input = $app->input;
$plugin = $input->get('plugin', '');
$method = $input->get('method', '');
$group = $input->get('g', 'element');
if (!JPluginHelper::importPlugin('fabrik_' . $group, $plugin)) {
$o = new stdClass();
$o->err = 'unable to import plugin fabrik_' . $group . ' ' . $plugin;
echo json_encode($o);
return;
}
$dispatcher = JEventDispatcher::getInstance();
if (substr($method, 0, 2) !== 'on') {
$method = 'on' . JString::ucfirst($method);
}
$dispatcher->trigger($method);
}
示例14: getLocations
/**
* @param string $locType - cities, regions, countries, russia
* @return string
*/
public static function getLocations($locType)
{
$zoo = App::getInstance('zoo');
$locations = self::apiRequest(array('method' => 'ems.get.locations', 'plain' => 'true', 'type' => $locType));
$result = array('' => '- ' . JText::_('JBZOO_ELEMENT_SHIPPING_EMSPOST_' . $locType) . ' -');
if (!$locations) {
return $result;
}
$jbvars = $zoo->jbvars;
foreach ($locations['locations'] as $location) {
$value = $jbvars->lower($location['value']);
$name = JString::ucfirst($jbvars->lower($location['name']));
$result[$value] = $name;
}
if ($locType != 'russia') {
asort($result);
}
return $result;
}
示例15: init
public function init()
{
$plugin = JPluginHelper::getPlugin('editors', $this->_name);
require_once JPATH_SITE . '/plugins/editors/' . $plugin->name . '/' . $plugin->name . '.php';
$className = 'plgEditor' . JString::ucfirst($plugin->name);
$editor = new $className($this, (array) $plugin);
$onInit = $editor->onInit();
if (empty($onInit)) {
return '';
}
// We only need to fetch the script declarations since other scripts are already loaded
$doc = new DOMDocument();
$doc->loadHTML($onInit);
$scripts = $doc->getElementsByTagName('script');
$js = '';
foreach ($scripts as $key => $script) {
$js .= $scripts->item($key)->nodeValue;
}
return $js;
}