Drupal Module for Zoom Print and Save - drupal

i would like to ask about module on Drupal. I need to add "Zoom", "Print", and "Save" functionalities. I am sure there must be a module to handle this. Is there any solution about which module I should use? For information, i am using Drupal 7 and need to add the functionalities to Views page. Thanks

You can use this module for printing: http://drupal.org/project/print
This also gives provision to save as pdf & email the article.

Related

Create dynamic stylesheet

I need to allow the webmaster of a plone site to change the "main color" of the site (repercuted on the docuemntFirstHeading, portletHeader, etc).
I think I can use the base_properties.prop file liked to a mystylesheet.css.dtml file.
Is there a way to modifiy programmaticaly the base_properties file (which would repercute the changes in mystylesheet.css.dtml with a "&dtml-maincolor" declaration) ?
I'm using Plone 4.3.3
There was a product for Plone 3 called CSSManager which provided a form to edit the base_properties. It may need some updating of imports to work in Plone 4; Plone 4's default "sunburst" theme does not use base_properties, so there probably hasn't been much motivation for that basic maintenance to happen.
Maybe you can look at its code to find out how to edit base_properties.
https://pypi.python.org/pypi/Products.CSSManager
You can have a look at the stylesheet in adi.slickstyle (disclaimer: one of my humble packages), which collects and unifies all selectors setting col, bg-col and borders, so they can be set at once.
If you want to give a user access to a customizable stylesheet via a Plonesite's UI (=not ZMI), check out adi.ttw_styles (disclaimer: yet another one of my humble packages) it allows to use a 'page'-contenttype as the stylesource, thus you can grant edit-permission to any user you want, easily via the sharing-tab of the page.
The future: Plone 5 is said to introduce LESS based styles, to address this and make base_properties obsolete.

Plone setuphandler- In a setuphandler, how can I programatically add/create a folderish content type at root of Plonesite?

I have have made a folderish content type called supplier_folder, which displays a list of suppliers that can be added under it, and their information. I can add it through the navigation bar, but I would like to add it programatically during setup.
I have been following the tutorial on custom installer code (http://docs.plone.org/develop/addons/components/genericsetup.html#custom-installer-code-setuphandlers-py) and have looked at creating objects programatically (http://docs.plone.org/develop/plone/content/creating.html).
Unfortunately, the second article says I need to have a folder created. How can I get around this and add the supplier_folder object at the Plone Site outside of a folder?
IIRC, only users with role Manager or Site Administrator can add content to the root of the site; you can overcome this limitation in two ways:
by using the _constructInstance method as it bypasses the permissions when creating an item
by switching roles inside your code with plone.api.env.adopt_roles
I personally prefer the second one.
you can see an example of a pretty complex setuphandlers.py in interlegis.portalmodelo.policy package.
When you create a new Plone site, it's also creating some default content types.
Look at how Plone do: https://github.com/plone/Products.CMFPlone/blob/1471828ee97a8dd84396bad4a3286be514819869/Products/CMFPlone/setuphandlers.py#L119
There are a couple of ways to achieve this. The buildin mechanism is to use GenericSetup in combination with "structure" folder as described here: http://koansys.com/tech/create-plone-initial-content-with-generic-setup
In short you need the following:
Create a folder "structure" in your Generic Setup profile (in general, under profiles/default)
Create a .objects file with the following content: "suppliers,supplier_folder"
in "structure" create a folder "suppliers" with a .properties file and content:
[DEFAULT]
title = Suppliers
description = Some usefull description text
As far as I remember this is ok for simple structures likes your. If you have complex structures with folders and sub-folders and want more specific control you probably need to write python code. I made some stuff here: https://github.com/collective/zettwerk.setup/blob/master/zettwerk/setup/structure.py
But zettwerk.setup is not yet released, but you should be able to integrate the structure.py right into your project. Than you can the handle_structure method into your setuphandlers.py and passing a structure dict like this:
handle_structure(portal, [{'id': 'suppliers', 'portal_type': 'supplier_folder'}])
The advantage of this method is, that you can also control metadata like workflow state, default page setting, portlets, local roles and some others.

drupal 6 /user/permissions checkbox page core module

Does anyone know where i can find the code that makes the user/permissions checkbox page in drupal? I'd like to see how it's done to make something similar for a custom module i'm building.
The function you're looking for is theme_checkbox($element) and can be found in root/includes/form.inc. If you ever want to know what function/template is responsible for a certain HTML element then Theme developer is your friend.
Enable the module, set the permissions and you'll see a small checkbox Themer info. Then just point to the HTML part you're interested and see what theme function/template is doing the rendering.
i think on default module folder there is user folder on user.admin.inc file contain code for permission function is user_admin_perm(); see this code

Easiest way to create a Module in DotNetNuke 6 and to debug

Can I avoid all the packaging and just create a Web application with a .ascx file and use that? The closest thing I can find is this article which is for 5.1 and does not completely work for v6.
http://mestanzasoft.wordpress.com/2011/03/27/creating-a-dotnetnuke-dnn-module-with-an-ascx-control/
So if there is a more up to date tutorial for v6 let me know please.
You should be able to choose Create New Module from the Host -> Extensions page, and then choose the control (which, I think, is what the blog post said). What specifically isn't working?
One thing that may be an issue you're running into is that the control needs to inherit from IModuleBase (probably via PortalModuleBase). You can't just drop a control that knows nothing about DNN in the website and get DNN to make it into a module (though you can make a thin wrapper around a control like that).
Yes you can.
If you go to Host > Module Definitions and click on Create New..., you will find there are there ways to create a new module:
New : That will allow you to create a simple module with single view control. You have to provide module information and create parent folder to do this.
Control: This will allow you to create new module from a control. If you don't want to create a new module folder and control at UI, you can just add a new folder to desktopmodules folder and drop an ascx control which inherits from DotNetNuke.Entities.PortalModuleBase and then use this option to provide correct folder and control that you have created and you are done.
Last option is to create it using manifest and generally useful when you want to split single module with multiple definition to different modules.
Please let me know if you have more questions.
Thanks
In DNN 6.0 you have to go to Host - Extensions...
then hover over the semi-transparent "Manage" button, which you can barely see (hidden behind the word EXTENSIONS, perhaps), and wait for the popup dialog, and THEN click "Create New Module".
:(

Is there a Drupal module for importing text and images?

I'm very new to Drupal, and am wondering if there's an API that external programs can call to transfer text and images directly into my Drupal site.
Yes. There are several ways to accomplish this in Drupal:
If you're doing a one-time import, try the Node Import module --- this lets you import content from a CSV file.
If you want your Drupal site to provide a web-based API to which new content can be POSTed (via, for example, XMLRPC), check out the Services module.
If you want your Drupal site to periodically retrieve content from other sites (RSS feeds, for example), check out FeedAPI.
If you want to write your own PHP code to create new content, check out this article for an introduction.
Not sure what you mean by having a module for importing text, but there is one specifically for images: the Image module. Here is an excerpt from its project page:
... allows users with proper permissions to upload images into Drupal. Thumbnails and additional sizes are created automatically.
Images could be posted individually to the front page, included in stories or grouped in galleries.
Importing text can be performed directly as one of the other existing entity types.

Resources