示例#1
0
void Subscribe::onPreRender()
{
	PageBase::onPreRender();

	if(getPostBack() == false)
	{
		bool hasUrlParams = false;
		hasUrlParams |= initControlValue(m_portalName, "name");
		hasUrlParams |= initControlValue(m_portalID, "portal");
		hasUrlParams |= initControlValue(m_portalPov, "pov");

		if(hasUrlParams)
			m_showPortalParams->setCheck(true);
	}

	bool viewParams = m_showPortalParams->getCheck();

	OS_ASSERT(m_rowPortalLink != nullptr);
	m_rowPortalLink->setVisible(!viewParams);
	OS_ASSERT(m_rowName != nullptr);
	m_rowName->setVisible(viewParams);
	OS_ASSERT(m_rowID != nullptr);
	m_rowID->setVisible(viewParams);
	OS_ASSERT(m_rowUser != nullptr);
	m_rowUser->setVisible(viewParams);
}
示例#2
0
void FileEditor::onPreRender()
{
	EditorBase::onPreRender();

	if(isRevision())
	{
		m_browser->setVisible(m_enableBrowser->getCheck());

		if(getPostBack() == false)
		{
			shared_ptr<ObjectsFile> current = objects_file_cast(getCurrent());
			if(current != nullptr)
			{
				m_title->setValue(current->title);
     			m_description->setValue(current->description);
			}
		}
	}
}
示例#3
0
void IHtmlSelect::onInit()
{
	ControlBase::onInit();

	// 01/12/2009 0.13-RC2
	/*
	if(getPostBack() && hasID())
		// Inizializza il valore del controllo
		setValue(getRequest()->getPostParamString(getTarget().to_ascii()));
	*/
	if(getPostBack() && hasID())
	{
		// Ottiene il parametro associato al controllo
		shared_ptr<HttpPostParam> param = getRequest()->getPostParam(getTarget().to_wide());
		// Verifica che sia stato postato un parametro relativo al controllo
		if(param != nullptr)
			// Inizializza il valore del controllo
			setValue(param->getString());
	}
}
示例#4
0
void Subscribe::onInit()
{
	PageBase::onInit();

	const list<shared_ptr<IDbDriver> >::type &drivers = DatabasesSystem::instance()->getDrivers();
	for(list<shared_ptr<IDbDriver> >::type::const_iterator i = drivers.begin(); i != drivers.end(); ++i)
	{
		shared_ptr<IDbDriver> driver = *i;
		m_databaseDriver->addOption(driver->getDescription(), driver->getName());
	}

	shared_ptr<IdeBlock> block(OS_NEW IdeBlock(getText(_S("main.pages.subscribe.title"))));
	getArea(pageAreaContent)->getControls()->add(block);

	block->getBody()->getControls()->add(shared_ptr<IdeHelpBox>(OS_NEW IdeHelpBox(getText(_S("main.pages.subscribe.help")), _S("59FCAB72193EB4E02AF5CFD2D45811ACCB765879"))));

	block->getBody()->getControls()->add(m_table);

	// Header opzioni portale

	shared_ptr<HtmlTableHeader> portalHeader = m_table->addRow()->addHeader();
	portalHeader->setCss(_S("os_subtitle"));
	portalHeader->setColSpan(2);
	portalHeader->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(getText("main.pages.subscribe.subtitle"))));

	// Link del portale

	m_rowPortalLink = m_table->addRow();

	shared_ptr<HtmlTableCell> portalLinkLeft = m_rowPortalLink->addCell();
	portalLinkLeft->setCss(_S("os_label"));
	portalLinkLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(getText("main.pages.subscribe.portalLink"))));
	portalLinkLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(":")));

	shared_ptr<HtmlTableCell> portalLinkRight = m_rowPortalLink->addCell();
	portalLinkRight->setCss(_S("os_value"));
	portalLinkRight->getControls()->add(m_portalLink);

	// Checkbox di visualizzazione dei parametri

	shared_ptr<HtmlTableRow> rowShowParams = m_table->addRow();

	shared_ptr<HtmlTableCell> colShowParamsLeft = rowShowParams->addCell();
	colShowParamsLeft->setCss(_S("os_label"));
	colShowParamsLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(getText("main.pages.subscribe.showParams"))));
	colShowParamsLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(":")));

	shared_ptr<HtmlTableCell> colShowParamsRight = rowShowParams->addCell();
	colShowParamsRight->setCss(_S("os_value"));
	colShowParamsRight->getControls()->add(m_showPortalParams);

	// Nome del portale

	m_rowName = m_table->addRow();

	shared_ptr<HtmlTableCell> nameLeft = m_rowName->addCell();
	nameLeft->setCss(_S("os_label"));
	nameLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(getText("main.pages.subscribe.name"))));
	nameLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(":")));

	shared_ptr<HtmlTableCell> nameRight = m_rowName->addCell();
	nameRight->setCss(_S("os_value"));
	nameRight->getControls()->add(m_portalName);

	// ID del portale

	m_rowID = m_table->addRow();

	shared_ptr<HtmlTableCell> idLeft = m_rowID->addCell();
	idLeft->setCss(_S("os_label"));
	idLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(getText("main.pages.subscribe.id"))));
	idLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(":")));

	shared_ptr<HtmlTableCell> idRight = m_rowID->addCell();
	idRight->setCss(_S("os_value"));
	idRight->getControls()->add(m_portalID);

	// Utente del portale

	m_rowUser = m_table->addRow();

	shared_ptr<HtmlTableCell> userLeft = m_rowUser->addCell();
	userLeft->setCss(_S("os_label"));
	userLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(getText("main.pages.subscribe.user"))));
	userLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(":")));

	shared_ptr<HtmlTableCell> userRight = m_rowUser->addCell();
	userRight->setCss(_S("os_value"));
	userRight->getControls()->add(m_portalPov);

	// Password del portale

	shared_ptr<HtmlTableRow> rowPassword = m_table->addRow();

	shared_ptr<HtmlTableCell> passwordLeft = rowPassword->addCell();
	passwordLeft->setCss(_S("os_label"));
	passwordLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(getText("main.pages.subscribe.password"))));
	passwordLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(":")));

	shared_ptr<HtmlTableCell> passwordRight = rowPassword->addCell();
	passwordRight->setCss(_S("os_value"));
	passwordRight->getControls()->add(m_portalPassword);

	// Header opzioni database

	shared_ptr<HtmlTableHeader> databaseHeader = m_table->addRow()->addHeader();
	databaseHeader->setCss(_S("os_subtitle"));
	databaseHeader->setColSpan(2);
	databaseHeader->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(getText("main.pages.subscribe.database.title"))));

	// Driver

	shared_ptr<HtmlTableRow> rowDriver = m_table->addRow();

	shared_ptr<HtmlTableCell> driverLeft = rowDriver->addCell();
	driverLeft->setCss(_S("os_label"));
	driverLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(getText("main.pages.subscribe.database.driver"))));
	driverLeft->getControls()->add(shared_ptr<HtmlText>(OS_NEW HtmlText(":")));

	shared_ptr<HtmlTableCell> driverRight = rowDriver->addCell();
	driverRight->setCss(_S("os_value"));
	driverRight->getControls()->add(m_databaseDriver);

	if(getPostBack() == false)
	{
		shared_ptr<IDbDriver> defaultDriver = DatabasesSystem::instance()->getDefaultDriver();
		if(defaultDriver != nullptr)
			m_databaseDriver->setValue(defaultDriver->getName());
	}
}