• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP YDConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: actionDefault

 function actionDefault()
 {
     // Get the filter
     $filter = 'no_spam';
     if (isset($_GET['filter']) && strtolower($_GET['filter']) == 'spam') {
         $filter = 'spam';
     }
     // Get the ID from the query string
     $id = $this->getIdFromQS();
     // If there is something, set the defaults
     if ($id != -1) {
         // Get the list of comments
         $comments = $this->weblog->getComments($id, 'CREATED DESC');
         // Get the item details
         $item = $this->weblog->getItemById($id);
         $this->tpl->assign('item', $item);
     } else {
         // Get the list of comments
         if ($filter == 'no_spam') {
             $comments = $this->weblog->getComments(null, 'CREATED DESC');
         } else {
             $comments = $this->weblog->getComments(null, 'CREATED DESC', -1, -1, false, true);
         }
     }
     // Get the pagesize and current page from the URL
     $page = @$_GET['page'];
     // Create the YDRecordSet object
     $comments = new YDRecordSet($comments, $page, YDConfig::get('YD_DB_DEFAULTPAGESIZE', 20));
     // Assign it to the template
     $this->tpl->assign('comments', $comments);
     $this->tpl->assign('filter', $filter);
     // Display the template
     $this->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:34,代码来源:comments.php


示例2: actionDefault

 function actionDefault()
 {
     // Get the data
     $db = YDDatabase::getInstance('sqlite', 'database2.db');
     // Output the server version
     YDDebugUtil::dump($db->getServerVersion(), 'Version:');
     // Output some queries
     YDDebugUtil::dump($db->getRecords('select * from escalations'), 'escalations');
     YDDebugUtil::dump($db->getRecords('select * from sqlite_master'), 'sqlite_master');
     YDConfig::set('YD_DB_FETCHTYPE', YD_DB_FETCH_NUM);
     YDDebugUtil::dump($db->getRecords('select * from sqlite_master'), 'array - sqlite_master');
     YDConfig::set('YD_DB_FETCHTYPE', YD_DB_FETCH_ASSOC);
     // Test string escaping
     YDDebugUtil::dump($db->string("Pieter's Framework"), '$db->string');
     // Show number of queries
     YDDebugUtil::dump($db->getSqlCount(), 'Number of queries');
     // Test timestamps
     YDDebugUtil::dump($db->getDate(), 'getDate()');
     YDDebugUtil::dump($db->getTime(), 'getTime()');
     YDDebugUtil::dump($db->getDate('__NOW__'), 'getDate( \'__NOW__\' )');
     YDDebugUtil::dump($db->getTime('__NOW__'), 'getTime( \'__NOW__\' )');
     YDDebugUtil::dump($db->getDate('28-FEB-1977'), 'getDate( \'28-FEB-1977\' )');
     YDDebugUtil::dump($db->getTime('28-FEB-1977'), 'getTime( \'28-FEB-1977\' )');
     YDDebugUtil::dump($db->sqlString($db->getDate()), 'sqlString( getDate() )');
     YDDebugUtil::dump($db->sqlString($db->getTime()), 'sqlString( getTime() )');
     YDDebugUtil::dump($db->sqlString($db->getDate('__NOW__')), 'sqlString( getDate( \'__NOW__\' ) )');
     YDDebugUtil::dump($db->sqlString($db->getTime('__NOW__')), 'sqlString( getTime( \'__NOW__\' ) )');
     // Test limits
     YDDebugUtil::dump($db->_prepareSqlForLimit('SELECT * FROM TABLE', 10));
     YDDebugUtil::dump($db->_prepareSqlForLimit('SELECT * FROM TABLE', 10, 25));
     // Test errors
     YDDebugUtil::dump($db->getRecords('xx'), 'should return error');
     // Close the database connection
     $db->close();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:35,代码来源:database2.php


示例3: actionDefault

 function actionDefault()
 {
     // Create the form
     $form = new YDForm('form1');
     $form->registerFilter('reverse', 'strrev');
     $form->setDefaults(array('txt2' => 'First text', 'txt3' => "2\nlines", 'hid1' => 'me hidden', 'chk1' => 'x', 'chk2' => false, 'sel1' => 2));
     $text =& $form->addElement('text', 'txt1', 'Enter text 1:');
     $text->_label = 'new label for txt1';
     $form->addElement('text', 'txt2', 'Enter text 2:', array('class' => 'textInputClass', 'name' => 'x'));
     $form->addElement('textarea', 'txt3', 'Enter text 2:');
     $form->addElement('textareacounter', 'txtcounter_1', 'Textarea counter 1', array(), array('maxlength' => 10, 'before' => ' (', 'after' => ' characters remaining)'));
     $form->addElement('textareacounter', 'txtcounter_2', 'Textarea counter 2');
     $form->addElement('radio', 'rad1', 'Select a value 1:', array(), array(1 => 'een', 2 => 'twee'));
     $form->addElement('radio', 'rad2', 'Select a value 2:', array(), array(1 => 'een<br/>', 2 => 'twee'));
     $form->addElement('hidden', 'hid1', '');
     $form->addElement('hidden', 'hid2', '', array(), 'i am also hidden');
     $form->addElement('image', 'img1', '', array(), 'http://www.scripting.com/images/xml.gif');
     $form->addElement('password', 'pas1', 'Enter your password');
     $form->addElement('bbtextarea', 'bbt1', 'Enter your BBCode');
     $form->addElement('checkbox', 'chk1', 'Select me please');
     $form->addElement('checkbox', 'chk2', 'Select me please');
     $form->addElement('select', 'sel1', 'Select an option:', array(), array(1 => 'een', 2 => 'twee'));
     $form->addElement('span', 'span1', 'This is a span. The next element is an image (img).');
     $form->addElement('img', 'img2', 'http://www.scripting.com/images/xml.gif');
     $form->addElement('file', 'fil1', 'Select an file:');
     $form->addElement('submit', 'cmd1', 'Send');
     $form->addElement('reset', 'res1', 'Reset');
     $form->addFilter('__ALL__', 'upper');
     $form->addFilter('txt1', 'trim');
     $form->addFilter('txt2', 'reverse');
     $form->addRule('txt1', 'required', 'txt1 is required');
     $form->addRule('chk2', 'exact', 'chk2 is required', 1);
     $form->addFormRule(array(&$this, 'formrule'), 'txt1 is required');
     if (YDConfig::get('YD_DEBUG') == 1 || YDConfig::get('YD_DEBUG') == 2) {
         YDDebugUtil::dump($form->_regElements, 'Registered elements');
         YDDebugUtil::dump($form->_regRules, 'Registered rules');
         YDDebugUtil::dump($form->_regFilters, 'Registered filters');
         YDDebugUtil::dump($form->_filters, 'Filters');
         YDDebugUtil::dump($form->_rules, 'Rules');
         YDDebugUtil::dump($form->_formrules, 'Form Rules');
         YDDebugUtil::dump($form->getValue('txt1'), 'txt1');
         YDDebugUtil::dump($form->getValue('txt2'), 'txt2');
         YDDebugUtil::dump($_POST, '$_POST');
         YDDebugUtil::dump($_FILES, '$_FILES');
         YDDebugUtil::dump($form->toArray());
     }
     if ($form->validate()) {
         YDDebugUtil::dump($form->getModifiedValues(), 'Form modified values');
         YDDebugUtil::dump($form->getValues(), 'Form values');
     } else {
         $form->display();
     }
     // Create the form
     $form2 = new YDForm('form2');
     $form2->setDefaults(array('txt1' => 'First text'));
     $form2->addElement('text', 'txt1', 'Enter text 1:');
     $form2->addElement('text', 'txt2', 'Enter text 2:');
     $form2->addElement('submit', 'cmd1', 'Send');
     $form2->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:60,代码来源:form2.php


示例4: actionDefault

 function actionDefault()
 {
     // Set some variables
     YDConfig::set('MyConfigVar1', 'value cfg1');
     YDConfig::set('MyConfigVar2', 'value cfg2');
     YDConfig::set('MyConfigVar3', 'value cfg3');
     // Get the values
     YDDebugUtil::dump(YDConfig::get('MyConfigVar1'), 'get - MyConfigVar1');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar2'), 'get - MyConfigVar2');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar3'), 'get - MyConfigVar3');
     // Check if the variables exist or not
     YDDebugUtil::dump(YDConfig::exists('MyConfigVar1'), 'exists - MyConfigVar1');
     YDDebugUtil::dump(YDConfig::exists('MyConfigVar2'), 'exists - MyConfigVar2');
     YDDebugUtil::dump(YDConfig::exists('MyConfigVar3'), 'exists - MyConfigVar3');
     // Check an unexisting variable
     YDDebugUtil::dump(YDConfig::exists('xx'), 'exists - xx');
     // Set some variables, not overriding existing values
     YDConfig::set('MyConfigVar1', 'value cfg1 changed', false);
     YDConfig::set('MyConfigVar2', 'value cfg2 changed', false);
     YDConfig::set('MyConfigVar3', 'value cfg3 changed', false);
     // Get the values (should be unchanged)
     YDDebugUtil::dump(YDConfig::get('MyConfigVar1'), 'get - MyConfigVar1 - changed1');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar2'), 'get - MyConfigVar2 - changed1');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar3'), 'get - MyConfigVar3 - changed1');
     // Set some variables, overriding existing values
     YDConfig::set('MyConfigVar1', 'value cfg1 changed', true);
     YDConfig::set('MyConfigVar2', 'value cfg2 changed', true);
     YDConfig::set('MyConfigVar3', 'value cfg3 changed', true);
     // Get the values (should be changed)
     YDDebugUtil::dump(YDConfig::get('MyConfigVar1'), 'get - MyConfigVar1 - changed2');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar2'), 'get - MyConfigVar2 - changed2');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar3'), 'get - MyConfigVar3 - changed2');
     // Dump the contents of YDConfig
     YDConfig::dump();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:35,代码来源:config.php


