public function formatter($widget, $inputs) { $plugins = $this->getOption('plugins'); $prefix = $widget->generateId(sprintf($this->widgetSchema->getNameFormat(), $this->pluginFieldKey)) . '_'; $rows = array(); foreach ($inputs as $id => $input) { $name = substr($id, strlen($prefix)); $plugin = $plugins[$name]; $rows[] = $widget->renderContentTag('tr', $widget->renderContentTag('td', $input['input']) . $widget->renderContentTag('td', $input['label']) . $widget->renderContentTag('td', sfWidget::escapeOnce($plugin->getVersion())) . $widget->renderContentTag('td', sfWidget::escapeOnce($plugin->getSummary())) . $widget->renderContentTag('td', $plugin->hasBackend() ? link_to(__('Setting'), $plugin->getName() . '/index') : '')); } return !$rows ? '' : implode($widget->getOption('separator'), $rows); }
$w = new MyWidget(array(), array('foo' => 'bar')); $t->is($w->renderContentTag('textarea', 'content', array('bar' => 'foo')), '<textarea foo="bar" bar="foo">content</textarea>', '->renderContentTag() renders a HTML tag with content and attributes'); $t->is($w->renderContentTag(''), '', '->renderContentTag() renders an empty string if the tag name is empty'); // ::escapeOnce() $t->diag('::escapeOnce()'); $t->is(sfWidget::escapeOnce('This a > text to "escape"'), 'This a > text to "escape"', '::escapeOnce() escapes an HTML strings'); $t->is(sfWidget::escapeOnce(sfWidget::escapeOnce('This a > text to "escape"')), 'This a > text to "escape"', '::escapeOnce() does not escape an already escaped string'); $t->is(sfWidget::escapeOnce('This a > text to "escape"'), 'This a > text to "escape"', '::escapeOnce() does not escape an already escaped string'); class MyClass { public function __toString() { return 'mycontent'; } } $t->is(sfWidget::escapeOnce(new MyClass()), 'mycontent', '::escapeOnce() converts objects to string'); // ::fixDoubleEscape() $t->diag('::fixDoubleEscape()'); $t->is(sfWidget::fixDoubleEscape(htmlspecialchars(htmlspecialchars('This a > text to "escape"'), ENT_QUOTES, sfWidget::getCharset()), ENT_QUOTES, sfWidget::getCharset()), 'This a > text to "escape"', '::fixDoubleEscape() fixes double escaped strings'); // ::getCharset() ::setCharset() $t->diag('::getCharset() ::setCharset()'); $t->is(sfWidget::getCharset(), 'UTF-8', '::getCharset() returns the charset to use for widgets'); sfWidget::setCharset('ISO-8859-1'); $t->is(sfWidget::getCharset(), 'ISO-8859-1', '::setCharset() changes the charset to use for widgets'); // ::setXhtml() ::isXhtml() $t->diag('::setXhtml() ::isXhtml()'); $w = new MyWidget(); $t->is(sfWidget::isXhtml(), true, '::isXhtml() return true if the widget must returns XHTML tags'); sfWidget::setXhtml(false); $t->is($w->renderTag('input', array('value' => 'Test')), '<input value="Test">', '::setXhtml() changes the value of the XHTML tag'); // ->getJavaScripts() ->getStylesheets()
<div id="Top"><div class="parts googleCalendarDescBox" style="position: relative;"> <div class="body"> <ul> <li><?php echo __('Schedules fetched from Google are saved and updated in this SNS.'); ?> </li> <li><?php echo __('If the public flag was set to [All Members], those schedules are public to SNS members.'); ?> </li> <li><?php echo __('If the public flag was set to [Participants only scheduled public], those schedules can see the members that have the mail address related to Google Calendar and invited to schedules on Google Calendar. Thus, the all SNS member cannot those schedules.'); ?> </li> <li><?php echo __('Then, the schedules you create are the only target of convert.'); ?> </li> </ul> </div> </div><!-- parts --></div> <?php $options = array('button' => __('Update'), 'title' => __('Fetch from Google Calendar %email%', array('%email%' => sfWidget::escapeOnce($form->getOption('id')))), 'url' => url_for('calendar_api_import')); op_include_form('googleCalendarImportForm', $form, $options);