| 1 |
<?php |
<?php |
| 2 |
// $Id: flag.module,v 1.11.2.72.2.24 2009/11/02 06:17:01 quicksketch Exp $ |
// $Id: flag.module,v 1.11.2.72.2.25 2009/11/02 06:30:10 quicksketch Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 898 |
} |
} |
| 899 |
|
|
| 900 |
/** |
/** |
| 901 |
|
* Implementation of hook_service(). |
| 902 |
|
*/ |
| 903 |
|
function flag_service() { |
| 904 |
|
$items = array(); |
| 905 |
|
|
| 906 |
|
$items[] = array( |
| 907 |
|
'#method' => 'flag.flag', |
| 908 |
|
'#callback' => 'flag_service_flag', |
| 909 |
|
'#access callback' => 'flag_service_flag_access', |
| 910 |
|
'#file' => array( |
| 911 |
|
'file' => 'inc', |
| 912 |
|
'module' => 'flag', |
| 913 |
|
'file name' => 'includes/flag.services', |
| 914 |
|
), |
| 915 |
|
'#args' => array( |
| 916 |
|
array( |
| 917 |
|
'#name' => 'flag_name', |
| 918 |
|
'#type' => 'string', |
| 919 |
|
'#description' => t('The name of the flag.'), |
| 920 |
|
), |
| 921 |
|
array( |
| 922 |
|
'#name' => 'content_id', |
| 923 |
|
'#type' => 'int', |
| 924 |
|
'#description' => t('The content ID.'), |
| 925 |
|
), |
| 926 |
|
array( |
| 927 |
|
'#name' => 'uid', |
| 928 |
|
'#type' => 'int', |
| 929 |
|
'#description' => t('The user ID for which to flag.'), |
| 930 |
|
'#optional' => TRUE, |
| 931 |
|
), |
| 932 |
|
array( |
| 933 |
|
'#name' => 'action', |
| 934 |
|
'#type' => 'string', |
| 935 |
|
'#description' => t('Optional; The action to perform, default is "flag". Should be "flag" or "unflag".'), |
| 936 |
|
'#optional' => TRUE, |
| 937 |
|
), |
| 938 |
|
array( |
| 939 |
|
'#name' => 'skip_permission_check', |
| 940 |
|
'#type' => 'boolean', |
| 941 |
|
'#description' => t('Optional; Flag the content even if the user does not have permission to do so. FALSE by default'), |
| 942 |
|
'#optional' => TRUE, |
| 943 |
|
), |
| 944 |
|
), |
| 945 |
|
'#return' => 'boolean', |
| 946 |
|
'#help' => t('Flags (or unflags) a content.') |
| 947 |
|
); |
| 948 |
|
|
| 949 |
|
$items[] = array( |
| 950 |
|
'#method' => 'flag.is_flagged', |
| 951 |
|
'#callback' => 'flag_service_is_flagged', |
| 952 |
|
'#access callback' => 'flag_service_flag_access', |
| 953 |
|
'#file' => array( |
| 954 |
|
'file' => 'inc', |
| 955 |
|
'module' => 'flag', |
| 956 |
|
'file name' => 'includes/flag.services', |
| 957 |
|
), |
| 958 |
|
'#args' => array( |
| 959 |
|
array( |
| 960 |
|
'#name' => 'flag_name', |
| 961 |
|
'#type' => 'string', |
| 962 |
|
'#description' => t('The name of the flag.'), |
| 963 |
|
), |
| 964 |
|
array( |
| 965 |
|
'#name' => 'content_id', |
| 966 |
|
'#type' => 'int', |
| 967 |
|
'#description' => t('The content ID.'), |
| 968 |
|
), |
| 969 |
|
array( |
| 970 |
|
'#name' => 'uid', |
| 971 |
|
'#type' => 'int', |
| 972 |
|
'#description' => t('The user ID that might have flagged the content.'), |
| 973 |
|
'#optional' => TRUE, |
| 974 |
|
), |
| 975 |
|
), |
| 976 |
|
'#return' => 'boolean', |
| 977 |
|
'#help' => t('Check if a content was flagged by a user.') |
| 978 |
|
); |
| 979 |
|
|
| 980 |
|
return $items; |
| 981 |
|
} |
| 982 |
|
|
| 983 |
|
/** |
| 984 |
* Implementation of hook_theme(). |
* Implementation of hook_theme(). |
| 985 |
*/ |
*/ |
| 986 |
function flag_theme() { |
function flag_theme() { |