示例5: actionDefault

 function actionDefault()
 {
     // Get the ID from the query string
     $id = $this->getIdFromQS();
     // If there is nothing, show the list
     if ($id == -1) {
         // Get the count and number of requests
         $requests_count = $this->weblog->getBadBehaviorRequestsCount();
         $requests = $this->weblog->getBadBehaviorPostRequests();
         // Get the pagesize and current page from the URL
         $page = @$_GET['page'];
         // Create the YDRecordSet object
         $requests = new YDRecordSet($requests, $page, YDConfig::get('YD_DB_DEFAULTPAGESIZE', 20));
         // Assign it to the template
         $this->tpl->assign('requests_count', $requests_count);
         $this->tpl->assign('requests', $requests);
     } else {
         // Get the request data
         $request = $this->weblog->getBadBehaviorRequestById($id);
         // Redirect if nothing found
         if (!$request) {
             $this->redirectToAction();
         }
         // Add it to the template
         $this->tpl->assign('request', $request);
     }
     // Display the template
     $this->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:29,代码来源:bad_behavior.php


示例6: get

 /**
  *	@returns	The current locale.
  */
 function get()
 {
     // Set the default locale
     YDConfig::set(YD_LOCALE_KEY, 'en', false);
     // Return the setting
     return strtolower(YDConfig::get(YD_LOCALE_KEY));
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:10,代码来源:YDLocale.php


示例7: module

 /**
  *  This static function returns an YDCMStatistics module
  *
  *  @returns    an module object
  */
 function module($name)
 {
     // include lib
     // TODO: check if name is a valid lib name
     require_once YDConfig::get('YD_DBOBJECT_PATH') . '/' . $name . '.php';
     // return class
     return new $name();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:13,代码来源:YDCMStatistics.php


示例8: actionThumbnailSmall

 function actionThumbnailSmall()
 {
     // Get the image name
     if (!isset($_GET['id'])) {
         die('No image selected.');
     }
     // Create a new image object
     $img = new YDFSImage(YDConfig::get('dir_uploads', '../uploads') . '/' . $_GET['id']);
     // Output the thumbnail
     $img->outputThumbnail(48, 48);
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:11,代码来源:YDWeblogAdminRequest.php


示例9: actionShowLog

 function actionShowLog()
 {
     $file = new YDFSFile(YDConfig::get('YD_LOG_FILE'));
     $data = $file->getContents();
     if (substr($data, 0, 5) == '<?xml') {
         header('Content-type: text/xml');
     } else {
         header('Content-type: text/plain');
     }
     echo $data;
     die;
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:12,代码来源:logging.php


示例10: getFormPage

 /**
  *  This function returns the page form (form admin edition)
  *
  *  @returns    YDForm object
  */
 function getFormPage()
 {
     YDInclude('YDForm.php');
     // get template and language object
     $templates = YDCMComponent::module('YDCMTemplates');
     $languages = YDCMComponent::module('YDCMLanguages');
     // create access options
     $access = array(0 => t('public'), 1 => t('private'));
     // create 'template pack' options
     $template_pack = array(1 => t('use templatepack') . ' (' . $templates->template_pack() . ')', 0 => t('use custom template'));
     // create form object
     $form = new YDForm(YDConfig::get('YDCMPAGE_FORMPAGE'));
     $form->addElement('text', 'reference', t('page_reference'), array('size' => 25, 'maxlength' => 35));
     $form->addElement('text', 'title', t('page_title'), array('size' => 70, 'maxlength' => 70));
     $form->addElement('textarea', 'html', t('page_html'));
     $form->addElement('textarea', 'xhtml', t('page_xhtml'));
     $form->addElement('select', 'access', t('page_access'), array(), $access);
     $form->addElement('select', 'state', t('page_state'), array(), array(1 => t('yes'), 0 => t('no'), 2 => t('schedule')));
     $form->addElement('datetimeselect', 'published_date_start', t('page_startdate'));
     $form->addElement('datetimeselect', 'published_date_end', t('page_enddate'));
     $form->addElement('select', 'template_pack', '', array(), $template_pack);
     $form->addElement('select', 'template', t('page_template'), array(), $templates->visitors_templates());
     $form->addElement('select', 'metatags', t('page_metatags'), array(), array(0 => t('no'), 1 => t('yes')));
     $form->addElement('textarea', 'description', t('page_description'), array('cols' => 50, 'rows' => 5));
     $form->addElement('textarea', 'keywords', t('page_keywords'), array('cols' => 50, 'rows' => 5));
     $form->addElement('select', 'searcheable', t('page_search'), array(), array(0 => t('no'), 1 => t('yes')));
     $form->addElement('hidden', 'content_id');
     $form->addElement('hidden', 'parent_id');
     $form->addElement('hidden', 'language_id');
     // parent of new page is 0 by default
     $form->setDefault('content_id', 0);
     $form->setDefault('parent_id', 0);
     $form->setDefault('language_id', $languages->adminDefault());
     // add form rules
     $form->addRule('reference', 'required', t('reference_required'));
     $form->addRule('reference', 'alphanumeric', t('reference_alphanumeric'));
     $form->addRule('reference', 'maxwords', t('reference_maxwords'), 1);
     $form->addRule('reference', 'maxlength', t('reference_maxlength'), 100);
     $form->addRule('title', 'required', t('title_required'));
     $form->addRule('title', 'maxlength', t('title_maxlength'), 255);
     $form->addRule('content_id', 'required', t('content_id_required'));
     $form->addRule('content_id', 'numeric', t('content_id_numeric'));
     $form->addRule('parent_id', 'required', t('parent_id_required'));
     $form->addRule('parent_id', 'numeric', t('parent_id_numeric'));
     $form->addRule('html', 'maxlength', t('html_maxlength'), 50000);
     $form->addRule('xhtml', 'maxlength', t('xhtml_maxlength'), 50000);
     $form->addRule('template_pack', 'in_array', t('template_pack_invalid'), array(0, 1));
     $form->addRule('template', 'in_array', t('template_invalid'), array_keys($templates->visitors_templates()));
     $form->addRule('metatags', 'in_array', t('metatags_invalid'), array(0, 1));
     $form->addRule('description', 'maxlength', t('description_maxlength'), 2000);
     $form->addRule('keywords', 'maxlength', t('keywords_maxlength'), 2000);
     return $form;
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:58,代码来源:YDCMPage.php


示例11: actionDefault

 function actionDefault()
 {
     // Get the list of items
     $items = $this->weblog->getItems();
     // Get the pagesize and current page from the URL
     $page = @$_GET['page'];
     // Create the YDRecordSet object
     $items = new YDRecordSet($items, $page, intval(YDConfig::get('YD_DB_DEFAULTPAGESIZE', 20) / 2));
     // Assign it to the template
     $this->tpl->assign('items', $items);
     // Display the template
     $this->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:13,代码来源:items.php


示例12: actionDefault

 function actionDefault()
 {
     // Get the list of links
     $links = $this->weblog->getLinks();
     // Get the pagesize and current page from the URL
     $page = @$_GET['page'];
     // Create the YDRecordSet object
     $links = new YDRecordSet($links, $page, YDConfig::get('YD_DB_DEFAULTPAGESIZE', 20));
     // Assign it to the template
     $this->tpl->assign('links', $links);
     // Display the template
     $this->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:13,代码来源:links.php


示例13: YDHttpClient

 /**
  *	This is the class constructor for the YDHttpClient class.
  *
  *	@param $host	The host name to connect to.
  *	@param $port	(optional) The port to connect to (default is 80).
  */
 function YDHttpClient($host, $port = 80)
 {
     // Initialize the HTTP client
     $this->HttpClient($host, $port);
     $this->user_agent = 'Mozilla/4.0 (compatible; ' . YD_FW_NAMEVERS . ')';
     $this->contenttype = '';
     if (YDConfig::get('YD_HTTP_USES_GZIP') == 1) {
         $this->useGzip(true);
     } else {
         $this->useGzip(false);
     }
     $this->setDebug(YDConfig::get('YD_DEBUG'));
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:19,代码来源:YDHttpClient.php


示例14: toHtml

 /**
  *	This function will return the element as HTML.
  *
  *	@returns	The form element as HTML text.
  */
 function toHtml()
 {
     // Create the list of attributes
     $attribs = array('name' => $this->_form . '_' . $this->_name);
     $attribs = array_merge($this->_attributes, $attribs);
     // check if we are in a Javascript environment
     if (YDConfig::get('YD_FORMELEMENT_TEXTAREA_NL')) {
         $this->_value = preg_replace("/\r*\n/", "\\n", $this->_value);
         $this->_value = preg_replace("/\\//", "\\\\/", $this->_value);
         $this->_value = preg_replace("/'/", " ", $this->_value);
     }
     // Get the HTML
     return '<textarea' . YDForm::_convertToHtmlAttrib($attribs) . '>' . $this->_value . '</textarea>';
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:19,代码来源:YDFormElement_TextArea.php


示例15: install

 function install()
 {
     // Initialize the parent
     $this->YDRequest();
     // Initialize the template
     $this->tpl = new YDTemplate();
     // Get the shortcuts to the directories
     $this->dir_uploads = YDConfig::get('dir_uploads', 'uploads');
     $this->dir_skins = YDConfig::get('dir_skins', 'skins') . '/';
     // Error out if the YDFramework temp directory is not writeable
     $this->_checkWriteableDirectory(YD_DIR_TEMP);
     $this->_checkWriteableDirectory(dirname(__FILE__) . '/include');
     $this->_checkWriteableDirectory(dirname(__FILE__) . '/uploads');
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:14,代码来源:install.php


示例16: actionDefault

 function actionDefault()
 {
     // Get the list of categories
     $categories = $this->weblog->getCategories();
     // Get the pagesize and current page from the URL
     $page = @$_GET['page'];
     // Create the YDRecordSet object
     $categories = new YDRecordSet($categories, $page, YDConfig::get('YD_DB_DEFAULTPAGESIZE', 20));
     // Assign it to the template
     $this->tpl->assign('categories', $categories);
     // Assign the quick adds form to the template
     $this->tpl->assignForm('form', $this->form);
     // Display the template
     $this->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:15,代码来源:categories.php


示例17: initCommentsFeed

 function initCommentsFeed()
 {
     // Get the weblog items
     $comments = $this->weblog->getComments(null, 'CREATED DESC', YDConfig::get('max_syndicated_items', 15));
     // Initialize the feed
     $this->feed = new YDFeedCreator();
     $this->feed->setTitle(YDConfig::get('weblog_title', 'Untitled Weblog') . ' - ' . t('comments'));
     $this->feed->setDescription(YDConfig::get('weblog_description', 'Untitled Weblog Description'));
     $this->feed->setLink(YDUrl::makeLinkAbsolute('index.php'));
     // Add the items
     foreach ($comments as $comment) {
         $body = $comment['comment'] . "\n\n" . t('by') . ' ' . $comment['username'];
         $this->feed->addItem($comment['item_title'], YDTplModLinkItem($comment['item_id'], '#comment'), YDTplModBBCode($body));
     }
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:15,代码来源:xml.php


示例18: actionDefault

 function actionDefault()
 {
     // Get the ID from the query string
     $id = $this->getIdFromQS();
     if ($id != -1) {
         $this->redirect('item.php?id=' . $id);
     }
     // Get the weblog items and 5 older items
     $items = $this->weblog->getItems(YDConfig::get('weblog_entries_fp', 5));
     $old_items = $this->weblog->getItems(5, sizeof($items));
     // Assign them to the template
     $this->tpl->assign('items', $items);
     $this->tpl->assign('old_items', $old_items);
     // Display the template
     $this->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:16,代码来源:index.php


示例19: JSinit

 /**
  *	This is the method returns the JS initialization of the editor
  *
  */
 function JSinit($htmlID)
 {
     // start by creating an FCKeditor object
     $js = "oFCKeditor = new FCKeditor( '" . $htmlID . "' );";
     // set the editor path
     $js .= "oFCKeditor.BasePath = '" . YDConfig::get('YD_AJAXEDITOR_FCKEDITOR_Url') . "';";
     // set editor skin path
     $js .= "oFCKeditor.Config['SkinPath'] = oFCKeditor.BasePath + 'editor/skins/" . YDConfig::get('YD_AJAXEDITOR_FCKEDITOR_Skin') . "/';";
     // set toolbar expanded on start
     $js .= YDConfig::get('YD_AJAXEDITOR_FCKEDITOR_ToolbarStartExpanded') ? "oFCKeditor.Config['ToolbarStartExpanded'] = true;" : "oFCKeditor.Config['ToolbarStartExpanded'] = false;";
     // set toolbar scheme
     $js .= "oFCKeditor.ToolbarSet = '" . YDConfig::get('YD_AJAXEDITOR_FCKEDITOR_ToolbarSet') . "';";
     // on fckeditor we add a replace method (that will replace the textarea)
     $js .= "oFCKeditor.ReplaceTextarea();";
     return $js;
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:20,代码来源:YDAjaxEditor.php


示例20: actionDefault

 function actionDefault()
 {
     // Create the form
     $form = new YDForm('form1');
     // Add a first set of elements
     $elementDate = $form->addElement('dateselect', 'dateSelect1', 'Enter data:');
     $elementTime = $form->addElement('timeselect', 'timeSelect1', 'Enter data:');
     $elementDateTime = $form->addElement('datetimeselect', 'datetimeSelect1', 'Enter data:');
     // Add a second set of elements
     $form->addElement('dateselect', 'dateSelect2', 'Enter data:', array(), array('yearstart' => 1970, 'yearend' => '2050'));
     $form->addElement('timeselect', 'timeSelect2', 'Enter data:');
     $form->addElement('datetimeselect', 'datetimeSelect2', 'Enter data:', array(), array('yearstart' => 1970, 'yearend' => '2050'));
     $form->addElement('datetimeselect', 'datetimeSelect3', 'Enter data with seconds:', array(), array('seconds' => true));
     // Add the send button
     $form->addElement('submit', 'cmd1', 'Send');
     // Set the defaults
     $form->setDefaults(array('dateSelect1' => array('month' => 4, 'day' => 4, 'year' => 2002), 'dateSelect2' => strval(time()), 'timeSelect2' => strval(time()), 'datetimeSelect2' => time() + 3600 * 24));
     // Display the form
     $form->display();
     // Show the contents of the form
     if (YDConfig::get('YD_DEBUG') == 1) {
         YDDebugUtil::dump($form->_regElements, 'Registered elements');
         YDDebugUtil::dump($form->_regRules, 'Registered rules');
         YDDebugUtil::dump($form->_regFilters, 'Registered filters');
         YDDebugUtil::dump($form->_filters, 'Filters');
         YDDebugUtil::dump($form->_rules, 'Rules');
         YDDebugUtil::dump($form->_formrules, 'Form Rules');
         YDDebugUtil::dump($form->getValue('dateSelect1'), 'dateSelect1');
         YDDebugUtil::dump($form->getValue('timeSelect1'), 'timeSelect1');
         YDDebugUtil::dump($form->getValue('datetimeSelect1'), 'datetimeSelect1');
         YDDebugUtil::dump($form->getValues(), '$form->getValues()');
         YDDebugUtil::dump($_POST, '$_POST');
         YDDebugUtil::dump($_FILES, '$_FILES');
     }
     if ($form->validate()) {
         YDDebugUtil::dump($form->getValues(), '$form->getValues()');
         YDDebugUtil::dump($elementDate->getTimeStamp(), '$elementDate->getTimeStamp()');
         YDDebugUtil::dump($elementDate->getTimeStamp('%d/%m/%Y'), '$elementDate->getTimeStamp( "%d/%m/%Y" )');
         YDDebugUtil::dump(date('M-d-Y', $elementDate->getTimeStamp()), '$elementDate->gdate( getTimeStamp() )');
         YDDebugUtil::dump($elementTime->getTimeStamp(), '$elementTime->getTimeStamp()');
         YDDebugUtil::dump($elementTime->getTimeStamp('%H:%M'), '$elementTime->getTimeStamp( "%H:%M" )');
         YDDebugUtil::dump($elementDateTime->getTimeStamp(), '$elementDateTime->getTimeStamp()');
         YDDebugUtil::dump($elementDateTime->getTimeStamp('%d/%m/%Y %H:%M'), '$elementDateTime->getTimeStamp( "%H:%M" )');
         YDDebugUtil::dump(YDStringUtil::formatDate($elementDateTime, 'datetime', 'pt'), 'YDStringUtil::formatDate');
     }
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:46,代码来源:form_dateselect.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP YDDebugUtil类代码示例发布时间:2022-05-23
下一篇:
PHP YAML类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap