本文整理汇总了PHP中Fox类的典型用法代码示例。如果您正苦于以下问题:PHP Fox类的具体用法?PHP Fox怎么用?PHP Fox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Fox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form $form
*/
protected function _prepareForm(Uni_Core_Form $form)
{
$form->setName('menu')->setMethod('post');
$subForm1 = new Zend_Form_SubForm();
$subForm1->setLegend('Menu Item Information');
$subForm1->setDescription('Menu Item Information');
$idField = new Zend_Form_Element_Hidden('id');
$title = new Zend_Form_Element_Text('title', array('class' => 'required', 'maxlength' => 200));
$title->setRequired(true)->setLabel('Title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$link = new Zend_Form_Element_Text('link', array('maxlength' => 200));
$link->setLabel('Link')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDescription('Use module/controller/action for internal links or http://www.example.com for external links');
$open_window = new Zend_Form_Element_Select('open_window', array('class' => 'required', 'maxlength' => 200));
$open_window->setRequired(true)->setLabel('Open Window')->setMultiOptions(Fox::getModel('navigation/menu')->getAllTargetWindows());
$status = new Zend_Form_Element_Select('status', array('class' => 'required', 'maxlength' => 200));
$status->setRequired(true)->setLabel('Status')->setMultiOptions(Fox::getModel('navigation/menu')->getAllStatuses());
$sort_order = new Zend_Form_Element_Text('sort_order', array('class' => 'required', 'maxlength' => 200));
$sort_order->setRequired(true)->setLabel('Sort Order')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$style_class = new Zend_Form_Element_Text('style_class');
$style_class->setLabel('Style Class')->addFilter('StripTags')->addFilter('StringTrim');
$menugroup = new Zend_Form_Element_Multiselect('menu_group', array('class' => 'required'));
$menugroup->setRequired(true)->setLabel('Menu Group')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setMultiOptions(Fox::getModel('navigation/menugroup')->getMenuGroupOptions());
$subForm1->addElements(array($idField, $title, $link, $open_window, $sort_order, $style_class, $status, $menugroup));
$form->addSubForm($subForm1, 'subform1');
parent::_prepareForm($form);
}
示例2: getConfig
/**
* Get config
*
* @return Fox_Extensionmanager_Model_Config
*/
protected function getConfig()
{
if (!$this->config) {
$this->config = Fox::getModel("extensionmanager/config");
}
return $this->config;
}
示例3: getAllGeneratedPackages
/**
* Get all generated packages
*
* @return array
*/
public function getAllGeneratedPackages()
{
$package = Fox::getModel("extensionmanager/generate/package");
$pkgPath = $package->getGeneratedPkgDir();
$pkgList = array();
$noMod = array('.', '..');
$doc = new DOMDocument();
if (is_dir($pkgPath)) {
$dp = opendir($pkgPath);
while ($file = readdir($dp)) {
if (!in_array($file, $noMod)) {
$doc->load($pkgPath . DS . $file);
if ($doc->documentElement->nodeName == Fox_Extensionmanager_Model_Generate_Package::PACKAGE_ROOT_ELEMENT && $doc->documentElement->childNodes) {
$data = array();
$nList = $doc->documentElement->childNodes;
foreach ($nList as $n) {
if (in_array($n->nodeName, array(Fox_Extensionmanager_Model_Generate_Package::PACKAGE_NAME_ELEMENT, Fox_Extensionmanager_Model_Generate_Package::PACKAGE_VERSION_ELEMENT, Fox_Extensionmanager_Model_Generate_Package::PACKAGE_STABILITY_ELEMENT))) {
$data[$n->nodeName] = $n->nodeValue;
}
}
if ($data) {
$pkgList[] = $data;
}
}
}
}
}
sort($pkgList);
return $pkgList;
}
示例4: reply
/**
* Send reply to contact request
*
* @param string $replyMessage
*/
public function reply($replyMessage)
{
$this->setStatus(Fox_Contact_Model_Contact::STATUS_REPLIED);
$this->save();
$modelTemplate = Fox::getModel('core/email/template');
$modelTemplate->sendTemplateMail(Fox::getPreference('contact/reply/email_template'), $this->getEmail(), array('sender_email' => Fox::getPreference('contact/reply/email'), 'sender_name' => Fox::getPreference('contact/reply/name')), array('name' => $this->getName(), 'subject' => $this->getSubject(), 'message' => $this->getMessage(), 'reply' => $replyMessage));
}
示例5: getTemplateContent
/**
* Get newsletter template content
*
* @return string
*/
public function getTemplateContent()
{
$id = $this->getRequest()->getParam('tId');
$model = Fox::getModel('newsletter/template');
$model->load($id);
return $model->getContent();
}
示例6: render
/**
* Render contents
*
* @return string
*/
public function render()
{
$args = func_get_args();
$changePwdImg = Fox::getThemeUrl('images/change_pwd.png');
$loginImg = Fox::getThemeUrl('images/login.png');
return '<a target="_self" href="' . $args[0]['change_password'] . '" title="' . $args[0]['change_password'] . '"><img src="' . $changePwdImg . '" alt="Change Password" title="Change Password" style="border:none;" /></a> <a target="_blank" href="' . $args[0]['login'] . '" title="' . $args[0]['login'] . '"><img src="' . $loginImg . '" alt="Login" title="Login" style="border:none;" /></a>';
}
示例7: traverseDirFiles
/**
* Traverses Files and Directories inside given path Recursively
* @param $path to traverse
*/
public function traverseDirFiles($path)
{
$dir = opendir($path);
$files = array();
$f = array();
$skip = array(Fox::getDirectoryPath() . DS . "var", Fox::getDirectoryPath() . DS . "library" . DS . "Zend", Fox::getExtensionDirectoryPath(), Fox::getDirectoryPath() . DS . "theme" . DS . "installer", APPLICATION_PATH . DS . "views" . DS . "installer");
while ($ft = readdir($dir)) {
if (in_array($ft, array(".", "..")) || in_array($path . DS . $ft, $skip)) {
continue;
}
$f[] = $ft;
}
sort($f);
foreach ($f as $file) {
if (filetype($path . DS . $file) != "dir") {
$files[] = $file;
} else {
$this->traverseDirFiles($path . DS . $file);
}
}
foreach ($files as $f) {
$this->processFiles($path, $f);
}
closedir($dir);
}
示例8: routKey
/**
* Loades cms page of specified key
*
* @param Fox_Core_Controller_Action $controller
* @param string $key
* @return boolean
*/
public function routKey($controller, $key)
{
$page = Fox::getModel('cms/page');
$page->load($key, 'url_key');
if ($page->getId() && $page->getStatus()) {
if (($container = $page->getLayout()) != '') {
$layoutUpdate = '<container key="' . $container . '"/>';
}
if (($lUpdate = $page->getLayoutUpdate()) != '') {
$layoutUpdate .= $lUpdate;
}
$layout = $controller->loadLayout($layoutUpdate, $key);
$layout->setTitle($page->getTitle());
$layout->setMetaKeywords($page->getMetaKeywords());
$layout->setMetaDescription($page->getMetaDescription());
if ($contentView = $controller->getViewByKey('content')) {
$pageView = Fox::getView('cms/page');
$pageView->setPageContent($page->getContent());
$pageView->setPageTitle($page->getTitle());
$pageView->setPageUrlKey($page->getUrlKey());
$contentView->addChild('__page_content__', $pageView);
}
$controller->renderLayout();
$controller->getResponse()->setHeader('HTTP/1.1', '200 ok');
$controller->getResponse()->setHeader('Status', '200 ok');
$this->routingCompleted = TRUE;
}
return $this->routingCompleted;
}
示例9: pageNotFoundAction
/**
* Page not found action
*/
public function pageNotFoundAction()
{
$this->getResponse()->setHeader('HTTP/1.1', '404 Not Found');
$this->getResponse()->setHeader('Status', '404 File not found');
if (!Fox::getHelper('core/router')->routKey($this, 'no-page-404')) {
$this->_forward('nothing');
}
}
示例10: _prepareContainer
/**
* Prepare container
*/
protected function _prepareContainer()
{
parent::_prepareContainer();
$this->setIsEditButtonEnabled(FALSE);
$this->setIsSaveButtonEnabled(FALSE);
$this->setIsResetButtonEnabled(FALSE);
$this->addButton(array('name' => 'reply', 'id' => 'reply', 'button_text' => 'Reply', 'style_class' => 'form-button', 'icon_class' => 'save', 'url' => Fox::getUrl('*/*/reply', array('id' => $this->getRequest()->getParam('id')))));
}
示例11: deleteModules
/**
* Delete Modules
*
* @param array $modules Name of modules that needs to be deleted are passed as array values
*/
public function deleteModules($modules)
{
foreach ($modules as $moduleName) {
$module = Fox::getModel('core/module');
$module->load($moduleName);
$module->delete();
}
}
示例12: render
/**
* Render contents
*
* @return string
*/
public function render()
{
$args = func_get_args();
$url = $args[0]['preview_url'];
$queueImg = Fox::getThemeUrl('images/queue.png');
$previewImg = Fox::getThemeUrl('images/preview.png');
$previewUrl = "window.open('" . $url . "','previewWindow','width=800,height=600')";
return '<a href="' . $args[0]['send_newsletter'] . '" title="' . $args[0]['send_newsletter'] . '"><img src="' . $queueImg . '" alt="Send Newsletter" title="Send Newsletter" style="border:none;" width="22" height="22"/></a> <a target="_blank" title="' . $args[0]['preview_url'] . '" title="' . $args[0]['preview_url'] . '" onclick="' . $previewUrl . '"><img src="' . $previewImg . '" alt="Preview" title="Preview" /></a>';
}
示例13: _prepareForm
/**
* Prepare form
*
* @param Uni_Core_Form_Eav $form
*/
protected function _prepareForm(Uni_Core_Form_Eav $form)
{
$form->setName('setting')->setMethod('post');
$model = Fox::getModel($this->getModelKey());
$eavMetaData = $model->getEavFormMetaData();
$form->createEavForm($eavMetaData);
$form->setElementsBelongTo($model->getItem());
parent::_prepareForm($form);
}
示例14: _prepareCollection
/**
* Prepare model collection
*/
protected function _prepareCollection()
{
$model = Fox::getModel('admin/role');
$sortCondition = $this->getSortCondition();
$filters = $this->getSearchCriteria();
$collection = $model->getModelCollection($filters, '*', $sortCondition, $this->getColumns());
$this->setCollection($collection);
parent::_prepareCollection();
}
示例15: _prepareColumns
/**
* Prepare table columns
*/
protected function _prepareColumns()
{
$this->addColumn('id', array('label' => 'Id', 'align' => 'left', 'width' => 50, 'type' => self::TYPE_NUMBER, 'field' => 'id'));
$this->addColumn('title', array('label' => 'Title', 'align' => 'left', 'field' => 'title'));
$this->addColumn('identifier_key', array('label' => 'Identifier Key', 'align' => 'left', 'field' => 'identifier_key'));
$this->addColumn('status', array('label' => 'Status', 'align' => 'center', 'width' => 100, 'type' => self::TYPE_OPTIONS, 'options' => Fox::getModel('cms/block')->getAllStatuses(), 'field' => 'status'));
$this->addColumn('created_on', array('label' => 'Created On', 'align' => 'center', 'width' => 182, 'type' => self::TYPE_DATE, 'field' => 'created_on'));
$this->addColumn('modified_on', array('label' => 'Modified On', 'align' => 'center', 'width' => 182, 'type' => self::TYPE_DATE, 'field' => 'modified_on'));
parent::_prepareColumns();
}